]> source.dussan.org Git - nextcloud-server.git/commitdiff
on xp'ed mode and switching configurations: save raw mode instead of toggling filter...
authorArthur Schiwon <blizzz@owncloud.com>
Wed, 29 Oct 2014 17:52:55 +0000 (18:52 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Wed, 29 Oct 2014 17:53:07 +0000 (18:53 +0100)
apps/user_ldap/js/experiencedAdmin.js
apps/user_ldap/js/settings.js

index fac8dd6470f712ab9c70e493d034d982fdcddf3e..8d138eecc419269f858f0d511708705589343e9b 100644 (file)
@@ -50,17 +50,9 @@ ExperiencedAdmin.prototype.isExperienced = function() {
  * switches all LDAP filters from Assisted to Raw mode.
  */
 ExperiencedAdmin.prototype.enableRawMode = function() {
-       var containers = {
-               'toggleRawGroupFilter': '#rawGroupFilterContainer',
-               'toggleRawLoginFilter': '#rawLoginFilterContainer',
-               'toggleRawUserFilter' : '#rawUserFilterContainer'
-       };
-
-       for(var method in containers) {
-               if($(containers[method]).hasClass('invisible')) {
-                       this.wizard[method]();
-               }
-       }
+       LdapWizard._save({id: 'ldapGroupFilterMode'}, LdapWizard.filterModeRaw);
+       LdapWizard._save({id: 'ldapUserFilterMode' }, LdapWizard.filterModeRaw);
+       LdapWizard._save({id: 'ldapLoginFilterMode'}, LdapWizard.filterModeRaw);
 };
 
 ExperiencedAdmin.prototype.updateUserTab = function(mode) {
index 1627528200fa6626fe07e8eec8cc089a37a4901d..fa40aba73b43a17c5dab2e0924394b08cbcdb87a 100644 (file)
@@ -838,9 +838,10 @@ var LdapWizard = {
                }
        },
 
-       onToggleRawFilterConfirmation: function(currentMode, callback) {
-               if(!LdapWizard.admin.isExperienced()
-                       || currentMode === LdapWizard.filterModeAssisted
+       onToggleRawFilterConfirmation: function(currentMode, isRawVisible, callback) {
+               if(   !LdapWizard.admin.isExperienced()
+                  || currentMode === LdapWizard.filterModeAssisted
+                  || (LdapWizard.admin.isExperienced() && !isRawVisible)
                ) {
                        return callback(true);
                }
@@ -855,6 +856,7 @@ var LdapWizard = {
        toggleRawGroupFilter: function() {
                LdapWizard.onToggleRawFilterConfirmation(
                        LdapWizard.groupFilter.getMode(),
+                       !$('#rawGroupFilterContainer').hasClass('invisible'),
                        function(confirmed) {
                                if(confirmed !== true) {
                                        return;
@@ -875,6 +877,7 @@ var LdapWizard = {
        toggleRawLoginFilter: function() {
                LdapWizard.onToggleRawFilterConfirmation(
                        LdapWizard.loginFilter.getMode(),
+                       !$('#rawLoginFilterContainer').hasClass('invisible'),
                        function(confirmed) {
                                if(confirmed !== true) {
                                        return;
@@ -909,6 +912,7 @@ var LdapWizard = {
        toggleRawUserFilter: function() {
                LdapWizard.onToggleRawFilterConfirmation(
                        LdapWizard.userFilter.getMode(),
+                       !$('#rawUserFilterContainer').hasClass('invisible'),
                        function(confirmed) {
                                if(confirmed === true) {
                                        LdapWizard.blacklistRemove('ldap_userlist_filter');