protected function BeforeInit() { $this->group = Usergroup::Schema()->ByID(Request::GetData('usergroup')); if (!$this->group || !self::Guard()->GetUser()->GetIsAdmin()) { //TODO: Message Response::Redirect(BackendRouter::ModuleUrl(new Overview())); } return parent::BeforeInit(); }
/** * Gets and checks the requested user * @return boolean False if processing can continue */ protected function BeforeInit() { $this->user = User::Schema()->ByID(Request::GetData('user')); if (!$this->user || !self::Guard()->Allow(BackendAction::AssignGroups(), $this->user)) { //TODO: Error message Response::Redirect(BackendRouter::ModuleUrl(new UserList())); } return parent::BeforeInit(); }
protected function BeforeInit() { $this->layout = Layout::Schema()->ByID(Request::GetData('layout')); if (!$this->layout) { //TODO: Message Response::Redirect($this->BackLink()); } $this->file = PathUtil::LayoutTemplate($this->layout); if (!File::Exists($this->file)) { //TODO: Message Response::Redirect($this->BackLink()); } $this->contents = File::GetContents($this->file); return parent::BeforeInit(); }