Development

sfReCaptchaPlugin

You must first sign up to be able to contribute.

sfReCaptcha plugin

The reCAPTCHA project takes unOCRable bits of text and uses people to decipher them via CAPTCHA tests. Answers are verified by juxtaposing deciphered texts with the undeciphered. By implimenting reCAPTCHA you are helping digitize books.

The sfReCaptcha plugin integrates the reCAPTCHA service in symfony. It comes with a custom validator as well as an example module which demonstrates the usage.

For more information on reCAPTCHA visit recaptcha.net.

Installation

To install the plugin, navigate to your symfony project root and run:

  symfony plugin-install http://plugins.symfony-project.com/sfReCaptchaPlugin

In order to use the reCAPTCHA or Mailhide service, you first need to sign up and get an API key.
You can do this here for reCAPTCHA and here for Mailhide.

Note: If you're using a name-based virtual host like http://askeet, the API key registration will fail because the reCAPTCHA service doesn't identify your ServerName as a valid URI. To handle this, simply append a .tld to your ServerName variable (e.g. ServerName askeet.org).

Insert your API keys in your applications app.yml:

  all:
    recaptcha:
      publickey: "foo"
      privatekey: "bar"
    mailhide:
      publickey: "foo"
      privatekey: "bar"

Example

You need to enable the recaptcha module in your applications settings.yml:

  all:
    .settings:
      enabled_modules:        [default, recaptcha]

and clear your cache afterwards:

  symfony cc

For the reCAPTCHA example, navigate to:

  http://foobar.com/frontend_dev.php/recaptcha

or to the following URI, to use the Mailhide example:

  http://foobar.com/frontend_dev.php/recaptcha/mailhide

Changelog

  • 1.0.4
    • Load the reCAPTCHA library in a helper rather than in the action
  • 1.0.3
    • Updated the recaptcha-php-library to version 1.10
    • README now points to this wiki-page
  • 1.0.2
    • Updated the recaptcha-php-library to version 1.9
    • Cleaned up the example indexSuccess action (Now doesn't throw an error if no text was entered, thanks flod)
    • Small updates to the README file
  • 1.0.1
    • Updated the recaptcha-php-library to version 1.8

Active tickets

#3372
sfReCaptchaPlugin - improved error messages
#3550
Add possibility to change theme to reCaptcha-plugin

Attachments