/** * 401 * * @html errors/accessdenied * * @param AccessDeniedException $event * @param Context $ctx * @return Response\Redirect */ public function accessDenied(AccessDeniedException $event, Context $ctx) { // not logged in if (!$ctx->user) { $path = $ctx->request->uri->path; $from = ($path and $path != '/') ? '?from=' . $path : null; return Response::redirect('/login' . $from); } }
/** * Log out user * * @param Context $ctx * @return Response\Redirect */ public function logout(Context $ctx) { Auth::logout(); $ctx->logger->info($ctx->user->username . ' logs out'); return Response::redirect('/login'); }