PHP Класс Airship\Engine\Security\CSRF

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$expireOld boolean
$hmacIP Default to FALSE to be friendly to Tor/Mobile users
$recycleAfter integer
$sessionIndex string

Открытые методы

Метод Описание
__construct ( array $options = [] ) CSRF constructor.
check ( ) : boolean Validate a request based on $_SESSION and $_POST data
getTokenString ( string $lockTo = '' ) : string Retrieve a token array for unit testing endpoints
insertToken ( string $lockTo = '', boolean $echo = true ) : string Insert a CSRF token to a form
reconfigure ( array $options = [] ) Use this to change the configuration settings.

Защищенные методы

Метод Описание
generateToken ( string $lockTo = '' ) : array Generate, store, and return the index and token
recycleTokens ( ) Enforce an upper limit on the number of tokens stored in session state by removing the oldest tokens first.

Описание методов

__construct() публичный метод

CSRF constructor.
public __construct ( array $options = [] )
$options array

check() публичный метод

Validate a request based on $_SESSION and $_POST data
public check ( ) : boolean
Результат boolean

generateToken() защищенный метод

Generate, store, and return the index and token
protected generateToken ( string $lockTo = '' ) : array
$lockTo string What URI endpoint this is valid for
Результат array [string, string]

getTokenString() публичный метод

Retrieve a token array for unit testing endpoints
public getTokenString ( string $lockTo = '' ) : string
$lockTo string - Only get tokens locked to a particular form
Результат string

insertToken() публичный метод

Insert a CSRF token to a form
public insertToken ( string $lockTo = '', boolean $echo = true ) : string
$lockTo string This CSRF token is only valid for this HTTP request endpoint
$echo boolean if true, echo instead of returning
Результат string

reconfigure() публичный метод

Only use this if you know what you are doing.
public reconfigure ( array $options = [] )
$options array

recycleTokens() защищенный метод

Enforce an upper limit on the number of tokens stored in session state by removing the oldest tokens first.
protected recycleTokens ( )

Описание свойств

$expireOld защищенное свойство

protected bool $expireOld
Результат boolean

$hmacIP защищенное свойство

Default to FALSE to be friendly to Tor/Mobile users
protected $hmacIP

$recycleAfter защищенное свойство

protected int $recycleAfter
Результат integer

$sessionIndex защищенное свойство

protected string $sessionIndex
Результат string