]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/controller/login/class_WebLoginAreaController.php
Login failed page added
[shipsimu.git] / inc / classes / main / controller / login / class_WebLoginAreaController.php
index 34893a10f9cf652452e98b0192e1c18ff9c98fc0..883cfca36653c216257a35dc1765fced7817ccfa 100644 (file)
@@ -68,8 +68,14 @@ class WebLoginAreaController extends BaseController implements Controller {
         * @return      void
         */
        public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
-               // Run the pre filters
-               $this->executePreFilters($requestInstance, $responseInstance);
+               // Try to run the pre filters, if auth exceptions come through redirect here
+               try {
+                       // Run the pre filters
+                       $this->executePreFilters($requestInstance, $responseInstance);
+               } catch (UserAuthorizationException $e) {
+                       // Redirect to main page
+                       $responseInstance->redirectToConfiguredUrl('login_failed_url');
+               }
 
                // Get the command instance from the resolver by sending a request instance to the resolver
                $commandInstance = $this->getResolverInstance()->resolvCommandByRequest($requestInstance);