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.x2.1.x2.2.x2.3.x2.4.x2.5.x2.6.x2.7.02.7.12.7.22.7.32.7.42.7.52.7.62.7.72.7.82.7.92.7.10
NoNoNoNoNoNo1.1.01.1.01.1.01.1.01.1.01.1.01.1.01.1.01.1.01.1.01.1.01.1.0

Readme

Symphony CMS -Google reCaptcha extension

Installation

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