//var_dump(array(get_class($this),$sesPrefix .'-auth'));
if (self::$authUser) {
- $a = self::$authUser; // are they still allowed to do stuff..
+
+ if (isset($_SESSION[get_class($this)][$sesPrefix .'-auth'])) {
+ $_SESSION[get_class($this)][$sesPrefix .'-auth-timeout'] = time() + (30*60); // eg. 30 minutes
+ setcookie('Pman.timeout', time() + (30*60), time() + (30*60), '/');
+ }
- $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..
- if (isset($_SESSION[get_class($this)][$sesPrefix .'-auth'])) {
- $_SESSION[get_class($this)][$sesPrefix .'-auth-timeout'] = time() + (30*60); // eg. 30 minutes
- setcookie('Pman.timeout', time() + (30*60), time() + (30*60), '/');
- }
-
- $user = clone ($u);
- return clone($user);
+ $user = clone (self::$authUser);
+ return clone($user);
- }
- unset($_SESSION[get_class($this)][$sesPrefix .'-auth']);
- unset($_SESSION[get_class($this)][$sesPrefix .'-timeout']);
- setcookie('Pman.timeout', -1, time() + (30*60), '/');
}
//var_dump(array(get_class($this),$sesPrefix .'-auth'));
$_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize((object)$d);
+
+
// ensure it's written so that ajax calls can fetch it..