DataObjects/Core_person_signup.php
[Pman.Core] / DataObjects / Person.php
index f826380..471ac33 100644 (file)
@@ -377,11 +377,12 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
         if (!empty($_SESSION[get_class($this)][$sesPrefix .'-auth'])) {
             $a = unserialize($_SESSION[get_class($this)][$sesPrefix .'-auth']);
             
-            
             $u = DB_DataObject::factory($this->tableName()); // allow extending this ...
             $u->autoJoin();
             if ($u->get($a->id)) { /// && strlen($u->passwd)) {  // should work out the pid .. really..
-                return clone($u);
+                $user = clone ($u);
+                
+                return clone($user);
             }
             unset($_SESSION[get_class($this)][$sesPrefix .'-auth']);
         }
@@ -452,8 +453,10 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
         $p = DB_DAtaObject::Factory($this->tableName());
         $p->get($this->pid());
         
+        $d = $p->toArray();
+        
         //var_dump(array(get_class($this),$sesPrefix .'-auth'));
-        $_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize((object)$p->toArray());
+        $_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize((object)$d);
         // ensure it's written so that ajax calls can fetch it..
         
         
@@ -852,6 +855,15 @@ class Pman_Core_DataObjects_Person extends DB_DataObject
                     "$tn_p.remarks",
                     "join_company_id_id.name"
             );
+            $tbcols = $this->table();
+            foreach(array('firstname','lastname') as $k) {
+                if (isset($tbcols[$k])) {
+                    $props[] = "{$tn_p}.{$k}";
+                }
+            }
+            
+            
+            
             
             $str =  $x->toSQL(array(
                 'default' => $props,