|
@@ -79,12 +79,6 @@
|
|
|
<label>Enable LDAP</label>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="field">
|
|
|
- <div class="ui toggle checkbox">
|
|
|
- <input type="checkbox" id="autoredirect" name="autoredirect">
|
|
|
- <label>Auto redirect</label>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
<div class="field">
|
|
|
<label>Bind Username</label>
|
|
|
<div class="ui fluid input">
|
|
@@ -171,26 +165,35 @@
|
|
|
}
|
|
|
|
|
|
function test() {
|
|
|
+ $("#test_btn").text("Testing...");
|
|
|
$.get("../../system/auth/ldap/config/testConnection")
|
|
|
.done(function(data) {
|
|
|
if (data.error != undefined) {
|
|
|
- alert(data.error);
|
|
|
- } else if (data == null) {
|
|
|
+ if (data.error != "") {
|
|
|
+ alert(data.error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (data.userinfo == null) {
|
|
|
alert("No entries was found");
|
|
|
- } else {
|
|
|
- //OK!
|
|
|
- $("#information").html("");
|
|
|
- $(data).each(function(index, element) {
|
|
|
- $("#information").append(`
|
|
|
+ }
|
|
|
+ //OK!
|
|
|
+ $("#information").html("");
|
|
|
+ $(data.userinfo).each(function(index, element) {
|
|
|
+ $("#information").append(`
|
|
|
<tr>
|
|
|
<td data-label="username">` + element.username + `</td>
|
|
|
<td data-label="ldap_group">` + element.group + `</td>
|
|
|
<td data-label="equiv_group">` + element.equiv_group + `</td>
|
|
|
</tr>
|
|
|
- `);
|
|
|
- });
|
|
|
- $("#testConnection").show("fast");
|
|
|
- }
|
|
|
+ `);
|
|
|
+ });
|
|
|
+ $("#information").append(`
|
|
|
+ <tr>
|
|
|
+ <td data-label="length" colspan="3">Showing ` + data.length + ` of 10 entries</td>
|
|
|
+ </tr>
|
|
|
+ `);
|
|
|
+ $("#testConnection").show("fast");
|
|
|
+ $("#test_btn").text("Test connection");
|
|
|
});
|
|
|
}
|
|
|
|