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 | |
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')
-rw-r--r-- | phpBB/includes/acp/acp_ban.php | 71 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 7 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_icons.php | 4 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_modules.php | 3 |
4 files changed, 62 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) ); } } diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 3869a3ac4a..e6630e36d2 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -75,6 +75,8 @@ class acp_forums } $auth->acl_clear_prefetch(); + $cache->destroy('sql', FORUMS_TABLE); + recalc_btree('forum_id', FORUMS_TABLE); trigger_error($user->lang['FORUM_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); @@ -174,6 +176,8 @@ class acp_forums } $auth->acl_clear_prefetch(); + $cache->destroy('sql', FORUMS_TABLE); + recalc_btree('forum_id', FORUMS_TABLE); $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; @@ -306,6 +310,8 @@ class acp_forums add_log('admin', $log_action, $forum_data['forum_name'], $move_forum_name); unset($forum_data); + $cache->destroy('sql', FORUMS_TABLE); + break; case 'sync': @@ -328,6 +334,7 @@ class acp_forums sync('forum', 'forum_id', $forum_id); add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']); + $cache->destroy('sql', FORUMS_TABLE); $template->assign_var('L_FORUM_RESYNCED', sprintf($user->lang['FORUM_RESYNCED'], $row['forum_name'])); diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index dd581475f2..44e9f450a5 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -303,6 +303,7 @@ class acp_icons } $cache->destroy('icons'); + $cache->destroy('sql', $table); if ($action == 'modify') { @@ -427,6 +428,8 @@ class acp_icons } $cache->destroy('icons'); + $cache->destroy('sql', $table); + trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action)); } else @@ -553,6 +556,7 @@ class acp_icons $db->sql_query($sql); $cache->destroy('icons'); + $cache->destroy('sql', $table); break; } diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 927fed7502..8065080e30 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -755,6 +755,9 @@ class acp_modules $p_class = str_replace(array('.', '/', '\\'), '', basename($this->module_class)); $cache->destroy('_modules_' . $p_class); + + // Additionally remove sql cache + $cache->destroy('sql', MODULES_TABLE); } /** |