13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Captcha |
16 * @package Zend_Captcha |
17 * @subpackage Adapter |
17 * @subpackage Adapter |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 */ |
20 */ |
21 |
21 |
22 /** @see Zend_Captcha_Word */ |
22 /** @see Zend_Captcha_Word */ |
23 require_once 'Zend/Captcha/Word.php'; |
23 require_once 'Zend/Captcha/Word.php'; |
28 * Note that only rendering is necessary for word-based captcha |
28 * Note that only rendering is necessary for word-based captcha |
29 * |
29 * |
30 * @category Zend |
30 * @category Zend |
31 * @package Zend_Captcha |
31 * @package Zend_Captcha |
32 * @subpackage Adapter |
32 * @subpackage Adapter |
33 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
33 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
34 * @license http://framework.zend.com/license/new-bsd New BSD License |
34 * @license http://framework.zend.com/license/new-bsd New BSD License |
35 * @version $Id: Dumb.php 20096 2010-01-06 02:05:09Z bkarwin $ |
35 * @version $Id: Dumb.php 24747 2012-05-05 00:21:56Z adamlundrigan $ |
36 */ |
36 */ |
37 class Zend_Captcha_Dumb extends Zend_Captcha_Word |
37 class Zend_Captcha_Dumb extends Zend_Captcha_Word |
38 { |
38 { |
|
39 /** |
|
40 * CAPTCHA label |
|
41 * @type string |
|
42 */ |
|
43 protected $_label = 'Please type this word backwards'; |
|
44 |
|
45 /** |
|
46 * Set the label for the CAPTCHA |
|
47 * @param string $label |
|
48 */ |
|
49 public function setLabel($label) |
|
50 { |
|
51 $this->_label = $label; |
|
52 } |
|
53 |
|
54 /** |
|
55 * Retrieve the label for the CAPTCHA |
|
56 * @return string |
|
57 */ |
|
58 public function getLabel() |
|
59 { |
|
60 return $this->_label; |
|
61 } |
39 /** |
62 /** |
40 * Render the captcha |
63 * Render the captcha |
41 * |
64 * |
42 * @param Zend_View_Interface $view |
65 * @param Zend_View_Interface $view |
43 * @param mixed $element |
66 * @param mixed $element |
44 * @return string |
67 * @return string |
45 */ |
68 */ |
46 public function render(Zend_View_Interface $view = null, $element = null) |
69 public function render(Zend_View_Interface $view = null, $element = null) |
47 { |
70 { |
48 return 'Please type this word backwards: <b>' |
71 return $this->getLabel() . ': <b>' |
49 . strrev($this->getWord()) |
72 . strrev($this->getWord()) |
50 . '</b>'; |
73 . '</b>'; |
51 } |
74 } |
52 } |
75 } |