ReCaptcha : modif du message d'erreur

This commit is contained in:
2019-12-01 17:43:35 +01:00
parent 7415fa590b
commit 9e66d7916d
2 changed files with 2 additions and 2 deletions

View File

@@ -56,7 +56,7 @@ class ContactController extends BaseFrontController
if($checkModule && $checkModule->getActivate()){ if($checkModule && $checkModule->getActivate()){
$checkCaptchaEvent = new ReCaptchaCheckEvent(); $checkCaptchaEvent = new ReCaptchaCheckEvent();
$this->dispatch(ReCaptchaEvents::CHECK_CAPTCHA_EVENT, $checkCaptchaEvent); $this->dispatch(ReCaptchaEvents::CHECK_CAPTCHA_EVENT, $checkCaptchaEvent);
if ($checkCaptchaEvent->isHuman() == false) { throw new FormValidationException('Invalid reCAPTCHA'); } if ($checkCaptchaEvent->isHuman() == false) { throw new FormValidationException('Veuillez confirmer que vous n\'êtes pas un robot.'); }
} }
$this->getMailer()->sendSimpleEmailMessage( $this->getMailer()->sendSimpleEmailMessage(

View File

@@ -171,7 +171,7 @@ class CustomerController extends BaseFrontController
if($checkModule && $checkModule->getActivate()){ if($checkModule && $checkModule->getActivate()){
$checkCaptchaEvent = new ReCaptchaCheckEvent(); $checkCaptchaEvent = new ReCaptchaCheckEvent();
$this->dispatch(ReCaptchaEvents::CHECK_CAPTCHA_EVENT, $checkCaptchaEvent); $this->dispatch(ReCaptchaEvents::CHECK_CAPTCHA_EVENT, $checkCaptchaEvent);
if ($checkCaptchaEvent->isHuman() == false) { throw new \Exception('Invalid reCAPTCHA'); } if ($checkCaptchaEvent->isHuman() == false) { throw new \Exception('Veuillez confirmer que vous n\'êtes pas un robot.'); }
} }
$customerCreateEvent = $this->createEventInstance($form->getData()); $customerCreateEvent = $this->createEventInstance($form->getData());