From: Roland Häder Date: Thu, 20 Nov 2008 19:58:15 +0000 (+0000) Subject: No controller instances are now passed to filters X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f705ac104f6be9c118c7a469bd154e2cc9eb167b;p=shipsimu.git No controller instances are now passed to filters --- diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php index af4f88c..3b127b2 100644 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginCompanyAction.php @@ -74,7 +74,7 @@ class WebShipSimuLoginCompanyAction extends BaseShipSimuAction implements Comman */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); } } diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentStartupHelpAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentStartupHelpAction.php index 283afa4..6640bd3 100644 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentStartupHelpAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentStartupHelpAction.php @@ -74,10 +74,10 @@ class WebShipSimuLoginGovermentStartupHelpAction extends BaseShipSimuAction impl */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); // Check if goverment can pay startup help - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_startup_help_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_startup_help_filter')); } } diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php index c11ca43..3f7c77b 100644 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginGovermentTrainingAction.php @@ -74,10 +74,10 @@ class WebShipSimuLoginGovermentTrainingAction extends BaseShipSimuAction impleme */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); // Check if goverment can pay a training - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_training_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_training_filter')); } } diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php index 3d6d5c3..67f258b 100644 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginLogoutAction.php @@ -73,7 +73,7 @@ class WebShipSimuLoginLogoutAction extends BaseShipSimuAction implements Command */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); } } diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginProfileAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginProfileAction.php index 774b725..4389797 100644 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginProfileAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginProfileAction.php @@ -74,7 +74,7 @@ class WebShipSimuLoginProfileAction extends BaseShipSimuAction implements Comman */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); } } diff --git a/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php b/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php index 8119b3c..a6b3b9b 100644 --- a/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php +++ b/application/ship-simu/main/actions/web/class_WebShipSimuLoginRefillAction.php @@ -73,10 +73,10 @@ class WebShipSimuLoginRefillAction extends BaseShipSimuAction implements Command */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Check for user status by default - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); // Is the refill page active? - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter')); // Add payment discovery filter $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('payment_discovery_filter', array($this))); diff --git a/application/ship-simu/main/commands/web/class_WebRefillFormCommand.php b/application/ship-simu/main/commands/web/class_WebRefillFormCommand.php index 4717e1e..5cae379 100644 --- a/application/ship-simu/main/commands/web/class_WebRefillFormCommand.php +++ b/application/ship-simu/main/commands/web/class_WebRefillFormCommand.php @@ -74,22 +74,22 @@ class WebRefillFormCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add user auth filter (we don't need an update of the user here because it will be redirected) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); // Add user status filter here - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); // Is the refill page active? - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_page_filter')); // Verify password - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); // Verify CAPTCHA code - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter')); // Verify refill request - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_filter')); // Prepare a filter based on the requested type we shall refill $filterName = sprintf("refill_request_%s_book_filter", $requestInstance->getRequestElement('type')); diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php index 39742f8..80e4a5d 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuGuestLoginCommand.php @@ -102,13 +102,13 @@ class WebShipsimuGuestLoginCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add username verifier filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_guest_verifier_filter')); // Add password verifier filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('passwd_guest_verifier_filter')); // Add CAPTCHA verifier code - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_guest_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_guest_verifier_filter')); } } diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php index 417cee5..3d66614 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuProfileCommand.php @@ -122,28 +122,28 @@ class WebShipsimuProfileCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add user auth filter (we don't need an update of the user here because it will be redirected) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); // User status filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); // Updated rules accepted - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter')); // Account password validation - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); // Validate CAPTCHA input - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_profile_verifier_filter')); // Validate birthday input - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_profile_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_profile_verifier_filter')); // Email changed - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_change_filter')); // Password changed - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_change_filter')); } } diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php index 0f1822b..c47c4a6 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php @@ -95,25 +95,25 @@ class WebShipsimuRegisterCommand extends BaseCommand implements Commandable { */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Validate email address (if configured: check on double email addresses) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_filter')); // Validate username and check if it does not exist - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_filter')); // Validate if username is "guest" and not taken - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_filter')); // Validate if password is set - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_filter')); // Check if rules where accepted - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter')); // Validate CAPTCHA input - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_register_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_register_verifier_filter')); // Validate birthday - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_register_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('birthday_register_verifier_filter')); } } diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php index ffcc903..e554d9a 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuUserLoginCommand.php @@ -104,23 +104,23 @@ class WebShipsimuUserLoginCommand extends BaseCommand implements Commandable { // Which login type do we have? switch ($this->getConfigInstance()->readConfig('login_type')) { case "username": // Login via username - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_verifier_filter')); break; case "email": // Login via email - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_verifier_filter')); break; default: // Wether username or email is set - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_email_verifier_filter')); break; } // Password verifier filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_verifier_filter')); // Add filter for CAPTCHA - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_user_verifier_filter')); } } diff --git a/application/ship-simu/main/commands/web/goverment/class_WebShipsimuGovermentStartupCommand.php b/application/ship-simu/main/commands/web/goverment/class_WebShipsimuGovermentStartupCommand.php index cd203e5..18a3bc0 100644 --- a/application/ship-simu/main/commands/web/goverment/class_WebShipsimuGovermentStartupCommand.php +++ b/application/ship-simu/main/commands/web/goverment/class_WebShipsimuGovermentStartupCommand.php @@ -72,19 +72,19 @@ class WebShipsimuGovermentStartupCommand extends BaseCommand implements Commanda */ public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) { // Add user auth filter (we don't need an update of the user here because it will be redirected) - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); // Add user status filter here - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_status_filter')); // Check if goverment can pay startup help - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_startup_help_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('goverment_pays_startup_help_filter')); // Verify password - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('account_password_filter')); // Verify CAPTCHA code - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_filter')); } } diff --git a/application/ship-simu/main/controller/web/class_WebGovermentFailedController.php b/application/ship-simu/main/controller/web/class_WebGovermentFailedController.php index eb5882b..d945d9a 100644 --- a/application/ship-simu/main/controller/web/class_WebGovermentFailedController.php +++ b/application/ship-simu/main/controller/web/class_WebGovermentFailedController.php @@ -47,16 +47,16 @@ class WebGovermentFailedController extends BaseController implements Controller $controllerInstance->setResolverInstance($resolverInstance); // User auth filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_auth_filter')); // User update filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('user_update_filter')); // News fetcher filter - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_download_filter')); // News proccess/display-preparation - $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter', array($controllerInstance))); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter')); // Return the prepared instance return $controllerInstance;