From f6dd835d8cf21f82d67840b2829871638fca721b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 4 Jun 2008 17:34:43 +0000 Subject: [PATCH] NullFilter class added, partial filter for accepting rules added --- .gitattributes | 4 + .../templates/de/code/selector_main.ctp | 4 +- .../web/class_WebShipsimuRegisterCommand.php | 2 + .../templates/de/code/shipsimu_main.ctp | 4 +- inc/classes/main/filter/checkboxes/.htaccess | 1 + .../checkboxes/class_RulesAcceptedFilter.php | 74 +++++++++++++++++++ inc/classes/main/filter/null/.htaccess | 1 + .../main/filter/null/class_NullFilter.php | 72 ++++++++++++++++++ inc/config.php | 3 + 9 files changed, 161 insertions(+), 4 deletions(-) create mode 100644 inc/classes/main/filter/checkboxes/.htaccess create mode 100644 inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php create mode 100644 inc/classes/main/filter/null/.htaccess create mode 100644 inc/classes/main/filter/null/class_NullFilter.php diff --git a/.gitattributes b/.gitattributes index ed5d93c..70f8b4d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -324,9 +324,13 @@ inc/classes/main/factories/objects/class_ObjectFactory.php -text inc/classes/main/factories/web/.htaccess -text inc/classes/main/factories/web/class_WebNewsFactory.php -text inc/classes/main/filter/.htaccess -text +inc/classes/main/filter/checkboxes/.htaccess -text +inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php -text inc/classes/main/filter/class_ -text inc/classes/main/filter/class_AbstractFilterDecorator.php -text inc/classes/main/filter/class_FilterChain.php -text +inc/classes/main/filter/null/.htaccess -text +inc/classes/main/filter/null/class_NullFilter.php -text inc/classes/main/filter/validator/.htaccess -text inc/classes/main/filter/validator/class_EmailValidatorFilter.php -text inc/classes/main/filter/validator/class_PasswordValidatorFilter.php -text diff --git a/application/selector/templates/de/code/selector_main.ctp b/application/selector/templates/de/code/selector_main.ctp index 1bdaaee..c18c4a9 100644 --- a/application/selector/templates/de/code/selector_main.ctp +++ b/application/selector/templates/de/code/selector_main.ctp @@ -3,7 +3,7 @@ {?navigation?}
-[HEADER_APPLICATION_SELECTOR] +{app_selector_header}
@@ -11,7 +11,7 @@
{?footer?} diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php index 29a6da4..e926dbf 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php @@ -61,6 +61,8 @@ class WebShipsimuRegisterCommand extends BaseCommand implements Commandable { // @TODO Add some more pre/post filters to the controller $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator')); $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator')); + $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_filter')); // Return the prepared instance return $commandInstance; diff --git a/application/ship-simu/templates/de/code/shipsimu_main.ctp b/application/ship-simu/templates/de/code/shipsimu_main.ctp index 61cdaa4..793fd8e 100644 --- a/application/ship-simu/templates/de/code/shipsimu_main.ctp +++ b/application/ship-simu/templates/de/code/shipsimu_main.ctp @@ -1,7 +1,7 @@ {?header?}
-[HEADER_SHIP_SIMU] +{ship_simu_header]
{?footer?} diff --git a/inc/classes/main/filter/checkboxes/.htaccess b/inc/classes/main/filter/checkboxes/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/filter/checkboxes/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php new file mode 100644 index 0000000..e10c7c9 --- /dev/null +++ b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php @@ -0,0 +1,74 @@ + + * @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 RulesAcceptedFilter extends BaseFrameworkSystem implements Filterable { + /** + * Private constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription("A filter for checking if rules where accepted"); + + // Create unique ID number + $this->createUniqueID(); + + // 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 createRulesAcceptedFilter () { + // Get a new instance + $filterInstance = new RulesAcceptedFilter(); + + // 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) { + // Implement this! + $this->partialStub("Please implement this method."); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/filter/null/.htaccess b/inc/classes/main/filter/null/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/inc/classes/main/filter/null/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/classes/main/filter/null/class_NullFilter.php b/inc/classes/main/filter/null/class_NullFilter.php new file mode 100644 index 0000000..9a8a1ad --- /dev/null +++ b/inc/classes/main/filter/null/class_NullFilter.php @@ -0,0 +1,72 @@ + + * @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 NullFilter extends BaseFrameworkSystem implements Filterable { + /** + * Private constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription("A null filter"); + + // Create unique ID number + $this->createUniqueID(); + + // 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 createNullFilter () { + // Get a new instance + $filterInstance = new NullFilter(); + + // 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) { + // Not implemented, just passing through + } +} + +// [EOF] +?> diff --git a/inc/config.php b/inc/config.php index ac58e21..33b04d8 100644 --- a/inc/config.php +++ b/inc/config.php @@ -174,5 +174,8 @@ $cfg->setConfigEntry('username_validator', "UserNameValidatorFilter"); // CFG: PASSWORD-VALIDATOR $cfg->setConfigEntry('password_validator', "PasswordValidatorFilter"); +// CFG: RULES-ACCEPTED-FILTER +$cfg->setConfigEntry('rules_accepted_filter', "RulesAcceptedFilter"); + // [EOF] ?> -- 2.39.5