Newer
Older
function foo_captcha_help($path, $arg) {
switch ($path) {
case 'admin/config/people/captcha/foo_captcha':
return '<p>' . t('This is a very simple CAPTCHA, which requires users to enter "foo" in a textfield.') . '</p>';
$items['admin/config/people/captcha/foo_captcha'] = array(
'page callback' => 'drupal_get_form',
'page arguments' => array('foo_captcha_settings_form'),
'access arguments' => array('administer CAPTCHA settings'),
'file' => 'foo_captcha.admin.inc',
function foo_captcha_captcha($op, $captcha_type = '') {
return array('Foo CAPTCHA');
if ($captcha_type == 'Foo CAPTCHA') {
$captcha = array();
$captcha['solution'] = 'foo';
$captcha['form']['captcha_response'] = array(
'#type' => 'textfield',
'#title' => t('Enter "foo"'),
'#process' => array('foo_captcha_process'),
/**
* Process the response to the foo CAPTCHA before validation.
*/
function foo_captcha_process($element, $edit) {
if (variable_get('foo_captcha_ignore_spaces', FALSE)) {
$element['#value'] = preg_replace('/\s*/', '', $element['#value']);