Path

ez.no / developer / contribs / applications / recaptcha (ez4)


reCAPTCHA (ez4)

Author Version Downloads Compatible with
Bruce Morrison 1.2 1915 4.0.0
reCAPTCHA is an extension that allows the integration of the reCAPTCHA anti-spam CAPTCHA service in your eZ publish content objects. reCAPTCHA provides a reCAPTCHA datatype that can be used in editing content and information collection. reCAPTCHA provides both text and audio CAPTCHAs.

Note: A ez3 compatible version can be found here: http://ez.no/developer/contribs/applications/recaptcha_ez3

Description

About reCAPTCHA
==================
Over 60 million CAPTCHAs are solved every day by people around the world.
reCAPTCHA channels this human effort into helping to digitize books from the
Internet Archive. When you solve a reCAPTCHA, you help preserve literature by
deciphering a word that was not readable by computers.

reCAPTCHA is a project of the School of Computer Science at Carnegie Mellon
University.

From: http://recaptcha.net/aboutus.html

Installation
==================
Follow these steps to add the reCAPTCHA module to your eZ publish installation:

1) Extract the archive into the /extension directory

2) Edit site.ini.append in /settings/override. Add the following to the file:

[ExtensionSettings]
ActiveExtensions[]=recaptcha

If you already have the [ExtensionSettings] block, just add the second line.

3) Visit http://recaptcha.net/api/getkey to signup and get your own API keys

4) Edit extension/settings/recaptcha.ini.append.php and add your API keys

5) Clear Cache

Usage
==================
To use, simply add a reCAPTCHA attribute to your content class.

License
==================
This file may be distributed and/or modified under the terms of the "GNU
General Public License" version 2 as published by the Free Software Foundation

This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

The "GNU General Public License" (GPL) is available at
http://www.gnu.org/copyleft/gpl.html.

Screenshot

Using reCAPTCHA as a information collector
Using reCAPTCHA as a information collector

Changelog

# v1.0 4 Jan 2008
Initial version

#v1.1 29 Jan 2008
+ added ability to have different keys per domain
+ added ability to set permissions to bypass captcha

#v1.2 15 Dec 2008
+ fixed JS issues reported in IE7 by Łukasz Serwatka @
http://projects.ez.no/recaptcha/forum/general/js_issue_with_ie7

Comments

Instalation reCAPTCHA for begginer

I've installed reCAPTCHA doing 5 steps described above, added reCAPTCHA attribute to comment class, then added
{attribute_edit_gui attribute=$object.data_map.recaptcha} 
to comment.tpl.

When I try to add a comment, I see reCAPTCHA box, but independly what is written into this box, the comment is added. Could someone provide me sample of comment.tpl, or solution what to do to make it go?

Thanks and clarifications

Thanks for an extremely useful plugin. A couple of clarifications:

- It may be obvious to some, but to validate input you need to mark the reCAPTCHA attribute as an information collector.
-For the template operator to work, you will have to type {"anything"|recaptcha_get_html}; a simple {recaptcha_get_html} won't work, because it is registered as a template operator, not as a template function.

Comment captcha

I've just installed this extension. Like Canoli Dubs i wanted to use it for comments.

This can be done by making an override for comment.tpl in yoursiteAccss/override/templates/edit/comment.tpl (copy the original from base/override/templates/edit/comment.tpl)

Add to this template the line:
{attribute_edit_gui attribute=$object.data_map.recaptcha}

It doesn't work directly as described, because the comment.tpl only shows specific attributes and not all attributes from the comment class.

Selected theme won't display under IE

Hi ! Great contribution. I've tried it for the first time and everything works great except when testing it under IE7: the selected theme won't display (and IE7 raises a JS error).

I found what's wrong in this javascript piece of code:



var RecaptchaOptions = {


theme: RecaptchaTheme,


lang: RecaptchaLang,


};



The "lang" end of line extra comma raises a javascript error.

Just remove it in the extensions design files:
- content/datatype/collect/recaptcha.tpl
- content/datatype/edit/recaptcha.tpl

