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.
CSRF form protection
mixed $_hash = ''Actual hash used.
Detailsstring $_salt = 'salt'Salt for CSRF token
DetailsZend_Session_Namespace $_session = ''
Detailsint $_timeout = '300'TTL for CSRF token
Detailsstring $helper = 'formHidden'Use formHidden view helper by default
Details__construct(
string|array|Zend_Config $spec, array|Zend_Config $options
=
null
)
:
voidConstructor
Creates session namespace for CSRF token, and adds validator for CSRF token.
Details_generateHash(
)
:
voidGenerate CSRF token
Generates CSRF token and stores both in {@link $_hash} and element value.
DetailsgetHash(
)
:
stringRetrieve CSRF token
If no CSRF token currently exists, generates one.
DetailsgetLabel(
)
:
nullOverride getLabel() to always be empty
DetailsgetSalt(
)
:
stringRetrieve salt for CSRF token
DetailsgetSession(
)
:
Zend_Session_NamespaceGet session object
Instantiate session object if none currently exists
DetailsgetSessionName(
)
:
stringGet session namespace for CSRF token
Generates a session namespace based on salt, element name, and class.
DetailsgetTimeout(
)
:
intGet CSRF session token timeout
DetailsinitCsrfToken(
)
:
voidInitialize CSRF token in session
DetailsinitCsrfValidator(
)
:
Zend_Form_Element_HashInitialize CSRF validator
Creates Session namespace, and initializes CSRF token in session. Additionally, adds validator for validating CSRF token.
Detailsrender(
Zend_View_Interface $view
=
null
)
:
stringRender CSRF token in form
DetailssetSalt(
string $salt
)
:
Zend_Form_Element_HashSalt for CSRF token
DetailssetSession(
Zend_Session_Namespace $session
)
:
Zend_Form_Element_HashSet session object
DetailssetTimeout(
int $ttl
)
:
Zend_Form_Element_HashSet timeout for CSRF session token
Details