X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fcontroller%2Fform%2Fclass_WebDoFormController.php;h=e760492fcbfa4b8dd3addb09320826f256836f5b;hb=c59dccf46c5d0e3b7f2687370b2b15023b1ecdfe;hp=db7cfb432522612d4b131ccc85646ff698f4d35a;hpb=e2767d5148436d0c90ed66ed9290416353ae6e60;p=hub.git diff --git a/inc/classes/main/controller/form/class_WebDoFormController.php b/inc/classes/main/controller/form/class_WebDoFormController.php index db7cfb432..e760492fc 100644 --- a/inc/classes/main/controller/form/class_WebDoFormController.php +++ b/inc/classes/main/controller/form/class_WebDoFormController.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -30,12 +30,6 @@ class WebDoFormController extends BaseController implements Controller { protected function __construct () { // Call parent constructor parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Controller for handling forms"); - - // Create unique ID number - $this->generateUniqueId(); } /** @@ -72,8 +66,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); + // 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_url'); + } // Is the request still valid? Post filters shall only be executed of // the request is valid