DataObjects/Core_notify.php
[Pman.Core] / Mailer.php
index 193bca3..40f9772 100644 (file)
@@ -237,7 +237,8 @@ class Pman_Core_Mailer {
     {
         
         if ($url[0] == '/') {
-            $file = $this->page->rootDir . $url;
+            $ff = HTML_FlexyFramework::get();
+            $file = $ff->rootDir . $url;
             require_once 'File/MimeType.php';
             $m  = new File_MimeType();
             $mt = $m->fromFilename($file);
@@ -276,14 +277,18 @@ class Pman_Core_Mailer {
         // CACHE???
         // 2 files --- the info file.. and the actual file...
         // add user
-        $cache = ini_get('session.save_path').'/Pman_Core_Mailer/' . md5($url);
+        // unix only...
+        $uinfo = posix_getpwuid( posix_getuid () ); 
+        $user = $uinfo['name']; 
+        
+        $cache = ini_get('session.save_path')."/Pman_Core_Mailer-{$user}/" . md5($url);
         if (file_exists($cache) and filemtime($cache) > strtotime('NOW - 1 WEEK')) {
             $ret =  json_decode($cache);
             $ret['file'] = $cache . '.data';
             return $ret;
         }
         if (!file_exists(dirname($cache))) {
-            mkdir(dirname($cache),0666, true);
+            mkdir(dirname($cache),0700, true);
         }
         
         require_once 'HTTP/Request.php';