/**
* 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
$_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize($u);
return true;
}
-
+ //die("test init");
if (!$this->canInitializeSystem()) {
+ // die("can not init");
return false;
}
function canInitializeSystem()
{
+
return !strcasecmp(get_class($this) , __CLASS__);
}
$g = DB_DataObject::Factory('core_group_member');
$grps = $g->listGroupMembership($this);
//var_dump($grps);
- $isAdmin = $g->inAdmin;
+ $isAdmin = $g->inAdmin; //??? what???
//echo '<PRE>'; print_r($grps);var_dump($isAdmin);
// the load all the perms for those groups, and add them all together..
// then load all those
}
$tn_p = $this->tableName();
$tn_gm = DB_DataObject::Factory('core_group_member')->tableName();
- $tn_g = DB_DataObject::Factory('core_groups')->tableName();
+ $tn_g = DB_DataObject::Factory('core_group')->tableName();
///---------------- Group views --------
if (!empty($q['query']['in_group'])) {
}
function setFromRoo($ar, $roo)
{
- $this->setFrom($ar);
+ $this->setFrom($ar);
if (!empty($ar['passwd1'])) {
$this->setPassword($ar['passwd1']);
}
return $sesPrefix;
}
+ function loginPublic()
+ {
+ $this->isAuth(); // force session start..
+
+ $db = $this->getDatabaseConnection();
+
+ $ff = HTML_FlexyFramework::get();
+
+ if(empty($ff->Pman) || empty($ff->Pman['login_public'])){
+ return false;
+ }
+
+ $sesPrefix = $ff->Pman['login_public'] . '-' .get_class($this) .'-'.$db->dsn['database'] ;
+
+ $p = DB_DAtaObject::Factory($this->tableName());
+ $p->get($this->pid());
+
+ $_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize((object)$p->toArray());
+
+ return true;
+ }
+
}