Beispiel #1
0
 protected function _actionDispatch(Library\CommandContext $context)
 {
     if ($context->user->isAuthentic()) {
         //Redirect if user is already logged in
         if ($context->request->query->get('view', 'alpha') == 'session') {
             $menu = $this->getObject('application.pages')->getHome();
             //@TODO : Fix the redirect
             //$this->getObject('application')->redirect('?Itemid='.$menu->id, 'You are already logged in!');
         }
     }
     if (!$context->user->isAuthentic()) {
         //Redirect if user is already logged in
         if ($context->request->query->get('view', 'alpha') == 'session') {
             $menu = $this->getObject('application.pages')->getHome();
             //@TODO : Fix the redirect
             //$this->getObject('application')->redirect('?Itemid='.$menu->id, 'You are already logged out!');
         }
     }
     return parent::_actionDispatch($context);
 }
Beispiel #2
0
 protected function _actionDispatch(Library\CommandContext $context)
 {
     $view = $context->request->query->get('view', 'cmd', $this->_controller);
     if ($view == 'pages' && !$context->request->query->has('menu')) {
         $page = $this->getObject('com:pages.database.table.pages')->select(array('home' => 1), Library\Database::FETCH_ROW);
         $url = clone $context->request->getUrl();
         $url->query['view'] = $view;
         $url->query['menu'] = $page->pages_menu_id;
         return $this->redirect($url);
     }
     if ($view == 'modules' && !$context->request->query->has('application')) {
         $url = clone $context->request->getUrl();
         $url->query['application'] = 'site';
         return $this->redirect($url);
     }
     if ($view == 'menus' && !$context->request->query->has('application')) {
         $url = clone $context->request->getUrl();
         $url->query['application'] = 'site';
         return $this->redirect($url);
     }
     return parent::_actionDispatch($context);
 }