Captcha/Word.php

Show: PublicProtectedPrivateinherited
Table of Contents
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

>VConstant  MISSING_VALUE = 'missingValue'
>VConstant  MISSING_ID = 'missingID'
>VConstant  BAD_CAPTCHA = 'badCaptcha'

Properties

>VPropertypublic$C = array("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z")
static
Default valuearray("b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z")Details
Type
n/a
>VPropertypublic$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 valuearray("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
>VPropertypublic$V = array("a", "e", "i", "o", "u", "y")
static
Default valuearray("a", "e", "i", "o", "u", "y")Details
Type
n/a
>VPropertypublic$VN = array("a", "e", "i", "o", "u", "y", "2", "3", "4", "5", "6", "7", "8", "9")
static
Default valuearray("a", "e", "i", "o", "u", "y", "2", "3", "4", "5", "6", "7", "8", "9")Details
Type
n/a
>VPropertyprotectedstring $_id
Random session ID
Details
Type
string
>VPropertyprotectedboolean $_keepSession = false
Should generate() keep session or create a new one?
Default valuefalseDetails
Type
boolean
>VPropertyprotectedarray $_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 valuearray(self::MISSING_VALUE => 'Empty captcha value', self::MISSING_ID => 'Captcha ID field is missing', self::BAD_CAPTCHA => 'Captcha value is wrong')Details
Type
array
>VPropertyprotected\Zend_Session_Namespace $_session
Session
>VPropertyprotectedstring $_sessionClass = 'Zend_Session_Namespace'
Class name for sessions
Default value'Zend_Session_Namespace'Details
Type
string
>VPropertyprotectedinteger $_timeout = 300
Session lifetime for the captcha data
Default value300Details
Type
integer
>VPropertyprotectedboolean $_useNumbers = true
Should the numbers be used or only letters
Default valuetrueDetails
Type
boolean
>VPropertyprotectedstring $_word
Generated word
Details
Type
string
>VPropertyprotectedinteger $_wordlen = 8
Length of the word to generate
Default value8Details
Type
integer

Methods

methodprotected_generateRandomId() : void

methodprotected_generateWord() : string

Generate new random word

Returns
TypeDescription
string
methodprotected_setId(string $id) : void

Set captcha identifier

Parameters
NameTypeDescription
$idstring

return Zend_Captcha_Word

methodprotected_setWord(string $word) : \Zend_Captcha_Word

Set captcha word

Parameters
NameTypeDescription
$wordstring
Returns
TypeDescription
\Zend_Captcha_Word
methodpublicgenerate() : string

Generate new session ID and new word

Returns
TypeDescription
stringsession ID
methodpublicgetDecorator() : string

Get captcha decorator

Returns
TypeDescription
string
methodpublicgetId() : string

Retrieve captcha ID

Returns
TypeDescription
string
methodpublicgetSession() : \Zend_Session_Namespace

Get session object

Returns
TypeDescription
\Zend_Session_Namespace
methodpublicgetSessionClass() : string

Retrieve session class to utilize

Returns
TypeDescription
string
methodpublicgetTimeout() : int

Get session token timeout

Returns
TypeDescription
int
methodpublicgetUseNumbers() : bool

Numbers should be included in the pattern?

Returns
TypeDescription
bool
methodpublicgetWord() : string

Get captcha word

Returns
TypeDescription
string
methodpublicgetWordlen() : integer

Retrieve word length to use when genrating captcha

Returns
TypeDescription
integer
methodpublicisValid(mixed $value,  $context = null) : boolean

Validate the word

Parameters
NameTypeDescription
$valuemixed
$context
Returns
TypeDescription
boolean
Details
See
 
methodpublicsetKeepSession(bool $keepSession) : \Zend_Captcha_Word

Sets if session should be preserved on generate()

Parameters
NameTypeDescription
$keepSessionbool

Should session be kept on generate()?

Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetSession(\Zend_Session_Namespace $session) : \Zend_Captcha_Word

Set session namespace object

Parameters
NameTypeDescription
$session\Zend_Session_Namespace
Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetSessionClass(string $_sessionClass) : \Zend_Captcha_Word

Set session class for persistence

Parameters
NameTypeDescription
$_sessionClassstring
Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetTimeout(int $ttl) : \Zend_Captcha_Word

Set timeout for session token

Parameters
NameTypeDescription
$ttlint
Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetUseNumbers(bool $_useNumbers) : \Zend_Captcha_Word

Set if numbers should be included in the pattern

Parameters
NameTypeDescription
$_useNumbersbool

numbers should be included in the pattern?

Returns
TypeDescription
\Zend_Captcha_Word
methodpublicsetWordlen(integer $wordlen) : \Zend_Captcha_Word

Set word length of captcha

Parameters
NameTypeDescription
$wordleninteger
Returns
TypeDescription
\Zend_Captcha_Word
Documentation was generated by phpDocumentor 2.2.0 .