- $relpath = $this->rootURL . '/' . $path .'/';
- $ff = HTML_FlexyFramework::get();
- $dir = $this->rootDir.'/' . $path;
-
- $args = func_get_args();
- $ar = array();
- if (count($args) < 2) {
- $ar = glob($dir . '/*.css');
- } else {
- array_shift($args);
- foreach($args as $f) {
- if (strpos($f,'*') > -1) {
-
- $ar = array_merge($ar , glob($dir . '/'. $f));
- continue;
- }
- // what if the fiel does not exist???
- $ar[] = $dir .'/'. $f;
- }
-
- }
-
-
- // cached version?? - how do we decide if it's expired?
- // while scanning the directory is slow... - it's faster than serving every file...
-
-
- //$path = $this->rootURL ."/Pman/$mod/";
-
- //print_R($ar);exit;
-
- $files = array();
- $arfiles = array();
- $relfiles = array(); // array of files without the path part...
- $maxtime = 0;
- $mtime = 0;
- foreach($ar as $fn) {
- $relfiles[] = substr($fn, strlen($dir)+1);
- $f = basename($fn);
- // got the 'module file..'
- $mtime = filemtime($dir . '/'. $f);
- $maxtime = max($mtime, $maxtime);
- $arfiles[$fn] = $mtime;
- $files[] = $relpath . $f . '?ts='.$mtime;
-
-
-
+ $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");