Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update login filter when user filter was newly generated #7321

Merged
merged 1 commit into from
Dec 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apps/user_ldap/js/wizard/wizardTabLoginFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ OCA = OCA || {};
setModel: function(configModel) {
this._super(configModel);
this.configModel.on('configLoaded', this.onConfigSwitch, this);
this.configModel.on('configUpdated', this.onConfigUpdated, this);
this.configModel.on('receivedLdapFeature', this.onFeatureReceived, this);
},

Expand Down Expand Up @@ -204,6 +205,22 @@ OCA = OCA || {};
view.onConfigLoaded(view, configuration);
},

/**
* @param {WizardTabLoginFilter} view
* @param {Object} configuration
*/
onConfigUpdated: function(view, configuration) {
// When the user list filter is updated in assisted mode, also
// update the login filter automatically.
if(
!_.isUndefined(configuration.ldap_userlist_filter)
&& view.parsedFilterMode === view.configModel.FILTER_MODE_ASSISTED
&& _.toArray(configuration).length === 1
) {
view.configModel.requestWizard('ldap_login_filter');
}
},

/**
* if UserObjectClasses are found, the corresponding element will be
* updated
Expand Down