if (empty($this->name)) {
return $this->email;
}
+
return '"' . addslashes($this->name) . '" <' . $this->email . '>';
}
) &&
($default_admin || $u->get('email', $ff->Pman['local_autoauth']))
) {
- $_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize($default_admin ? $default_admin : $u);
+
+ $user = $default_admin ? $default_admin->toArray() : $u->toArray();
+
+ $_SESSION[get_class($this)][$sesPrefix .'-auth'] = serialize((object) $user);
return true;
}
/*
* Seems we never expose oath_key / passwd, so...
*/
- $this->selectAdd("
- LENGTH(passwd) AS length_passwd,
- LENGTH(oath_key) AS length_oath_key
- ");
+
+ if($this->tableName() == 'core_person'){
+ $this->_extra_cols = array('length_passwd', 'length_oath_key');
+
+ $this->selectAdd("
+ LENGTH({$this->tableName()}.passwd) AS length_passwd,
+ LENGTH({$this->tableName()}.oath_key) AS length_oath_key
+ ");
+ }
}
if ($roo->authUser->id > -1 || $p->count() > 1) {
return;
}
- $c = DB_DAtaObject::Factory('core_company');
- $tc =$c->count();
+ $c = DB_DataObject::Factory('core_company');
+ $tc = $c->count();
if (!$tc || $tc> 1) {
$roo->jerr("can not create initial user as multiple companies already exist");
}
return true;
}
- function toRooSingleArray($au, $q)
- {
- $ret = $this->toArray();
-
- $core_person = DB_DataObject::factory('core_person');
- $core_person->selectAdd("{$core_person->tableName()}.oath_key AS oath_key");
- $core_person->get($this->id);
-
- $ret['has_oath_key'] = (empty($core_person->oath_key)) ? 0 : 1;
-
- return $ret;
-
- }
-
function beforeUpdate($old, $q, $roo)
{
if(!empty($q['_generate_oath_key'])){