* @package taoCe * @license GPL-2.0 * */ class Main extends \tao_actions_Main { /** * Wrapper to the main action: update the first time property and redirect * @return void */ public function index() { $this->defaultData(); //redirect to the usual tao/Main/index if ($this->hasRequestParameter('ext') || $this->hasRequestParameter('structure')) { //but before update the first time property $user = $this->getServiceLocator()->get(\tao_models_classes_UserService::SERVICE_ID)->getCurrentUser(); if ($this->hasRequestParameter('nosplash')) { TaoCe::becomeVeteran(); } //@todo use forward on cross-extension forward is supported $this->redirect(_url('index', 'Main', 'tao', [ 'ext' => $this->getRequestParameter('ext'), 'structure' => $this->getRequestParameter('structure') ])); } else { //render the index but with the taoCe URL used by client side routes parent::index(); } } /** * Action used to redirect request made to root of tao. */ public function rootEntry() { $this->defaultData(); if (\common_session_SessionManager::isAnonymous()) { /* @var $urlRouteService DefaultUrlService */ $urlRouteService = $this->getServiceLocator()->get(DefaultUrlService::SERVICE_ID); $this->redirect($urlRouteService->getLoginUrl()); } else { $this->redirect(_url('entry', 'Main', 'tao')); } } }