for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Class for user password managing
*
* @file Password.php
* PHP version 8.0+
* @author Alexander Yancharuk <alex at itvault dot info>
* @copyright © 2012-2021 Alexander Yancharuk
* @date Сбт Апр 21 15:49:49 2012
* @license The BSD 3-Clause License
* <https://tldrlegal.com/license/bsd-3-clause-license-(revised)>
*/
namespace Veles\Auth;
use Veles\Model\User;
* User password managing
class Password
{
* User hash check
* @param User $user
* @param $cookie_hash
* @return bool
public static function checkCookieHash(User $user, $cookie_hash)
return $user->getCookieHash() === $cookie_hash;
}
* User password check in ajax-authentication
* @param User $user User
* @param string $password Password retrieved through ajax
* @deprecated
public static function check(User $user, $password)
return $user->getHash() === crypt($password, $user->getHash());