public function beforeSave() { if ($this->isNewRecord()) { $this->added_by = WebApp::get()->user()->id; $this->added_time = date('Y-m-d H:i:s'); } return parent::beforeSave(); // TODO: Change the autogenerated stub }
public function beforeSave() { if (WebApp::get()->user()->isConnected()) { $this->user_id = WebApp::get()->user()->id; $this->username = WebApp::get()->user()->name; $this->email = WebApp::get()->user()->email; } elseif (!trim($this->email)) { $this->setError('email', 'Email is required for guests!'); return false; } elseif (!trim($this->username)) { $this->setError('username', 'Name is required for quests!'); return false; } $this->published_time = date('Y-m-d H:i:s'); $this->status = BlogComment::STATUS_OK; return parent::beforeSave(); // TODO: Change the autogenerated stub }
public function beforeSave() { if ($this->isNewRecord()) { $this->user_id = WebApp::get()->user()->id; } return parent::beforeSave(); }
public function beforeSave() { if (is_a(App::get(), '\\mpf\\WebApp') && WebApp::get()->request()->getModule()) { if (!UserAccess::get()->isSectionAdmin($this->section_id)) { Messages::get()->error("You don't have access to edit this user group!"); return false; } } return parent::beforeSave(); }
public function beforeSave() { if (!UserAccess::get()->isSectionAdmin($this->section_id)) { Messages::get()->error("You can't edit this category!"); return false; } if ($this->isNewRecord()) { $this->user_id = WebApp::get()->user()->id; } return parent::beforeSave(); }