mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-10 10:04:01 +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",
|
dataType: "json",
|
||||||
success: function(e) {
|
success: function(e) {
|
||||||
self.hideModal();
|
if (e.status != "ERROR") {
|
||||||
self.initApplication();
|
self.hideModal();
|
||||||
|
self.initApplication();
|
||||||
|
} else {
|
||||||
|
var errorlogin = document.getElementsByClassName('alert')[0];
|
||||||
|
errorlogin.classList.remove("d-none");
|
||||||
|
errorlogin.innerHTML = e.message;
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function(e) {
|
error: function(e) {
|
||||||
var errorlogin = document.getElementsByClassName('alert')[0];
|
var errorlogin = document.getElementsByClassName('alert')[0];
|
||||||
errorlogin.classList.remove("d-none");
|
errorlogin.classList.remove("d-none");
|
||||||
errorlogin.innerHTML = "Authentication failed"
|
errorlogin.innerHTML = "Authentication failed";
|
||||||
//self.showMessage("Authentication failed", "e");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1937,10 +1943,6 @@ function IFM(params) {
|
|||||||
self.initApplication();
|
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;
|
$u = $uuid . "=" . $user . "," . $basedn;
|
||||||
if (!$ds = ldap_connect($ldap_server)) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||||
@@ -1036,16 +1037,18 @@ f00bar;
|
|||||||
$ldbind = @ldap_bind($ds, $u, $pass);
|
$ldbind = @ldap_bind($ds, $u, $pass);
|
||||||
if ($ldbind) {
|
if ($ldbind) {
|
||||||
if ($ufilter) {
|
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;
|
$authenticated = true;
|
||||||
} else {
|
} 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;
|
$authenticated = false;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
$authenticated = true;
|
$authenticated = true;
|
||||||
} else {
|
} 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;
|
$authenticated = false;
|
||||||
}
|
}
|
||||||
ldap_unbind($ds);
|
ldap_unbind($ds);
|
||||||
|
Reference in New Issue
Block a user