reCaptcha

A place for users and developers of the Xataface to discuss and receive support.

reCaptcha

Postby Martin Pruss » Sat Feb 09, 2008 10:32 am

hi steve
happy new year.. or ist already too late for best wishes like these?
great that you provide svn checkout now...thanks.
Here is my question:
To prevent my public input form from spambot attacks i was thinking about a little turing test. I don't want to reinvent the weel, so i struggled over reCaptcha. http://recaptcha.net/plugins/php/. The funny thing is they use the user input of the validator to read ocr scans.
From their website:
About 60 million CAPTCHAs are solved by humans around the world every day. In each case, roughly ten seconds of human time are being spent. Individually, that's not a lot of time, but in aggregate these little puzzles consume more than 150,000 hours of work each day. What if we could make positive use of this human effort? reCAPTCHA does exactly that by channeling the effort spent solving CAPTCHAs online into "reading" books.

to make a long story short: in their install instructions i found this"extract recaptchalib.php in the directory where you your forms live."

but.. where is this directory in case of dataface? is it the root folder of my app?
cheers
martin :shock:
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby shannah » Sat Feb 09, 2008 3:23 pm

Hi Martin,

Their instruction to place the recaptchalib.php file in the directory where the form lives is relative to their instructions on how to include it:
Code: Select all
require_once('recaptchalib.php');


The 'context' of execution is always in the application directory, so with their instruction you would place it in the same directory as your index.php and conf.ini file. If you were to place it in a subdirectory - say 'include', then you would change their require_once call to:

Code: Select all
require_once('include/recaptchalib.php');
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Martin Pruss » Mon Feb 11, 2008 3:37 pm

hi steve
after 2 days of trying i finally gave it up to implement recaptcha.
their php code has to be inluded between form tags.
the only form tag i could find in dataface was the search form

i now try to make it more difficult for spammers by implementing an email activation.
cheers
martin
Martin Pruss
 
Posts: 61
Joined: Tue Oct 23, 2007 2:22 pm
Location: Berlin

Postby shannah » Mon Feb 11, 2008 5:09 pm

Hi Martin,

Yes. The current release of Dataface (0.7.1) does make it difficult to add arbitrary content in between the form tags of the edit form.

The next release (and the version currently available in SVN) would allow for this quite easily using slots.

e.g. there are blocks corresponding to each field of a form:
{$fieldname}_widget_row
before_{$fieldname}_widget
{$fieldname}_widget
after_{$fieldname}_widget

E.g. if you wanted to add something after the 'firstname' field you would implement
Code: Select all
function block__after_firstname_widget(){
    echo 'some custom content';
}



That recaptcha thing looks pretty cool... would make for an interesting module add-on.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Feb 11, 2008 8:44 pm

Hi Martin,

It's been a while since I've worked with the 0.7.1 codebase so I had to check. The form template for edit forms is handled by the getFormTemplate() method in the Dataface/QuickForm.php file.

You can add things within the
tags by making changes to this method.

Best regards

Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 13 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved