From 7480fd6d18489ccb2be81e324ad76b05e7def001 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 17 Aug 2008 01:17:58 +0000 Subject: [PATCH] Refill request validator added with stubs --- .gitattributes | 1 + application/ship-simu/config.php | 3 + .../web/class_WebMoneyRefillFormCommand.php | 3 + ...lass_MoneyRefillRequestValidatorFilter.php | 65 +++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 application/ship-simu/main/filter/class_MoneyRefillRequestValidatorFilter.php diff --git a/.gitattributes b/.gitattributes index eaa20f6..bd57ad4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -141,6 +141,7 @@ application/ship-simu/main/factories/.htaccess -text application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php -text application/ship-simu/main/filter/.htaccess -text application/ship-simu/main/filter/class_MoneyRefillPageFilter.php -text +application/ship-simu/main/filter/class_MoneyRefillRequestValidatorFilter.php -text application/ship-simu/main/goverment/.htaccess -text application/ship-simu/main/goverment/class_SimplifiedGoverment.php -text application/ship-simu/main/login/.htaccess -text diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php index 75e555d..c4b6093 100644 --- a/application/ship-simu/config.php +++ b/application/ship-simu/config.php @@ -142,6 +142,9 @@ $cfg->setConfigEntry('user_status_confirmed_class', "UserStatusConfimedUpdateFil // CFG: CAPTCHA-ENCRYPT-VALIDATOR-CLASS $cfg->setConfigEntry('captcha_encrypt_validator_class', "CaptchaEncryptFilter"); +// CFG: REFILL-REQUEST-VALIDATOR-CLASS +$cfg->setConfigEntry('refill_request_validator_class', "MoneyRefillRequestValidatorFilter"); + // CFG: CAPTCHA-GUEST-VERIFIER-CLASS $cfg->setConfigEntry('captcha_guest_verifier_class', "GraphicalCodeCaptchaVerifierFilter"); diff --git a/application/ship-simu/main/commands/web/class_WebMoneyRefillFormCommand.php b/application/ship-simu/main/commands/web/class_WebMoneyRefillFormCommand.php index 1fa33d4..dc25f25 100644 --- a/application/ship-simu/main/commands/web/class_WebMoneyRefillFormCommand.php +++ b/application/ship-simu/main/commands/web/class_WebMoneyRefillFormCommand.php @@ -83,6 +83,9 @@ class WebMoneyRefillFormCommand extends BaseCommand implements Commandable { // Verify CAPTCHA code $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_refill_verifier_class')); + + // Verify refill request + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('refill_request_validator_class')); } } diff --git a/application/ship-simu/main/filter/class_MoneyRefillRequestValidatorFilter.php b/application/ship-simu/main/filter/class_MoneyRefillRequestValidatorFilter.php new file mode 100644 index 0000000..cea1ba6 --- /dev/null +++ b/application/ship-simu/main/filter/class_MoneyRefillRequestValidatorFilter.php @@ -0,0 +1,65 @@ + + * @version 0.0.0 + * @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 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class MoneyRefillRequestValidatorFilter extends BaseFrameworkSystem implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createMoneyRefillRequestValidatorFilter () { + // Get a new instance + $filterInstance = new MoneyRefillRequestValidatorFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + $this->partialStub("Please implement this method."); + } +} + +// [EOF] +?> -- 2.39.2