Script.php: we create for backward compatibility. -Hui

ProjectHomePage
Hui Lan 2020-03-18 22:16:00 +08:00
parent 1aec051398
commit cdd4dceb0a
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,7 @@ header("Location: index.php");
{ {
while($row = mysqli_fetch_assoc($result)) { while($row = mysqli_fetch_assoc($result)) {
// verify the hashed password and unhashed password // verify the hashed password and unhashed password
$sha512pass = hash('sha512', $password); $sha512pass = hash('sha512', $password); // for backward compatibility. Old passwords were hashed using SHA512 algorithm.
if(password_verify($password, $row["Password"]) or $sha512pass == $row["HashPassword"] or $password == $row["Password"]){ if(password_verify($password, $row["Password"]) or $sha512pass == $row["HashPassword"] or $password == $row["Password"]){
$_SESSION['user_id']=$row['User_ID']; $_SESSION['user_id']=$row['User_ID'];
$_SESSION['user_email']=$row['Email']; $_SESSION['user_email']=$row['Email'];