Esempio n. 1
0
 /**
  * @see	\wcf\system\captcha\ICaptchaHandler::validate()
  */
 public function validate()
 {
     if (WCF::getSession()->getVar('recaptchaDone')) {
         return;
     }
     if (!RECAPTCHA_PUBLICKEY || !RECAPTCHA_PRIVATEKEY) {
         // V1
         \wcf\system\recaptcha\RecaptchaHandler::getInstance()->validate($this->challenge, $this->response);
     } else {
         // V2
         RecaptchaHandlerV2::getInstance()->validate($this->response);
     }
 }
Esempio n. 2
0
 /**
  * Validates the captcha.
  */
 protected function validateCaptcha()
 {
     if ($this->useCaptcha) {
         if (!RECAPTCHA_PUBLICKEY || !RECAPTCHA_PRIVATEKEY) {
             // V1
             RecaptchaHandler::getInstance()->validate($this->challenge, $this->response);
         } else {
             // V2
             RecaptchaHandlerV2::getInstance()->validate($this->response);
         }
         $this->useCaptcha = false;
     }
 }