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
파일 보기 프로젝트 열기: phalcon/forum 1 사용 예제들

공개 메소드들

메소드 설명
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