$e = DB_DataObject::factory('Events');
$e->init($act,$obj,$remarks);
- $e->event_when = date('Y-m-d H:i:s');
+ $e->event_when = $e->sqlValue('NOW()');
$eid = $e->insert();
$e = DB_DataObject::factory('Events');
$e->init($act,$obj,$remarks);
- $e->event_when = date('Y-m-d H:i:s');
+ $e->event_when = $e->sqlValue('NOW()');
$wa = DB_DataObject::factory('core_watch');
if (method_exists($wa,'notifyEvent')) {
$wa->notifyEvent($e); // trigger any actions..
}
-
function switchUser($id)
{
$tbl = empty($ff->Pman['authTable']) ? 'core_person' : $ff->Pman['authTable'];
$au = $u->getAuthUser();
-
// first check they have perms to do this..
if (!$au|| ($au->company()->comptype != 'OWNER') || !$this->hasPerm('Core.Person', 'E')) {
$this->jerr("User switching not permitted");
}
-
-
+
$u = DB_DataObject::factory($tbl);
$u->get($id);
if (!$u->active()) {
}
$u->login();
// we might need this later..
- $this->addEvent("SWITCH USER", false, $au->name . ' TO ' . $u->name);
+ $this->addEvent("SWITCH-USER", false, $au->name . ' TO ' . $u->name);
$this->jok("SWITCH");
}