function getEmailFrom()
{
+ if (empty($this->name)) {
+ return $this->email;
+ }
return '"' . addslashes($this->name) . '" <' . $this->email . '>';
}
function toEventString()
return true;
}
- $_SESSION[__CLASS__][$sesPrefix .'-auth'] = '';
+ unset($_SESSION[__CLASS__][$sesPrefix .'-auth']);
}
// local auth -
$group->get('name', 'Administrators');
$member = DB_DataObject::factory('group_members');
+ $member->autoJoin();
$member->group_id = $group->id;
+ $member->whereAdd("
+ join_user_id_id.id IS NOT NULL
+ ");
if($member->find(true)){
- $default_admin = DB_DataObject::factory('Perosn');
+ $default_admin = DB_DataObject::factory('Person');
if(!$default_admin->get($member->user_id)){
$default_admin = false;
}
}
}
+
$u = DB_DataObject::factory('Person');
$ff = HTML_FlexyFramework::get();
if (!empty($ff->Pman['local_autoauth']) &&
$_SESSION[__CLASS__][$sesPrefix .'-auth'] = serialize($u);
return true;
}
+ //var_dump(session_id());
+ //var_dump($_SESSION[__CLASS__]);
- if (!empty( $_SESSION[__CLASS__][$sesPrefix .'-empty'] )) {
- return false;
- }
-
+ //if (!empty( $_SESSION[__CLASS__][$sesPrefix .'-empty'] )) {
+ // return false;
+ //}
+ //die("got this far?");
// not in session or not matched...
$u = DB_DataObject::factory('Person');
$u->whereAdd(' LENGTH(passwd) > 0');
if ($u->get($a->id)) { /// && strlen($u->passwd)) {
return clone($u);
}
-
+ unset($_SESSION[__CLASS__][$sesPrefix .'-auth']);
}
if (empty( $_SESSION[__CLASS__][$sesPrefix .'-empty'] )) {
$u = DB_DataObject::factory('Person');
$u->whereAdd(' LENGTH(passwd) > 0');
- $_SESSION[__CLASS__][$sesPrefix .'-empty'] = $u->count();
+ $_SESSION[__CLASS__][$sesPrefix .'-empty'] = $u->count();
}
- if (empty( $_SESSION[__CLASS__][$sesPrefix .'-empty'] )) {
+ if (isset( $_SESSION[__CLASS__][$sesPrefix .'-empty'] ) && $_SESSION[__CLASS__][$sesPrefix .'-empty'] < 1) {
// fake person - open system..
//$ce = DB_DataObject::factory('core_enum');
$u = DB_DataObject::factory('Person');
$u->id = -1;
+
+ // if a company has been created fill that in in company_id_id
+ $c = DB_DAtaObject::factory('Companies')->lookupOwner();
+ if ($c) {
+ $u->company_id_id = $c->pid();
+ $u->company_id = $c->pid();
+ }
+
return $u;
}
$sesPrefix = $ff->appNameShort .'-' .get_class($this) .'-'.$db->dsn['database'] ;
$_SESSION[__CLASS__][$sesPrefix .'-auth'] = "";
+
+
+
}
function genPassKey ($t)
}
+ if(!empty($q['query']['name'])){
+ $this->whereAdd("
+ Person.name LIKE '%{$this->escape($q['query']['name'])}%'
+ ");
+ }
+
if (!empty($q['query']['search'])) {
// use our magic search builder...