/usr/share/php/Text/CAPTCHA/Driver/Base.php is in php-text-captcha 1.0.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | <?php
/**
* Base class file for all Text_CAPTCHA drivers.
*
* PHP version 5
*
* @category Text
* @package Text_CAPTCHA
* @author Michael Cramer <michael@bigmichi1.de>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @link http://pear.php.net/package/Text_CAPTCHA
*/
require_once 'Text/CAPTCHA/Driver.php';
/**
* Base class file for all Text_CAPTCHA drivers.
*
* @category Text
* @package Text_CAPTCHA
* @author Michael Cramer <michael@bigmichi1.de>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @link http://pear.php.net/package/Text_CAPTCHA
*/
abstract class Text_CAPTCHA_Driver_Base implements Text_CAPTCHA_Driver
{
/**
* Captcha
*
* @var object|string
*/
private $_captcha;
/**
* Phrase
*
* @var string
*/
private $_phrase;
/**
* Sets secret CAPTCHA phrase.
* This method sets the CAPTCHA phrase (use null for a random phrase)
*
* @param string $phrase The (new) phrase
*
* @return void
*/
public final function setPhrase($phrase)
{
$this->_phrase = $phrase;
}
/**
* Return secret CAPTCHA phrase
* This method returns the CAPTCHA phrase
*
* @return string secret phrase
*/
public final function getPhrase()
{
return $this->_phrase;
}
/**
* Sets the generated captcha.
*
* @param object|string $captcha the generated captcha
*
* @return void
*/
protected final function setCaptcha($captcha)
{
$this->_captcha = $captcha;
}
/**
* Place holder for the real getCAPTCHA() method
* used by extended classes to return the generated CAPTCHA
* (as an image resource, as an ASCII text, ...)
*
* @return string|object
*/
public final function getCAPTCHA()
{
return $this->_captcha;
}
/**
* Reset the phrase and the CAPTCHA.
*
* @return void
*/
public function resetDriver()
{
$this->setPhrase(null);
$this->setCaptcha(null);
}
}
|