syncing core_person and groups
authorAlan Knowles <alan@roojs.com>
Thu, 3 Jun 2021 03:58:42 +0000 (11:58 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 3 Jun 2021 03:58:42 +0000 (11:58 +0800)
DataObjects/Core_company.php
DataObjects/Core_person.php
DataObjects/Core_project.php

index ac63449..ba7df39 100644 (file)
@@ -499,10 +499,16 @@ class Pman_Core_DataObjects_Core_Company extends DB_DataObject
     }
     static function lookupOwner()
     {
+        static $cache = false;
+        if ($cache !== false) {
+            return clone($cache); // no updating this object..
+        }
+        
         $enum = DB_DataObject::Factory('core_enum')->lookup('COMPTYPE', 'OWNER'  );
         $companies = DB_DataObject::factory('core_company');
         $companies->comptype_id = $enum;
         if ($companies->find(true)) {
+            $cache = clone($companies);
             return $companies;
         }
         return false;
index f473b5c..7b61faf 100644 (file)
@@ -523,11 +523,8 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
         $this->isAuth(); // force session start..
         
         $sesPrefix = $this->sesPrefix();
-        
         $_SESSION[get_class($this)][$sesPrefix .'-auth-timeout'] = -1;
-        
         $_SESSION[get_class($this)][$sesPrefix .'-auth'] = "";
-        
         self::$authUser = false;
         
     }    
index 20bc619..3e48b0a 100644 (file)
@@ -130,7 +130,7 @@ class Pman_Core_DataObjects_Core_project extends DB_DataObject
         
         //&& $au->hasPerm('Documents.Documents','S') << this is dependant on the doc modules
           
-        if (!$au->hasPerm('Core.Projects_All','S') ) {
+        if (php_sapi_name() != 'cli' && !$au->hasPerm('Core.Projects_All','S') ) {