Page 1 of 1

reCaptcha

PostPosted: Sat Feb 09, 2008 10:32 am
by Martin Pruss
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:

PostPosted: Sat Feb 09, 2008 3:23 pm
by shannah
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');

PostPosted: Mon Feb 11, 2008 3:37 pm
by Martin Pruss
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

PostPosted: Mon Feb 11, 2008 5:09 pm
by shannah
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.

PostPosted: Mon Feb 11, 2008 8:44 pm
by shannah
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