From 8ec67fe499cb16175eeb739d38e6172da3cf1a4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 26 Jun 2008 17:51:29 +0000 Subject: [PATCH] CAPTCHA now works in registration form --- application/ship-simu/config.php | 3 +++ .../web/class_WebShipsimuRegisterCommand.php | 12 ++++++++++++ .../main/commands/web/class_WebRegisterCommand.php | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/application/ship-simu/config.php b/application/ship-simu/config.php index ee4315f..a51dc57 100644 --- a/application/ship-simu/config.php +++ b/application/ship-simu/config.php @@ -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); diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php index b7c240f..3a45e76 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuRegisterCommand.php @@ -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')); } } diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php index b00b73b..df7cf21 100644 --- a/inc/classes/main/commands/web/class_WebRegisterCommand.php +++ b/inc/classes/main/commands/web/class_WebRegisterCommand.php @@ -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 } } -- 2.39.5