mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-10 18:14:00 +02:00
Merge remote-tracking branch 'baranov_ifm/v4.0' into v4.0
This commit is contained in:
14
src/ifm.js
14
src/ifm.js
@@ -1921,14 +1921,20 @@ function IFM(params) {
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(e) {
|
||||
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");
|
||||
// }
|
||||
});
|
||||
};
|
||||
|
||||
|
@@ -1040,7 +1040,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);
|
||||
@@ -1051,13 +1052,15 @@ f00bar;
|
||||
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