diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-01-24 14:11:53 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-01-24 14:11:53 +0100 |
commit | 5b9e181198a61f5c123f5e8d5acec4c30cc8908a (patch) | |
tree | b908cd8d837eb49185f636a3e989ddc4c62eabab /apps/user_ldap/js | |
parent | 3bf38c7a8469d1a1eac579378fc6336db86d0218 (diff) | |
download | nextcloud-server-5b9e181198a61f5c123f5e8d5acec4c30cc8908a.tar.gz nextcloud-server-5b9e181198a61f5c123f5e8d5acec4c30cc8908a.zip |
LDAP: implement deleteConfiguration feature
Diffstat (limited to 'apps/user_ldap/js')
-rw-r--r-- | apps/user_ldap/js/settings.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js index c3484da5ac6..49bbc60d81c 100644 --- a/apps/user_ldap/js/settings.js +++ b/apps/user_ldap/js/settings.js @@ -45,12 +45,32 @@ var LdapConfiguration = { $(this).removeAttr('checked'); } }); + }, + + deleteConfiguration: function() { + $.post( + OC.filePath('user_ldap','ajax','deleteConfiguration.php'), + $('#ldap_serverconfig_chooser').serialize(), + function (result) { + if(result.status == 'success') { + $('#ldap_serverconfig_chooser option:selected').remove(); + $('#ldap_serverconfig_chooser option:first').select(); + LdapConfiguration.refreshConfig(); + } else { + OC.dialogs.alert( + result.message, + 'Deletion failed' + ); + } + } + ); } } $(document).ready(function() { $('#ldapSettings').tabs(); $('#ldap_action_test_connection').button(); + $('#ldap_action_delete_configuration').button(); LdapConfiguration.refreshConfig(); $('#ldap_action_test_connection').click(function(event){ event.preventDefault(); @@ -73,6 +93,19 @@ $(document).ready(function() { ); }); + $('#ldap_action_delete_configuration').click(function(event) { + event.preventDefault(); + OC.dialogs.confirm( + 'Do you really want to delete the current Server Configuration?', + 'Confirm Deletion', + function(deleteConfiguration) { + if(deleteConfiguration) { + LdapConfiguration.deleteConfiguration(); + } + } + ); + }); + $('#ldap_submit').click(function(event) { event.preventDefault(); $.post( |