DataObjects/Events.php
[Pman.Core] / DataObjects / Events.php
index 6e34de9..e285634 100644 (file)
@@ -254,17 +254,16 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
             $tnb = $this->escape($q['query']['on_table']);
             $this->whereAdd("Events.on_table LIKE '%{$tnb}%'");
         } 
-        
+        echo "fuk"; die;
     }
     
     function applyPermissionFilters($q, $au ,$roo)
     {
-        if (!$au->hasPerm("Admin.Admin_Tab", 'S') &&  !$au->hasPerm("BAdmin.BAdmin", 'S')) {
+        if (!$au->hasPerm("Admin.Admin_Tab", 'S')) {
             //DB_DataObject::DebugLevel(1);
             // they can only view their changes..
             $this->whereAdd("($tn.person_id = {$au->id} OR $tn.person_id = 0)");
 //            $this->person_id = $au->id;
-            
         }
     }
     
@@ -484,14 +483,16 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
             $user = getenv('USERNAME'); // windows.
         }
         
-        // DEPRICATED...
+        
+   
+        if (!empty($ff->Pman['storedir'])) {
+            return $ff->Pman['storedir'] .'/Events/'.$user;
+        }
+        // DEPRICATED... 
         if (!empty($ff->Pman['event_log_dir'])) {
             return $ff->Pman['event_log_dir'] . '/'.$user;
         }
-        if (!empty($ff->Pman['storedir'])) {
-            return $ff->Pman['storedir'] .'/Events/'.$user;
         
-        }
         return false;
     }
     
@@ -500,6 +501,7 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
     function writeEventLog($extra_data  = false)
     {
         $logdir = $this->logDir();
+        
         if (!$logdir) {
             return false;
         }
@@ -511,6 +513,7 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
             
             @mkdir(dirname($file),0700,true); // this might fail if it does not have correct permissions..
             if (!file_exists(dirname($file))) {
+                print_r($this);
                 die("could not create $file - permissons are not correct"); // fatal, otherwise we loop!?
             }