mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-26 17:54:39 +02:00
- adding ability to assign moderator specific ban options
- fixing destroying of sql caches - fixing referencing of sql cached queries if more than one are active on one page - other fixes git-svn-id: file:///svn/phpbb/trunk@5633 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -53,15 +53,6 @@ class acp_ban
|
||||
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL'] . adm_back_link($this->u_action));
|
||||
}
|
||||
|
||||
// Ban length options
|
||||
$ban_end_text = array(0 => $user->lang['PERMANENT'], 30 => $user->lang['30_MINS'], 60 => $user->lang['1_HOUR'], 360 => $user->lang['6_HOURS'], 1440 => $user->lang['1_DAY'], 10080 => $user->lang['7_DAYS'], 20160 => $user->lang['2_WEEKS'], 40320 => $user->lang['1_MONTH'], -1 => $user->lang['UNTIL'] . ' -> ');
|
||||
|
||||
$ban_end_options = '';
|
||||
foreach ($ban_end_text as $length => $text)
|
||||
{
|
||||
$ban_end_options .= '<option value="' . $length . '">' . $text . '</option>';
|
||||
}
|
||||
|
||||
// Define language vars
|
||||
$this->page_title = $user->lang[strtoupper($mode) . '_BAN'];
|
||||
|
||||
@@ -71,6 +62,53 @@ class acp_ban
|
||||
$l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN'];
|
||||
$l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED'];
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'user':
|
||||
$l_ban_cell = $user->lang['USERNAME'];
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$l_ban_cell = $user->lang['IP_HOSTNAME'];
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
$l_ban_cell = $user->lang['EMAIL_ADDRESS'];
|
||||
break;
|
||||
}
|
||||
|
||||
$this->display_ban_options($mode);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_TITLE' => $this->page_title,
|
||||
'L_EXPLAIN' => $l_ban_explain,
|
||||
'L_UNBAN_TITLE' => $l_unban_title,
|
||||
'L_UNBAN_EXPLAIN' => $l_unban_explain,
|
||||
'L_BAN_CELL' => $l_ban_cell,
|
||||
'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain,
|
||||
'L_NO_BAN_CELL' => $l_no_ban_cell,
|
||||
|
||||
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
|
||||
|
||||
'U_ACTION' => $this->u_action,
|
||||
'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_ban&field=ban",
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function display_ban_options($mode)
|
||||
{
|
||||
global $user, $db, $template;
|
||||
|
||||
// Ban length options
|
||||
$ban_end_text = array(0 => $user->lang['PERMANENT'], 30 => $user->lang['30_MINS'], 60 => $user->lang['1_HOUR'], 360 => $user->lang['6_HOURS'], 1440 => $user->lang['1_DAY'], 10080 => $user->lang['7_DAYS'], 20160 => $user->lang['2_WEEKS'], 40320 => $user->lang['1_MONTH'], -1 => $user->lang['UNTIL'] . ' -> ');
|
||||
|
||||
$ban_end_options = '';
|
||||
foreach ($ban_end_text as $length => $text)
|
||||
{
|
||||
$ban_end_options .= '<option value="' . $length . '">' . $text . '</option>';
|
||||
}
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'user':
|
||||
@@ -163,22 +201,9 @@ class acp_ban
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'L_TITLE' => $this->page_title,
|
||||
'L_EXPLAIN' => $l_ban_explain,
|
||||
'L_UNBAN_TITLE' => $l_unban_title,
|
||||
'L_UNBAN_EXPLAIN' => $l_unban_explain,
|
||||
'L_BAN_CELL' => $l_ban_cell,
|
||||
'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain,
|
||||
'L_NO_BAN_CELL' => $l_no_ban_cell,
|
||||
|
||||
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
|
||||
'S_BAN_END_OPTIONS' => $ban_end_options,
|
||||
'S_BANNED_OPTIONS' => ($banned_options) ? true : false,
|
||||
'BANNED_OPTIONS' => $banned_options,
|
||||
|
||||
'U_ACTION' => $this->u_action,
|
||||
'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_ban&field=ban",
|
||||
)
|
||||
'BANNED_OPTIONS' => $banned_options)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user