fixing some JSHint warnings
This commit is contained in:
parent
1c57ffa16f
commit
e0cac32442
2 changed files with 18 additions and 17 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
/* global LdapWizard */
|
||||||
|
|
||||||
function LdapFilter(target) {
|
function LdapFilter(target) {
|
||||||
this.locked = true;
|
this.locked = true;
|
||||||
this.target = false;
|
this.target = false;
|
||||||
|
@ -49,12 +51,12 @@ LdapFilter.prototype.compose = function() {
|
||||||
LdapWizard.detectGroupMemberAssoc();
|
LdapWizard.detectGroupMemberAssoc();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function (result) {
|
function () {
|
||||||
console.log('LDAP Wizard: could not compose filter. '+
|
console.log('LDAP Wizard: could not compose filter. '+
|
||||||
'Please check owncloud.log');
|
'Please check owncloud.log');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
LdapFilter.prototype.determineMode = function() {
|
LdapFilter.prototype.determineMode = function() {
|
||||||
var param = 'action=get'+encodeURIComponent(this.target)+'FilterMode'+
|
var param = 'action=get'+encodeURIComponent(this.target)+'FilterMode'+
|
||||||
|
@ -64,13 +66,13 @@ LdapFilter.prototype.determineMode = function() {
|
||||||
var filter = this;
|
var filter = this;
|
||||||
LdapWizard.ajax(param,
|
LdapWizard.ajax(param,
|
||||||
function(result) {
|
function(result) {
|
||||||
property = 'ldap' + filter.target + 'FilterMode';
|
var property = 'ldap' + filter.target + 'FilterMode';
|
||||||
filter.mode = parseInt(result.changes[property]);
|
filter.mode = parseInt(result.changes[property], 10);
|
||||||
if(filter.mode === LdapWizard.filterModeRaw
|
if(filter.mode === LdapWizard.filterModeRaw &&
|
||||||
&& $('#raw'+filter.target+'FilterContainer').hasClass('invisible')) {
|
$('#raw'+filter.target+'FilterContainer').hasClass('invisible')) {
|
||||||
LdapWizard['toggleRaw'+filter.target+'Filter']();
|
LdapWizard['toggleRaw'+filter.target+'Filter']();
|
||||||
} else if(filter.mode === LdapWizard.filterModeAssisted
|
} else if(filter.mode === LdapWizard.filterModeAssisted &&
|
||||||
&& !$('#raw'+filter.target+'FilterContainer').hasClass('invisible')) {
|
!$('#raw'+filter.target+'FilterContainer').hasClass('invisible')) {
|
||||||
LdapWizard['toggleRaw'+filter.target+'Filter']();
|
LdapWizard['toggleRaw'+filter.target+'Filter']();
|
||||||
} else {
|
} else {
|
||||||
console.log('LDAP Wizard determineMode: returned mode was »' +
|
console.log('LDAP Wizard determineMode: returned mode was »' +
|
||||||
|
@ -78,7 +80,7 @@ LdapFilter.prototype.determineMode = function() {
|
||||||
}
|
}
|
||||||
filter.unlock();
|
filter.unlock();
|
||||||
},
|
},
|
||||||
function (result) {
|
function () {
|
||||||
//on error case get back to default i.e. Assisted
|
//on error case get back to default i.e. Assisted
|
||||||
if(!$('#raw'+filter.target+'FilterContainer').hasClass('invisible')) {
|
if(!$('#raw'+filter.target+'FilterContainer').hasClass('invisible')) {
|
||||||
LdapWizard['toggleRaw'+filter.target+'Filter']();
|
LdapWizard['toggleRaw'+filter.target+'Filter']();
|
||||||
|
@ -87,8 +89,7 @@ LdapFilter.prototype.determineMode = function() {
|
||||||
filter.unlock();
|
filter.unlock();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
};
|
||||||
}
|
|
||||||
|
|
||||||
LdapFilter.prototype.unlock = function() {
|
LdapFilter.prototype.unlock = function() {
|
||||||
this.locked = false;
|
this.locked = false;
|
||||||
|
@ -96,4 +97,4 @@ LdapFilter.prototype.unlock = function() {
|
||||||
this.lazyRunCompose = false;
|
this.lazyRunCompose = false;
|
||||||
this.compose();
|
this.compose();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
|
@ -14,7 +14,7 @@ var LdapConfiguration = {
|
||||||
|
|
||||||
//deal with Checkboxes
|
//deal with Checkboxes
|
||||||
if($(elementID).is('input[type=checkbox]')) {
|
if($(elementID).is('input[type=checkbox]')) {
|
||||||
if(parseInt(configvalue) === 1) {
|
if(parseInt(configvalue, 10) === 1) {
|
||||||
$(elementID).attr('checked', 'checked');
|
$(elementID).attr('checked', 'checked');
|
||||||
} else {
|
} else {
|
||||||
$(elementID).removeAttr('checked');
|
$(elementID).removeAttr('checked');
|
||||||
|
@ -478,7 +478,7 @@ var LdapWizard = {
|
||||||
},
|
},
|
||||||
|
|
||||||
functionalityCheck: function() {
|
functionalityCheck: function() {
|
||||||
//criterias to enable the connection:
|
//criteria to enable the connection:
|
||||||
// - host, port, basedn, user filter, login filter
|
// - host, port, basedn, user filter, login filter
|
||||||
host = $('#ldap_host').val();
|
host = $('#ldap_host').val();
|
||||||
port = $('#ldap_port').val();
|
port = $('#ldap_port').val();
|
||||||
|
@ -575,8 +575,8 @@ var LdapWizard = {
|
||||||
},
|
},
|
||||||
|
|
||||||
postInitUserFilter: function() {
|
postInitUserFilter: function() {
|
||||||
if(LdapWizard.userFilterObjectClassesHasRun
|
if(LdapWizard.userFilterObjectClassesHasRun &&
|
||||||
&& LdapWizard.userFilterAvailableGroupsHasRun) {
|
LdapWizard.userFilterAvailableGroupsHasRun) {
|
||||||
LdapWizard.userFilter.compose();
|
LdapWizard.userFilter.compose();
|
||||||
LdapWizard.countUsers();
|
LdapWizard.countUsers();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue