aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/js/settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/js/settings.js')
-rw-r--r--apps/user_ldap/js/settings.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index cae9655e3df..4e5923406ea 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -1,3 +1,25 @@
$(document).ready(function() {
$('#ldapSettings').tabs();
+ $('#ldap_action_test_connection').button();
+ $('#ldap_action_test_connection').click(function(event){
+ event.preventDefault();
+ $.post(
+ OC.filePath('user_ldap','ajax','testConfiguration.php'),
+ $('#ldap').serialize(),
+ function (result) {
+ if (result.status == 'success') {
+ OC.dialogs.alert(
+ result.message,
+ 'Connection test succeeded'
+ );
+ } else {
+ $('#ldap_action_test_connection').css('background-color', 'red');
+ OC.dialogs.alert(
+ result.message,
+ 'Connection test failed'
+ );
+ }
+ }
+ );
+ });
}); \ No newline at end of file