ffdn_common.module 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /* *********************************************************************
  3. * DEFINES, INCLUDES & INIT
  4. * ********************************************************************/
  5. define('FFDN_CUSTOM_CAPTCHA', "FFDN Custom CAPTCHA");
  6. /* *********************************************************************
  7. * CAPTCHA
  8. * ********************************************************************/
  9. /**
  10. * Implementation of hook_captcha().
  11. */
  12. function ffdn_common_captcha($op, $captcha_type='') {
  13. switch ($op) {
  14. case 'list':
  15. return array(
  16. FFDN_CUSTOM_CAPTCHA
  17. );
  18. case 'generate':
  19. if ($captcha_type == FFDN_CUSTOM_CAPTCHA) {
  20. $captcha = array();
  21. $captcha['solution'] = 'FFDN';
  22. $captcha['form']['captcha_response'] = array(
  23. '#type' => 'textfield',
  24. '#title' => t("What is the Federation FDN's acronym? (4 letters)"),
  25. '#description' => t("This is a basic anti-spam system ;)"),
  26. '#required' => TRUE,
  27. );
  28. return $captcha;
  29. }
  30. break;
  31. }
  32. }