[ Index ] |
PHP Cross Reference of phpBB-3.3.14-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * 4 * This file is part of the phpBB Forum Software package. 5 * 6 * @copyright (c) phpBB Limited <https://www.phpbb.com> 7 * @license GNU General Public License, version 2 (GPL-2.0) 8 * 9 * For full copyright and license information, please see 10 * the docs/CREDITS.txt file. 11 * 12 */ 13 14 /** 15 * @ignore 16 */ 17 if (!defined('IN_PHPBB')) 18 { 19 exit; 20 } 21 22 class acp_ban 23 { 24 var $u_action; 25 26 function main($id, $mode) 27 { 28 global $user, $template, $request, $phpbb_dispatcher; 29 global $phpbb_root_path, $phpEx; 30 31 if (!function_exists('user_ban')) 32 { 33 include($phpbb_root_path . 'includes/functions_user.' . $phpEx); 34 } 35 36 $bansubmit = $request->is_set_post('bansubmit'); 37 $unbansubmit = $request->is_set_post('unbansubmit'); 38 39 $user->add_lang(array('acp/ban', 'acp/users')); 40 $this->tpl_name = 'acp_ban'; 41 $form_key = 'acp_ban'; 42 add_form_key($form_key); 43 44 if (($bansubmit || $unbansubmit) && !check_form_key($form_key)) 45 { 46 trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); 47 } 48 49 // Ban submitted? 50 if ($bansubmit) 51 { 52 // Grab the list of entries 53 $ban = $request->variable('ban', '', true); 54 $ban_length = $request->variable('banlength', 0); 55 $ban_length_other = $request->variable('banlengthother', ''); 56 $ban_exclude = $request->variable('banexclude', 0); 57 $ban_reason = $request->variable('banreason', '', true); 58 $ban_give_reason = $request->variable('bangivereason', '', true); 59 60 if ($ban) 61 { 62 $abort_ban = false; 63 /** 64 * Use this event to modify the ban details before the ban is performed 65 * 66 * @event core.acp_ban_before 67 * @var string mode One of the following: user, ip, email 68 * @var string ban Either string or array with usernames, ips or email addresses 69 * @var int ban_length Ban length in minutes 70 * @var string ban_length_other Ban length as a date (YYYY-MM-DD) 71 * @var bool ban_exclude Are we banning or excluding from another ban 72 * @var string ban_reason Ban reason displayed to moderators 73 * @var string ban_give_reason Ban reason displayed to the banned user 74 * @var mixed abort_ban Either false, or an error message that is displayed to the user. 75 * If a string is given the bans are not issued. 76 * @since 3.1.0-RC5 77 */ 78 $vars = array( 79 'mode', 80 'ban', 81 'ban_length', 82 'ban_length_other', 83 'ban_exclude', 84 'ban_reason', 85 'ban_give_reason', 86 'abort_ban', 87 ); 88 extract($phpbb_dispatcher->trigger_event('core.acp_ban_before', compact($vars))); 89 90 if ($abort_ban) 91 { 92 trigger_error($abort_ban . adm_back_link($this->u_action)); 93 } 94 user_ban($mode, $ban, $ban_length, $ban_length_other, $ban_exclude, $ban_reason, $ban_give_reason); 95 96 /** 97 * Use this event to perform actions after the ban has been performed 98 * 99 * @event core.acp_ban_after 100 * @var string mode One of the following: user, ip, email 101 * @var string ban Either string or array with usernames, ips or email addresses 102 * @var int ban_length Ban length in minutes 103 * @var string ban_length_other Ban length as a date (YYYY-MM-DD) 104 * @var bool ban_exclude Are we banning or excluding from another ban 105 * @var string ban_reason Ban reason displayed to moderators 106 * @var string ban_give_reason Ban reason displayed to the banned user 107 * @since 3.1.0-RC5 108 */ 109 $vars = array( 110 'mode', 111 'ban', 112 'ban_length', 113 'ban_length_other', 114 'ban_exclude', 115 'ban_reason', 116 'ban_give_reason', 117 ); 118 extract($phpbb_dispatcher->trigger_event('core.acp_ban_after', compact($vars))); 119 120 trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . adm_back_link($this->u_action)); 121 } 122 } 123 else if ($unbansubmit) 124 { 125 $ban = $request->variable('unban', array('')); 126 127 if ($ban) 128 { 129 user_unban($mode, $ban); 130 131 trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . adm_back_link($this->u_action)); 132 } 133 } 134 135 // Define language vars 136 $this->page_title = $user->lang[strtoupper($mode) . '_BAN']; 137 138 $l_ban_explain = $user->lang[strtoupper($mode) . '_BAN_EXPLAIN']; 139 $l_ban_exclude_explain = $user->lang[strtoupper($mode) . '_BAN_EXCLUDE_EXPLAIN']; 140 $l_unban_title = $user->lang[strtoupper($mode) . '_UNBAN']; 141 $l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN']; 142 $l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED']; 143 144 switch ($mode) 145 { 146 case 'user': 147 $l_ban_cell = $user->lang['USERNAME']; 148 break; 149 150 case 'ip': 151 $l_ban_cell = $user->lang['IP_HOSTNAME']; 152 break; 153 154 case 'email': 155 $l_ban_cell = $user->lang['EMAIL_ADDRESS']; 156 break; 157 } 158 159 display_ban_end_options(); 160 display_ban_options($mode); 161 162 $template->assign_vars(array( 163 'L_TITLE' => $this->page_title, 164 'L_EXPLAIN' => $l_ban_explain, 165 'L_UNBAN_TITLE' => $l_unban_title, 166 'L_UNBAN_EXPLAIN' => $l_unban_explain, 167 'L_BAN_CELL' => $l_ban_cell, 168 'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain, 169 'L_NO_BAN_CELL' => $l_no_ban_cell, 170 171 'S_USERNAME_BAN' => ($mode == 'user') ? true : false, 172 173 'U_ACTION' => $this->u_action, 174 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=acp_ban&field=ban'), 175 )); 176 } 177 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Nov 25 19:05:08 2024 | Cross-referenced by PHPXref 0.7.1 |