Gallery2:Modules:recaptcha - Gallery Codex
Personal tools


From Gallery Codex


Stop Spam,

Read Books


This module is an alternative for the default captcha component.

ReCaptcha G2 module uses the reCAPTCHA API for Carnegie Mellon University.

the current v0.4 is a beta !


Protect your gallery for spam comment

and brute force attack on your login.


  • Download the module from:
  • Install it by
    • creating a directory called "recaptcha" under gallery/modules/
    • unzipping the contents of into that directory
  • Create your ReCAPTCHA key
  • Activate the module on your Gallery website under "Site Admin" -> "Plugins"
  • Configure the module by entering in the public and private key that you obtained when you created your ReCAPTCHA key.
  • If you have the "Captcha" plugin already installed and activated, deactivate it to avoid having both Captcha and ReCaptcha running at the same time.

if your gallery has multiple domain names, activate the plugins through each of them.


  • v0.3, initial release
  • v0.4, this version can manage a gallery with multiple domain name & bugs fix

Requested Features for Next Version

Other Requests


v0.4 Version 0.4 contains a couple of minor bugs which results in PHP notices filling the apache error log. The notices look like this :

[Sun Jun 01 17:04:40 2008] [error] [client] PHP Notice:  Use of undefined constant recaptcha - assumed 'recaptcha' in /var/www/html/gallery/modules/recaptcha/classes/ on line 75
[Sun Jun 01 17:04:40 2008] [error] [client] PHP Notice:  Undefined variable: error in /var/www/html/gallery/modules/recaptcha/classes/ on line 75

This is caused by an old array syntax which you can read about here : [1] and an undefined "$error" array.

Here is a patch that fixes these bugs :

<                               #$form[recaptcha-error] = $resp-> error;
>                               #$form['recaptcha-error'] = $resp-> error;
>                 $error = array();
<                       $form[recaptcha]=recaptcha_get_html($publickey, $error);
>                       $form['recaptcha']=recaptcha_get_html($publickey, $error);