aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2014-11-21 16:23:56 +0100
committerArthur Schiwon <blizzz@owncloud.com>2014-11-21 16:23:56 +0100
commit503de94392c0863e29cc8f1a46637f78ce8523ce (patch)
treee07f64eb5011b971e691857ea120ef3555632447 /apps/user_ldap/js
parentc07c338c908653d694df4457dc1739122a1f594c (diff)
downloadnextcloud-server-503de94392c0863e29cc8f1a46637f78ce8523ce.tar.gz
nextcloud-server-503de94392c0863e29cc8f1a46637f78ce8523ce.zip
make updateCount work properly with new xp'd mode as well as without
Diffstat (limited to 'apps/user_ldap/js')
-rw-r--r--apps/user_ldap/js/ldapFilter.js12
-rw-r--r--apps/user_ldap/js/settings.js20
2 files changed, 25 insertions, 7 deletions
diff --git a/apps/user_ldap/js/ldapFilter.js b/apps/user_ldap/js/ldapFilter.js
index 63baec24ecc..4fe8e4aebdf 100644
--- a/apps/user_ldap/js/ldapFilter.js
+++ b/apps/user_ldap/js/ldapFilter.js
@@ -8,6 +8,7 @@ function LdapFilter(target, determineModeCallback) {
this.determineModeCallback = determineModeCallback;
this.foundFeatures = false;
this.activated = false;
+ this.countPending = false;
if( target === 'User' ||
target === 'Login' ||
@@ -25,9 +26,13 @@ LdapFilter.prototype.activate = function() {
this.determineMode();
};
-LdapFilter.prototype.compose = function() {
+LdapFilter.prototype.compose = function(updateCount = false) {
var action;
+ if(updateCount) {
+ this.countPending = updateCount;
+ }
+
if(this.locked) {
this.lazyRunCompose = true;
return false;
@@ -57,6 +62,7 @@ LdapFilter.prototype.compose = function() {
filter.afterComposeSuccess(result);
},
function () {
+ filter.countPending = false;
console.log('LDAP Wizard: could not compose filter. '+
'Please check owncloud.log');
}
@@ -77,6 +83,10 @@ LdapFilter.prototype.afterDetectorsRan = function() {
*/
LdapFilter.prototype.afterComposeSuccess = function(result) {
LdapWizard.applyChanges(result);
+ if(this.countPending) {
+ this.countPending = false;
+ this.updateCount();
+ }
};
LdapFilter.prototype.determineMode = function() {
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index 15c63614f50..9987f6fd015 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -669,7 +669,8 @@ var LdapWizard = {
instantiateFilters: function() {
delete LdapWizard.userFilter;
LdapWizard.userFilter = new LdapFilter('User', function(mode) {
- if(mode === LdapWizard.filterModeAssisted) {
+ if( !LdapWizard.admin.isExperienced()
+ || mode === LdapWizard.filterModeAssisted) {
LdapWizard.userFilter.updateCount();
}
LdapWizard.userFilter.findFeatures();
@@ -689,7 +690,8 @@ var LdapWizard = {
delete LdapWizard.groupFilter;
LdapWizard.groupFilter = new LdapFilter('Group', function(mode) {
- if(mode === LdapWizard.filterModeAssisted) {
+ if( !LdapWizard.admin.isExperienced()
+ || mode === LdapWizard.filterModeAssisted) {
LdapWizard.groupFilter.updateCount();
}
LdapWizard.groupFilter.findFeatures();
@@ -775,6 +777,12 @@ var LdapWizard = {
if(triggerObj.id === 'ldap_loginfilter_username'
|| triggerObj.id === 'ldap_loginfilter_email') {
LdapWizard.loginFilter.compose();
+ } else if (!LdapWizard.admin.isExperienced()) {
+ if(triggerObj.id === 'ldap_userlist_filter') {
+ LdapWizard.userFilter.updateCount();
+ } else if (triggerObj.id === 'ldap_group_filter') {
+ LdapWizard.groupFilter.updateCount();
+ }
}
if($('#ldapSettings').tabs('option', 'active') == 0) {
@@ -804,7 +812,7 @@ var LdapWizard = {
LdapWizard._save($('#'+originalObj)[0], $.trim(values));
if(originalObj === 'ldap_userfilter_objectclass'
|| originalObj === 'ldap_userfilter_groups') {
- LdapWizard.userFilter.compose();
+ LdapWizard.userFilter.compose(!LdapWizard.admin.isExperienced());
//when user filter is changed afterwards, login filter needs to
//be adjusted, too
if(!LdapWizard.loginFilter) {
@@ -815,7 +823,7 @@ var LdapWizard = {
LdapWizard.loginFilter.compose();
} else if(originalObj === 'ldap_groupfilter_objectclass'
|| originalObj === 'ldap_groupfilter_groups') {
- LdapWizard.groupFilter.compose();
+ LdapWizard.groupFilter.compose(!LdapWizard.admin.isExperienced());
}
},
@@ -885,10 +893,10 @@ var LdapWizard = {
LdapWizard._save({ id: modeKey }, LdapWizard.filterModeAssisted);
if(isUser) {
LdapWizard.blacklistRemove('ldap_userlist_filter');
- LdapWizard.userFilter.compose();
+ LdapWizard.userFilter.compose(!LdapWizard.admin.isExperienced());
} else {
LdapWizard.blacklistRemove('ldap_group_filter');
- LdapWizard.groupFilter.compose();
+ LdapWizard.groupFilter.compose(!LdapWizard.admin.isExperienced());
}
}
},