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 5380 2011-02-21 12:04:43Z Tomm $
| * $Id: banning.php 5795 2012-04-19 14:34:52Z Tomm $
|
*/
// 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 110 | Zeile 120 |
---|
// 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")
|
{
| {
|
// Delete the ban filter $db->delete_query("banfilters", "fid='{$filter['fid']}'");
| // Delete the ban filter $db->delete_query("banfilters", "fid='{$filter['fid']}'");
|
Zeile 123 | Zeile 133 |
---|
// 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) { $cache->update_bannedips();
|
// Banned IP? Rebuild banned IP cache if($filter['type'] == 1) { $cache->update_bannedips();
|
| } else if($filter['type'] == 3) { $cache->update_bannedemails();
|
}
flash_message($lang->success_ban_deleted, 'success');
| }
flash_message($lang->success_ban_deleted, 'success');
|
Zeile 139 | Zeile 152 |
---|
$page->output_confirm_action("index.php?module=config-banning&action=delete&fid={$filter['fid']}", $lang->confirm_ban_deletion); } }
|
$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 149 | Zeile 162 |
---|
case "emails": $type = "3"; $title = $lang->disallowed_email_addresses;
|
case "emails": $type = "3"; $title = $lang->disallowed_email_addresses;
|
break;
| break;
|
case "usernames": $type = "2"; $title = $lang->disallowed_usernames;
| case "usernames": $type = "2"; $title = $lang->disallowed_usernames;
|
Zeile 159 | Zeile 172 |
---|
$title = $lang->banned_ip_addresses; $mybb->input['type'] = "ips"; }
|
$title = $lang->banned_ip_addresses; $mybb->input['type'] = "ips"; }
|
|
|
$page->output_header($title);
$sub_tabs['ips'] = array( 'title' => $lang->banned_ips, 'link' => "index.php?module=config-banning", 'description' => $lang->banned_ips_desc
|
$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['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"
|
);
| );
|
$sub_tabs['usernames'] = array( 'title' => $lang->disallowed_usernames, 'link' => "index.php?module=config-banning&type=usernames", 'description' => $lang->disallowed_usernames_desc
|
$sub_tabs['usernames'] = array( '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, 'link' => "index.php?module=config-banning&type=emails",
| $sub_tabs['emails'] = array( 'title' => $lang->disallowed_email_addresses, 'link' => "index.php?module=config-banning&type=emails",
|
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 = new Table; if($mybb->input['type'] == "usernames")
|
Zeile 195 | Zeile 213 |
---|
$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 216 | Zeile 234 |
---|
if($filter['lastuse'] > 0) { $last_use = my_date($mybb->settings['dateformat'], $filter['lastuse']).", ".my_date($mybb->settings['timeformat'], $filter['lastuse']);
|
if($filter['lastuse'] > 0) { $last_use = my_date($mybb->settings['dateformat'], $filter['lastuse']).", ".my_date($mybb->settings['timeformat'], $filter['lastuse']);
|
}
| }
|
else { $last_use = $lang->never; }
if($filter['dateline'] > 0)
|
else { $last_use = $lang->never; }
if($filter['dateline'] > 0)
|
{
| {
|
$date = my_date($mybb->settings['dateformat'], $filter['dateline']).", ".my_date($mybb->settings['timeformat'], $filter['dateline']);
|
$date = my_date($mybb->settings['dateformat'], $filter['dateline']).", ".my_date($mybb->settings['timeformat'], $filter['dateline']);
|
}
| }
|
else { $date = $lang->na;
| else { $date = $lang->na;
|
Zeile 235 | Zeile 253 |
---|
$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($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 247 | 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 266 | 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); }
|