public function preDispatch() { parent::preDispatch(); // do something before the action is called //-> see Zend Framework \Pimcore\Tool\Authentication::authenticateSession(); $adminSession = new \Zend_Session_Namespace("pimcore_admin"); if (!$adminSession->user instanceof \User) { $auth = \Zend_Auth::getInstance(); if ($auth->hasIdentity()) { // We have a login session (user is logged in) $cached_person = $auth->getIdentity(); $id = $cached_person->getId(); $this->view->person = $this->person = \Object\Person::getById($id); } else { $this->forward("form-login", "login"); } } else { $this->view->person = $this->person = \Object\Person::getById(590); } if ($this->person) { $this->view->user = $this->user = $this->person; $this->view->societe = $this->societe = $this->person->getSociete(); $this->view->locations = $this->locations = $this->societe->getLocations(); $this->storeLocation(); } }
public function preDispatch() { parent::preDispatch(); // do something before the action is called //-> see Zend Framework \Pimcore\Tool\Authentication::authenticateSession(); $adminSession = new \Zend_Session_Namespace("pimcore_admin"); if (!$adminSession->user instanceof \User) { // $this->forward ( "form-login", "login" ); } }
public function preDispatch() { parent::preDispatch(); $result = Plugin::getEventManager()->trigger('action.' . $this->getRequest()->getActionName(), $this, array("controller" => $this, "request" => $this->getRequest()), function ($v) { return is_array($v) && array_key_exists("action", $v) && array_key_exists("controller", $v) && array_key_exists("module", $v); }); if ($result->stopped()) { $forward = $result->last(); $this->_forward($forward['action'], $forward['controller'], $forward['module'], $forward['params']); } }
public function preDispatch() { parent::preDispatch(); // do something before the action is called //-> see Zend Framework $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { // We have a login session (user is logged in) $this->view->person = $this->person = $auth->getIdentity(); $this->view->societe = $this->societe = \Object\Societe::getById($this->person->getSociete()->getId()); } else { $this->forward("form-login", "login"); } }
public function preDispatch() { parent::preDispatch(); // do something before the action is called //-> see Zend Framework }