Revert "Updated to remove passwords from sessions" (#4422)

This commit is contained in:
Neil Lathwood
2016-09-13 15:10:42 +01:00
committed by Tony Murray
parent ec9383be60
commit a8efda8f30
10 changed files with 83 additions and 55 deletions

View File

@@ -1335,16 +1335,3 @@ function ipmiSensorName($hardwareId, $sensorIpmi, $rewriteArray)
return $sensorIpmi;
}
}
function reauthenticate($sess_id, $token)
{
list($uname,$hash) = explode('|', $token);
$session = dbFetchRow("SELECT * FROM `session` WHERE `session_username` = '$uname' AND session_value='$sess_id'", array(), true);
$hasher = new PasswordHash(8, false);
if ($hasher->CheckPassword($uname.$session['session_token'], $hash)) {
$_SESSION['username'] = $uname;
return 1;
} else {
return 0;
}
}//end reauthenticate()