Resolve captcha-related todos
authorMatthias Schmidt <gravatronics@live.com>
Sat, 14 Jun 2014 15:18:03 +0000 (17:18 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 14 Jun 2014 15:18:03 +0000 (17:18 +0200)
wcfsetup/install/files/lib/action/FacebookAuthAction.class.php
wcfsetup/install/files/lib/action/GithubAuthAction.class.php
wcfsetup/install/files/lib/action/GoogleAuthAction.class.php
wcfsetup/install/files/lib/action/TwitterAuthAction.class.php
wcfsetup/install/files/lib/form/RegisterForm.class.php

index a82912943c870edef7f4e6aff7233eb3fae7c573..9db5426320cd7a9125f759d889cfa18571b016aa 100644 (file)
@@ -116,8 +116,10 @@ class FacebookAuthAction extends AbstractAction {
                                        WCF::getSession()->register('__facebookData', $userData);
                                        
                                        // we assume that bots won't register on facebook first
-                                       // todo: captcha
-                                       WCF::getSession()->register('recaptchaDone', true);
+                                       // thus no need for a captcha
+                                       if (REGISTER_CAPTCHA_TYPE) {
+                                               WCF::getSession()->register('noRegistrationCaptcha', true);
+                                       }
                                        
                                        WCF::getSession()->update();
                                        HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Register'));
index bcf0c93f2bb77ca6f40f3ef42f21da1f4f3f1dac..1801fb3147ee8ad35bf50ac3fa24f4ac2e473487 100644 (file)
@@ -148,8 +148,10 @@ class GithubAuthAction extends AbstractAction {
                                        WCF::getSession()->register('__githubToken', $data['access_token']);
                                        
                                        // we assume that bots won't register on github first
-                                       // todo: captcha
-                                       WCF::getSession()->register('recaptchaDone', true);
+                                       // thus no need for a captcha
+                                       if (REGISTER_CAPTCHA_TYPE) {
+                                               WCF::getSession()->register('noRegistrationCaptcha', true);
+                                       }
                                        
                                        WCF::getSession()->update();
                                        HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Register'));
index 62042513c5ce1051ba17f94dfdd5820a437e4ce7..0b73bd0e46abdab439743adc3cd55b23b55b359b 100644 (file)
@@ -129,8 +129,10 @@ class GoogleAuthAction extends AbstractAction {
                                        WCF::getSession()->register('__googleData', $userData);
                                        
                                        // we assume that bots won't register on facebook first
-                                       // todo: captcha
-                                       WCF::getSession()->register('recaptchaDone', true);
+                                       // thus no need for a captcha
+                                       if (REGISTER_CAPTCHA_TYPE) {
+                                               WCF::getSession()->register('noRegistrationCaptcha', true);
+                                       }
                                        
                                        WCF::getSession()->update();
                                        HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Register'));
index fd40437a885ca80e85b11ef19520364cf9a050f6..8500b5dea94a73e270a06964c2f496691bdec835 100644 (file)
@@ -128,8 +128,10 @@ class TwitterAuthAction extends AbstractAction {
                                        WCF::getSession()->register('__twitterData', $data);
                                        
                                        // we assume that bots won't register on twitter first
-                                       // todo: captcha
-                                       WCF::getSession()->register('recaptchaDone', true);
+                                       // thus no need for a captcha
+                                       if (REGISTER_CAPTCHA_TYPE) {
+                                               WCF::getSession()->register('noRegistrationCaptcha', true);
+                                       }
                                        
                                        WCF::getSession()->update();
                                        HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Register'));
index 17f2dac5d068e0c964c38291585724452ac6772d..9d70d0870b9d7ea96ab1d290e9ff6e7d044eed30 100644 (file)
@@ -173,6 +173,12 @@ class RegisterForm extends UserAddForm {
                        if (!$this->captchaObjectType->getProcessor()->isAvailable()) {
                                $this->captchaObjectType = null;
                        }
+                       
+                       if (WCF::getSession()->getVar('noRegistrationCaptcha')) {
+                               $this->captchaObjectType = null;
+                               
+                               WCF::getSession()->unregister('noRegistrationCaptcha');
+                       }
                }
                
                parent::readData();