/** * LogOut function for Users. It unsets the session. * * @return mixed */ public function viewlogOut() { if ($this->request->isPost() && $this->request->post('logout', false) == '1') { $this->user->logout(); $this->checkLoginRedirectConfig(); } $this->view->assign('user', $this->user); if ($this->xml === false) { return $this->siteManagerController->getIframeContent($this->view->fetch('AdminArea'), ['cssClass' => 'admin-login']); } else { $this->view->setTemplate('LogOut'); } }
/** * @Fraym\Annotation\Route("/fraym/admin/logout", name="adminPanelLogout", permission={"\Fraym\User\User"="isAdmin"}) * @return mixed */ public function logoutUser() { $this->user->logout(); $this->route->redirectToUrl('/'); }