/** * Redirects to Login form with error message. * Listens to User.isNotAuthorized hook. */ public function noAccess(Exception $exception) { $frontController = FrontController::getInstance(); if (Common::isXmlHttpRequest()) { echo $frontController->dispatch('Login', 'ajaxNoAccess', array($exception->getMessage())); return; } echo $frontController->dispatch('Login', 'login', array($exception->getMessage())); }