Simple exception handler and error handler added, profile update added with stubs
[shipsimu.git] / inc / classes / main / controller / form / class_WebDoFormController.php
index db7cfb432522612d4b131ccc85646ff698f4d35a..1856dd3d1718f38babda4f23a2baf592c33d0433 100644 (file)
@@ -72,8 +72,17 @@ class WebDoFormController extends BaseController implements Controller {
                // Get command instance from resolver
                $commandInstance = $this->getResolverInstance()->resolveCommand($formAction);
 
-               // Execute *very* generic pre filters
-               $this->executePreFilters($requestInstance, $responseInstance);
+               // Try to add more filters by the command
+               $commandInstance->addExtraFilters($this);
+
+               // 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');
+               }
 
                // Is the request still valid? Post filters shall only be executed of
                // the request is valid