diff options
author | Andrew Dolgov <[email protected]> | 2007-03-01 10:43:54 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2007-03-01 10:43:54 +0100 |
commit | 01a87dff9efecf9070b652f59a52e55bd2db1906 (patch) | |
tree | cdb2be616dfae0a8b8c8a1e9f31bf167ba84e6f7 /functions.js | |
parent | 81596c6612ed98ea2d648300e28bbe1661d97165 (diff) |
rework login process, drop http auth
Diffstat (limited to 'functions.js')
-rw-r--r-- | functions.js | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/functions.js b/functions.js index 292612919..88d750b6b 100644 --- a/functions.js +++ b/functions.js @@ -52,6 +52,17 @@ function xmlhttp_ready(obj) { return obj.readyState == 4 || obj.readyState == 0 || !obj.readyState; } +function logout_callback() { + var container = document.getElementById('notify'); + if (xmlhttp.readyState == 4) { + try { + window.location.reload(true); + } catch (e) { + exception_error("logout_callback", e); + } + } +} + function notify_callback() { var container = document.getElementById('notify'); if (xmlhttp.readyState == 4) { @@ -1527,7 +1538,7 @@ function fatalError(code, message) { try { if (code == 6) { - window.location.href = "login.php?rt=none"; + //window.location.href = "login.php?rt=none"; } else if (code == 5) { window.location.href = "update.php"; } else { @@ -1605,3 +1616,17 @@ function filterDlgCheckAction(sender) { function explainError(code) { return displayDlg("explainError", code); } + +function logoutUser() { + try { + if (xmlhttp_ready(xmlhttp_rpc)) { + xmlhttp_rpc.open("GET", "backend.php?op=rpc&subop=logout", true); + xmlhttp_rpc.onreadystatechange=logout_callback; + xmlhttp_rpc.send(null); + } else { + printLockingError(); + } + } catch (e) { + exception_error("logoutUser", e); + } +} |