DataObjects/Core_domain.php
[Pman.Core] / DataObjects / Person.php
index ee4e10f..69ed35e 100644 (file)
@@ -274,6 +274,8 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
             }
             
             unset($_SESSION[get_class($this)][$sesPrefix .'-auth']);
+            unset($_SESSION[get_class($this)][$sesPrefix .'-timeout']);
+            setcookie('Pman.timeout', -1, time() + (30*60), '/');
             
         }
         if (!$this->canInitializeSystem()) {
@@ -309,6 +311,7 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
         //var_dump($ff->Pman['local_autoauth']);         var_dump($_SERVER); exit;
         $u = DB_DataObject::factory($this->tableName());
         $ff = HTML_FlexyFramework::get();
+        
         if (!empty($ff->Pman['local_autoauth']) && 
             (!empty($_SERVER['SERVER_ADDR'])) &&
             ($_SERVER['SERVER_ADDR'] == '127.0.0.1') &&
@@ -517,10 +520,10 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
        
     }      
     
-    function generatePassword() // genearte a password (add set 'rawPasswd' to it's value)
+    function generatePassword($length = 5) // genearte a password (add set 'rawPasswd' to it's value)
     {
         require_once 'Text/Password.php';
-        $this->rawPasswd = strtr(ucfirst(Text_Password::create(5)).ucfirst(Text_Password::create(5)), array(
+        $this->rawPasswd = strtr(ucfirst(Text_Password::create($length)).ucfirst(Text_Password::create($length)), array(
         "a"=>"4", "e"=>"3",  "i"=>"1",  "o"=>"0", "s"=>"5",  "t"=>"7"));
         $this->setPassword($this->rawPasswd);
         return $this->rawPasswd;
@@ -689,6 +692,7 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
         if (!isset($pcache[$this->id])) {
             $pcache[$this->id] = $this->getPerms();
         }
+        
        // echo "<PRE>";print_r($pcache[$au->id]);
        // var_dump($pcache[$au->id]);
         if (empty($pcache[$this->id][$name])) {
@@ -852,6 +856,11 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
                 {$this->tableName()}.name LIKE '%{$this->escape($q['query']['name'])}%'
             ");
         }
+         if(!empty($q['query']['name_starts'])){
+            $this->whereAdd("
+                {$this->tableName()}.name LIKE '{$this->escape($q['query']['name_starts'])}%'
+            ");
+        }
         
         if (!empty($q['query']['search'])) {