From: Marcel Werk Date: Tue, 24 May 2016 16:17:17 +0000 (+0200) Subject: Added parameter to force captcha usage for registered users X-Git-Tag: 3.0.0_Beta_1~1643 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=17b9b1501b1d4de3108e0c091c2a063cf39f0106;p=GitHub%2FWoltLab%2FWCF.git Added parameter to force captcha usage for registered users --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a5625b339..821f1df839 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ * Added users online list pagination * Added support for embedded youtube playlists * Scaled embedded youtube videos to maximum width +* `\wcf\form\AbstractCaptchaForm`: added parameter to force captcha usage for registered users. #### CMS diff --git a/wcfsetup/install/files/lib/form/AbstractCaptchaForm.class.php b/wcfsetup/install/files/lib/form/AbstractCaptchaForm.class.php index 4643d058fd..dc8355e7c8 100644 --- a/wcfsetup/install/files/lib/form/AbstractCaptchaForm.class.php +++ b/wcfsetup/install/files/lib/form/AbstractCaptchaForm.class.php @@ -28,11 +28,17 @@ abstract class AbstractCaptchaForm extends AbstractForm { public $captchaObjectTypeName = CAPTCHA_TYPE; /** - * true if recaptcha is used + * true if captcha is used * @var boolean */ public $useCaptcha = true; + /** + * true to force captcha usage + * @var boolean + */ + public $forceCaptcha = false; + /** * @inheritDoc */ @@ -49,7 +55,7 @@ abstract class AbstractCaptchaForm extends AbstractForm { * @inheritDoc */ public function readData() { - if (!WCF::getUser()->userID && $this->useCaptcha && $this->captchaObjectTypeName) { + if ((!WCF::getUser()->userID || $this->forceCaptcha) && $this->useCaptcha && $this->captchaObjectTypeName) { $this->captchaObjectType = CaptchaHandler::getInstance()->getObjectTypeByName($this->captchaObjectTypeName); if ($this->captchaObjectType === null) { throw new SystemException("Unknown captcha object type with name '".$this->captchaObjectTypeName."'");