Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Word-based captcha adapter
Generates random word which user should recognise
MISSING_VALUE = 'missingValue'
MISSING_ID = 'missingID'
BAD_CAPTCHA = 'badCaptcha'
$C = 'array'
$CN = 'array'
$V = 'array'
$VN = 'array'
string $_id = ''
Random session ID
boolean $_keepSession = 'false'
Should generate() keep session or create a new one?
array $_messageTemplates = 'array'
Error messages
Zend_Session_Namespace $_session = ''
Session
string $_sessionClass = 'Zend_Session_Namespace'
Class name for sessions
integer $_timeout = '300'
Session lifetime for the captcha data
boolean $_useNumbers = 'true'
Should the numbers be used or only letters
string $_word = ''
Generated word
integer $_wordlen = '8'
Length of the word to generate
_generateRandomId(
)
:
_generateWord(
)
:
string
Generate new random word
_setId(
string $id
)
:
Set captcha identifier
_setWord(
string $word
)
:
Zend_Captcha_Word
Set captcha word
generate(
)
:
string
Generate new session ID and new word
getDecorator(
)
:
string
Get captcha decorator
getId(
)
:
string
Retrieve captcha ID
getSession(
)
:
Zend_Session_Namespace
Get session object
getSessionClass(
)
:
string
Retrieve session class to utilize
getTimeout(
)
:
int
Get session token timeout
getWord(
)
:
string
Get captcha word
getWordlen(
)
:
integer
Retrieve word length to use when genrating captcha
isValid(
mixed $value, $context
=
null
)
:
boolean
Validate the word
setKeepSession(
$keepSession $keepSession
)
:
Zend_Captcha_Word
Sets if session should be preserved on generate()
setSession(
Zend_Session_Namespace $session
)
:
Zend_Captcha_Word
Set session namespace object
setSessionClass(
string $_sessionClass
)
:
Zend_Captcha_Word
Set session class for persistence
setTimeout(
int $ttl
)
:
Zend_Captcha_Word
Set timeout for session token
setWordlen(
integer $wordlen
)
:
Zend_Captcha_Word
Set word length of captcha