mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-19 08:39:06 +01:00
748c9d3ec3
- Correction de bugs - Passage à Net_LDAP2 - Ajout du changement de niveau de l'annuaire durant la navigation
52 lines
1.6 KiB
JavaScript
52 lines
1.6 KiB
JavaScript
var LSsession_login = new Class({
|
|
initialize: function(){
|
|
this.select_ldapserver = $('LSsession_ldapserver');
|
|
if ( ! this.select_ldapserver )
|
|
return;
|
|
this.select_ldapserver.addEvent('change',this.onLdapServerChanged.bind(this));
|
|
this.onLdapServerChanged();
|
|
},
|
|
|
|
onLdapServerChanged: function(){
|
|
var imgload = varLSdefault.loadingImgDisplay(this.select_ldapserver);
|
|
var server = this.select_ldapserver.value;
|
|
var data = {
|
|
template: 'login',
|
|
action: 'onLdapServerChanged',
|
|
server: server,
|
|
imgload: imgload
|
|
};
|
|
new Ajax('index_ajax.php', {data: data, onComplete: this.onLdapServerChangedComplete.bind(this)}).request();
|
|
},
|
|
|
|
onLdapServerChangedComplete: function(responseText, responseXML){
|
|
varLSdefault.loadingImgHide();
|
|
var data = Json.evaluate(responseText);
|
|
LSdebug(data);
|
|
if ( data ) {
|
|
if (data.LSdebug) {
|
|
varLSdefault.displayDebug(data.LSdebug);
|
|
}
|
|
if (data.LSerror) {
|
|
varLSdefault.displayError(data.LSerror);
|
|
return;
|
|
}
|
|
if (data.list_topDn) {
|
|
$('LSsession_topDn').getParent().setHTML(data.list_topDn);
|
|
LSdebug($('LSsession_topDn').innerHTML);
|
|
$$('.loginform-level').each(function(el) {
|
|
el.setStyle('display','block');
|
|
});
|
|
}
|
|
}
|
|
else {
|
|
$$('.loginform-level').each(function(el) {
|
|
el.setStyle('display','none');
|
|
});
|
|
$('LSsession_topDn').empty();
|
|
}
|
|
}
|
|
});
|
|
window.addEvent(window.ie ? 'load' : 'domready', function() {
|
|
varLSsession_login = new LSsession_login();
|
|
});
|