Vergleich admin/modules/config/banning.php - 1.8.0 - 1.8.23

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 27Zeile 27
		$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', 1)."'");

	$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;

	if($db->num_rows($query))
{
$errors[] = $lang->error_filter_already_banned;

Zeile 37Zeile 37
	{
$new_filter = array(
"filter" => $db->escape_string($mybb->input['filter']),

	{
$new_filter = array(
"filter" => $db->escape_string($mybb->input['filter']),

			"type" => $mybb->get_input('type', 1),

			"type" => $mybb->get_input('type', MyBB::INPUT_INT),

			"dateline" => TIME_NOW
);
$fid = $db->insert_query("banfilters", $new_filter);


			"dateline" => TIME_NOW
);
$fid = $db->insert_query("banfilters", $new_filter);


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



		$plugins->run_hooks("admin_config_banning_add_commit");

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

			$cache->update_bannedips();

			$cache->update_bannedips();

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

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

		{
$cache->update_bannedemails();

		{
$cache->update_bannedemails();

		}

$plugins->run_hooks("admin_config_banning_add_commit");


		}




		// Log admin action

		// Log admin action

		log_admin_action($fid, $mybb->input['filter'], $mybb->input['type']);

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


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


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

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

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

		}
}
else
{

		}
}
else
{

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

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

Zeile 92Zeile 92

if($mybb->input['action'] == "delete")
{


if($mybb->input['action'] == "delete")
{

	$query = $db->simple_select("banfilters", "*", "fid='".$mybb->get_input('fid', 1)."'");

	$query = $db->simple_select("banfilters", "*", "fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'");

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

// Does the filter not exist?

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

// Does the filter not exist?

Zeile 131Zeile 131
		$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'], $filter['filter'], $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 196Zeile 196
		'link' => "index.php?module=config-banning&type=emails",
'description' => $lang->disallowed_email_addresses_desc
);

		'link' => "index.php?module=config-banning&type=emails",
'description' => $lang->disallowed_email_addresses_desc
);





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

if($errors)

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

if($errors)

	{

	{

		$page->output_inline_error($errors);
}

		$page->output_inline_error($errors);
}

 

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

if($mybb->input['type'] == "usernames")
{
$form_container = new FormContainer($lang->add_disallowed_username);
$form_container->output_row($lang->username." <em>*</em>", $lang->username_desc, $form->generate_text_box('filter', $mybb->input['filter'], array('id' => 'filter')), 'filter');
$buttons[] = $form->generate_submit_button($lang->disallow_username);
}
else if($mybb->input['type'] == "emails")
{
$form_container = new FormContainer($lang->add_disallowed_email_address);
$form_container->output_row($lang->email_address." <em>*</em>", $lang->email_address_desc, $form->generate_text_box('filter', $mybb->input['filter'], array('id' => 'filter')), 'filter');
$buttons[] = $form->generate_submit_button($lang->disallow_email_address);
}
else
{
$form_container = new FormContainer($lang->ban_an_ip_address);
$form_container->output_row($lang->ip_address." <em>*</em>", $lang->ip_address_desc, $form->generate_text_box('filter', $mybb->input['filter'], array('id' => 'filter')), 'filter');
$buttons[] = $form->generate_submit_button($lang->ban_ip_address);
}

$form_container->end();
echo $form->generate_hidden_field("type", $type);
$form->output_submit_wrapper($buttons);
$form->end();

echo '<br />';


$table = new Table;
if($mybb->input['type'] == "usernames")
{
$table->construct_header($lang->username);


$table = new Table;
if($mybb->input['type'] == "usernames")
{
$table->construct_header($lang->username);

		$table->construct_header($lang->date_disallowed, array("class" => "align_center", "width" => 200));

		$table->construct_header($lang->date_disallowed, array("class" => "align_center", "width" => 200));

		$table->construct_header($lang->last_attempted_use, array("class" => "align_center", "width" => 200));
}
else if($mybb->input['type'] == "emails")

		$table->construct_header($lang->last_attempted_use, array("class" => "align_center", "width" => 200));
}
else if($mybb->input['type'] == "emails")

	{

	{

		$table->construct_header($lang->email_address);
$table->construct_header($lang->date_disallowed, array("class" => "align_center", "width" => 200));
$table->construct_header($lang->last_attempted_use, array("class" => "align_center", "width" => 200));

		$table->construct_header($lang->email_address);
$table->construct_header($lang->date_disallowed, array("class" => "align_center", "width" => 200));
$table->construct_header($lang->last_attempted_use, array("class" => "align_center", "width" => 200));

	}

	}

	else
{
$table->construct_header($lang->ip_address);

	else
{
$table->construct_header($lang->ip_address);

Zeile 227Zeile 255

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


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

	{

	{

		$filter['filter'] = htmlspecialchars_uni($filter['filter']);

if($filter['lastuse'] > 0)

		$filter['filter'] = htmlspecialchars_uni($filter['filter']);

if($filter['lastuse'] > 0)

Zeile 262Zeile 290
	}

$table->output($title);

	}

$table->output($title);


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

if($mybb->input['type'] == "usernames")
{
$form_container = new FormContainer($lang->add_disallowed_username);
$form_container->output_row($lang->username." <em>*</em>", $lang->username_desc, $form->generate_text_box('filter', $mybb->input['filter'], array('id' => 'filter')), 'filter');
$buttons[] = $form->generate_submit_button($lang->disallow_username);
}
else if($mybb->input['type'] == "emails")
{
$form_container = new FormContainer($lang->add_disallowed_email_address);
$form_container->output_row($lang->email_address." <em>*</em>", $lang->email_address_desc, $form->generate_text_box('filter', $mybb->input['filter'], array('id' => 'filter')), 'filter');
$buttons[] = $form->generate_submit_button($lang->disallow_email_address);
}
else
{
$form_container = new FormContainer($lang->ban_an_ip_address);
$form_container->output_row($lang->ip_address." <em>*</em>", $lang->ip_address_desc, $form->generate_text_box('filter', $mybb->input['filter'], array('id' => 'filter')), 'filter');
$buttons[] = $form->generate_submit_button($lang->ban_ip_address);
}

$form_container->end();
echo $form->generate_hidden_field("type", $type);
$form->output_submit_wrapper($buttons);
$form->end();

 

$page->output_footer();
}


$page->output_footer();
}