File indexing completed on 2024-05-12 06:02:19

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_Captcha
0017  * @subpackage Adapter
0018  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0019  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0020  */
0021 
0022 /** @see Zend_Captcha_Word */
0023 // require_once 'Zend/Captcha/Word.php';
0024 
0025 /**
0026  * Example dumb word-based captcha
0027  *
0028  * Note that only rendering is necessary for word-based captcha
0029  *
0030  * @category   Zend
0031  * @package    Zend_Captcha
0032  * @subpackage Adapter
0033  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0034  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0035  * @version    $Id$
0036 */
0037 class Zend_Captcha_Dumb extends Zend_Captcha_Word
0038 {
0039     /**
0040      * CAPTCHA label
0041      * @type string
0042      */
0043     protected $_label = 'Please type this word backwards';
0044     
0045     /**
0046      * Set the label for the CAPTCHA
0047      * @param string $label
0048      */
0049     public function setLabel($label)
0050     {
0051         $this->_label = $label;
0052     }
0053     
0054     /**
0055      * Retrieve the label for the CAPTCHA
0056      * @return string
0057      */
0058     public function getLabel()
0059     {
0060         return $this->_label;
0061     }
0062     /**
0063      * Render the captcha
0064      *
0065      * @param  Zend_View_Interface $view
0066      * @param  mixed $element
0067      * @return string
0068      */
0069     public function render(Zend_View_Interface $view = null, $element = null)
0070     {
0071         return $this->getLabel() . ': <b>'
0072              . strrev($this->getWord())
0073              . '</b>';
0074     }
0075 }