我想自己写个登录,然后是密码校验这步不太懂这些参数取自哪里:
在网上扒教程,定位到/uc_client/user.php,约365行的这几个方法(最底部):
这里有几个疑问,在pre_ucenter_members的salt字段为空字符串时,应该走的分支:password_verify($password, $hash);
随后两个参数$algo和$options我没看懂,虽然我用返回的是true,但是这里没有和数据库的密码作比对,也可以判断吗?
$password = '123456'
constant('PASSWORD_BCRYPT') = '2y'
$hash = password_hash($password, constant('PASSWORD_BCRYPT'), array());
$pass = password_verify($password, $hash);
var_dump($pass);
user.php代码
functionget_passwordalgo() {
$algo = $this->base->settings['passwordalgo';
if(empty($algo)) {
returnconstant('PASSWORD_BCRYPT');
} else {
returnconstant($algo) === null ? constant('PASSWORD_BCRYPT') : constant($algo);
}
}
function[/c