diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-03-15 13:03:57 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-03-15 13:03:57 +0000 |
commit | d907d066f2e0d7974766370b11dab69a59962f97 (patch) | |
tree | 146a203caa445298e084088c30311b959d00c9f1 /phpBB/includes/acp/acp_ban.php | |
parent | 8c3f94f9ae8a1333be8c01dd2e0be74dffc91831 (diff) | |
download | forums-d907d066f2e0d7974766370b11dab69a59962f97.tar forums-d907d066f2e0d7974766370b11dab69a59962f97.tar.gz forums-d907d066f2e0d7974766370b11dab69a59962f97.tar.bz2 forums-d907d066f2e0d7974766370b11dab69a59962f97.tar.xz forums-d907d066f2e0d7974766370b11dab69a59962f97.zip |
- 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
Diffstat (limited to 'phpBB/includes/acp/acp_ban.php')
-rw-r--r-- | phpBB/includes/acp/acp_ban.php | 71 |
1 files changed, 48 insertions, 23 deletions
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 4c8a1a0dfc..6b4f2f843b 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -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']; @@ -74,6 +65,53 @@ class acp_ban 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': $field = 'username'; $l_ban_cell = $user->lang['USERNAME']; @@ -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) ); } } |