");
+ }
+
+ public function loadRecaptcha(HookRenderEvent $event)
+ {
+ $siteKey = ReCaptcha::getConfigValue('site_key');
+ $captchaStyle = ReCaptcha::getConfigValue('captcha_style');
+
+ if ($captchaStyle !== 'invisible') {
+ $event->add($this->render(
+ 'recaptcha-js.html',
+ [
+ "siteKey" => $siteKey,
+ "captchaStyle" => $captchaStyle,
+ ]
+ ));
+
+ return;
+ }
+
+ $event->add($this->render(
+ 'recaptcha-js-invisible.html',
+ [
+ "siteKey" => $siteKey,
+ "captchaStyle" => $captchaStyle,
+ ]
+ ));
+ }
+}
diff --git a/local/modules/ReCaptcha/I18n/backOffice/default/fr_FR.php b/local/modules/ReCaptcha/I18n/backOffice/default/fr_FR.php
new file mode 100644
index 00000000..85634178
--- /dev/null
+++ b/local/modules/ReCaptcha/I18n/backOffice/default/fr_FR.php
@@ -0,0 +1,7 @@
+ 'Envoyer',
+ 'These infos are available here : ' => 'Ces infos sont disponibles ici : ',
+ 'reCAPTCHA Configuration' => 'Configuration reCAPTCHA',
+);
diff --git a/local/modules/ReCaptcha/I18n/en_US.php b/local/modules/ReCaptcha/I18n/en_US.php
new file mode 100644
index 00000000..0b4fa142
--- /dev/null
+++ b/local/modules/ReCaptcha/I18n/en_US.php
@@ -0,0 +1,4 @@
+ 'The displayed english string',
+);
diff --git a/local/modules/ReCaptcha/I18n/fr_FR.php b/local/modules/ReCaptcha/I18n/fr_FR.php
new file mode 100644
index 00000000..00914ac1
--- /dev/null
+++ b/local/modules/ReCaptcha/I18n/fr_FR.php
@@ -0,0 +1,11 @@
+ 'Ajouter un CAPTCHA au formulaire de contact',
+ 'Captcha validation failed, please try again.' => 'Nous n\'avons pas pu vérifier ',
+ 'Check this box to add a captcha to the standard Thelia 2 contact form' => 'Cochez cette case pour ajouter un CAPTCHA au formulaire de contact standard de Thelia',
+ 'Error' => 'Erreur',
+ 'ReCaptcha style' => 'Style du CAPTCHA',
+ 'Secret key' => 'Clé secrète',
+ 'Site key' => 'Clé du site',
+);
diff --git a/local/modules/ReCaptcha/LICENSE b/local/modules/ReCaptcha/LICENSE
new file mode 100644
index 00000000..2152256c
--- /dev/null
+++ b/local/modules/ReCaptcha/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 OpenStudio
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/local/modules/ReCaptcha/ReCaptcha.php b/local/modules/ReCaptcha/ReCaptcha.php
new file mode 100644
index 00000000..dafde8f5
--- /dev/null
+++ b/local/modules/ReCaptcha/ReCaptcha.php
@@ -0,0 +1,55 @@
+ TemplateDefinition::FRONT_OFFICE,
+ "code" => "recaptcha.js",
+ "title" => [
+ "en_US" => "reCaptcha js",
+ "fr_FR" => "Js pour recaptcha",
+ ],
+ "block" => false,
+ "active" => true,
+ ],
+ [
+ "type" => TemplateDefinition::FRONT_OFFICE,
+ "code" => "recaptcha.check",
+ "title" => [
+ "en_US" => "reCaptcha check hook",
+ "fr_FR" => "reCaptcha check hook",
+ ],
+ "block" => false,
+ "active" => true,
+ ],
+ ];
+ }
+}
diff --git a/local/modules/ReCaptcha/Readme.md b/local/modules/ReCaptcha/Readme.md
new file mode 100644
index 00000000..877cfe59
--- /dev/null
+++ b/local/modules/ReCaptcha/Readme.md
@@ -0,0 +1,65 @@
+# Re Captcha
+
+This module allow you to add easily a reCAPTCHA to your form
+## Installation
+
+### Composer
+
+Add it in your main thelia composer.json file
+
+```
+composer require thelia/re-captcha-module:~2.0.3
+```
+
+## Usage
+
+Before using this module you have to create google api key here http://www.google.com/recaptcha/admin
+next configure your reCAPTCHA access here http://your_site.com`/admin/module/ReCaptcha` with keys you obtained in Google's page
+and choose which style of captcha you want :
+
+- A standard captcha (or a compact version of this one)
+
+ 
+
+- An invisible captcha
+
+ 
+
+If you're using Thelia 2.4 or better, you can automatically add a CAPTCHA to the standard Thelia
+contact form. To do so, just check the "Add captcha to standard contact form" box in the module
+configuration.
+
+For thelia 2.3, you'll need help from a developer to add some hooks in template and dispatch the check events, see details below.
+
+### Hook
+
+First if you don't have `{hook name="main.head-top"}` hook in your template you have to put this hook `{hook name="recaptcha.js"}` in the top of your head
+Then add this hook `{hook name="recaptcha.check"}` in every form where you want to check if the user is human,
+be careful if you want to use the invisible captcha this hook must be placed directly in the form tag like this :
+```
+
+```
+
+### Event
+
+To check in server-side if the captcha is valid you have to dispatch the "CHECK_CAPTCHA_EVENT" like this :
+```
+$checkCaptchaEvent = new ReCaptchaCheckEvent();
+$this->dispatch(ReCaptchaEvents::CHECK_CAPTCHA_EVENT, $checkCaptchaEvent);
+```
+
+Then the result of check is available in `$checkCaptchaEvent->isHuman()`as boolean so you can do a test like this :
+```
+if ($checkCaptchaEvent->isHuman() == false) {
+ throw new \Exception('Invalid captcha');
+}
+```
+
+Don't forget to add this use at the top of your class :
+```
+use ReCaptcha\Event\ReCaptchaCheckEvent;
+use ReCaptcha\Event\ReCaptchaEvents;
+```
diff --git a/local/modules/ReCaptcha/composer.json b/local/modules/ReCaptcha/composer.json
new file mode 100644
index 00000000..84b27144
--- /dev/null
+++ b/local/modules/ReCaptcha/composer.json
@@ -0,0 +1,11 @@
+{
+ "name": "thelia/re-captcha-module",
+ "license": "LGPL-3.0+",
+ "type": "thelia-module",
+ "require": {
+ "thelia/installer": "~1.1"
+ },
+ "extra": {
+ "installer-name": "ReCaptcha"
+ }
+}
\ No newline at end of file
diff --git a/local/modules/ReCaptcha/templates/backOffice/default/recaptcha/configuration.html b/local/modules/ReCaptcha/templates/backOffice/default/recaptcha/configuration.html
new file mode 100644
index 00000000..0dc3b717
--- /dev/null
+++ b/local/modules/ReCaptcha/templates/backOffice/default/recaptcha/configuration.html
@@ -0,0 +1,48 @@
+