X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_person.php;h=c03d9621124fc6b6c3012bd4f1f2e764682ac736;hb=b32faa5954b497d89318489fabfdbaacf9da86d8;hp=0e62884dd835738fd9861c0f823d65416eb99eff;hpb=19d7630238fda4aa1ac25408eb1727bcc43dd063;p=Pman.Core diff --git a/DataObjects/Core_person.php b/DataObjects/Core_person.php index 0e62884d..c03d9621 100644 --- a/DataObjects/Core_person.php +++ b/DataObjects/Core_person.php @@ -290,8 +290,8 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $u->checkPassword($_SERVER['PHP_AUTH_PW']) ) { // logged in via http auth - - $_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize($u); + // http auth will not need session... + //$_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize($u); self::$authUser = $u; return true; } @@ -341,6 +341,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject "); if($member->find(true)){ $default_admin = DB_DataObject::factory($this->tableName()); + $default_admin->autoJoin(); if(!$default_admin->get($member->user_id)){ $default_admin = false; } @@ -349,6 +350,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject //var_dump($ff->Pman['local_autoauth']); var_dump($_SERVER); exit; $u = DB_DataObject::factory($this->tableName()); + $u->autoJoin(); $ff = HTML_FlexyFramework::get(); if ($auto_auth_allow && @@ -358,7 +360,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $user = $default_admin ? $default_admin->toArray() : $u->toArray(); // if we request other URLS.. then we get auto logged in.. - self::$authUser = $u; + self::$authUser = $default_admin ? $default_admin : $u;; //$_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize((object) $user); return true; } @@ -412,10 +414,9 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $_SESSION[get_class($this)][$sesPrefix .'-auth-timeout'] = time() + (30*60); // eg. 30 minutes setcookie('Pman.timeout', time() + (30*60), time() + (30*60), '/'); } - - $user = clone (self::$authUser); - return clone($user); - + // not really sure why it's cloned.. + return clone (self::$authUser); + } @@ -496,7 +497,11 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject //var_dump(array(get_class($this),$sesPrefix .'-auth')); $_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize((object)$d); + $pp = DB_DAtaObject::Factory($this->tableName()); + $pp->get($this->pid()); + $pp->autoJoin(); + self::$authUser = $pp; // ensure it's written so that ajax calls can fetch it.. @@ -512,6 +517,8 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $_SESSION[get_class($this)][$sesPrefix .'-auth'] = ""; + self::$authUser = false; + } function genPassKey ($t) { @@ -1414,7 +1421,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject return $sesPrefix; } - function loginPublic() + function loginPublic() // used where??? { $this->isAuth(); // force session start..