Asset.php
authorAlan Knowles <alan@roojs.com>
Thu, 16 Aug 2018 00:42:20 +0000 (08:42 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 16 Aug 2018 00:42:20 +0000 (08:42 +0800)
Asset.php

index 503a94e..b65dca0 100644 (file)
--- a/Asset.php
+++ b/Asset.php
@@ -36,10 +36,7 @@ class Pman_Core_Asset extends Pman {
     
     function get($s='', $opts = Array())
     {
-        if(!empty($_REQUEST['_clear_cache'])) {
-            $this->clearCompiledFilesCache();
-        }
-        
+
         
         $this->sessionState(0);
         
@@ -121,6 +118,10 @@ class Pman_Core_Asset extends Pman {
     }
     
     function post($s='') {
+        if(!empty($_REQUEST['_clear_cache'])) {
+            $this->clearCompiledFilesCache();
+        }
+        
         die('invalid');
     }
      
@@ -166,6 +167,12 @@ class Pman_Core_Asset extends Pman {
     
     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();