Adding support for Re-Captcha

by Noe Nieto last modified Feb 03, 2010 03:59 PM
PloneFormGen has built-in support for Re-Captcha. This little howto-tells you how to enable it.

PloneFormGen and Captcha Fields

From the README_CAPTCHA.txt available on the Products.PloneFormGen package:

When PFG is installed in a Plone instance via add/remove products, it will look for evidence that either collective.captcha or collective.recaptcha are available. If that's found, the Captcha Field will be added to the available field list.

If you are using collective.recaptcha, you need to take the additional step of setting your public/private keypair. You get these by setting up an account at recaptcha.net. The account is free. You may specify your keypair in the PFG configlet in your site settings.

If you add a captcha facility *after* installing PFG, you will need to reinstall PFG (via add/remove products) to enable captcha support.

Installing collective.recaptcha

 
  • Add the following code to your buildout.cfg to install collective.recaptcha and Products.PloneformGen together.
[buildout]
...
eggs =
    ...
    collective.recaptcha
    Products.PloneFormGen
    ...

[instance]

zcml =
    ...
    collective.recaptcha
    Products.PloneFormGen
    ...
  • Re-run bin/buildout and relaunch your zope/plone instance.
  • Open the PortalQuickinstaller or plone control panel and install (or reinstall if already) PloneFornGen.
  • Open the PloneFormGen configlet in the Plone control Panel and fill in the fields with your Public and Private Keys of your ReCaptcha Account.

And that's it!! You are now set to use PFG and Recaptcha in your forms.