$_params
$_params : array
Hash of parameters necessary to use the chosen backend.
The Horde_Token_Base:: class provides a common abstracted interface for a token implementation.
Copyright 2010-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
__construct(array $params)
Constructor.
array | $params | Required parameters:
|
verify(string $token) : boolean
Checks if the given token has been previously used. First purges all expired tokens. Then retrieves current tokens for the given ip address. If the specified token was not found, adds it.
string | $token | The value of the token to check. |
True if the token has not been used, false otherwise.
isValid(string $token, string $seed = '', integer $timeout = null, boolean $unique = false) : boolean
Validate a signed token.
string | $token | The signed token. |
string | $seed | The unique ID of the token. |
integer | $timeout | Timout of the token in seconds. Values below zero represent no timeout. |
boolean | $unique | Should validation of the token succeed only once? |
True if the token was valid.
validate(string $token, string $seed = '', integer $timeout = null) : array
Is the given token still valid? Throws an exception in case it is not.
string | $token | The signed token. |
string | $seed | The unique ID of the token. |
integer | $timeout | Timout of the token in seconds. Values below zero represent no timeout. |
If the token was invalid.
An array of two elements: The nonce and the hash.
validateUnique(string $token, string $seed = '') : NULL
Is the given token valid and has never been used before? Throws an exception otherwise.
string | $token | The signed token. |
string | $seed | The unique ID of the token. |
If the token was invalid or has been used before.