diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-01-14 15:15:55 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-01-14 15:15:55 +0100 |
commit | 672bc287154f63cc742812cc76f22869036e20c7 (patch) | |
tree | 0920d8035880cd7e7a3ce5d9fee62dd38b3e0edb /apps | |
parent | 51d783ca6e2d8341531b12224c7e2f51fe70fdfe (diff) | |
download | nextcloud-server-672bc287154f63cc742812cc76f22869036e20c7.tar.gz nextcloud-server-672bc287154f63cc742812cc76f22869036e20c7.zip |
allow to read again objectclasses and groups under certain conditions
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/js/ldapFilter.js | 11 | ||||
-rw-r--r-- | apps/user_ldap/js/settings.js | 22 |
2 files changed, 31 insertions, 2 deletions
diff --git a/apps/user_ldap/js/ldapFilter.js b/apps/user_ldap/js/ldapFilter.js index c77995e0dee..c546e942d07 100644 --- a/apps/user_ldap/js/ldapFilter.js +++ b/apps/user_ldap/js/ldapFilter.js @@ -19,6 +19,8 @@ function LdapFilter(target, determineModeCallback) { LdapFilter.prototype.activate = function() { if(this.activated) { + // might be necessary, if configuration changes happened. + this.findFeatures(); return; } this.activated = true; @@ -136,8 +138,15 @@ LdapFilter.prototype.unlock = function() { } }; +/** + * resets this.foundFeatures so that LDAP queries can be fired again to retrieve + * objectClasses, groups, etc. + */ +LdapFilter.prototype.reAllowFeatureLookup = function () { + this.foundFeatures = false; +}; + LdapFilter.prototype.findFeatures = function() { - //TODO: reset this.foundFeatures when any base DN changes if(!this.foundFeatures && !this.locked && this.mode === LdapWizard.filterModeAssisted) { this.foundFeatures = true; var objcEl, avgrEl; diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js index 3372613b941..2a8fedf5dde 100644 --- a/apps/user_ldap/js/settings.js +++ b/apps/user_ldap/js/settings.js @@ -149,6 +149,7 @@ var LdapWizard = { loginFilter: false, groupFilter: false, ajaxRequests: {}, + lastTestSuccessful: true, ajax: function(param, fnOnSuccess, fnOnError, reqID) { if(!_.isUndefined(reqID)) { @@ -619,6 +620,7 @@ var LdapWizard = { LdapWizard.detectorsRunInXPMode = 0; LdapWizard.instantiateFilters(); LdapWizard.admin.setExperienced($('#ldap_experienced_admin').is(':checked')); + LdapWizard.lastTestSuccessful = true; LdapWizard.basicStatusCheck(); LdapWizard.functionalityCheck(); LdapWizard.isConfigurationActiveControlLocked = false; @@ -760,7 +762,19 @@ var LdapWizard = { } }, - processChanges: function(triggerObj) { + /** + * allows UserFilter, LoginFilter and GroupFilter to lookup objectClasses + * and similar again. This should be called after essential changes, e.g. + * Host or BaseDN changes, or positive functionality check + * + */ + allowFilterFeatureSearch: function () { + LdapWizard.userFilter.reAllowFeatureLookup(); + LdapWizard.loginFilter.reAllowFeatureLookup(); + LdapWizard.groupFilter.reAllowFeatureLookup(); + }, + + processChanges: function (triggerObj) { LdapWizard.hideInfoBox(); if(triggerObj.id === 'ldap_host' @@ -771,6 +785,7 @@ var LdapWizard = { if($('#ldap_port').val()) { //if Port is already set, check BaseDN LdapWizard.checkBaseDN(); + LdapWizard.allowFilterFeatureSearch(); } } @@ -1002,6 +1017,10 @@ var LdapWizard = { $('.ldap_config_state_indicator').addClass('ldap_grey'); $('.ldap_config_state_indicator_sign').removeClass('error'); $('.ldap_config_state_indicator_sign').addClass('success'); + if(!LdapWizard.lastTestSuccessful) { + LdapWizard.lastTestSuccessful = true; + LdapWizard.allowFilterFeatureSearch(); + } }, //onError function(result) { @@ -1011,6 +1030,7 @@ var LdapWizard = { $('.ldap_config_state_indicator').removeClass('ldap_grey'); $('.ldap_config_state_indicator_sign').addClass('error'); $('.ldap_config_state_indicator_sign').removeClass('success'); + LdapWizard.lastTestSuccessful = false; } ); } else { |