mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-12 19:13:57 +02:00
misterunknown: fixed some authentication bugs
This commit is contained in:
6
ifm.php
6
ifm.php
@@ -1529,12 +1529,12 @@ function checkCredentials($user, $pass) {
|
|||||||
list($uname, $hash) = explode(":", $srcopt);
|
list($uname, $hash) = explode(":", $srcopt);
|
||||||
break;
|
break;
|
||||||
case "file":
|
case "file":
|
||||||
if(file_exists($srcopt) && is_readable($srcopt)) {
|
if(@file_exists($srcopt) && @is_readable($srcopt)) {
|
||||||
list($uname, $hash) = explode(":", fgets(fopen($file, 'r')));
|
list($uname, $hash) = explode(":", fgets(fopen($srcopt, 'r')));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return password_verify($pass, $hash)?($uname == $user):false;
|
return password_verify($pass, trim($hash))?($uname == $user):false;
|
||||||
}
|
}
|
||||||
// print login form
|
// print login form
|
||||||
function loginForm($loginFailed=false) {
|
function loginForm($loginFailed=false) {
|
||||||
|
Reference in New Issue
Block a user