Download the PHP package thelia/re-captcha-module without Composer
On this page you can find all versions of the php package thelia/re-captcha-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thelia/re-captcha-module
More information about thelia/re-captcha-module
Files in thelia/re-captcha-module
Package re-captcha-module
Short Description This module allows you to add easily a reCAPTCHA to your form
License LGPL-3.0+
Informations about the package re-captcha-module
Re Captcha
This module allows you to add easily a reCAPTCHA to your form
Installation
Composer
Add it in your main thelia composer.json file
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
Then 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 :
Then the result of check is available in $checkCaptchaEvent->isHuman()
as boolean so you can do a test like this :
Don't forget to add this use at the top of your class :