*/
require_once 'DB/DataObject.php';
+
class Pman_Core_DataObjects_Person extends DB_DataObject
{
###START_AUTOCODE
// force a logout - without a check on the isAuth - as this is called from there..
$db = $this->getDatabaseConnection();
- $sesPrefix = get_class($this) .'-'.$db->dsn['database'] ;
+ $sesPrefix = $ff->appNameShort .'-'.get_class($this) .'-'.$db->dsn['database'] ;
$_SESSION[__CLASS__][$sesPrefix .'-auth'] = "";
return false;
// we combine db + project names,
// otherwise if projects use different 'auth' objects
// then we get unserialize issues.
- $sesPrefix = get_class($this) .'-'.$db->dsn['database'] ;
+ $ff= HTML_FlexyFramework::get();
+ $sesPrefix = $ff->appNameShort .'-' .get_class($this) .'-'.$db->dsn['database'] ;
@session_start();
return false;
}
$db = $this->getDatabaseConnection();
- $sesPrefix = get_class($this) .'-'.$db->dsn['database'] ;
+ $ff= HTML_FlexyFramework::get();
+ $sesPrefix = $ff->appNameShort .'-' .get_class($this) .'-'.$db->dsn['database'] ;
+
if (!empty($_SESSION[__CLASS__][$sesPrefix .'-auth'])) {
$gr = DB_DataObject::Factory('group_rights');
$gr->applyDefs($g, 0);
}
-
- $sesPrefix = get_class($this) .'-'.$db->dsn['database'] ;
+ $ff= HTML_FlexyFramework::get();
+ $sesPrefix = $ff->appNameShort .'-' .get_class($this) .'-'.$db->dsn['database'] ;
+
+
$_SESSION[__CLASS__][$sesPrefix .'-auth'] = serialize($this);
}
function logout()
{
$this->isAuth(); // force session start..
- $db = $this->getDatabaseConnection();
- $sesPrefix = get_class($this) .'-'.$db->dsn['database'] ;
+ $db = $this->getDatabaseConnection();
+ $ff= HTML_FlexyFramework::get();
+ $sesPrefix = $ff->appNameShort .'-' .get_class($this) .'-'.$db->dsn['database'] ;
+
$_SESSION[__CLASS__][$sesPrefix .'-auth'] = "";
}
$this->whereAdd('LENGTH(passwd) > 1');
$this->email = $n;
}
- function lang($val)
+ function lang()
{
+ if (!func_num_args()) {
+ return $this->lang;
+ }
+ $val = array_shift(func_get_args());
if ($val == $this->lang) {
return;
}
$uu = clone($this);
$this->lang = $val;
$this->update($uu);
-
+ return $this->lang;
}