smaller corrections to make scruitinizer happier, no effective changes

This commit is contained in:
Arthur Schiwon 2014-10-08 16:20:52 +02:00
parent ab3535855f
commit 02985c9ec5
3 changed files with 16 additions and 13 deletions

View File

@ -4,6 +4,8 @@
* See the COPYING-README file.
*/
/* global LdapWizard */
/**
* controls behaviour depend on whether the admin is experienced in LDAP or not.
*
@ -48,26 +50,26 @@ ExperiencedAdmin.prototype.isExperienced = function() {
* 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) {
@ -77,7 +79,7 @@ ExperiencedAdmin.prototype._updateTab = function(mode, $countEl) {
} else {
$countEl.addClass('hidden');
}
}
};
/**
* hide user and group counters, they will be displayed on demand only

View File

@ -1,6 +1,6 @@
/* global LdapWizard */
function LdapFilter(target, determineModeCallback) {
function LdapFilter(target, determineModeCallback) {
this.locked = true;
this.target = false;
this.mode = LdapWizard.filterModeAssisted;
@ -14,7 +14,7 @@ function LdapFilter(target, determineModeCallback) {
target === 'Group') {
this.target = target;
}
}
};
LdapFilter.prototype.activate = function() {
if(this.activated) {
@ -23,7 +23,7 @@ LdapFilter.prototype.activate = function() {
this.activated = true;
this.determineMode();
}
};
LdapFilter.prototype.compose = function(callback) {
var action;
@ -111,11 +111,11 @@ LdapFilter.prototype.setMode = function(mode) {
if(mode === LdapWizard.filterModeAssisted || mode === LdapWizard.filterModeRaw) {
this.mode = mode;
}
}
};
LdapFilter.prototype.getMode = function() {
return this.mode;
}
};
LdapFilter.prototype.unlock = function() {
this.locked = false;
@ -129,6 +129,7 @@ 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;
if(this.target === 'User') {
objcEl = 'ldap_userfilter_objectclass';
avgrEl = 'ldap_userfilter_groups';

View File

@ -694,8 +694,8 @@ var LdapWizard = {
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