diff --git a/functions.js b/functions.js index db1351510..d701710ce 100644 --- a/functions.js +++ b/functions.js @@ -779,6 +779,11 @@ function hideOrShowFeedsCategory(doc, node, hide, cat_node) { var cat_unread = 0; + if (!node) { + debug("hideOrShowFeeds: passed node is null, aborting"); + return; + } + if (node.hasChildNodes() && node.firstChild.nextSibling != false) { for (i = 0; i < node.childNodes.length; i++) { if (node.childNodes[i].nodeName != "LI") { continue; } @@ -1394,12 +1399,18 @@ function storeInitParams(params, is_client) { function fatalError(code, message) { try { - var fe = document.getElementById("fatal_error"); - var fc = document.getElementById("fatal_error_msg"); - fc.innerHTML = "Code " + code + ": " + message; + if (code != 6) { - fe.style.display = "block"; + var fe = document.getElementById("fatal_error"); + var fc = document.getElementById("fatal_error_msg"); + + fc.innerHTML = "Code " + code + ": " + message; + + fe.style.display = "block"; + } else { + window.location.href = "login.php?rt=none"; + } } catch (e) { exception_error("fatalError", e); diff --git a/login.php b/login.php index 8cd2a5c5d..27170c96b 100644 --- a/login.php +++ b/login.php @@ -9,6 +9,7 @@ $error_msg = ""; $url_path = get_script_urlpath(); + $return_to = $_REQUEST["rt"]; if (ENABLE_LOGIN_SSL) { $redirect_base = "https://" . $_SERVER["SERVER_NAME"] . $url_path; @@ -16,7 +17,7 @@ $redirect_base = "http://" . $_SERVER["SERVER_NAME"] . $url_path; } - if (SINGLE_USER_MODE) { + if (SINGLE_USER_MODE && $return_to != "none") { header("Location: $redirect_base/tt-rss.php"); exit; } @@ -25,10 +26,9 @@ $login = $_POST["login"]; $password = $_POST["password"]; - $return_to = $_POST["rt"]; $action = $_POST["action"]; - if ($_COOKIE[get_session_cookie_name()]) { + if ($_COOKIE[get_session_cookie_name()] && $return_to != "none") { require_once "sessions.php"; if ($_SESSION["uid"]) { initialize_user_prefs($link, $_SESSION["uid"]); @@ -129,7 +129,8 @@ window.onload = init;