Captcha/Word.php
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.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Captcha
- Subpackage
- Adapter
\Zend_Captcha_Word
Package: Zend_Captcha\Adapter

















Word-based captcha adapter
Generates random word which user should recognise
- Parent(s)
- \Zend_Captcha_Base < \Zend_Validate_Abstract
- Children
- \Zend_Captcha_Figlet
- \Zend_Captcha_Image
- \Zend_Captcha_Dumb
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id$
Constants
Properties


$C = array("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z")
static
Default value
array("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z")
Details- Type
- n/a


$CN = array("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z", "2", "3", "4", "5", "6", "7", "8", "9")
static
Default value
array("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z", "2", "3", "4", "5", "6", "7", "8", "9")
Details- Type
- n/a


$V = array("a", "e", "i", "o", "u", "y")
static
Default value
array("a", "e", "i", "o", "u", "y")
Details- Type
- n/a


$VN = array("a", "e", "i", "o", "u", "y", "2", "3", "4", "5", "6", "7", "8", "9")
static
Default value
array("a", "e", "i", "o", "u", "y", "2", "3", "4", "5", "6", "7", "8", "9")
Details- Type
- n/a


boolean $_keepSession = false
Should generate() keep session or create a new one?
Default value
false
Details- Type
- boolean


array $_messageTemplates = array(self::MISSING_VALUE => 'Empty captcha value', self::MISSING_ID => 'Captcha ID field is missing', self::BAD_CAPTCHA => 'Captcha value is wrong')
Error messages
Default value
array(self::MISSING_VALUE => 'Empty captcha value', self::MISSING_ID => 'Captcha ID field is missing', self::BAD_CAPTCHA => 'Captcha value is wrong')
Details- Type
- array


string $_sessionClass = 'Zend_Session_Namespace'
Class name for sessions
Default value
'Zend_Session_Namespace'
Details- Type
- string


boolean $_useNumbers = true
Should the numbers be used or only letters
Default value
true
Details- Type
- boolean
Methods


_setId(string $id) : void
Set captcha identifier
Parameters
Name | Type | Description |
---|---|---|
$id | string | return Zend_Captcha_Word |


_setWord(string $word) : \Zend_Captcha_Word
Set captcha word
Parameters
Returns
Name | Type | Description |
---|---|---|
$word | string |
Type | Description |
---|---|
\Zend_Captcha_Word |


getSession() : \Zend_Session_Namespace
Get session object
Returns
Type | Description |
---|---|
\Zend_Session_Namespace |


getWordlen() : integer
Retrieve word length to use when genrating captcha
Returns
Type | Description |
---|---|
integer |


setKeepSession(bool $keepSession) : \Zend_Captcha_Word
Sets if session should be preserved on generate()
Parameters
Returns
Name | Type | Description |
---|---|---|
$keepSession | bool | Should session be kept on generate()? |
Type | Description |
---|---|
\Zend_Captcha_Word |


setSession(\Zend_Session_Namespace $session) : \Zend_Captcha_Word
Set session namespace object
Parameters
Returns
Name | Type | Description |
---|---|---|
$session | \Zend_Session_Namespace |
Type | Description |
---|---|
\Zend_Captcha_Word |


setSessionClass(string $_sessionClass) : \Zend_Captcha_Word
Set session class for persistence
Parameters
Returns
Name | Type | Description |
---|---|---|
$_sessionClass | string |
Type | Description |
---|---|
\Zend_Captcha_Word |


setTimeout(int $ttl) : \Zend_Captcha_Word
Set timeout for session token
Parameters
Returns
Name | Type | Description |
---|---|---|
$ttl | int |
Type | Description |
---|---|
\Zend_Captcha_Word |


setUseNumbers(bool $_useNumbers) : \Zend_Captcha_Word
Set if numbers should be included in the pattern
Parameters
Returns
Name | Type | Description |
---|---|---|
$_useNumbers | bool | numbers should be included in the pattern? |
Type | Description |
---|---|
\Zend_Captcha_Word |


setWordlen(integer $wordlen) : \Zend_Captcha_Word
Set word length of captcha
Parameters
Returns
Name | Type | Description |
---|---|---|
$wordlen | integer |
Type | Description |
---|---|
\Zend_Captcha_Word |