Commit f1b573c6 authored by Arnab Nandi's avatar Arnab Nandi

*** empty log message ***

parent 3c7df743
......@@ -6,14 +6,16 @@ send an email to [drupal AT arnab DOT org] telling me you're using it.
To Install:
Enable the module, and then go to admin/settings/captcha to enable captchas for various actions.
- Uses GD to draw stuff, emits in PNG
- Captcha for comments is contingent upon a patch(#14708) for now.
Captcha Todo - arnabdotorg
Captcha Todo:
- clean up image generation code.
- add TTF font capability.
- make captcha distortion more spiffy.
Captcha Screenshot
Captcha Demo:
......@@ -74,12 +74,13 @@ function captcha_settings() {
* Implementation of hook_menu(), for adding form elements & validation.
function captcha_user($type, &$edit, &$user, $category = NULL) {
function captcha_user($type, &$edit, &$newuser, $category = NULL) {
global $user;
// What type of registration action are we taking?
//make sure this is a registration, and captcha is enabled for registration
if (_captcha_istrue("captcha_user_register") && !$user->uid)
// make sure this is a registration, and captcha is enabled for registration
if (_captcha_istrue("captcha_user_register") && !$newuser->uid && !$user->uid)
switch ($type) {
case t("register"):
// Add two items to the resigtration form.
......@@ -110,6 +111,7 @@ function captcha_user($type, &$edit, &$user, $category = NULL) {
* NOTE: This will work ONLY if the patch at has been applied. Let's hope the patch makes HEAD!
function captcha_comment($op,$edit) {
global $user;
// check if captcha is enabled for form type
......@@ -138,7 +140,7 @@ function captcha_comment($op,$edit) {
$output .= form_item("", '<img src="'.url('captcha/image/'.time()).'" alt="Captcha Image: you will need to recognize the text in it."/>');
$output .= form_textfield(t('Word'), 'captchaword', NULL, 15, 15, 'Please type in the letters/numbers that are shown in the image above.', NULL, TRUE);
return form_group(t('Verify comment authorship'), $output);
} else return NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment