Ejemplo n.º 1
0
 public function onDispatch(MvcEvent $e)
 {
     $action = $this->getEvent()->getRouteMatch()->getParam('action');
     if ($action != 'login') {
         if ($this->userAuth()->hasIdentity()) {
             $this->user = $this->userAuth()->getIdentity();
         } else {
             return $this->redirect()->toRoute('App/admin', ['action' => 'login']);
         }
     }
     parent::onDispatch($e);
 }