You are here

function foo_captcha_captcha in CAPTCHA Pack 7

Same name and namespace in other branches
  1. 8 foo_captcha/foo_captcha.module \foo_captcha_captcha()
  2. 5 foo_captcha/foo_captcha.module \foo_captcha_captcha()
  3. 6 foo_captcha/foo_captcha.module \foo_captcha_captcha()

Implements hook_captcha().

File

foo_captcha/foo_captcha.module, line 32

Code

function foo_captcha_captcha($op, $captcha_type = '') {
  switch ($op) {
    case 'list':
      return array(
        'Foo CAPTCHA',
      );
    case 'generate':
      if ($captcha_type == 'Foo CAPTCHA') {
        $captcha = array();
        $captcha['solution'] = 'foo';
        $captcha['form']['captcha_response'] = array(
          '#type' => 'textfield',
          '#title' => t('Enter "foo"'),
          '#required' => TRUE,
          '#process' => array(
            'foo_captcha_process',
          ),
        );
        return $captcha;
      }
      break;
  }
}