From 796ee8c4c0cc7b105c6fd4c0e43d40c9e898bb43 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 8 May 2013 17:47:07 +0200 Subject: LDAP: Implement clear mappings functionality --- apps/user_ldap/js/settings.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'apps/user_ldap/js') diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js index e34849ec887..5e4c0262a6d 100644 --- a/apps/user_ldap/js/settings.js +++ b/apps/user_ldap/js/settings.js @@ -99,6 +99,26 @@ var LdapConfiguration = { } } ); + }, + + clearMappings: function(mappingSubject) { + $.post( + OC.filePath('user_ldap','ajax','clearMappings.php'), + 'ldap_clear_mapping='+mappingSubject, + function(result) { + if(result.status == 'success') { + OC.dialogs.info( + t('user_ldap', 'mappings cleared'), + t('user_ldap', 'Success') + ); + } else { + OC.dialogs.alert( + result.message, + t('user_ldap', 'Error') + ); + } + } + ); } } @@ -166,6 +186,16 @@ $(document).ready(function() { ); }); + $('#ldap_action_clear_user_mappings').click(function(event) { + event.preventDefault(); + LdapConfiguration.clearMappings('user'); + }); + + $('#ldap_action_clear_group_mappings').click(function(event) { + event.preventDefault(); + LdapConfiguration.clearMappings('group'); + }); + $('#ldap_serverconfig_chooser').change(function(event) { value = $('#ldap_serverconfig_chooser option:selected:first').attr('value'); if(value == 'NEW') { -- cgit v1.2.3