| 1 |
<?php |
<?php |
| 2 |
/* $Id: recaptcha.module,v 1.13.2.4.2.14 2008/01/26 17:30:03 robloach Exp $ */ |
/* $Id: recaptcha.module,v 1.13.2.4.2.15 2009/02/02 22:41:58 robloach Exp $ */ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
/** |
/** |
| 10 |
* Display help and module information |
* Implementation of hook_help(). |
|
* @param section which section of the site we're displaying help |
|
|
* @return help text for section |
|
| 11 |
*/ |
*/ |
| 12 |
function recaptcha_help($section = '') { |
function recaptcha_help($section = '') { |
| 13 |
$output = ''; |
$output = ''; |
| 30 |
break; |
break; |
| 31 |
} |
} |
| 32 |
return $output; |
return $output; |
| 33 |
} // function recaptcha_help |
} |
| 34 |
|
|
| 35 |
/** |
/** |
| 36 |
* Implementation of hook_menu(). |
* Implementation of hook_menu(). |
| 49 |
); |
); |
| 50 |
} |
} |
| 51 |
return $items; |
return $items; |
| 52 |
} // function recaptcha_menu |
} |
| 53 |
|
|
| 54 |
/** |
/** |
| 55 |
* Valid permissions for this module |
* Valid permissions for this module |
| 56 |
* @return array An array of valid permissions for the onthisdate module |
* |
| 57 |
|
* @return |
| 58 |
|
* An array of valid permissions for the onthisdate module |
| 59 |
*/ |
*/ |
| 60 |
function recaptcha_perm() { |
function recaptcha_perm() { |
| 61 |
return array('administer recaptcha'); |
return array('administer recaptcha'); |
| 62 |
} // function recaptcha_perm() |
} |
| 63 |
|
|
| 64 |
/** |
/** |
| 65 |
* Implementation of admin settings(). |
* Implementation of admin settings(). |
| 119 |
); |
); |
| 120 |
|
|
| 121 |
return system_settings_form($form); |
return system_settings_form($form); |
| 122 |
} // function recaptcha_admin_settings |
} |
| 123 |
|
|
| 124 |
/** |
/** |
| 125 |
* The validation on the reCAPTCHA administration settings |
* The validation on the reCAPTCHA administration settings |
| 155 |
return captcha_captcha('generate', 'Math', $args); |
return captcha_captcha('generate', 'Math', $args); |
| 156 |
} |
} |
| 157 |
fclose($connect); // close connection |
fclose($connect); // close connection |
| 158 |
|
|
| 159 |
// Retrieve configuration variables from database |
// Retrieve configuration variables from database |
| 160 |
$recaptcha_secure_connection = variable_get('recaptcha_secure_connection', FALSE); |
$recaptcha_secure_connection = variable_get('recaptcha_secure_connection', FALSE); |
| 161 |
$recaptcha_theme = variable_get('recaptcha_theme', 'red'); |
$recaptcha_theme = variable_get('recaptcha_theme', 'red'); |
| 197 |
); |
); |
| 198 |
} |
} |
| 199 |
return $result; |
return $result; |
| 200 |
|
|
| 201 |
case 'preprocess': |
case 'preprocess': |
| 202 |
require_once('recaptcha.inc'); |
require_once('recaptcha.inc'); |
| 203 |
@(include_once('recaptcha/recaptchalib.php')) or _recaptcha_library_not_found(); |
@(include_once('recaptcha/recaptchalib.php')) or _recaptcha_library_not_found(); |
| 215 |
} |
} |
| 216 |
break; |
break; |
| 217 |
} |
} |
| 218 |
} // function recaptcha_captcha |
} |
| 219 |
|
|
| 220 |
/** |
/** |
| 221 |
* Creates the custom themed recaptcha widget |
* Creates the custom themed recaptcha widget |
| 222 |
*/ |
*/ |
| 223 |
function theme_recaptcha_custom_widget() { |
function theme_recaptcha_custom_widget() { |
| 224 |
$recaptcha_only_if_incorrect_sol = t('Incorrect please try again'); |
$recaptcha_only_if_incorrect_sol = t('Incorrect please try again'); |
| 225 |
$recaptcha_only_if_image_enter = t('Enter the words above:'); |
$recaptcha_only_if_image_enter = t('Enter the words above:'); |