aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2007-05-16 19:20:50 +0000
committerDavid M <davidmj@users.sourceforge.net>2007-05-16 19:20:50 +0000
commit34bd3a9b1c06f45db6ab563dbb82729ff104e5a7 (patch)
treea8fa3a18f662069bc5431b4ca1380634e69feebf /phpBB
parent15743dc7ac7ae8985e785096d2e3ed2a046c6e32 (diff)
downloadforums-34bd3a9b1c06f45db6ab563dbb82729ff104e5a7.tar
forums-34bd3a9b1c06f45db6ab563dbb82729ff104e5a7.tar.gz
forums-34bd3a9b1c06f45db6ab563dbb82729ff104e5a7.tar.bz2
forums-34bd3a9b1c06f45db6ab563dbb82729ff104e5a7.tar.xz
forums-34bd3a9b1c06f45db6ab563dbb82729ff104e5a7.zip
#11012
- For now, only founders can clear the cache ( we might change this ) git-svn-id: file:///svn/phpbb/trunk@7612 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_main.html11
-rw-r--r--phpBB/includes/acp/acp_main.php16
-rw-r--r--phpBB/language/en/acp/common.php6
3 files changed, 32 insertions, 1 deletions
diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html
index 696d384ff8..80c7f09d6e 100644
--- a/phpBB/adm/style/acp_main.html
+++ b/phpBB/adm/style/acp_main.html
@@ -126,7 +126,16 @@
<dd><input type="hidden" name="action" value="db_track" /><input class="button2" type="submit" id="action_db_track" name="action_db_track" value="{L_RUN}" /></dd>
</dl>
</form>
- </fieldset>
+
+ <!-- IF S_FOUNDER -->
+ <form id="action_purge_cache_form" method="post" action="{U_ACTION}">
+ <dl>
+ <dt><label for="action_purge_cache">{L_PURGE_CACHE}</label><br /><span>{L_PURGE_CACHE_EXPLAIN}</span></dt>
+ <dd><input type="hidden" name="action" value="purge_cache" /><input class="button2" type="submit" id="action_purge_cache" name="action_purge_cache" value="{L_RUN}" /></dd>
+ </dl>
+ </form>
+ <!-- ENDIF -->
+ </fieldset>
<!-- ENDIF -->
<!-- IF .log -->
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index d49f933008..b944765011 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -77,6 +77,10 @@ class acp_main
$confirm = true;
$confirm_lang = 'RESYNC_POST_MARKING_CONFIRM';
break;
+ case 'purge_cache':
+ $confirm = true;
+ $confirm_lang = 'PURGE_CACHE_CONFIRM';
+ break;
default:
$confirm = true;
@@ -257,6 +261,17 @@ class acp_main
add_log('admin', 'LOG_RESYNC_POST_MARKING');
break;
+
+ case 'purge_cache':
+ if ((int) $user->data['user_type'] !== USER_FOUNDER)
+ {
+ trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
+ global $cache;
+ $cache->purge();
+ add_log('admin', 'LOG_PURGE_CACHE');
+ break;
}
}
}
@@ -362,6 +377,7 @@ class acp_main
'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
+ 'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
)
);
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index e17df3c86b..2c7d8de7f3 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -320,6 +320,10 @@ $lang = array_merge($lang, array(
'POSTS_PER_DAY' => 'Posts per day',
+ 'PURGE_CACHE' => 'Purge the cache',
+ 'PURGE_CACHE_CONFIRM' => 'Are you sure you wish to purge the cache?',
+ 'PURGE_CACHE_EXPLAIN' => 'Purge all cache related items, this includes any cached template files or queries.',
+
'RESET_DATE' => 'Reset board’s start date',
'RESET_DATE_CONFIRM' => 'Are you sure you wish to reset the board’s start date?',
'RESET_ONLINE' => 'Reset most users ever online',
@@ -583,6 +587,8 @@ $lang = array_merge($lang, array(
'LOG_PRUNE_USER_DEL_DEL' => '<strong>Users pruned and posts deleted</strong><br />» %s',
'LOG_PRUNE_USER_DEL_ANON' => '<strong>Users pruned and posts retained</strong><br />» %s',
+ 'LOG_PURGE_CACHE' => '<strong>Purged cache</strong>',
+
'LOG_RANK_ADDED' => '<strong>Added new rank</strong><br />» %s',
'LOG_RANK_REMOVED' => '<strong>Removed rank</strong><br />» %s',
'LOG_RANK_UPDATED' => '<strong>Updated rank</strong><br />» %s',