Zeile 17 | Zeile 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 44 | Zeile 46 |
---|
$plugins->run_hooks("admin_config_banning_add_commit");
|
$plugins->run_hooks("admin_config_banning_add_commit");
|
if($mybb->input['type'] == 1) { $cache->update_bannedips(); } else if($mybb->input['type'] == 3) { $cache->update_bannedemails(); }
| 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']);
|
// Log admin action log_admin_action($fid, $mybb->input['filter'], (int)$mybb->input['type']);
|
if($mybb->input['type'] == 1) {
| 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 77 | Zeile 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 85 | Zeile 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 94 | Zeile 96 |
---|
{ $query = $db->simple_select("banfilters", "*", "fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'"); $filter = $db->fetch_array($query);
|
{ $query = $db->simple_select("banfilters", "*", "fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'"); $filter = $db->fetch_array($query);
|
|
|
// Does the filter not exist? if(!$filter['fid']) { flash_message($lang->error_invalid_filter, 'error'); admin_redirect("index.php?module=config-banning");
|
// Does the filter not exist? if(!$filter['fid']) { flash_message($lang->error_invalid_filter, 'error'); admin_redirect("index.php?module=config-banning");
|
}
$plugins->run_hooks("admin_config_banning_delete");
| }
$plugins->run_hooks("admin_config_banning_delete");
|
if($filter['type'] == 3) {
| if($filter['type'] == 3) {
|
Zeile 118 | Zeile 120 |
---|
}
// User clicked no
|
}
// User clicked no
|
if($mybb->input['no']) {
| if($mybb->get_input('no')) {
|
admin_redirect("index.php?module=config-banning&type={$type}"); }
| admin_redirect("index.php?module=config-banning&type={$type}"); }
|
Zeile 156 | Zeile 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 202 | Zeile 204 |
---|
if($errors) { $page->output_inline_error($errors);
|
if($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 253 | Zeile 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 290 | Zeile 312 |
---|
}
$table->output($title);
|
}
$table->output($title);
|
| echo "<br />".draw_admin_pagination($pagenum, "20", $total_rows, "index.php?module=config-banning&type={$mybb->get_input('type')}&page={page}");
|
$page->output_footer(); }
| $page->output_footer(); }
|