Improvement function hashPassword
This commit is contained in:
@@ -2879,10 +2879,9 @@ class Bootstrap
|
|||||||
$encrypt = $typeEncrypt['previous'];
|
$encrypt = $typeEncrypt['previous'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($includeHashType) {
|
|
||||||
$var = $encrypt . ':' . $pass;
|
|
||||||
} else {
|
|
||||||
eval("\$var = hash('" . $encrypt . "', '" . $pass . "');");
|
eval("\$var = hash('" . $encrypt . "', '" . $pass . "');");
|
||||||
|
if ($includeHashType) {
|
||||||
|
$var = $encrypt . ':' . $var;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $var;
|
return $var;
|
||||||
@@ -2892,11 +2891,11 @@ class Bootstrap
|
|||||||
{
|
{
|
||||||
$hashType = Bootstrap::getPasswordHashType();
|
$hashType = Bootstrap::getPasswordHashType();
|
||||||
if (Bootstrap::hashPassword($pass, $hashType) == $userPass
|
if (Bootstrap::hashPassword($pass, $hashType) == $userPass
|
||||||
|| Bootstrap::hashPassword($pass, $hashType, true) == $userPass) {
|
|| $pass === Bootstrap::hashPassword($userPass, $hashType, true)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (Bootstrap::hashPassword($pass, $hashType, false, true) == $userPass
|
if (Bootstrap::hashPassword($pass, $hashType, false, true) == $userPass
|
||||||
|| Bootstrap::hashPassword($pass, $hashType, true, true) == $userPass) {
|
||$pass === Bootstrap::hashPassword($userPass, $hashType, true, true)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user