Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: banning.php 5016 2010-06-12 00:24:02Z RyanGordon $
| * $Id$
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 26 | Zeile 26 |
---|
if(!trim($mybb->input['filter'])) { $errors[] = $lang->error_missing_ban_input;
|
if(!trim($mybb->input['filter'])) { $errors[] = $lang->error_missing_ban_input;
|
| }
$query = $db->simple_select("banfilters", "fid", "filter = '".$db->escape_string($mybb->input['filter'])."' AND type = '".intval($mybb->input['type'])."'"); if($db->num_rows($query)) { $errors[] = $lang->error_filter_already_banned;
|
}
if(!$errors)
| }
if(!$errors)
|
Zeile 38 | Zeile 44 |
---|
$fid = $db->insert_query("banfilters", $new_filter); if($mybb->input['type'] == 1)
|
$fid = $db->insert_query("banfilters", $new_filter); if($mybb->input['type'] == 1)
|
{
| {
|
$cache->update_bannedips();
|
$cache->update_bannedips();
|
| } else if($mybb->input['type'] == 3) { $cache->update_bannedemails();
|
} $plugins->run_hooks("admin_config_banning_add_commit");
| } $plugins->run_hooks("admin_config_banning_add_commit");
|
Zeile 78 | Zeile 88 |
---|
$mybb->input['type'] = "emails"; } $mybb->input['action'] = '';
|
$mybb->input['type'] = "emails"; } $mybb->input['action'] = '';
|
} }
| } }
|
if($mybb->input['action'] == "delete") { $plugins->run_hooks("admin_config_banning_delete");
|
if($mybb->input['action'] == "delete") { $plugins->run_hooks("admin_config_banning_delete");
|
|
|
$query = $db->simple_select("banfilters", "*", "fid='".intval($mybb->input['fid'])."'"); $filter = $db->fetch_array($query);
| $query = $db->simple_select("banfilters", "*", "fid='".intval($mybb->input['fid'])."'"); $filter = $db->fetch_array($query);
|
Zeile 106 | Zeile 116 |
---|
else { $type = "ips";
|
else { $type = "ips";
|
}
| }
|
// User clicked no if($mybb->input['no'])
|
// User clicked no if($mybb->input['no'])
|
{ admin_redirect("index.php?module=config-banning&type={$type}");
| { admin_redirect("index.php?module=config-banning&type={$type}");
|
}
if($mybb->request_method == "post")
| }
if($mybb->request_method == "post")
|
Zeile 120 | Zeile 130 |
---|
$db->delete_query("banfilters", "fid='{$filter['fid']}'"); $plugins->run_hooks("admin_config_banning_delete_commit");
|
$db->delete_query("banfilters", "fid='{$filter['fid']}'"); $plugins->run_hooks("admin_config_banning_delete_commit");
|
|
|
// Log admin action log_admin_action($filter['fid'], $filter['filter'], $filter['type']);
|
// Log admin action log_admin_action($filter['fid'], $filter['filter'], $filter['type']);
|
| |
// Banned IP? Rebuild banned IP cache if($filter['type'] == 1)
|
// Banned IP? Rebuild banned IP cache if($filter['type'] == 1)
|
{
| {
|
$cache->update_bannedips();
|
$cache->update_bannedips();
|
| } else if($filter['type'] == 3) { $cache->update_bannedemails();
|
}
flash_message($lang->success_ban_deleted, 'success'); admin_redirect("index.php?module=config-banning&type={$type}");
|
}
flash_message($lang->success_ban_deleted, 'success'); admin_redirect("index.php?module=config-banning&type={$type}");
|
}
| }
|
else { $page->output_confirm_action("index.php?module=config-banning&action=delete&fid={$filter['fid']}", $lang->confirm_ban_deletion); } }
|
else { $page->output_confirm_action("index.php?module=config-banning&action=delete&fid={$filter['fid']}", $lang->confirm_ban_deletion); } }
|
|
|
if(!$mybb->input['action']) { $plugins->run_hooks("admin_config_banning_start");
| if(!$mybb->input['action']) { $plugins->run_hooks("admin_config_banning_start");
|
Zeile 158 | Zeile 171 |
---|
$type = "1"; $title = $lang->banned_ip_addresses; $mybb->input['type'] = "ips";
|
$type = "1"; $title = $lang->banned_ip_addresses; $mybb->input['type'] = "ips";
|
}
$page->output_header($title);
| }
$page->output_header($title);
|
$sub_tabs['ips'] = array( 'title' => $lang->banned_ips, 'link' => "index.php?module=config-banning", 'description' => $lang->banned_ips_desc
|
$sub_tabs['ips'] = array( 'title' => $lang->banned_ips, 'link' => "index.php?module=config-banning", 'description' => $lang->banned_ips_desc
|
);
| );
|
$sub_tabs['users'] = array( 'title' => $lang->banned_accounts, 'link' => "index.php?module=user-banning"
| $sub_tabs['users'] = array( 'title' => $lang->banned_accounts, 'link' => "index.php?module=user-banning"
|
Zeile 177 | Zeile 190 |
---|
'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 186 | Zeile 199 |
---|
);
$page->output_nav_tabs($sub_tabs, $mybb->input['type']);
|
);
$page->output_nav_tabs($sub_tabs, $mybb->input['type']);
|
| if($errors) { $page->output_inline_error($errors); }
|
$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->last_attempted_use, 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->email_address);
| else if($mybb->input['type'] == "emails") { $table->construct_header($lang->email_address);
|
Zeile 207 | Zeile 225 |
---|
$table->construct_header($lang->last_access, array("class" => "align_center", "width" => 200)); } $table->construct_header($lang->controls, array("width" => 1));
|
$table->construct_header($lang->last_access, array("class" => "align_center", "width" => 200)); } $table->construct_header($lang->controls, array("width" => 1));
|
|
|
$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']);
|
$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)
|
if($filter['lastuse'] > 0)
|
{
| {
|
$last_use = my_date($mybb->settings['dateformat'], $filter['lastuse']).", ".my_date($mybb->settings['timeformat'], $filter['lastuse']); } else {
|
$last_use = my_date($mybb->settings['dateformat'], $filter['lastuse']).", ".my_date($mybb->settings['timeformat'], $filter['lastuse']); } else {
|
$last_use = $lang->never;
| $last_use = $lang->never; }
if($filter['dateline'] > 0) { $date = my_date($mybb->settings['dateformat'], $filter['dateline']).", ".my_date($mybb->settings['timeformat'], $filter['dateline']); } else { $date = $lang->na;
|
}
|
}
|
$date = my_date($mybb->settings['dateformat'], $filter['dateline']).", ".my_date($mybb->settings['timeformat'], $filter['dateline']);
|
|
$table->construct_cell($filter['filter']); $table->construct_cell($date, array("class" => "align_center")); $table->construct_cell($last_use, array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=config-banning&action=delete&fid={$filter['fid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_ban_deletion}');\"><img src=\"styles/{$page->style}/images/icons/delete.gif\" title=\"{$lang->delete}\" alt=\"{$lang->delete}\" /></a>", array("class" => "align_center"));
|
$table->construct_cell($filter['filter']); $table->construct_cell($date, array("class" => "align_center")); $table->construct_cell($last_use, array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=config-banning&action=delete&fid={$filter['fid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_ban_deletion}');\"><img src=\"styles/{$page->style}/images/icons/delete.gif\" title=\"{$lang->delete}\" alt=\"{$lang->delete}\" /></a>", array("class" => "align_center"));
|
$table->construct_row(); }
| $table->construct_row(); }
|
if($table->num_rows() == 0) { $table->construct_cell($lang->no_bans, array("colspan" => 4));
| if($table->num_rows() == 0) { $table->construct_cell($lang->no_bans, array("colspan" => 4));
|
Zeile 237 | Zeile 265 |
---|
$table->output($title);
$form = new Form("index.php?module=config-banning&action=add", "post", "add");
|
$table->output($title);
$form = new Form("index.php?module=config-banning&action=add", "post", "add");
|
if($errors) { $page->output_inline_error($errors); }
| |
if($mybb->input['type'] == "usernames") {
| if($mybb->input['type'] == "usernames") {
|
Zeile 256 | Zeile 280 |
---|
} else {
|
} else {
|
$form_container = new FormContainer($lang->ban_ip_address);
| $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->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); }
|