summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-10-09 17:17:50 +0200
committerArthur Schiwon <blizzz@owncloud.com>2014-10-09 17:17:50 +0200
commit2cf01027976117cab824a54971a7b97e4c8e0b9d (patch)
treed63dbc2664250b99eb22bcb3ad9404698d894d50 /apps
parent9f036e776ef40553845c47dacaae0d5af02383c9 (diff)
downloadnextcloud-server-2cf01027976117cab824a54971a7b97e4c8e0b9d.tar.gz
nextcloud-server-2cf01027976117cab824a54971a7b97e4c8e0b9d.zip
fix triggering of group update counts. improves the basic code which is also responsible for user counts. i did not find regressions, please doublecheck
Diffstat (limited to 'apps')
-rw-r--r--apps/user_ldap/js/ldapFilter.js19
-rw-r--r--apps/user_ldap/js/settings.js10
2 files changed, 15 insertions, 14 deletions
diff --git a/apps/user_ldap/js/ldapFilter.js b/apps/user_ldap/js/ldapFilter.js
index 5b93d81f371..6b62604efb7 100644
--- a/apps/user_ldap/js/ldapFilter.js
+++ b/apps/user_ldap/js/ldapFilter.js
@@ -14,7 +14,7 @@ function LdapFilter(target, determineModeCallback) {
target === 'Group') {
this.target = target;
}
-};
+}
LdapFilter.prototype.activate = function() {
if(this.activated) {
@@ -33,6 +33,11 @@ LdapFilter.prototype.compose = function(callback) {
return false;
}
+ if(this.mode === LdapWizard.filterModeRaw) {
+ //Raw filter editing, i.e. user defined filter, don't compose
+ return;
+ }
+
if(this.target === 'User') {
action = 'getUserListFilter';
} else if(this.target === 'Login') {
@@ -41,11 +46,6 @@ LdapFilter.prototype.compose = function(callback) {
action = 'getGroupFilter';
}
- if(!$('#raw'+this.target+'FilterContainer').hasClass('invisible')) {
- //Raw filter editing, i.e. user defined filter, don't compose
- return;
- }
-
var param = 'action='+action+
'&ldap_serverconfig_chooser='+
encodeURIComponent($('#ldap_serverconfig_chooser').val());
@@ -55,10 +55,9 @@ LdapFilter.prototype.compose = function(callback) {
LdapWizard.ajax(param,
function(result) {
LdapWizard.applyChanges(result);
- if(filter.target === 'User') {
- LdapWizard.countUsers();
- } else if(filter.target === 'Group') {
- LdapWizard.countGroups();
+ console.log(filter.mode);
+ filter.updateCount();
+ if(filter.target === 'Group') {
LdapWizard.detectGroupMemberAssoc();
}
if(typeof callback !== 'undefined') {
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index f5b8081497f..be643c81b4b 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -542,7 +542,6 @@ var LdapWizard = {
initGroupFilter: function() {
LdapWizard.groupFilter.activate();
- LdapWizard.countGroups();
},
/** init login filter tab section **/
@@ -576,6 +575,9 @@ var LdapWizard = {
instantiateFilters: function() {
delete LdapWizard.userFilter;
LdapWizard.userFilter = new LdapFilter('User', function(mode) {
+ if(mode === LdapWizard.filterModeAssisted) {
+ LdapWizard.groupFilter.updateCount();
+ }
LdapWizard.userFilter.findFeatures();
});
$('#rawUserFilterContainer .ldapGetEntryCount').click(function(event) {
@@ -593,6 +595,9 @@ var LdapWizard = {
delete LdapWizard.groupFilter;
LdapWizard.groupFilter = new LdapFilter('Group', function(mode) {
+ if(mode === LdapWizard.filterModeAssisted) {
+ LdapWizard.groupFilter.updateCount();
+ }
LdapWizard.groupFilter.findFeatures();
});
$('#rawGroupFilterContainer .ldapGetEntryCount').click(function(event) {
@@ -617,7 +622,6 @@ var LdapWizard = {
if(LdapWizard.userFilterObjectClassesHasRun &&
LdapWizard.userFilterAvailableGroupsHasRun) {
LdapWizard.userFilter.compose(LdapWizard.detectEmailAttribute);
- LdapWizard.countUsers();
}
},
@@ -657,10 +661,8 @@ var LdapWizard = {
}
if(triggerObj.id == 'ldap_userlist_filter' && !LdapWizard.admin.isExperienced()) {
- LdapWizard.countUsers();
LdapWizard.detectEmailAttribute();
} else if(triggerObj.id == 'ldap_group_filter' && !LdapWizard.admin.isExperienced()) {
- LdapWizard.countGroups();
LdapWizard.detectGroupMemberAssoc();
}