summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-05-08 17:47:07 +0200
committerArthur Schiwon <blizzz@owncloud.com>2013-05-08 17:47:07 +0200
commit796ee8c4c0cc7b105c6fd4c0e43d40c9e898bb43 (patch)
treef9e38fe32856ba1d86680fb1c9153c7e63b1d682 /apps/user_ldap/js
parent3f1717d3d54fd82090abe6518da56c88678e24a2 (diff)
downloadnextcloud-server-796ee8c4c0cc7b105c6fd4c0e43d40c9e898bb43.tar.gz
nextcloud-server-796ee8c4c0cc7b105c6fd4c0e43d40c9e898bb43.zip
LDAP: Implement clear mappings functionality
Diffstat (limited to 'apps/user_ldap/js')
-rw-r--r--apps/user_ldap/js/settings.js30
1 files changed, 30 insertions, 0 deletions
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') {