Ejemplo n.º 1
1
 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();
     }
 }
Ejemplo n.º 2
0
 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" );
     }
 }
Ejemplo n.º 3
0
 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']);
     }
 }
Ejemplo n.º 4
0
 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");
     }
 }
Ejemplo n.º 5
0
 public function preDispatch()
 {
     parent::preDispatch();
     // do something before the action is called //-> see Zend Framework
 }