CsrfGuard
class CsrfGuard (View source)
The CsrfManager class.
Constants
TOKEN_KEY |
|
Methods
__construct(Config $config, Input $input, Session $session, UserManager $userManager)
CsrfGuard constructor.
bool
validate(bool $justDie = false, string $message = 'Invalid Token')
Validate token or die.
HtmlElement
input(mixed $userId = null, array $attribs = array())
Create token input.
string
createToken(int $length = 12)
Create token string.
string
getToken(boolean $forceNew = false)
Get form token string.
string
getFormToken(mixed $userId = null, boolean $forceNew = false)
Get a token for specific user.
boolean
checkToken(mixed $userId = null, string $method = null)
checkToken
Details
at line line 60
__construct(Config $config, Input $input, Session $session, UserManager $userManager)
CsrfGuard constructor.
at line line 76
bool
validate(bool $justDie = false, string $message = 'Invalid Token')
Validate token or die.
at line line 99
HtmlElement
input(mixed $userId = null, array $attribs = array())
Create token input.
at line line 115
string
createToken(int $length = 12)
Create token string.
at line line 140
string
getToken(boolean $forceNew = false)
Get form token string.
at line line 168
string
getFormToken(mixed $userId = null, boolean $forceNew = false)
Get a token for specific user.
at line line 188
boolean
checkToken(mixed $userId = null, string $method = null)
checkToken