DataObjects/Person.php
authorAlan Knowles <alan@akbkhome.com>
Thu, 21 Mar 2013 06:57:07 +0000 (14:57 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 21 Mar 2013 06:57:07 +0000 (14:57 +0800)
DataObjects/Person.php

index 7da19c1..bcb0a37 100644 (file)
@@ -308,11 +308,14 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
              
         }
         
-        
-        
-        $u = DB_DataObject::factory('Person');
-        $u->whereAdd(' LENGTH(passwd) > 0');
-        if (!$u->count()){
+        if (empty(   $_SESSION[__CLASS__][$sesPrefix .'-empty'] )) {
+            $u = DB_DataObject::factory('Person');
+            $u->whereAdd(' LENGTH(passwd) > 0');
+             $_SESSION[__CLASS__][$sesPrefix .'-empty']  = $u->count();
+        }
+                
+             
+        if (empty(   $_SESSION[__CLASS__][$sesPrefix .'-empty'] )) {
             
             // fake person - open system..
             //$ce = DB_DataObject::factory('core_enum');