Ejemplo n.º 1
0
 public function indexAction()
 {
     $gaIndex = Config::getAppOptions('layout');
     if (!isset($gaIndex['indexController']) || empty($gaIndex['indexController'])) {
         $gaIndex['indexController'] = "Backend\\Controller\\Backend";
     }
     if (!isset($gaIndex['indexAction']) || empty($gaIndex['indexAction'])) {
         $gaIndex['indexAction'] = "index";
     }
     if (!isset($gaIndex['indexParam']) || empty($gaIndex['indexParam'])) {
         $gaIndex['indexParam'] = "";
     }
     $loResource = $this->forward()->dispatch($gaIndex['indexController'], array('action' => $gaIndex['indexAction'], $gaIndex['indexParam']));
     $loView = new ViewModel(array('loController' => $this));
     $loView->addChild($loResource, 'lsApplication');
     return $loView;
 }
Ejemplo n.º 2
0
 public function authAction()
 {
     $lsToken = $this->request('tk', null);
     if ($lsToken !== null) {
         $loEntity = $this->getEntityManager()->getRepository($this->_sEntity)->findOneBy(array('stToken' => $lsToken, 'isActive' => 1));
         if (is_object($loEntity)) {
             $lsResouceController = $loEntity->get('stResource');
             $lsAction = $loEntity->get('stAction');
             $lnResourceId = $loEntity->get('Resource_id');
             $loEntity->set('dtLastAccess', Date('Y-m-d H:i:s'));
             $this->getEntityManager()->persist($loEntity);
             $this->entityFlush();
             $loResource = $this->forward()->dispatch($lsResouceController, array('action' => $lsAction, 'id' => $lnResourceId, 'allow' => true));
             $loView = new ViewModel();
             $loView->addChild($loResource, 'actionAccess');
             return $loView;
         }
     }
     return $this->redirect()->toRoute('access', array('controller' => 'access', 'action' => 'login'));
 }