nextcloud/apps/user_ldap/js/wizard/wizardTabLoginFilter.js

272 lines
8.5 KiB
JavaScript
Raw Normal View History

LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
/**
* Copyright (c) 2015, Arthur Schiwon <blizzz@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
OCA = OCA || {};
(function() {
/**
* @classdesc This class represents the view belonging to the login filter
* tab in the LDAP wizard.
*/
var WizardTabLoginFilter = OCA.LDAP.Wizard.WizardTabGeneric.subClass({
/**
* initializes the instance. Always call it after initialization.
*
* @param tabIndex
* @param tabID
*/
init: function (tabIndex, tabID) {
this._super(tabIndex, tabID);
var items = {
ldap_loginfilter_username: {
$element: $('#ldap_loginfilter_username'),
setMethod: 'setLoginAttributeUsername'
},
ldap_loginfilter_email: {
$element: $('#ldap_loginfilter_email'),
setMethod: 'setLoginAttributeEmail'
},
ldap_login_filter_mode: {
setMethod: 'setFilterModeOnce'
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
},
ldap_loginfilter_attributes: {
$element: $('#ldap_loginfilter_attributes'),
setMethod: 'setLoginAttributesOther'
},
ldap_login_filter: {
$element: $('#ldap_login_filter'),
setMethod: 'setLoginFilter'
},
loginFilterRawToggle: {
$element: $('#toggleRawLoginFilter')
},
loginFilterRawContainer: {
$element: $('#rawLoginFilterContainer')
},
ldap_test_loginname: {
$element: $('#ldap_test_loginname'),
$relatedElements: $('.ldapVerifyLoginName')
}
};
this.setManagedItems(items);
this.filterModeKey = 'ldapLoginFilterMode';
this._initMultiSelect(
this.managedItems.ldap_loginfilter_attributes.$element,
t('user_ldap', 'Select attributes')
);
this.filterName = 'ldap_login_filter';
this._initFilterModeSwitcher(
this.managedItems.loginFilterRawToggle.$element,
this.managedItems.loginFilterRawContainer.$element,
[
this.managedItems.ldap_loginfilter_username.$element,
this.managedItems.ldap_loginfilter_email.$element,
this.managedItems.ldap_loginfilter_attributes.$element
],
'ldap_login_filter_mode'
);
_.bindAll(this, 'onVerifyClick', 'onTestLoginnameChange');
this.managedItems.ldap_test_loginname.$element.keyup(this.onTestLoginnameChange);
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
this.managedItems.ldap_test_loginname.$relatedElements.click(this.onVerifyClick);
},
/**
* Sets the config model for this view and subscribes to some events.
* Also binds the config chooser to the model
*
* @param {OCA.LDAP.Wizard.ConfigModel} configModel
*/
setModel: function(configModel) {
this._super(configModel);
this.configModel.on('configLoaded', this.onConfigSwitch, this);
this.configModel.on('configUpdated', this.onConfigUpdated, this);
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
this.configModel.on('receivedLdapFeature', this.onFeatureReceived, this);
},
/**
* sets the selected attributes
*
* @param {Array} attributes
*/
setLoginAttributesOther: function(attributes) {
this.setElementValue(this.managedItems.ldap_loginfilter_attributes.$element, attributes);
this.managedItems.ldap_loginfilter_attributes.$element.multiselect('refresh');
},
/**
* sets the login list filter
*
* @param {string} filter
*/
setLoginFilter: function(filter) {
this.setElementValue(this.managedItems.ldap_login_filter.$element, filter);
this.$filterModeRawContainer.siblings('.ldapReadOnlyFilterContainer').find('.ldapFilterReadOnlyElement').text(filter);
},
/**
* updates the username attribute check box
*
* @param {string} useUsername contains an int
*/
setLoginAttributeUsername: function(useUsername) {
this.setElementValue(
this.managedItems.ldap_loginfilter_username.$element, useUsername
);
},
/**
* updates the email attribute check box
*
* @param {string} useEmail contains an int
*/
setLoginAttributeEmail: function(useEmail) {
this.setElementValue(
this.managedItems.ldap_loginfilter_email.$element, useEmail
);
},
/**
* presents the result of the login name test
*
* @param result
*/
handleLoginTestResult: function(result) {
var message;
var isHtml = false;
if(result.status === 'success') {
var usersFound = parseInt(result.changes.ldap_test_loginname, 10);
if(usersFound < 1) {
2015-04-09 15:49:11 +03:00
var filter = $('<p>').text(result.changes.ldap_test_effective_filter).html();
2017-07-14 16:32:47 +03:00
message = t('user_ldap', 'User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command-line validation): <br/>' + filter);
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
console.warn(filter);
isHtml = true;
} else if(usersFound === 1) {
message = t('user_ldap', 'User found and settings verified.');
} else if(usersFound > 1) {
2017-07-14 16:32:47 +03:00
message = t('user_ldap', 'Consider narrowing your search, as it encompassed many users, only the first one of whom will be able to log in.');
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
}
} else {
2017-07-14 16:32:47 +03:00
message = t('user_ldap', 'An unspecified error occurred. Please check log and settings.');
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
if(!_.isUndefined(result.message) && result.message) {
message = result.message;
}
if(message === 'Bad search filter') {
message = t('user_ldap', 'The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise.');
} else if(message === 'connection error') {
2021-06-01 11:28:54 +03:00
message = t('user_ldap', 'A connection error to LDAP/AD occurred. Please check host, port and credentials.');
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
} else if(message === 'missing placeholder') {
message = t('user_ldap', 'The "%uid" placeholder is missing. It will be replaced with the login name when querying LDAP/AD.');
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
}
}
OC.Notification.showTemporary(message, {isHTML: isHtml});
},
/**
* @inheritdoc
*/
considerFeatureRequests: function() {
if(!this.isActive) {
return;
}
if(this.managedItems.ldap_loginfilter_attributes.$element.find('option').length === 0) {
this.disableElement(this.managedItems.ldap_loginfilter_attributes.$element);
if(this.parsedFilterMode === this.configModel.FILTER_MODE_ASSISTED) {
this.configModel.requestWizard('ldap_loginfilter_attributes');
}
}
},
/**
* @inheritdoc
*/
onActivate: function() {
this._super();
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
this.considerFeatureRequests();
if(!this.managedItems.ldap_login_filter.$element.val()) {
this.configModel.requestWizard('ldap_login_filter');
}
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
},
/**
* resets the view when a configuration switch happened.
*
* @param {WizardTabLoginFilter} view
* @param {Object} configuration
*/
onConfigSwitch: function(view, configuration) {
view.managedItems.ldap_loginfilter_attributes.$element.find('option').remove();
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');
}
},
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
/**
* if UserObjectClasses are found, the corresponding element will be
* updated
*
* @param {WizardTabLoginFilter} view
* @param {FeaturePayload} payload
*/
onFeatureReceived: function(view, payload) {
if(payload.feature === 'AvailableAttributes') {
view.equipMultiSelect(view.managedItems.ldap_loginfilter_attributes.$element, payload.data);
} else if(payload.feature === 'TestLoginName') {
view.handleLoginTestResult(payload.data);
}
},
/**
* request to test the provided login name
*
* @param {Event} event
*/
onVerifyClick: function(event) {
event.preventDefault();
var testLogin = this.managedItems.ldap_test_loginname.$element.val();
if(!testLogin) {
OC.Notification.showTemporary(t('user_ldap', 'Please provide a login name to test against'), 3);
} else {
this.configModel.requestWizard('ldap_test_loginname', {ldap_test_loginname: testLogin});
}
},
/**
* enables/disables the "Verify Settings" button, depending whether
* the corresponding text input has a value or not
*/
onTestLoginnameChange: function() {
var loginName = this.managedItems.ldap_test_loginname.$element.val();
var beDisabled = !_.isString(loginName) || !loginName.trim();
2015-11-05 15:43:50 +03:00
if(beDisabled) {
this.disableElement(this.managedItems.ldap_test_loginname.$relatedElements);
} else {
this.enableElement(this.managedItems.ldap_test_loginname.$relatedElements);
}
LDAP Wizard Overhaul wizard refactor reimplement save spinners and cursor implement Port detector introduced detector queue, added base dn detector disable input fields when detectors are running introduce spinners for fields that are being updated by detector cache jq element objects consolidate processing of detector results in generic / abstract base class display notification if a detector discovered a problem don't run base dn detector if a base is configured reset detector queue on configuration switch implement functionality check and update of status indicator document ConfigModel jsdoc for controller and main view more documentation implement the user filter tab view so far the multiselects get initialized (not filled yet) and the mode can be switched. mode is also restored. reintroduce filter switch confirmation in admin XP mode new detector for user object classes. so we also load user object classes if necessary and are able to save and show the setting. multiselect trigger save actions now on close only show spinners automatically, when a detector is running 20k limit for object classes preselection test adjust wordings, fix grammar add group (for users tab) detector also includes wording fixes error presentation moved from detectors to view, where it belongs add info label to users page missing wording changes show effective LDAP filter in Assisted Mode add user filter detector implement count button for users and limit all count actions to 1001 for performance reasons make port field a bit bigger. not perfect though. do not detect port automatically implement login filter tab view only load features in assisted mode and don't enable assisted fields while in raw mode add tooltips on login filter checkbox options for better understanding permanently show filter on login tab and also compile login filter in assisted mode test/verify button on login attributes tab, with backend changes. only run wizard requests if your an active tab. also run compile filter requests when switching to assisted mode underline toggle filter links to stress that they are clickable unity user and group tab functionality in common abstract class, add group filter tab view. only detectors and template adjustments left to have group tab implementation complete add object class and group detector for groups as well as filter composer show ldap filter permanently on groups tab introduce input element that can deal better with many groups, will be used with > 40 fix disabling complex group chooser while detection is running hide complex group chooser on config switch fix few more issues with complex chooser make complex group chooser available on Users tab as well detect base dn improvements/changes: - do not look for Base DN automatically, offer a button instead - fix for alternative way to detect a base dn (if agent dn is not given) - do not trigger filter composers on config switch Changes with configuration chooser controls - "New" was removed out of the configuration list - and split into buttons "add" and "copy" - delete button is also now an icon add test button for Base DN reimplement advanced tab. The save button is gone. reimplement expert tab remove unused methods implement mail attribute detector implement user display name attribute detection implement member group association detector replace text input with textarea for raw filter input finish functionality check auto-enable good configurations, as it was before cleanup move save confirmation handling to base class, reduces code duplication enable tabs only if no running save processes are left. move onConfigLoaded to base class, avoids code duplication simplify, save LOCs Test Configuration button to be dealt with in main view as it is a cross-tab element require detectorQueue in constructor cleanup put bootstrap into a function and thus make it testable get rid of old stuff
2015-03-03 13:56:03 +03:00
}
});
OCA.LDAP.Wizard.WizardTabLoginFilter = WizardTabLoginFilter;
})();