projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DataObjects/Core_person.php
[Pman.Core]
/
DataObjects
/
Core_person.php
diff --git
a/DataObjects/Core_person.php
b/DataObjects/Core_person.php
index
7581c61
..
5a3a705
100644
(file)
--- 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
$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;
}
self::$authUser = $u;
return true;
}
@@
-358,7
+358,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..
$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;
}
//$_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize((object) $user);
return true;
}
@@
-407,22
+407,14
@@
class Pman_Core_DataObjects_Core_person extends DB_DataObject
//var_dump(array(get_class($this),$sesPrefix .'-auth'));
if (self::$authUser) {
//var_dump(array(get_class($this),$sesPrefix .'-auth'));
if (self::$authUser) {
- $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..
-
+
+ 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), '/');
$_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);
-
}
}
- unset($_SESSION[get_class($this)][$sesPrefix .'-auth']);
-
unset($_SESSION[get_class($this)][$sesPrefix .'-timeout']
);
- setcookie('Pman.timeout', -1, time() + (30*60), '/');
+ // not really sure why it's cloned..
+
return clone (self::$authUser
);
+
}
}
@@
-502,6
+494,12
@@
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);
//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..
// ensure it's written so that ajax calls can fetch it..
@@
-517,6
+515,8
@@
class Pman_Core_DataObjects_Core_person extends DB_DataObject
$_SESSION[get_class($this)][$sesPrefix .'-auth'] = "";
$_SESSION[get_class($this)][$sesPrefix .'-auth'] = "";
+ self::$authUser = false;
+
}
function genPassKey ($t)
{
}
function genPassKey ($t)
{
@@
-1419,7
+1419,7
@@
class Pman_Core_DataObjects_Core_person extends DB_DataObject
return $sesPrefix;
}
return $sesPrefix;
}
- function loginPublic()
+ function loginPublic()
// used where???
{
$this->isAuth(); // force session start..
{
$this->isAuth(); // force session start..