summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-01-18 01:23:15 +0100
committerArthur Schiwon <blizzz@owncloud.com>2013-01-18 01:23:15 +0100
commita53addf8250ea47a36837463f15122339123aeff (patch)
tree53c89eb8549106000a418e58cf72bb9cf7881b85 /apps/user_ldap/js
parentd8be83029b107359884f9e23dd5bded71fea8999 (diff)
downloadnextcloud-server-a53addf8250ea47a36837463f15122339123aeff.tar.gz
nextcloud-server-a53addf8250ea47a36837463f15122339123aeff.zip
LDAP: first basics for multiserver config ui
Diffstat (limited to 'apps/user_ldap/js')
-rw-r--r--apps/user_ldap/js/settings.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index 7063eead96a..8cd31301f2e 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -21,4 +21,37 @@ $(document).ready(function() {
}
);
});
+
+ $('#ldap_serverconfig_chooser').change(function(event) {
+ value = $('#ldap_serverconfig_chooser option:selected:first').attr('value');
+ if(value == 'NEW') {
+ $.post(
+ OC.filePath('user_ldap','ajax','getNewServerConfigPrefix.php'),
+ function (result) {
+ if(result.status == 'success') {
+ OC.dialogs.confirm(
+ 'Take over settings from recent server configuration?',
+ 'Keep settings?',
+ function(keep) {
+ if(!keep) {
+ $('#ldap').find('input[type=text], input[type=password], textarea, select').val('');
+ $('#ldap').find('input[type=checkbox]').removeAttr('checked');
+ }
+ }
+ );
+ $('#ldap_serverconfig_chooser option:selected:first').removeAttr('selected');
+ var html = '<option value="'+result.configPrefix+'" selected>'+$('#ldap_serverconfig_chooser option').length+'. Server</option>';
+ $('#ldap_serverconfig_chooser option:last').before(html);
+ } else {
+ OC.dialogs.alert(
+ result.message,
+ 'Cannot add server configuration'
+ );
+ }
+ }
+ );
+ } else {
+ alert(value);
+ }
+ });
}); \ No newline at end of file