Vergleich admin/modules/config/banning.php - 1.8.13 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 17Zeile 17
$page->add_breadcrumb_item($lang->banning, "index.php?module=config-banning");

$plugins->run_hooks("admin_config_banning_begin");

$page->add_breadcrumb_item($lang->banning, "index.php?module=config-banning");

$plugins->run_hooks("admin_config_banning_begin");

 

$mybb->input['filter'] = $mybb->get_input('filter');


if($mybb->input['action'] == "add" && $mybb->request_method == "post")
{
$plugins->run_hooks("admin_config_banning_add");

if(!trim($mybb->input['filter']))


if($mybb->input['action'] == "add" && $mybb->request_method == "post")
{
$plugins->run_hooks("admin_config_banning_add");

if(!trim($mybb->input['filter']))

	{

	{

		$errors[] = $lang->error_missing_ban_input;

		$errors[] = $lang->error_missing_ban_input;

	}


	}


	$query = $db->simple_select("banfilters", "fid", "filter = '".$db->escape_string($mybb->input['filter'])."' AND type = '".$mybb->get_input('type', MyBB::INPUT_INT)."'");
if($db->num_rows($query))

	$query = $db->simple_select("banfilters", "fid", "filter = '".$db->escape_string($mybb->input['filter'])."' AND type = '".$mybb->get_input('type', MyBB::INPUT_INT)."'");
if($db->num_rows($query))

	{

	{

		$errors[] = $lang->error_filter_already_banned;
}


		$errors[] = $lang->error_filter_already_banned;
}


Zeile 46Zeile 48

if($mybb->input['type'] == 1)
{


if($mybb->input['type'] == 1)
{

			$cache->update_bannedips();
}
else if($mybb->input['type'] == 3)
{
$cache->update_bannedemails();
}

// Log admin action
log_admin_action($fid, htmlspecialchars_uni($mybb->input['filter']), (int)$mybb->input['type']);

if($mybb->input['type'] == 1)
{

			$cache->update_bannedips();
}
else if($mybb->input['type'] == 3)
{
$cache->update_bannedemails();
}

// Log admin action
log_admin_action($fid, $mybb->input['filter'], (int)$mybb->input['type']);

if($mybb->input['type'] == 1)
{

			flash_message($lang->success_ip_banned, 'success');
admin_redirect("index.php?module=config-banning");

			flash_message($lang->success_ip_banned, 'success');
admin_redirect("index.php?module=config-banning");

		}
else if($mybb->input['type'] == 2)

		}
else if($mybb->input['type'] == 2)

		{
flash_message($lang->success_username_disallowed, 'success');
admin_redirect("index.php?module=config-banning&type=usernames");

		{
flash_message($lang->success_username_disallowed, 'success');
admin_redirect("index.php?module=config-banning&type=usernames");

		}

		}

		else if($mybb->input['type'] == 3)
{
flash_message($lang->success_email_disallowed, 'success');

		else if($mybb->input['type'] == 3)
{
flash_message($lang->success_email_disallowed, 'success');

Zeile 77Zeile 79
		if($mybb->input['type'] == 1)
{
$mybb->input['type'] = "ips";

		if($mybb->input['type'] == 1)
{
$mybb->input['type'] = "ips";

		}

		}

		else if($mybb->input['type'] == 2)
{
$mybb->input['type'] = "usernames";

		else if($mybb->input['type'] == 2)
{
$mybb->input['type'] = "usernames";

Zeile 85Zeile 87
		else if($mybb->input['type'] == 3)
{
$mybb->input['type'] = "emails";

		else if($mybb->input['type'] == 3)
{
$mybb->input['type'] = "emails";

		}

		}

		$mybb->input['action'] = '';
}
}

		$mybb->input['action'] = '';
}
}

Zeile 96Zeile 98
	$filter = $db->fetch_array($query);

// Does the filter not exist?

	$filter = $db->fetch_array($query);

// Does the filter not exist?

	if(!$filter['fid'])
{

	if(!$filter)
{

		flash_message($lang->error_invalid_filter, 'error');
admin_redirect("index.php?module=config-banning");

		flash_message($lang->error_invalid_filter, 'error');
admin_redirect("index.php?module=config-banning");

	}


	}


	$plugins->run_hooks("admin_config_banning_delete");

if($filter['type'] == 3)

	$plugins->run_hooks("admin_config_banning_delete");

if($filter['type'] == 3)

	{

	{

		$type = "emails";
}
else if($filter['type'] == 2)

		$type = "emails";
}
else if($filter['type'] == 2)

	{

	{

		$type = "usernames";
}
else

		$type = "usernames";
}
else

	{

	{

		$type = "ips";
}

// User clicked no

		$type = "ips";
}

// User clicked no

	if($mybb->input['no'])
{
admin_redirect("index.php?module=config-banning&type={$type}");

	if($mybb->get_input('no'))
{
admin_redirect("index.php?module=config-banning&type={$type}");

	}

if($mybb->request_method == "post")

	}

if($mybb->request_method == "post")

Zeile 131Zeile 133
		$plugins->run_hooks("admin_config_banning_delete_commit");

// Log admin action

		$plugins->run_hooks("admin_config_banning_delete_commit");

// Log admin action

		log_admin_action($filter['fid'], htmlspecialchars_uni($filter['filter']), (int)$filter['type']);

		log_admin_action($filter['fid'], $filter['filter'], (int)$filter['type']);


// Banned IP? Rebuild banned IP cache
if($filter['type'] == 1)


// Banned IP? Rebuild banned IP cache
if($filter['type'] == 1)

Zeile 156Zeile 158
{
$plugins->run_hooks("admin_config_banning_start");


{
$plugins->run_hooks("admin_config_banning_start");


	switch($mybb->input['type'])

	switch($mybb->get_input('type'))

	{
case "emails":
$type = "3";

	{
case "emails":
$type = "3";

Zeile 189Zeile 191
		'title' => $lang->disallowed_usernames,
'link' => "index.php?module=config-banning&type=usernames",
'description' => $lang->disallowed_usernames_desc

		'title' => $lang->disallowed_usernames,
'link' => "index.php?module=config-banning&type=usernames",
'description' => $lang->disallowed_usernames_desc

	);

	);


$sub_tabs['emails'] = array(
'title' => $lang->disallowed_email_addresses,


$sub_tabs['emails'] = array(
'title' => $lang->disallowed_email_addresses,

Zeile 198Zeile 200
	);

$page->output_nav_tabs($sub_tabs, $mybb->input['type']);

	);

$page->output_nav_tabs($sub_tabs, $mybb->input['type']);





	if($errors)

	if($errors)

	{

	{

		$page->output_inline_error($errors);

		$page->output_inline_error($errors);

 
	}

$query = $db->simple_select("banfilters", "COUNT(fid) AS filter", "type='{$type}'");
$total_rows = $db->fetch_field($query, "filter");

$pagenum = $mybb->get_input('page', MyBB::INPUT_INT);
if($pagenum)
{
$start = ($pagenum - 1) * 20;
$pages = ceil($total_rows / 20);
if($pagenum > $pages)
{
$start = 0;
$pagenum = 1;
}
}
else
{
$start = 0;
$pagenum = 1;

	}

$form = new Form("index.php?module=config-banning&action=add", "post", "add");

	}

$form = new Form("index.php?module=config-banning&action=add", "post", "add");

Zeile 253Zeile 275
	}
$table->construct_header($lang->controls, array("width" => 1));


	}
$table->construct_header($lang->controls, array("width" => 1));


	$query = $db->simple_select("banfilters", "*", "type='{$type}'", array("order_by" => "filter", "order_dir" => "asc"));

	$query = $db->simple_select("banfilters", "*", "type='{$type}'", array('limit_start' => $start, 'limit' => 20, "order_by" => "filter", "order_dir" => "asc"));

	while($filter = $db->fetch_array($query))
{
$filter['filter'] = htmlspecialchars_uni($filter['filter']);

	while($filter = $db->fetch_array($query))
{
$filter['filter'] = htmlspecialchars_uni($filter['filter']);

Zeile 290Zeile 312
	}

$table->output($title);

	}

$table->output($title);

 

echo "<br />".draw_admin_pagination($pagenum, "20", $total_rows, "index.php?module=config-banning&amp;type={$mybb->get_input('type')}&amp;page={page}");


$page->output_footer();
}


$page->output_footer();
}