1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-11 10:34:00 +02:00

misterunknown: fixed some authentication bugs

This commit is contained in:
Marco Dickert
2016-02-26 16:37:13 +01:00
parent 0a66724444
commit b362c4db0f

View File

@@ -1529,12 +1529,12 @@ function checkCredentials($user, $pass) {
list($uname, $hash) = explode(":", $srcopt);
break;
case "file":
if(file_exists($srcopt) && is_readable($srcopt)) {
list($uname, $hash) = explode(":", fgets(fopen($file, 'r')));
if(@file_exists($srcopt) && @is_readable($srcopt)) {
list($uname, $hash) = explode(":", fgets(fopen($srcopt, 'r')));
}
break;
}
return password_verify($pass, $hash)?($uname == $user):false;
return password_verify($pass, trim($hash))?($uname == $user):false;
}
// print login form
function loginForm($loginFailed=false) {