|
|
@@ -14,12 +14,18 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="form-group">
|
|
|
- <button type="button" class="btn btn-default col-xs-offset-5 col-xs-2" onclick="testLdapCredentials()">{{ t('Test') }}</button>
|
|
|
- </div>
|
|
|
|
|
|
</fieldset>
|
|
|
|
|
|
+ <fieldset>
|
|
|
+ <h5>Logs</h5>
|
|
|
+ <textarea id="taLogs" class="col-xs-12" rows="4" readonly></textarea>
|
|
|
+ </fieldset>
|
|
|
+
|
|
|
+ <fieldset class="mt-4">
|
|
|
+ <button type="button" class="btn btn-default col-xs-offset-5 col-xs-2" onclick="testLdapCredentials()">{{ t('Test') }}</button>
|
|
|
+ </fieldset>
|
|
|
+
|
|
|
<script>
|
|
|
/**
|
|
|
* test association (ajax)
|
|
|
@@ -44,6 +50,14 @@
|
|
|
}, 5000);
|
|
|
}
|
|
|
}
|
|
|
+ /**
|
|
|
+ * add logs
|
|
|
+ */
|
|
|
+ function addLogs(formId, log) {
|
|
|
+ const textarea = $(`#${formId} #taLogs`);
|
|
|
+ const newLog = `${new Date()} - ${log}\n\n`;
|
|
|
+ textarea.val(`${newLog}${textarea.val()}`);
|
|
|
+ }
|
|
|
|
|
|
var $form = $('#formTestLdapCredentials');
|
|
|
var $action = '/_api/login/testLdap';
|
|
|
@@ -59,6 +73,18 @@
|
|
|
else {
|
|
|
showMessage($id, data.message, data.status);
|
|
|
}
|
|
|
+
|
|
|
+ if (data.err) {
|
|
|
+ addLogs($id, data.err);
|
|
|
+ }
|
|
|
+ if (data.ldapConfiguration) {
|
|
|
+ const prettified = JSON.stringify(data.ldapConfiguration.server, undefined, 4);
|
|
|
+ addLogs($id, `LDAP Configuration : ${prettified}`);
|
|
|
+ }
|
|
|
+ if (data.ldapAccountInfo) {
|
|
|
+ const prettified = JSON.stringify(data.ldapAccountInfo, undefined, 4);
|
|
|
+ addLogs($id, `Retrieved LDAP Account : ${prettified}`);
|
|
|
+ }
|
|
|
})
|
|
|
.fail(function() {
|
|
|
showMessage($id, 'エラーが発生しました', 'danger');
|