/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/auth/src/Traits
NameSizeModeActions
IsAuthorizedTrait.php25480644editdlrm
ReCaptchaTrait.php21340644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/auth/src/Traits/ReCaptchaTrait.php (2134B)
getParsedBody(); $captcha = $data['g-recaptcha-response'] ?? null; return $this->validateReCaptcha( $captcha, $request->clientIp() ); } /** * Validates reCaptcha response * * @param string $recaptchaResponse response * @param string $clientIp client ip * @return bool */ public function validateReCaptcha($recaptchaResponse, $clientIp) { $recaptcha = $this->_getReCaptchaInstance(); if (!empty($recaptcha)) { $response = $recaptcha->verify($recaptchaResponse, $clientIp); return $response->isSuccess(); } return false; } /** * Create reCaptcha instance if enabled in configuration * * @return \ReCaptcha\ReCaptcha|null */ protected function _getReCaptchaInstance() { $reCaptchaSecret = Configure::read('Users.reCaptcha.secret'); if (!empty($reCaptchaSecret)) { return new \ReCaptcha\ReCaptcha($reCaptchaSecret); } return null; } }