DataObjects/Core_person.php
authoredward <edward@roojs.com>
Mon, 31 Oct 2016 03:25:40 +0000 (11:25 +0800)
committeredward <edward@roojs.com>
Mon, 31 Oct 2016 03:25:40 +0000 (11:25 +0800)
DataObjects/Core_person.php

index 112ce06..3215bcd 100644 (file)
@@ -1215,6 +1215,19 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
     
     function loginPublic()
     {
+        $this->isAuth(); // force session start..
+         
+        $db = $this->getDatabaseConnection();
+        
+        $sesPrefix = 'Hydra-' .get_class($this) .'-'.$db->dsn['database'] ;
+
+        // we should not store the whole data in the session - otherwise it get's huge.
+        $p = DB_DAtaObject::Factory($this->tableName());
+        $p->get($this->pid());
+        
+        //var_dump(array(get_class($this),$sesPrefix .'-auth'));
+        $_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize((object)$p->toArray());
+        // ensure it's written so that ajax calls can fetch it..
         
     }