ffdn_common.module 1.1 KB

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