FEATURE: #3610 - Require ADMIN permissions for ?flush=all

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@72763 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2009-03-10 04:32:23 +00:00 committed by Sam Minnee
parent ad063f6106
commit 43f62244df

View File

@ -121,7 +121,12 @@ class SSViewer extends Object {
// flush template manifest cache if requested
if (isset($_GET['flush']) && $_GET['flush'] == 'all') {
self::flush_template_cache();
if(Director::isDev() || Permission::check('ADMIN')) {
self::flush_template_cache();
Debug::message('flushed!');
} else {
Security::permissionFailure(null, 'Please log in as an administrator to flush the template cache.');
}
}
if(substr((string) $templateList,-3) == '.ss') {
@ -591,4 +596,4 @@ function supressOutput() {
return "";
}
?>
?>