mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-28 14:45:28 +00:00
See ChangeLog
Monotone-Parent: 024380d579a482e49866c36ef54561cf8b39ab02 Monotone-Revision: 2cbc46c16f9b3d45d868b15a968f614dbbaf9749 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-03-08T15:18:05 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1695,6 +1695,34 @@ AIM = {
|
||||
i.onComplete(d.body.innerHTML);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function readCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for(var i=0;i < ca.length;i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function readLoginCookie() {
|
||||
var loginValues = null;
|
||||
var cookie = readCookie("0xHIGHFLYxSOGo");
|
||||
if (cookie && cookie.length > 8) {
|
||||
var value = decodeURIComponent(cookie.substr(8));
|
||||
loginValues = value.base64decode().split(":");
|
||||
}
|
||||
|
||||
return loginValues;
|
||||
}
|
||||
|
||||
function setLoginCookie(username, password) {
|
||||
var value = (username + ":" + password).base64encode();
|
||||
var cookieValue = encodeURIComponent("basic " + value);
|
||||
window.alert("0xHIGHFLYxSOGo=" + cookieValue);
|
||||
}
|
||||
|
||||
document.observe("dom:loaded", onLoadHandler);
|
||||
|
||||
Reference in New Issue
Block a user