From 01a87dff9efecf9070b652f59a52e55bd2db1906 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 1 Mar 2007 10:43:54 +0100 Subject: rework login process, drop http auth --- functions.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'functions.js') 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); + } +} -- cgit v1.2.3-54-g00ecf