From ed7256dd7823883f0fd734e5f19e24e34dda234b Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 14 Jun 2014 17:18:03 +0200 Subject: [PATCH] Resolve captcha-related todos --- .../install/files/lib/action/FacebookAuthAction.class.php | 6 ++++-- .../install/files/lib/action/GithubAuthAction.class.php | 6 ++++-- .../install/files/lib/action/GoogleAuthAction.class.php | 6 ++++-- .../install/files/lib/action/TwitterAuthAction.class.php | 6 ++++-- wcfsetup/install/files/lib/form/RegisterForm.class.php | 6 ++++++ 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php b/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php index a82912943c..9db5426320 100644 --- a/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php +++ b/wcfsetup/install/files/lib/action/FacebookAuthAction.class.php @@ -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')); diff --git a/wcfsetup/install/files/lib/action/GithubAuthAction.class.php b/wcfsetup/install/files/lib/action/GithubAuthAction.class.php index bcf0c93f2b..1801fb3147 100644 --- a/wcfsetup/install/files/lib/action/GithubAuthAction.class.php +++ b/wcfsetup/install/files/lib/action/GithubAuthAction.class.php @@ -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')); diff --git a/wcfsetup/install/files/lib/action/GoogleAuthAction.class.php b/wcfsetup/install/files/lib/action/GoogleAuthAction.class.php index 62042513c5..0b73bd0e46 100644 --- a/wcfsetup/install/files/lib/action/GoogleAuthAction.class.php +++ b/wcfsetup/install/files/lib/action/GoogleAuthAction.class.php @@ -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')); diff --git a/wcfsetup/install/files/lib/action/TwitterAuthAction.class.php b/wcfsetup/install/files/lib/action/TwitterAuthAction.class.php index fd40437a88..8500b5dea9 100644 --- a/wcfsetup/install/files/lib/action/TwitterAuthAction.class.php +++ b/wcfsetup/install/files/lib/action/TwitterAuthAction.class.php @@ -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')); diff --git a/wcfsetup/install/files/lib/form/RegisterForm.class.php b/wcfsetup/install/files/lib/form/RegisterForm.class.php index 17f2dac5d0..9d70d0870b 100644 --- a/wcfsetup/install/files/lib/form/RegisterForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterForm.class.php @@ -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(); -- 2.20.1