</option>
<!-- /security.blacklist -->
- <!-- security.antispam -->
- <option name="register_captcha_type">
+ <!-- security.antispam.captcha -->
+ <option name="captcha_type">
<categoryname>security.antispam.captcha</categoryname>
<optiontype>captchaSelect</optiontype>
<defaultvalue>com.woltlab.wcf.recaptcha</defaultvalue>
<allowemptyvalue>1</allowemptyvalue>
</option>
- <option name="lost_password_captcha_type">
+ <option name="register_use_captcha">
<categoryname>security.antispam.captcha</categoryname>
- <optiontype>captchaSelect</optiontype>
- <defaultvalue>com.woltlab.wcf.recaptcha</defaultvalue>
- <allowemptyvalue>1</allowemptyvalue>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ <options>captcha_type</options>
</option>
- <option name="profile_mail_captcha_type">
+ <option name="lost_password_use_captcha">
<categoryname>security.antispam.captcha</categoryname>
- <optiontype>captchaSelect</optiontype>
- <defaultvalue>com.woltlab.wcf.recaptcha</defaultvalue>
- <allowemptyvalue>1</allowemptyvalue>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ <options>captcha_type</options>
</option>
- <option name="search_captcha_type">
+ <option name="profile_mail_use_captcha">
<categoryname>security.antispam.captcha</categoryname>
<optiontype>boolean</optiontype>
- <optiontype>captchaSelect</optiontype>
- <defaultvalue>com.woltlab.wcf.recaptcha</defaultvalue>
- <allowemptyvalue>1</allowemptyvalue>
+ <defaultvalue>1</defaultvalue>
+ <options>captcha_type</options>
</option>
- <option name="message_captcha_type">
+ <option name="search_use_captcha">
<categoryname>security.antispam.captcha</categoryname>
<optiontype>boolean</optiontype>
- <optiontype>captchaSelect</optiontype>
- <defaultvalue>com.woltlab.wcf.recaptcha</defaultvalue>
- <allowemptyvalue>1</allowemptyvalue>
+ <defaultvalue>1</defaultvalue>
+ <options>captcha_type</options>
</option>
- <!-- /security.antispam -->
+ <!-- /security.antispam.captcha -->
+ <!-- security.antispam.recaptcha -->
<option name="recaptcha_publickey">
<categoryname>security.antispam.recaptcha</categoryname>
<optiontype>text</optiontype>
<defaultvalue>6LfOlMYSAAAAAKR3m_EFxmDv1xS8PCfeaSZ2LdG9</defaultvalue>
<showorder>2</showorder>
</option>
+ <!-- /security.antispam.recaptcha -->
<!-- general.system.date -->
<option name="timezone">
<maxvalue>100</maxvalue>
</option>
<!-- /message.general.poll -->
-
- <!-- deprecated -->
- <option name="register_use_captcha">
- <categoryname>security.antispam</categoryname>
- <optiontype>boolean</optiontype>
- <defaultvalue><![CDATA[1]]></defaultvalue>
- <options>module_system_recaptcha</options>
- <hidden>1</hidden>
- </option>
- <option name="lost_password_use_captcha">
- <categoryname>security.antispam</categoryname>
- <optiontype>boolean</optiontype>
- <defaultvalue><![CDATA[1]]></defaultvalue>
- <options>module_system_recaptcha</options>
- <hidden>1</hidden>
- </option>
- <option name="profile_mail_use_captcha">
- <categoryname>security.antispam</categoryname>
- <optiontype>boolean</optiontype>
- <defaultvalue><![CDATA[1]]></defaultvalue>
- <options>module_system_recaptcha</options>
- <hidden>1</hidden>
- </option>
- <option name="search_use_captcha">
- <categoryname>security.antispam</categoryname>
- <optiontype>boolean</optiontype>
- <options>module_system_recaptcha</options>
- <hidden>1</hidden>
- </option>
- <!-- deprecated -->
</options>
</import>
public $url = null;
/**
- * @todo
- * @var unknown
+ * @see \wcf\form\AbstractCaptchaForm::$useCaptcha
*/
public $useCaptcha = false;
if (!empty($_REQUEST['url'])) {
$this->url = StringUtil::trim($_REQUEST['url']);
-
+
// discard URL if it is not an absolute URL of local content
if (!ApplicationHandler::getInstance()->isInternalURL($this->url)) {
$this->url = '';
throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.user.login.blocked'));
}
if (USER_AUTHENTICATION_FAILURE_IP_CAPTCHA && $failures >= USER_AUTHENTICATION_FAILURE_IP_CAPTCHA) {
- $this->captchaObjectTypeName = REGISTER_CAPTCHA_TYPE;
+ $this->useCaptcha = true;
}
else if (USER_AUTHENTICATION_FAILURE_USER_CAPTCHA) {
if (isset($_POST['username'])) {
if ($user->userID) {
$failures = UserAuthenticationFailure::countUserFailures($user->userID);
if (USER_AUTHENTICATION_FAILURE_USER_CAPTCHA && $failures >= USER_AUTHENTICATION_FAILURE_USER_CAPTCHA) {
- $this->captchaObjectTypeName = REGISTER_CAPTCHA_TYPE;
+ $this->useCaptcha = true;
}
}
}
// we assume that bots won't register on facebook first
// thus no need for a captcha
- if (REGISTER_CAPTCHA_TYPE) {
+ if (REGISTER_USE_CAPTCHA) {
WCF::getSession()->register('noRegistrationCaptcha', true);
}
// we assume that bots won't register on github first
// thus no need for a captcha
- if (REGISTER_CAPTCHA_TYPE) {
+ if (REGISTER_USE_CAPTCHA) {
WCF::getSession()->register('noRegistrationCaptcha', true);
}
// we assume that bots won't register on google first
// thus no need for a captcha
- if (REGISTER_CAPTCHA_TYPE) {
+ if (REGISTER_USE_CAPTCHA) {
WCF::getSession()->register('noRegistrationCaptcha', true);
}
// we assume that bots won't register on twitter first
// thus no need for a captcha
- if (REGISTER_CAPTCHA_TYPE) {
+ if (REGISTER_USE_CAPTCHA) {
WCF::getSession()->register('noRegistrationCaptcha', true);
}
* @return array
*/
public function getGuestDialog() {
- if (MESSAGE_CAPTCHA_TYPE) {
- $captchaObjectType = CaptchaHandler::getInstance()->getObjectTypeByName(MESSAGE_CAPTCHA_TYPE);
+ if (CAPTCHA_TYPE) {
+ $captchaObjectType = CaptchaHandler::getInstance()->getObjectTypeByName(CAPTCHA_TYPE);
if ($captchaObjectType === null) {
- throw new SystemException("Unknown captcha object type with name '".MESSAGE_CAPTCHA_TYPE."'");
+ throw new SystemException("Unknown captcha object type with name '".CAPTCHA_TYPE."'");
}
if (!$captchaObjectType->getProcessor()->isAvailable()) {
protected function validateCaptcha() {
if (WCF::getUser()->userID) return;
- if (MESSAGE_CAPTCHA_TYPE) {
- $this->captchaObjectType = CaptchaHandler::getInstance()->getObjectTypeByName(MESSAGE_CAPTCHA_TYPE);
+ if (CAPTCHA_TYPE) {
+ $this->captchaObjectType = CaptchaHandler::getInstance()->getObjectTypeByName(CAPTCHA_TYPE);
if ($this->captchaObjectType === null) {
- throw new SystemException("Unknown captcha object type with name '".MESSAGE_CAPTCHA_TYPE."'");
+ throw new SystemException("Unknown captcha object type with name '".CAPTCHA_TYPE."'");
}
if (!$this->captchaObjectType->getProcessor()->isAvailable()) {
* name of the captcha object type; if empty, captcha is disabled
* @var string
*/
- public $captchaObjectTypeName = '';
+ public $captchaObjectTypeName = CAPTCHA_TYPE;
/**
- * challenge (legacy property from RecaptchaForm, do not use!)
- * @var string
- */
- public $challenge = '';
-
- /**
- * response (legacy property from RecaptchaForm, do not use!)
- * @var string
- */
- public $response = '';
-
- /**
- * true if recaptcha is used (legacy property from RecaptchaForm, do not use!)
+ * true if recaptcha is used
* @var boolean
*/
public $useCaptcha = true;
parent::assignVariables();
WCF::getTPL()->assign(array(
- 'captchaObjectType' => $this->captchaObjectType
+ 'captchaObjectType' => $this->captchaObjectType,
+ 'useCaptcha' => $this->useCaptcha
));
-
- if (!$this->captchaObjectType) {
- RecaptchaHandler::getInstance()->assignVariables();
- WCF::getTPL()->assign(array(
- 'useCaptcha' => $this->useCaptcha
- ));
- }
}
/**
* @see \wcf\page\IPage::readData()
*/
public function readData() {
- if (!WCF::getUser()->userID && $this->captchaObjectTypeName) {
+ if (!WCF::getUser()->userID && $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."'");
if ($this->captchaObjectType) {
$this->captchaObjectType->getProcessor()->readFormParameters();
}
- else if ($this->useCaptcha) {
- if (isset($_POST['recaptcha_challenge_field'])) $this->challenge = StringUtil::trim($_POST['recaptcha_challenge_field']);
- if (isset($_POST['recaptcha_response_field'])) $this->response = StringUtil::trim($_POST['recaptcha_response_field']);
- }
- }
-
- /**
- * @see \wcf\page\IPage::readParameters()
- */
- public function readParameters() {
- parent::readParameters();
-
- if ($this->captchaObjectType === null && (!MODULE_SYSTEM_RECAPTCHA || WCF::getUser()->userID || WCF::getSession()->getVar('recaptchaDone'))) {
- $this->useCaptcha = false;
- }
}
/**
if ($this->captchaObjectType) {
$this->captchaObjectType->getProcessor()->reset();
}
- else {
- WCF::getSession()->unregister('recaptchaDone');
- }
}
/**
if ($this->captchaObjectType) {
$this->captchaObjectType->getProcessor()->validate();
}
- else if ($this->useCaptcha) {
- RecaptchaHandler::getInstance()->validate($this->challenge, $this->response);
- $this->useCaptcha = false;
- }
}
}
public $user;
/**
- * @see \wcf\form\CaptchaForm::$captchaObjectTypeName
+ * @see \wcf\form\AbstractCaptchaForm::$useCaptcha
*/
- public $captchaObjectTypeName = LOST_PASSWORD_CAPTCHA_TYPE;
+ public $useCaptcha = LOST_PASSWORD_USE_CAPTCHA;
/**
* @see \wcf\form\IForm::readFormParameters()
public $message = '';
/**
- * captcha object type object
- * @var \wcf\data\object\type\ObjectType
+ * @see \wcf\form\AbstractCaptchaForm::$captchaObjectType
*/
public $captchaObjectType = null;
/**
- * name of the captcha object type; if empty, captcha is disabled
- * @var string
+ * @see \wcf\form\AbstractCaptchaForm::$useCaptcha
+ */
+ public $captchaObjectTypeName = CAPTCHA_TYPE;
+
+ /**
+ * @see \wcf\form\AbstractCaptchaForm::$useCaptcha
*/
- public $captchaObjectTypeName = REGISTER_CAPTCHA_TYPE;
+ public $useCaptcha = REGISTER_USE_CAPTCHA;
/**
* field names
* @see \wcf\page\IPage::readData()
*/
public function readData() {
- if ($this->captchaObjectTypeName) {
+ if ($this->useCaptcha && $this->captchaObjectTypeName) {
$this->captchaObjectType = CaptchaHandler::getInstance()->getObjectTypeByName($this->captchaObjectTypeName);
if ($this->captchaObjectType === null) {
throw new SystemException("Unknown captcha object type with id '".$this->captchaObjectTypeName."'");
public $username = '';
/**
- * @see \wcf\form\AbstractCaptchaForm::$captchaObjectTypeName
+ * @see \wcf\form\AbstractCaptchaForm::$useCaptcha
*/
- public $captchaObjectTypeName = SEARCH_CAPTCHA_TYPE;
+ public $useCaptcha = SEARCH_USE_CAPTCHA;
/**
* parameters used for previous search
<item name="wcf.acp.option.url_omit_index_php"><![CDATA[„index.php“ aus URLs entfernen]]></item>
<item name="wcf.acp.option.url_omit_index_php.description"><![CDATA[TODO]]></item>
<item name="wcf.acp.option.module_ad"><![CDATA[Werbung]]></item>
- <item name="wcf.acp.option.register_captcha_type"><![CDATA[Registierung]]></item>
- <item name="wcf.acp.option.lost_password_captcha_type"><![CDATA[Kennwort vergessen]]></item>
- <item name="wcf.acp.option.profile_mail_captcha_type"><![CDATA[E-Mail an Benutzer schicken]]></item>
- <item name="wcf.acp.option.search_captcha_type"><![CDATA[Suche]]></item>
- <item name="wcf.acp.option.message_captcha_type"><![CDATA[Nachrichten]]></item>
+ <item name="wcf.acp.option.captcha_type"><![CDATA[Captcha-Art]]></item>
+ <item name="wcf.acp.option.register_use_captcha"><![CDATA[Captcha in Registrierung aktivieren]]></item>
+ <item name="wcf.acp.option.lost_password_use_captcha"><![CDATA[Captcha in „Kennwort vergessen“ aktivieren]]></item>
+ <item name="wcf.acp.option.profile_mail_use_captcha"><![CDATA[Captcha in „E-Mail an Benutzer schicken“ aktivieren]]></item>
+ <item name="wcf.acp.option.search_use_captcha"><![CDATA[Captcha in Suchfunktion aktivieren]]></item>
<item name="wcf.acp.option.category.security.antispam.captcha"><![CDATA[Captchas]]></item>
<item name="wcf.acp.option.category.security.general.authentication"><![CDATA[Benutzer-Authentifikation]]></item>
<item name="wcf.acp.option.enable_user_authentication_failure"><![CDATA[Fehlgeschlagene Ammeldeversuche protokollieren]]></item>
<item name="wcf.acp.option.url_omit_index_php"><![CDATA[TODO: „index.php“ aus URLs entfernen]]></item>
<item name="wcf.acp.option.url_omit_index_php.description"><![CDATA[TODO]]></item>
<item name="wcf.acp.option.module_ad"><![CDATA[Ads]]></item>
- <item name="wcf.acp.option.register_captcha_type"><![CDATA[Registration]]></item>
- <item name="wcf.acp.option.lost_password_captcha_type"><![CDATA[Lost Password]]></item>
- <item name="wcf.acp.option.profile_mail_captcha_type"><![CDATA[Send Email to User]]></item>
- <item name="wcf.acp.option.search_captcha_type"><![CDATA[Search]]></item>
- <item name="wcf.acp.option.message_captcha_type"><![CDATA[Messages]]></item>
+ <item name="wcf.acp.option.captcha_type"><![CDATA[Captcha Type]]></item>
+ <item name="wcf.acp.option.register_use_captcha"><![CDATA[Enable Captcha protection during registration]]></item>
+ <item name="wcf.acp.option.lost_password_use_captcha"><![CDATA[Enable Captcha protection for “Lost Password”]]></item>
+ <item name="wcf.acp.option.profile_mail_use_captcha"><![CDATA[Enable Captcha protection for “Send Email to User”]]></item>
+ <item name="wcf.acp.option.search_use_captcha"><![CDATA[Enable Captcha protection for search]]></item>
<item name="wcf.acp.option.category.security.antispam.captcha"><![CDATA[Captchas]]></item>
<item name="wcf.acp.option.category.security.general.authentication"><![CDATA[TODO: Benutzer-Authentifikation]]></item>
<item name="wcf.acp.option.enable_user_authentication_failure"><![CDATA[TODO: Fehlgeschlagene Ammeldeversuche protokollieren]]></item>