<![CDATA[ eForm - reCAPTCHA verification anti spam - My Forums]]> https://forums.modx.com/thread/?thread=99706 <![CDATA[eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539276 I wonder if someone has already done this or knows how to intergrade it in eForm?

https://developers.google.com/recaptcha/docs/verify]]>
fourroses666 Mar 07, 2016, 07:47 AM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539276
<![CDATA[Re: eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-541188
If still interested in implementing of new Google reCaptcha just follow the steps below (tested on eForm 1.4.6):

1./ Get needed keys - https://www.google.com/recaptcha/intro/index.html. Click on "GET reCAPTCHA" button (top right).

2./ Add before </head> foll:
<script src='https://www.google.com/recaptcha/api.js'></script>

3./ Add in your form chunk (between <form></form>)
<div class="g-recaptcha" data-sitekey="YOUR_SITE_KEY"></div>

4./ Edit file eform.inc.php (it's in: assets/snippets/eForm/):
- Find "# check vericode", it's around line 185

- replace all in:
if($vericode) {}

- with:
if(isset($_POST['g-recaptcha-response'])){
          $captcha=$_POST['g-recaptcha-response'];
        }
		$secretKey = "YOUR_SECRET_KEY";
        $ip = $_SERVER['REMOTE_ADDR'];
        $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
        $responseKeys = json_decode($response,true);
        if(intval($responseKeys["success"]) !== 1) {
          $vMsg[count($vMsg)]=$_lang['ef_failed_vericode'];
		  $rClass['vericode']=$invalidClass; //added in 1.4.4
        } ;

-finally it should look like:
# check vericode
		if($vericode) {
		if(isset($_POST['g-recaptcha-response'])){
          $captcha=$_POST['g-recaptcha-response'];
        }
		$secretKey = "YOUR_SECRET_KEY";
        $ip = $_SERVER['REMOTE_ADDR'];
        $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
        $responseKeys = json_decode($response,true);
        if(intval($responseKeys["success"]) !== 1) {
          $vMsg[count($vMsg)]=$_lang['ef_failed_vericode'];
		  $rClass['vericode']=$invalidClass; //added in 1.4.4
        } ;}


Don't miss to replace "YOUR_SITE_KEY" and "YOUR_SECRET_KEY" above with your real keys from Google.

That's all.]]>
valkovdesign May 04, 2016, 06:11 AM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-541188
<![CDATA[Re: eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539430
Quote from: iusemodx at Mar 09, 2016, 07:28 AM
@SyberKnight

This is the "Evo" development section, not "Revo"

There is no official recaptcha snippet for Evo

The version in use in my version of eForm is "recaptcha V.1"
]]>
syberknight Mar 09, 2016, 02:51 PM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539430
<![CDATA[Re: eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539372
This is the "Evo" development section, not "Revo"

There is no official recaptcha snippet for Evo

The version in use in my version of eForm is "recaptcha V.1"]]>
iusemodx Mar 09, 2016, 01:28 AM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539372
<![CDATA[Re: eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539369
ref: https://forums.modx.com/thread/99538/recaptcha-v2-how-to-change-it-s-theme
]]>
syberknight Mar 08, 2016, 09:32 PM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539369
<![CDATA[Re: eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539347 iusemodx Mar 08, 2016, 08:27 AM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539347 <![CDATA[Re: eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539342
@media only screen and (max-width:380px) {
  #recaptcha_table{
    transform:scale(0.77);
    -webkit-transform:scale(0.77);
    transform-origin:0 0;
    -webkit-transform-origin:0 0;
  }
}


https://www.geekgoddess.com/how-to-resize-the-google-nocaptcha-recaptcha/]]>
fourroses666 Mar 08, 2016, 07:55 AM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539342
<![CDATA[Re: eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539335
My recaptcha is more in-style to what my website looks like

The problem with adding max-width to the image is that it can get to small to be readable - thats what I meant with not being able to change the size of the image]]>
iusemodx Mar 08, 2016, 07:02 AM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539335
<![CDATA[Re: eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539334 http://jaicab.com/responsive-reCAPTCHA/

Or:

<style>
  #recaptcha_image { width:auto !important; max-width: 100%; height: auto !important}
  #recaptcha_image img { width:100% ;}
  #recaptcha_response_field { width: 100% !important; max-width: 302px; }
  .recaptchatable, #recaptcha_area tr, #recaptcha_area td, #recaptcha_area th{float: left;}
  #recaptcha_area tr{height: auto !important;}
  .recaptcha_image_cell{width: 100% !important; max-width: 300px;}
  img{height: auto !important;}
</style>

<script type="text/javascript">
 var RecaptchaOptions = {
    theme : 'clean',
    custom_theme_widget: 'recaptcha_widget'
 };
</script>
]]>
fourroses666 Mar 08, 2016, 06:55 AM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam?page=2#dis-post-539334
<![CDATA[Re: eForm - reCAPTCHA verification anti spam]]> https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam#dis-post-539333
The only thing I can't modify is the width of the image that is displayed - the rest you can completely customise to suit your needs]]>
iusemodx Mar 08, 2016, 06:11 AM https://forums.modx.com/thread/99706/eform---recaptcha-verification-anti-spam#dis-post-539333