]> source.dussan.org Git - nextcloud-server.git/commitdiff
no fruitless count attempts, and notification should disappear
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 5 Feb 2015 15:25:22 +0000 (16:25 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Thu, 5 Feb 2015 15:25:22 +0000 (16:25 +0100)
apps/user_ldap/ajax/wizard.php
apps/user_ldap/js/settings.js

index 48bfb56311c9b02b4ecbe3541b55c96c90a2b951..7c4ef3a9a29aaceaaa6b83d10722e4ed0c6e9280 100644 (file)
@@ -85,7 +85,7 @@ switch($action) {
                                exit;
                        }
                } catch (\Exception $e) {
-                       \OCP\JSON::error(array('message' => $e->getMessage()));
+                       \OCP\JSON::error(array('message' => $e->getMessage(), 'code' => $e->getCode()));
                        exit;
                }
                \OCP\JSON::error();
index b1abb0994ba826fbb87d8152e8b418cf0a9ee317..768d62a18d1d85b3f8179fd8d7b2851e00fc148e 100644 (file)
@@ -351,7 +351,7 @@ var LdapWizard = {
                                encodeURIComponent($('#ldap_serverconfig_chooser').val());
 
                LdapWizard.showSpinner(spinnerID);
-               var request = LdapWizard.ajax(param,
+               LdapWizard.ajax(param,
                        function(result) {
                                LdapWizard.applyChanges(result);
                                LdapWizard.hideSpinner(spinnerID);
@@ -360,7 +360,7 @@ var LdapWizard = {
                                }
                        },
                        function (result) {
-                               OC.Notification.show('Counting the entries failed with, ' + result.message);
+                               OC.Notification.showTemporary('Counting the entries failed with: ' + result.message);
                                LdapWizard.hideSpinner(spinnerID);
                                if(!_.isUndefined(doneCallback)) {
                                        doneCallback(method);
@@ -371,11 +371,17 @@ var LdapWizard = {
        },
 
        countGroups: function(doneCallback) {
-               LdapWizard._countThings('countGroups', '#ldap_group_count', doneCallback);
+               var groupFilter  = $('#ldap_group_filter').val();
+               if(!_.isEmpty(groupFilter)) {
+                       LdapWizard._countThings('countGroups', '#ldap_group_count', doneCallback);
+               }
        },
 
        countUsers: function(doneCallback) {
-               LdapWizard._countThings('countUsers', '#ldap_user_count', doneCallback);
+               var userFilter  = $('#ldap_userlist_filter').val();
+               if(!_.isEmpty(userFilter)) {
+                       LdapWizard._countThings('countUsers', '#ldap_user_count', doneCallback);
+               }
        },
 
        /**