hasPerm("Admin.Admin_Tab", $lvl); } /** * init: * Initialize an event - ready to insert.. * * @param {String} action - group/name of event * @param {DataObject|false} obj - dataobject action occured on. * @param {String} any remarks */ function init($act, $obj, $remarks) { $pg = HTML_FlexyFramework::get()->page; $au = $pg->getAuthUser(); $this->person_name = $au ? $au->name : ''; $this->person_id = $au ? $au->id : ''; $this->ipaddr = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : 'cli'; $this->action = $act; $this->on_table = $obj ? $obj->tableName() : ''; $pk = $obj ? $obj->keys() : false; $this->on_id = $obj && $pk ? $obj->{$pk[0]}: 0; $rem = array(); // should this really go in remarks? - if ($obj && method_exists($obj,'toEventString')) { $rem[] = $obj->toEventString() ; } $rem[] = $remarks; $this->remarks = implode(' : ', $rem); } }