function add() { if ($this->param) { $usr = $this->app->auth->getUser(); $this->param['user_id'] = $usr ? $usr['user_id'] : '0'; $it = parent::add(); if ($it && $usr) { $it['first_name'] = $usr['first_name']; $it['last_name'] = $usr['last_name']; $it['title'] = $usr['title']; $it['user_id'] = $this->param['user_id']; } return $it; } return false; }
function add() { if ($_POST) { $usr = $this->api->api_get_user(); if ($usr && isset($usr['id'])) { if (!isset($_POST['user_id']) || empty($_POST['user_id'])) { $_POST['user_id'] = $usr['id']; return parent::add(); } } } return false; }