$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
}
Show file
Open project: phalcon/forum
Class Usage Examples
Method | Description | |
---|---|---|
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. |
public destroyPrefixedToken ( string $prefix ) | ||
$prefix | string |
public getPrefixedSessionToken ( string $prefix ) : mixed | ||
$prefix | string | |
return | mixed |
public getPrefixedToken ( string $prefix ) : string | ||
$prefix | string | |
return | string | mixed |
public getPrefixedTokenKey ( string $prefix ) : string | ||
$prefix | string | |
return | string |