* See the COPYING-README file.
*/
+/* global LdapWizard */
+
/**
* controls behaviour depend on whether the admin is experienced in LDAP or not.
*
* switches all LDAP filters from Assisted to Raw mode.
*/
ExperiencedAdmin.prototype.enableRawMode = function() {
- containers = {
+ var containers = {
'toggleRawGroupFilter': '#rawGroupFilterContainer',
'toggleRawLoginFilter': '#rawLoginFilterContainer',
'toggleRawUserFilter' : '#rawUserFilterContainer'
};
- for(method in containers) {
+ for(var method in containers) {
if($(containers[method]).hasClass('invisible')) {
this.wizard[method]();
}
- };
+ }
};
ExperiencedAdmin.prototype.updateUserTab = function(mode) {
this._updateTab(mode, $('#ldap_user_count'));
-}
+};
ExperiencedAdmin.prototype.updateGroupTab = function(mode) {
this._updateTab(mode, $('#ldap_group_count'));
-}
+};
ExperiencedAdmin.prototype._updateTab = function(mode, $countEl) {
if(mode === LdapWizard.filterModeAssisted) {
} else {
$countEl.addClass('hidden');
}
-}
+};
/**
* hide user and group counters, they will be displayed on demand only
/* global LdapWizard */
-function LdapFilter(target, determineModeCallback) {
+function LdapFilter(target, determineModeCallback) {
this.locked = true;
this.target = false;
this.mode = LdapWizard.filterModeAssisted;
target === 'Group') {
this.target = target;
}
-}
+};
LdapFilter.prototype.activate = function() {
if(this.activated) {
this.activated = true;
this.determineMode();
-}
+};
LdapFilter.prototype.compose = function(callback) {
var action;
if(mode === LdapWizard.filterModeAssisted || mode === LdapWizard.filterModeRaw) {
this.mode = mode;
}
-}
+};
LdapFilter.prototype.getMode = function() {
return this.mode;
-}
+};
LdapFilter.prototype.unlock = function() {
this.locked = false;
//TODO: reset this.foundFeatures when any base DN changes
if(!this.foundFeatures && !this.locked && this.mode === LdapWizard.filterModeAssisted) {
this.foundFeatures = true;
+ var objcEl, avgrEl;
if(this.target === 'User') {
objcEl = 'ldap_userfilter_objectclass';
avgrEl = 'ldap_userfilter_groups';
values = values + "\n" + resultObj[i].value;
}
LdapWizard._save($('#'+originalObj)[0], $.trim(values));
- if(originalObj == 'ldap_userfilter_objectclass'
- || originalObj == 'ldap_userfilter_groups') {
+ if(originalObj === 'ldap_userfilter_objectclass'
+ || originalObj === 'ldap_userfilter_groups') {
LdapWizard.userFilter.compose(LdapWizard.detectEmailAttribute);
//when user filter is changed afterwards, login filter needs to
//be adjusted, too