and everything works fine now.

@Bruce

The instance isn't on the Web yet.

The only changes made after unzipping into extensions were setting PrivateKey and PublicKey in recaptcha.ini.append.php as well as adding the extension reference to site.ini.append.php.

Most of the site (including the template for the form) is held in another extension. Could this be the problem?

Comment captcha

I was hoping to install this extension for use with comments.

This way a member would have to fill out a reCaptcha image in order for their comment to be processed. I've added the attribute to the 'User' class...and when a new user is created the Captcha image appears perfectly and works.

However, I add the attribute to my custom 'Comment' class the same exact way, but the reCaptcha does not even show at all.

Anyone know why this may be? Do I have to change something in the code perhaps? Thanks.

@Josh

Is your install on the net? Can you provide a link?

Cheers
Bruce

Captcha Verification Error

The ReCaptcha field is rendering correctly and responds to new word refreshes, but I'm getting this error back every time:
Missing or invalid input
- Verification: The reCAPTCHA wasn't entered correctly. Please try again.

Attribute:
- name: Verification
- identifier: verification
- type: reCAPTCHA
- required: Yes
- searchable: No
- collects information: Yes
- translation: No

Any ideas? I dug into the code and it looks like this response is coming directly from their API.

@Mickael

Hi Mickael

I've had a quick review of the tipafriend.php module view and unlike may of the other eZ components it's not extendible. A qiuck n dirty way to add a CAPTCHA is to modify the tipafriend.php as you suggested.

Cheers
Bruce

how to use with "tip a friend" function?

Hi all,

and thanks to Bruce for this useful contrib'.

I implemented it very simply for the "feedback form" content class, but I don't know how to use it with the "Tipafriend" function...

Could it work with an override of tipafriend.tpl ? Or is it necessary to modifiy tipafriend.php in the kernel (which is not recommended...)???

A solution would be great to enable this viral function for anonymous user while preventing spam...

So thanks in advance for your help :-)

MikRob

@Bruce

Hi Bruce,

thanks for the enhancement.

The site is a project of Patrick Kaiser from iolab Munich running under http://www.vierundzwanzig.de

reCAPTCHA will be used for anonymous comments and new glossary entry's.

New version 1.1

Hi Norman

Thanks to Andrés excellent suggestion I've just released version 1.1 that allows you to set a assign a bypass_recaptcha policy via the roles system.

As a side effect the admin user (with the default role of access to everything) never has to fill out the captcha.

Cheers
Bruce

@Bruce

You should use the access system, a simple

$FunctionList['bypass_captcha'] = array();

would do, then all you need to do is check this access in your data type.
More advance access setup including adding class / section / node / subtree limitations, can be found in kernel/content/module.php.

@Norman

Hi Norman

Thanks for the feedback. If you are able can you post the URL of the site using the extension? Actually anyone using the extension please post the sites.

I had thought of adding the enhancement functionality and I guess there are a couple of ways to do it.
1) Adding ini file settings - they would be global but pretty easy to implement
2) Adding an interface to the the datatype class edit view so the users and or groups can be chosen per content class - a bit of work to implement but could be interesting

I might have a look at adding option 1 in the coming days.

It's better for the reCAPTCHA project that more are actually filled in - that way there are more words digitalised...I wonder what happens when they run out of words! :)

Cheers
Bruce

Great contribution

Great contribution Bruce.

Just installed it on 4.0.0 installation within a few minutes.
Everything works fine.

Just one enhancement:
Extending the validation process so that it possible to bypass reCAPTURE
for specified, trusted user groups like 'administators'.

@sunny

Hi,

I have doubts that many can help you here with ASP .NET related questions. We are more or less PHP only here on ez.no

ReCaptcha with ASP.NET

Hi ,

Can you please help me regarding adding captcha control to asp.net create user wizard , i have posted detail info on Captcha forum . http://groups.google.com/group/re...rowse_thread/thread/2703cffe98d720e7

Thanks in advance,

Many Regards,
-Sunny.

log in or create a user account to comment.

Contribution info (stable)

Download