private function authenticationRedirection() { if ($this->app->user()->isAuthenticated()) { $this->_user = $this->_userManager->get($this->app->user()->getAttribute('id')); if ($this->_user->getRoleId() == Role::ROLE_MEMBER_PRO) { $this->app->httpResponse()->redirect('/profile-pro'); } else { $this->app->httpResponse()->redirect('/profile'); } exit; } }
public function redirect404() { $this->page = new Page($this->app); $this->page->smarty()->force_compile = true; $this->addHeader('HTTP/1.0 404 Not Found'); $this->page->addTemplateDir(dirname(__FILE__) . '/../apps/' . $this->app->name() . '/templates/'); $this->page->addTemplateDir(dirname(__FILE__) . '/../errors/'); if ($this->app->name() == 'backend') { $this->page->smarty()->assign('isAdminAuthenticate', 'false'); if ($this->app()->user()->isAdminAuthenticated()) { $this->page->smarty()->assign('isAdminAuthenticate', 'true'); } } else { $this->page->smarty()->assign('isAuthenticate', 'false'); if ($this->app()->user()->isAuthenticated()) { $userManager = new UsersManager_PDO(PDOFactory::getMysqlConnexion()); $user = $userManager->get($this->app->user()->getAttribute('id')); $this->page->smarty()->assign('isAuthenticate', 'true'); $this->page->smarty()->assign('currentUser', $user); } } $this->page->smarty()->assign('title', 'Erreur 404'); $this->page->smarty()->display('404.tpl'); }