1.1.0releasedGoogle reCaptcha
Insert and process reCaptcha field for form submission
Clone URLhttps://github.com/SagaraZD/google_recaptcha.git
Add as a submodulegit submodule add https://github.com/SagaraZD/google_recaptcha.git extensions/google_recaptcha --recursive
Compatibility
2.x.x | 2.1.x | 2.2.x | 2.3.x | 2.4.x | 2.5.x | 2.6.x | 2.7.0 | 2.7.1 | 2.7.2 | 2.7.3 | 2.7.4 | 2.7.5 | 2.7.6 | 2.7.7 | 2.7.8 | 2.7.9 | 2.7.10 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
No | No | No | No | No | No | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 | 1.1.0 |
Readme
Symphony CMS -Google reCaptcha extension
Installation
- Generate a site key at https://www.google.com/recaptcha
- Add Generated reCaptcha secret ID and reCaptcha site key on Symphony preferences
Add this code to the head of the website
Add this code to the form
<div data-callback="recaptcha_callback" class="g-recaptcha" data-sitekey="{/data/params/recaptcha-sitekey}"></div>
<input class="recaptcha_class" name="fields[google_recaptcha]" type="hidden" value="" />
Add this JavaScript to your site
//reCaptcha callback function
function recaptcha_callback(){
var g_recaptcha_key = $("#g-recaptcha-response").val();
$(".recaptcha_class").val(g_recaptcha_key);
}
Add filter to event
Add the reCAPTCHA Verification filter to your event your form is executing
Version history
Symphony 2.6.x to 2.x.x
- Add validateChallenge() public method
Symphony 2.6.x to 2.x.x
- Refactor the http request to use the Gateway class
Symphony 2.6.x only