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 ee4315f..a51dc57 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 b7c240f..3a45e76 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 b00b73b..df7cf21 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
        }
 }