public function beforeRender() { $this->AppMetaTags->set('og:site_name', AppController::NAME); $this->AppMetaTags->set('og:url', Router::url()); $this->AppMetaTags->set('og:title', $this->controller->data->get('pageTitle')); return parent::beforeRender(); }
public function beforeRender() { if (!$this->Session->isEmpty($this->sessionVarname)) { $this->controller->data->set('flashMessage', $this->Session->get($this->sessionVarname)); $this->reset(); } return parent::beforeRender(); }
/** * Creates a default array that can be saved in the {@link LogEntry} model * you can extend this method and the array in your own Logging Component * by extending this component. * @return array(string) */ public function beforeRedirect($url, $status = 'p', $exit = true) { if ($this->allowed($this->controller, $this->controller->action)) { $LogEntry = $this->createLogEntry(); $LogEntry->save(); } parent::afterAction(); }
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 startup() { $this->headers = new Hash(array('Reply-To' => Registry::get('AdminEmail'), 'From' => Registry::get('AdminEmail'))); return parent::startup(); }
public function startUp() { $this->config = Registry::get('ActionCache'); return parent::startUp(); }
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(); }