public function beforeAction() { // auto find model entry when id passed if (isset($this->params['id'])) { if (!$this->{$this->name}->fromId($this->params['id'])) { return false; } $this->data->set($this->name, $this->{$this->name}); } // send invalid logins (invalid user group) back to loing page if (!$this->UserLogin->loggedin() && empty($this->publicActions)) { $this->redirect(Router::getRoute('adminLogin')); } // change language on users locale if (isset($this->I18n) && $this->UserLogin->loggedin() && $this->User->hasField('locale')) { $this->I18n->locale($this->UserLogin->User->locale); } // if mobile layout selected, use other action view files if ($this->layout == 'mobile') { // and increase number of returned model entries if (!empty($this->{$this->name})) { $this->{$this->name}->perPage = 50; if (!in_array($this->action, array('edit', 'view'))) { $this->{$this->name}->depth = 0; } } $this->action .= '.mobile'; } return parent::beforeAction(); }
public function beforeAction() { if ($this->UserLogin->loggedin()) { $this->BlogPost->findConditions = array(); } return parent::beforeAction(); }
public function beforeAction() { parent::beforeAction(); // VALIDATION if (!in_array($this->action, $this->publicAccessActions) and !$this->Security->hasPermission('administradores_root')) { $this->set_404(); } }
public function beforeAction() { // find all nodes if logged in @todo add PermissionCheck to this if (isset($this->Node) && $this->UserLogin->loggedin()) { $this->Node->findConditions = array(); } return parent::beforeAction(); }
public function beforeAction() { if (empty($this->params['unique_id'])) { return false; } if (!($this->MediaFile = $this->MediaFile->findByUniqueId($this->params['unique_id']))) { return false; } return parent::beforeAction(); }
function beforeAction() { parent::beforeAction(); }