static FormLib::clearTokens |
( |
) | |
|
|
static |
Drop all cached tokens
- Returns
- [boolean] true
static FormLib::generateToken |
( |
) | |
|
|
static |
Create a unique token and store it in cache
- Returns
- [string] token
static FormLib::get |
( |
|
$name, |
|
|
|
$default_value = '' |
|
) |
| |
|
static |
Get a form field value
- Parameters
-
$name | [string] field name |
$default_value | [mixed, default empty string] value used if not present in GET or POST |
- Returns
- [mixed] field value
static FormLib::setToken |
( |
|
$token) | |
|
|
static |
Store token in cache
- Returns
- [boolean] true
static FormLib::tokenField |
( |
|
$name = 'crsfToken' ) | |
|
|
static |
Get a hidden <input> with a valid token value
- Parameters
-
$name | [string, default crsfToken] name of form field |
- Returns
- [string] html field
static FormLib::validateToken |
( |
|
$name = 'crsfToken' ) | |
|
|
static |
Validate submitted token
- Parameters
-
$name | [string, default crsfToken] name of form field |
- Returns
- [boolean]
Tokens are one-time-use. Upon validation, that token is removed from the cache
The documentation for this class was generated from the following file:
- pos/is4c-nf/lib/FormLib.php