Equation.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3. /**
  4. * Element for HTML_QuickForm to display a CAPTCHA equation
  5. *
  6. * The HTML_QuickForm_CAPTCHA package adds an element to the
  7. * HTML_QuickForm package to display a CAPTCHA equation.
  8. *
  9. * This package requires the use of a PHP session.
  10. *
  11. * PHP versions 4 and 5
  12. *
  13. * @category HTML
  14. * @package HTML_QuickForm_CAPTCHA
  15. * @author Philippe Jausions <Philippe.Jausions@11abacus.com>
  16. * @copyright 2006-2008 by Philippe Jausions / 11abacus
  17. * @license http://www.opensource.org/licenses/bsd-license.php New BSD
  18. * @version CVS: $Id: Equation.php,v 1.1 2008/04/26 23:27:30 jausions Exp $
  19. * @link http://pear.php.net/package/HTML_QuickForm_CAPTCHA
  20. */
  21. /**
  22. * Element for HTML_QuickForm to display a CAPTCHA equation question
  23. *
  24. * The HTML_QuickForm_CAPTCHA package adds an element to the
  25. * HTML_QuickForm package to display a CAPTCHA equation question.
  26. *
  27. * Options for the element
  28. * <ul>
  29. * <li>'min' (integer) Minimal number to use in an equation.</li>
  30. * <li>'max' (integer) Maximal number to use in an equation.</li>
  31. * <li>'severity' (integer) Complexity of the equation to resolve
  32. * (1 = easy, 2 = harder)</li>
  33. * <li>'numbersToText' (boolean) Whether to use the Numbers_Words
  34. * package to convert numbers to text,</li>
  35. * <li>'sessionVar' (string) name of session variable containing
  36. * the Text_CAPTCHA instance (defaults to
  37. * _HTML_QuickForm_CAPTCHA.)</li>
  38. * </ul>
  39. *
  40. * This package requires the use of a PHP session.
  41. *
  42. * @category HTML
  43. * @package HTML_QuickForm_CAPTCHA
  44. * @author Philippe Jausions <Philippe.Jausions@11abacus.com>
  45. * @copyright 2006-2008 by Philippe Jausions / 11abacus
  46. * @license http://www.opensource.org/licenses/bsd-license.php New BSD
  47. * @version Release: 0.3.0
  48. * @link http://pear.php.net/package/HTML_QuickForm_CAPTCHA
  49. * @see Text_CAPTCHA_Driver_Equation
  50. */
  51. class HTML_QuickForm_CAPTCHA_Equation extends HTML_QuickForm_CAPTCHA
  52. {
  53. /**
  54. * Default options
  55. *
  56. * @var array
  57. * @access protected
  58. */
  59. var $_options = array(
  60. 'sessionVar' => '_HTML_QuickForm_CAPTCHA',
  61. 'severity' => 1,
  62. 'numbersToText' => false,
  63. 'phrase' => null,
  64. );
  65. /**
  66. * CAPTCHA driver
  67. *
  68. * @var string
  69. * @access protected
  70. */
  71. var $_CAPTCHA_driver = 'Equation';
  72. }