/**
  * Verify Response
  *
  * @return bool
  */
 public function verify()
 {
     $controller = $this->_registry->getController();
     if (isset($controller->request->data["g-recaptcha-response"])) {
         $gRecaptchaResponse = $controller->request->data["g-recaptcha-response"];
         $resp = $this->recaptcha->verifyResponse(new Client(), $gRecaptchaResponse);
         // if verification is correct,
         if ($resp) {
             return true;
         }
     }
     return false;
 }
예제 #2
0
 /**
  * Return an array with errors : missing secret, connexion issue, ...
  *
  * @return array
  */
 public function errors()
 {
     return $this->recaptcha->errors();
 }