mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-21 14:22:44 +00:00
Monotone-Parent: b4ab290388b7487ab5a09d448908ecdc6f29eea7
Monotone-Revision: cd8f65727eef6b9a57f0c17e2acdb44a8d763546 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-09-06T22:18:08 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
function initLogin() {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() - 86400000);
|
||||
document.cookie = ("0xHIGHFLYxSOGo-0.9=discard; path=/"
|
||||
+ "; expires=" + date.toGMTString());
|
||||
var submit = $("submit");
|
||||
Event.observe(submit, "click", onLoginClick);
|
||||
|
||||
var userName = $("userName");
|
||||
userName.focus();
|
||||
Event.observe(submit, "click", onLoginClick);
|
||||
|
||||
var image = $("preparedAnimation");
|
||||
image.parentNode.removeChild(image);
|
||||
@@ -11,9 +16,26 @@ function initLogin() {
|
||||
function onLoginClick(event) {
|
||||
startAnimation($("loginButton"), $("submit"));
|
||||
|
||||
var loginString = $("userName").value + ":" + $("password").value;
|
||||
document.cookie = ("0xHIGHFLYxSOGo-0.9 = basic" + loginString.base64encode()
|
||||
+ "; path=/");
|
||||
var userName = $("userName").value;
|
||||
var password = $("password").value;
|
||||
|
||||
if (userName.length > 0) {
|
||||
var url = ($("connectForm").getAttribute("action")
|
||||
+ "?userName=" + userName
|
||||
+ "&password=" + password);
|
||||
document.cookie = "";
|
||||
triggerAjaxRequest(url, onLoginCallback);
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
function onLoginCallback(http) {
|
||||
if (http.readyState == 4) {
|
||||
if (http.status == 204) {
|
||||
window.location.href = ApplicationBaseURL + $("userName").value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addEvent(window, 'load', initLogin);
|
||||
|
||||
Reference in New Issue
Block a user