mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-09 17:46:31 +02:00
modfix
This commit is contained in:
18
src/ifm.js
18
src/ifm.js
@@ -1921,14 +1921,20 @@ function IFM(params) {
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(e) {
|
||||
self.hideModal();
|
||||
self.initApplication();
|
||||
if (e.status != "ERROR") {
|
||||
self.hideModal();
|
||||
self.initApplication();
|
||||
} else {
|
||||
var errorlogin = document.getElementsByClassName('alert')[0];
|
||||
errorlogin.classList.remove("d-none");
|
||||
errorlogin.innerHTML = e.message;
|
||||
}
|
||||
|
||||
},
|
||||
error: function(e) {
|
||||
var errorlogin = document.getElementsByClassName('alert')[0];
|
||||
errorlogin.classList.remove("d-none");
|
||||
errorlogin.innerHTML = "Authentication failed"
|
||||
//self.showMessage("Authentication failed", "e");
|
||||
errorlogin.innerHTML = "Authentication failed";
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1937,10 +1943,6 @@ function IFM(params) {
|
||||
self.initApplication();
|
||||
}
|
||||
}
|
||||
// },
|
||||
// error: function(resp) {
|
||||
// throw new Error("Not authenticated");
|
||||
// }
|
||||
});
|
||||
};
|
||||
|
||||
|
11
src/main.php
11
src/main.php
@@ -1028,7 +1028,8 @@ f00bar;
|
||||
}
|
||||
$u = $uuid . "=" . $user . "," . $basedn;
|
||||
if (!$ds = ldap_connect($ldap_server)) {
|
||||
trigger_error("Could not reach the ldap server.", E_USER_ERROR);
|
||||
throw new IFMException("Could not reach the ldap server." , true);
|
||||
//trigger_error("Could not reach the ldap server.", E_USER_ERROR);
|
||||
return false;
|
||||
}
|
||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
@@ -1036,16 +1037,18 @@ f00bar;
|
||||
$ldbind = @ldap_bind($ds, $u, $pass);
|
||||
if ($ldbind) {
|
||||
if ($ufilter) {
|
||||
if (ldap_count_entries($ds, ldap_search($ds, $u, $ufilter)) > 0) {
|
||||
if (ldap_count_entries($ds, ldap_search($ds, $u, $ufilter)) == 1) {
|
||||
$authenticated = true;
|
||||
} else {
|
||||
trigger_error("User not allowed.", E_USER_ERROR);
|
||||
throw new IFMException("User not allowed." , true);
|
||||
//trigger_error("User not allowed.", E_USER_ERROR);
|
||||
$authenticated = false;
|
||||
}
|
||||
} else
|
||||
$authenticated = true;
|
||||
} else {
|
||||
trigger_error(ldap_error($ds), E_USER_ERROR);
|
||||
throw new IFMException(ldap_error($ds) , true);
|
||||
//trigger_error(ldap_error($ds), E_USER_ERROR);
|
||||
$authenticated = false;
|
||||
}
|
||||
ldap_unbind($ds);
|
||||
|
Reference in New Issue
Block a user