]> git.mxchange.org Git - shipsimu.git/commitdiff
NullFilter class added, partial filter for accepting rules added
authorRoland Häder <roland@mxchange.org>
Wed, 4 Jun 2008 17:34:43 +0000 (17:34 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 4 Jun 2008 17:34:43 +0000 (17:34 +0000)
.gitattributes
application/selector/templates/de/code/selector_main.ctp
application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php
application/ship-simu/templates/de/code/shipsimu_main.ctp
inc/classes/main/filter/checkboxes/.htaccess [new file with mode: 0644]
inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php [new file with mode: 0644]
inc/classes/main/filter/null/.htaccess [new file with mode: 0644]
inc/classes/main/filter/null/class_NullFilter.php [new file with mode: 0644]
inc/config.php

index ed5d93cb80f60c591cba78af3636b0b0bb83f260..70f8b4da4b9cd64a7a36c43d8b041b45a99e833d 100644 (file)
@@ -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
index 1bdaaee3c34cb0478a4f584de41f68b9e92797f9..c18c4a98fe1231a3d82f2efa292629afbc1463d0 100644 (file)
@@ -3,7 +3,7 @@
 {?navigation?}
 
 <div id="main_header">
-[HEADER_APPLICATION_SELECTOR]
+{app_selector_header}
 </div>
 
 <div id="main_content">
@@ -11,7 +11,7 @@
 </div>
 
 <div id="main_footer">
-[FOOTER_APPLICATION_SELECTOR]
+{app_selector_footer}
 </div>
 
 {?footer?}
index 29a6da4ae9a9f84f1ca8dee04c1d27f8e575d771..e926dbf80450f91321cd9bf38ab6815f9d0fce5d 100644 (file)
@@ -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;
index 61cdaa45c4775ca3cfb1d2afa5ab03516c73a82c..793fd8e6f273a782bf456541ef18804097c054e4 100644 (file)
@@ -1,7 +1,7 @@
 {?header?}
 
 <div id="main_header">
-[HEADER_SHIP_SIMU]
+{ship_simu_header]
 </div>
 
 <div id="navigation">
@@ -17,7 +17,7 @@
 </div>
 
 <div id="main_footer">
-[FOOTER_SHIP_SIMU]
+{ship_simu_footer}
 </div>
 
 {?footer?}
diff --git a/inc/classes/main/filter/checkboxes/.htaccess b/inc/classes/main/filter/checkboxes/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -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 (file)
index 0000000..e10c7c9
--- /dev/null
@@ -0,0 +1,74 @@
+<?php
+/**
+ * A filter for checking if the user has accepted the rules. This is mainly
+ * used and done in registration process and should not be removed from your
+ * application.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+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 (file)
index 0000000..3a42882
--- /dev/null
@@ -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 (file)
index 0000000..9a8a1ad
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/**
+ * As the name said: A null filter does just pass through the data. This is
+ * useful to make other filters switch on/off-able.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+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]
+?>
index ac58e21524047710d9140b5b102427a002062494..33b04d8ca59cf36ea533f840fa8b1612db9946fa 100644 (file)
@@ -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]
 ?>