no fruitless count attempts, and notification should disappear

This commit is contained in:
Arthur Schiwon 2015-02-05 16:25:22 +01:00
parent 7a9d428d6f
commit 2bcb786214
2 changed files with 11 additions and 5 deletions

View File

@ -85,7 +85,7 @@ switch($action) {
exit; exit;
} }
} catch (\Exception $e) { } catch (\Exception $e) {
\OCP\JSON::error(array('message' => $e->getMessage())); \OCP\JSON::error(array('message' => $e->getMessage(), 'code' => $e->getCode()));
exit; exit;
} }
\OCP\JSON::error(); \OCP\JSON::error();

View File

@ -351,7 +351,7 @@ var LdapWizard = {
encodeURIComponent($('#ldap_serverconfig_chooser').val()); encodeURIComponent($('#ldap_serverconfig_chooser').val());
LdapWizard.showSpinner(spinnerID); LdapWizard.showSpinner(spinnerID);
var request = LdapWizard.ajax(param, LdapWizard.ajax(param,
function(result) { function(result) {
LdapWizard.applyChanges(result); LdapWizard.applyChanges(result);
LdapWizard.hideSpinner(spinnerID); LdapWizard.hideSpinner(spinnerID);
@ -360,7 +360,7 @@ var LdapWizard = {
} }
}, },
function (result) { 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); LdapWizard.hideSpinner(spinnerID);
if(!_.isUndefined(doneCallback)) { if(!_.isUndefined(doneCallback)) {
doneCallback(method); doneCallback(method);
@ -371,11 +371,17 @@ var LdapWizard = {
}, },
countGroups: function(doneCallback) { 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) { 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);
}
}, },
/** /**