2008-02-05 17:11:21 +01:00
|
|
|
var LSsession_login = new Class({
|
|
|
|
initialize: function(){
|
2008-02-26 18:40:05 +01:00
|
|
|
this.select_ldapserver = $('LSsession_ldapserver');
|
|
|
|
if ( ! this.select_ldapserver )
|
|
|
|
return;
|
|
|
|
this.select_ldapserver.addEvent('change',this.onLdapServerChanged.bind(this));
|
2008-04-25 15:48:12 +02:00
|
|
|
this.onLdapServerChanged();
|
2008-02-05 17:11:21 +01:00
|
|
|
},
|
|
|
|
|
2008-02-26 18:40:05 +01:00
|
|
|
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();
|
|
|
|
},
|
2008-02-05 17:11:21 +01:00
|
|
|
|
2008-02-26 18:40:05 +01:00
|
|
|
onLdapServerChangedComplete: function(responseText, responseXML){
|
|
|
|
varLSdefault.loadingImgHide();
|
|
|
|
var data = Json.evaluate(responseText);
|
|
|
|
LSdebug(data);
|
|
|
|
if ( data ) {
|
2008-04-25 15:48:12 +02:00
|
|
|
if (data.LSdebug) {
|
|
|
|
varLSdefault.displayDebug(data.LSdebug);
|
|
|
|
}
|
2008-02-26 18:40:05 +01:00
|
|
|
if (data.LSerror) {
|
|
|
|
varLSdefault.displayError(data.LSerror);
|
|
|
|
return;
|
|
|
|
}
|
2008-04-25 15:48:12 +02:00
|
|
|
if (data.list_topDn) {
|
2008-02-26 18:40:05 +01:00
|
|
|
$('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();
|
|
|
|
}
|
|
|
|
}
|
2008-02-05 17:11:21 +01:00
|
|
|
});
|
|
|
|
window.addEvent(window.ie ? 'load' : 'domready', function() {
|
2008-02-26 18:40:05 +01:00
|
|
|
varLSsession_login = new LSsession_login();
|
2008-02-05 17:11:21 +01:00
|
|
|
});
|