Introduced genericHanleRequestLoginAreaFailedRedirect()
[core.git] / inc / classes / main / controller / html / login / class_HtmlLoginAreaController.php
index 0c7725c0de7e639980c0c09002ad1a1c63458158..375bdeeaf5db8aba3ef32d65403fddc488bb4b90 100644 (file)
@@ -70,35 +70,11 @@ class HtmlLoginAreaController extends BaseController implements Controller {
         * @return      void
         */
        public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get the command instance from the resolver by sending a request instance to the resolver
-               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
-
-               // Add more filters by the command
-               $commandInstance->addExtraFilters($this, $requestInstance);
-
-               // 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');
-
-                       // Exit here
-                       exit();
-               }
-
-               // This request was valid! :-D
-               $requestInstance->requestIsValid();
-
-               // Execute the command
-               $commandInstance->execute($requestInstance, $responseInstance);
-
-               // Run the pre filters
-               $this->executePostFilters($requestInstance, $responseInstance);
-
-               // Flush the response out
-               $responseInstance->flushBuffer();
+               /*
+                * Generic execute of the command: pre and post filters with redirect
+                * but request becomes valid after pre-filters run.
+                */
+               $this->genericHanleRequestLoginAreaFailedRedirect($requestInstance, $responseInstance);
        }
 }