function get($s='', $opts = Array())
{
- if(!empty($_REQUEST['_clear_cache'])) {
- $this->clearCompiledFilesCache();
- }
-
+
$this->sessionState(0);
}
function post($s='') {
+ if(!empty($_REQUEST['_clear_cache'])) {
+ $this->clearCompiledFilesCache();
+ }
+
die('invalid');
}
function clearCompiledFilesCache()
{
+ $au = $this->getAuthUser();
+ if (!$au && !in_array($_SERVER['REMOTE_ADDR'] , array('127.0.0.1','::1'))) {
+ $this->jerr("Cache can only be cleared by authenticated users");
+ }
+
require_once 'System.php';
- $mods = $this->modulesList();
- foreach ($mods as $mod) {
+ $mods = $this->modulesList();
+ foreach ($mods as $module) {
$compile_dir = $this->getCompileDir('js', $module, false);
if(!empty($compile_dir)) {
- System::rm(array('-r', $compiledir));
+ System::rm(array('-r', $compile_dir));
}
$compile_dir = $this->getCompileDir('css', $module, false);
if(!empty($compile_dir)) {
- System::rm(array('-r', $compiledir));
+ System::rm(array('-r', $compile_dir));
}
}