CORE POS - IS4C
The CORE POS front end
Static Public Member Functions | List of all members
FormLib Class Reference
Inheritance diagram for FormLib:
LibraryClass

Static Public Member Functions

static clearTokens ()
 
static setToken ($token)
 
static generateToken ()
 
static tokenField ($name='crsfToken')
 
static validateToken ($name='crsfToken')
 
static get ($name, $default_value='')
 

Member Function Documentation

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: