CSRF Protection.
More...
CSRF Protection.
Definition at line 13 of file Csrf.php.
Constructor.
- Parameters
-
Definition at line 45 of file Csrf.php.
Elgg\Security\Csrf::generateActionToken |
( |
|
$timestamp, |
|
|
|
$session_token = '' |
|
) |
| |
Generate a token from a session token (specifying the user), the timestamp, and the site key.
- Parameters
-
int | $timestamp | Unix timestamp |
string | $session_token | Session-specific token |
- Returns
- false|string
Definition at line 187 of file Csrf.php.
Elgg\Security\Csrf::getActionTokenTimeout |
( |
| ) |
|
Returns the action token timeout in seconds.
- Returns
- int number of seconds that action token is valid
- See also
- Csrf::validateActionToken
Definition at line 149 of file Csrf.php.
Elgg\Security\Csrf::isValidToken |
( |
|
$token, |
|
|
|
$ts |
|
) |
| |
Basic token validation.
- Parameters
-
string | $token | Token |
int | $ts | Timestamp |
- Returns
- bool
Definition at line 122 of file Csrf.php.
Elgg\Security\Csrf::validate |
( |
Request |
$request | ) |
|
Validate CSRF tokens present in the request.
- Parameters
-
- Returns
- void
- Exceptions
-
Definition at line 66 of file Csrf.php.
Elgg\Security\Csrf::validateTokenOwnership |
( |
|
$token, |
|
|
|
$timestamp, |
|
|
|
$session_token = '' |
|
) |
| |
Was the given token generated for the session defined by session_token?
- Parameters
-
string | $token | CSRF token |
int | $timestamp | Unix time |
string | $session_token | Session-specific token |
- Returns
- bool
Definition at line 172 of file Csrf.php.
Elgg\Security\Csrf::validateTokenTimestamp |
( |
|
$ts | ) |
|
|
protected |
Is the token timestamp within acceptable range?
- Parameters
-
int | $ts | timestamp from the CSRF token |
- Returns
- bool
Definition at line 133 of file Csrf.php.
Elgg\Security\Csrf::$config |
|
protected |
Elgg\Security\Csrf::$crypto |
|
protected |
Elgg\Security\Csrf::$hmac |
|
protected |
Elgg\Security\Csrf::$session |
|
protected |
The documentation for this class was generated from the following file: