]> git.mxchange.org Git - shipsimu.git/commitdiff
CAPTCHA now works in registration form
authorRoland Häder <roland@mxchange.org>
Thu, 26 Jun 2008 17:51:29 +0000 (17:51 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 26 Jun 2008 17:51:29 +0000 (17:51 +0000)
application/ship-simu/config.php
application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php
inc/classes/main/commands/web/class_WebRegisterCommand.php

index ee4315fe3388d458b1c7f69ca6b43f661dcd54e0..a51dc57905eddceeb77d0e0f3383aa690e5fe39a 100644 (file)
@@ -136,6 +136,9 @@ $cfg->setConfigEntry('captcha_guest_verifier_class', "GraphicalCodeCaptchaVerifi
 // CFG: CAPTCHA-USER-VERIFIER-CLASS
 $cfg->setConfigEntry('captcha_user_verifier_class', "GraphicalCodeCaptchaVerifierFilter");
 
+// CFG: CAPTCHA-REGISTER-VERIFIER-CLASS
+$cfg->setConfigEntry('captcha_register_verifier_class', "GraphicalCodeCaptchaVerifierFilter");
+
 // CFG: NEWS-HOME-LIMIT
 $cfg->setConfigEntry('news_home_limit', 10);
 
index b7c240f9719673f8991478d86633800b941223c2..3a45e7634474f38bfc4f804465247c14580fdafe 100644 (file)
@@ -100,11 +100,23 @@ class WebShipsimuRegisterCommand extends BaseCommand implements Commandable {
         * @todo        Add some more pre/post filters to the controller
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Validate email address (if configured: check on double email addresses)
                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('email_validator_class'));
+
+               // Validate username and check if it does not exist
                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_validator_class'));
+
+               // Validate if username is "guest" and not taken
                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('username_is_guest_class'));
+
+               // Validate if password is set
                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('password_validator_class'));
+
+               // Check if rules where accepted
                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('rules_accepted_class'));
+
+               // Validate CAPTCHA input
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('captcha_register_verifier_class'));
        }
 }
 
index b00b73b548769349569ee7e0d22b5d836d42197b..df7cf2179e8665f274c437b40b5d1c26ea5da8c9 100644 (file)
@@ -128,7 +128,7 @@ class WebRegisterCommand extends BaseCommand implements Commandable, Registerabl
         * @return      void
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
-               // Empty for now
+               // Empty class
        }
 }