PHP Класс Phosphorum\Utils\Security

This component provides a set of functions to improve the security in Forum application. Prefixed version. $login = $this->request->getPost('login'); $password = $this->request->getPost('password'); $user = Users::findFirstByLogin($login); if ($user && $this->security->checkHash($password, $user->password)) { The password is valid }
Наследование: extends Phalcon\Security
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
checkPrefixedToken ( string $prefix, string $tokenKey = null, string $tokenValue = null, boolean $destroyIfValid = true ) : boolean Check if the CSRF token sent in the request is the same that the current in session.
destroyPrefixedToken ( string $prefix ) Removes the value of the CSRF token and key from session.
getPrefixedSessionToken ( string $prefix ) : mixed Returns the value of the CSRF token in session.
getPrefixedToken ( string $prefix ) : string Generates a pseudo random token value to be used as input's value in a CSRF check.
getPrefixedTokenKey ( string $prefix ) : string Generates a pseudo random token key to be used as input's name in a CSRF check.

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

checkPrefixedToken() публичный Метод

Check if the CSRF token sent in the request is the same that the current in session.
public checkPrefixedToken ( string $prefix, string $tokenKey = null, string $tokenValue = null, boolean $destroyIfValid = true ) : boolean
$prefix string
$tokenKey string
$tokenValue string
$destroyIfValid boolean
Результат boolean

destroyPrefixedToken() публичный Метод

Removes the value of the CSRF token and key from session.
public destroyPrefixedToken ( string $prefix )
$prefix string

getPrefixedSessionToken() публичный Метод

Returns the value of the CSRF token in session.
public getPrefixedSessionToken ( string $prefix ) : mixed
$prefix string
Результат mixed

getPrefixedToken() публичный Метод

Generates a pseudo random token value to be used as input's value in a CSRF check.
public getPrefixedToken ( string $prefix ) : string
$prefix string
Результат string mixed

getPrefixedTokenKey() публичный Метод

Generates a pseudo random token key to be used as input's name in a CSRF check.
public getPrefixedTokenKey ( string $prefix ) : string
$prefix string
Результат string