X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FCore_person.php;h=635ff1cfa93603e8300fee94c314c7da1feb4586;hp=f21045ab287b2992fc11264e7398d48235d96a80;hb=5d4ac076dc4f620fbb91944eead3e0af66216a03;hpb=6e67f21b403749a23c380a55a42bf309a9b93f35 diff --git a/DataObjects/Core_person.php b/DataObjects/Core_person.php index f21045ab..635ff1cf 100644 --- a/DataObjects/Core_person.php +++ b/DataObjects/Core_person.php @@ -2,7 +2,7 @@ /** * Table Definition for Person */ -require_once 'DB/DataObject.php'; +class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php'; class Pman_Core_DataObjects_Core_person extends DB_DataObject @@ -293,8 +293,9 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize($u); return true; } - + //die("test init"); if (!$this->canInitializeSystem()) { + // die("can not init"); return false; } @@ -364,6 +365,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject function canInitializeSystem() { + return !strcasecmp(get_class($this) , __CLASS__); } @@ -1219,23 +1221,20 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $db = $this->getDatabaseConnection(); - $ff= HTML_FlexyFramework::get(); + $ff = HTML_FlexyFramework::get(); - if(empty($ff->Pman) || empty($ff->Pman->login_public)){ + if(empty($ff->Pman) || empty($ff->Pman['login_public'])){ return false; } - $sesPrefix = 'Hydra-' .get_class($this) .'-'.$db->dsn['database'] ; + $sesPrefix = $ff->Pman['login_public'] . '-' .get_class($this) .'-'.$db->dsn['database'] ; - print_R($sesPrefix);exit; - // 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.. + return true; } }