<![CDATA[ Integration of ReCaptcha into Eform - MODX Community Forums]]> https://forums.modx.com/thread/?thread=46545 <![CDATA[Re: Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-534247 ]]> fourroses666 Nov 11, 2015, 06:48 AM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-534247 <![CDATA[Re: Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-496370 this]]> cipa Apr 28, 2014, 05:06 PM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-496370 <![CDATA[Re: Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-461485 ssanders Apr 03, 2013, 12:20 PM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-461485 <![CDATA[Re: Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-421717 ssanders Apr 27, 2012, 10:06 AM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-421717 <![CDATA[Re: &lt;SOLVED&gt; Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269338
Ahh. That actually makes sense - one of the first things to do so today wink

Thank you very much for your explanation.
Matt]]>
mconsidine Nov 10, 2009, 01:45 PM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269338
<![CDATA[Re: &lt;SOLVED&gt; Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269337
Thanks for doing this.

The way reCaptcha works or the idea behind it is that you are helping to decode scanned books. One of the words in the code is from a scanned book that the OCR couldn’t recognize. Then they put it in reCaptcha’s database and send it out with another word image that is known. When a certain number/percentage of users decipher the unkown word’s meaning to be the same thing, they have solved their problem and added it to their database.

So in essence, when you validate you only have to get one word right, the one that they know is already right.

Hope this helps you so you don’t keep trying to solve an error that isn’t there.

Explorertj]]>
explorertj Nov 10, 2009, 01:41 PM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269337
<![CDATA[Re: &lt;SOLVED&gt; Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269336 Matt

- Create a folder for the recaptcha library, e.g.
assets/snippets/recaptcha
- Upload the recaptchalib.php file provided by recaptcha to the above folder
- Upload the attached recapeform.inc.php to this folder as well
- Put your private and public recaptcha keys in a file called recaptchakeys.php
and upload it to this folder as well. It should look like this

$publickey = "--your public key between these quotes--";
$privatekey = "--your private key between these quotes--";


- Create a copy of the eForm snippet, saving it as "recapeForm"
- Edit this snippet, changing the name of the required include file from "eform.inc.php"
to "recapeform.inc.php" and updating its location as well
- The eForm function name has been changed in this include file to be "recapeForm". So
change the original call to eForm to reflect this name change.
- Create a document with the following content :

[!recapeForm? &vericode=`2` &formid=`testform` &tpl=`testform_chunk` &report=`testformreport_chunk` &gotoid=`2`!]


For no captcha, vericode = 0. For the default captcha, vericode = 1. For Recaptcha, vericode = 2.

- In the chunk that defines the form to be used, add "[+captcha_html+]" in the place
where the recaptcha image/dialogue is supposed to appear. The code for the form I used
to test this is

<p class="error">[+validationmessage+]</p>

<form method="post" action="[~[*id*]~]" id="EmailForm" name="EmailForm">

	<fieldset>
		<h3> Test Form</h3>

		<input name="formid" type="hidden" value="testform" />

		<label for="cfName">Your name (required):
		<input name="name" id="cfName" class="text" type="text" eform="Your Name::1:" /> </label>

		<label for="cfEmail">Your Email Address (required):
		<input name="email" id="cfEmail" class="text" type="text" eform="Email Address:email:1" /> </label>

		<label for="cfMessage">Message (required): 
		<textarea name="message" id="cfMessage" rows="4" cols="20" eform="Message:textarea:1"></textarea>
		</label>
        </fieldset>

           [+captcha_html+]

		<label> </label><input type="submit" name="contact" id="cfContact" class="button" value="Send This Message" />
</form>


Notes :
- I did not delete any code, but instead put my initials after or around anything
I commented out or added. So to look for changes, search for "MattC"
- The goal here was to avoid stomping on anything that is involved in the released
version of eForm. So some of the above steps would not be needed if in fact one
just wanted to replace eForm with this.
- To allow for a more customized rendition of the recaptcha image, additional
field subsitutions would need to be made, along the lines of the current manner
in which "[+captcha_html+]" is inserted into the form. See lines 710-724. However,
I have not actually tried doing this.
- Not certain what if anything needs to be changed on lines 850-859 and line 998
- When using the default Captcha I did get an "already submitted" message once. But
I wasn’t able to reproduce the error, so I don’t know what happened there.
- I’ve put up a demo at
http://www.considine.net/recaptcha/
No emails will actually get sent from the form, but you should be able to test out
the logic of various types of entries.
]]>
mconsidine Nov 10, 2009, 12:28 PM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269336
<![CDATA[Re: &lt;SOLVED&gt; Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269335
I recall seeing a reference to this issue somewhere (not relative to MODx, I think) and will need to go track that down. Hopefully the issue is resolved.

Working on the documentation/tutorial now, using as a base the updated eForm code you pointed to above.

Matt]]>
mconsidine Nov 10, 2009, 10:39 AM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269335
<![CDATA[Re: &lt;SOLVED&gt; Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269334
Cheers for the quick answer.

Look forward to the end version with documentation or a small tutorial laugh

Cheers for the good work]]>
iusemodx Nov 10, 2009, 10:04 AM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=5#dis-post-269334
<![CDATA[Re: &lt;SOLVED&gt; Integration of ReCaptcha into Eform]]> https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=4#dis-post-269333
I think it’s clear I should take the snippet text I posted and replace it with specific instructions on where to make changes in the eForm snippet as well as the file it requires (eform.inc.php). FWIW, I think the only change to the eForm snippet was in the location of my edited version of eform.inc.php, as well as to the name of the function (i.e. I changed "eForm" to "recapeForm" so I didn’t trip myself up somewhere). In short, the real edits took place in eform.inc.php and it might be easier if I just posted a note on what I added and what I commented out (I didn’t actually delete anything ...)

I believe that with the addition of another parameter (such as "&recaptcha=`1`") that this could live alongside the existing Captcha code. I haven’t tried that integration yet, but I will.

The version of eForm that I edited was the one which came with my 1.0.2 install, I think. So if there’s a newer version, I was unaware of it. I’ll take a look at the link you provided.

Finally, you didn’t ask the question, but I’ve been wondering how easy it would be to take this approach and integrate it with SPForm. A brief glance through that code did not suggest to me an obvious route to take.

When I have some progress on the items above, I’ll post it.
Matt
]]>
mconsidine Nov 10, 2009, 09:55 AM https://forums.modx.com/thread/46545/integration-of-recaptcha-into-eform?page=4#dis-post-269333