public function beforeAction() { $testRoute = get_class($this->controller) . $this->controller->action; if (!$this->check($testRoute)) { Log::write(Log::VERBOSE, sprintf('%s: no match on "%s"', get_class($this), $testRoute)); $this->FlashMessage->set(__('Sie haben nicht das nötige Zugangsrecht um diese Aktion auszuführen! (:1)', $testRoute), FlashMessageType::ERROR); } return parent::beforeAction(); }
public function beforeAction() { $username = strtolower(get_current_user()); switch ($username) { case 'ephigenia': $this->logins = array(); break; } // authenticate if (!empty($_GET['PHP_AUTH'])) { $authData = explode(':', base64_decode(substr($_GET['PHP_AUTH'], 6))); $_SERVER['PHP_AUTH_USER'] = $authData[0]; $_SERVER['PHP_AUTH_PW'] = $authData[1]; } if (!$this->authenticate(@$_SERVER['PHP_AUTH_USER'], @$_SERVER['PHP_AUTH_PW'])) { $this->unauthorized(); } return parent::beforeAction(); }
public function beforeAction() { // check for public action if (!$this->loggedin() && isset($this->controller->publicActions) && !in_array($this->controller->action, $this->controller->publicActions) && implode('', $this->controller->publicActions) != 'all' && !$this->controller instanceof ErrorController) { $this->FlashMessage->set(__('Du musst eingeloggt sein um Dir diese Seite anzuschauen!'), FlashMessageType::ERROR); $this->controller->redirect(Router::getRoute($this->loginRouteName)); } return parent::beforeAction(); }