From: Andrew Dolgov Date: Thu, 16 Mar 2006 10:57:22 +0000 (+0100) Subject: prevent setting session cookie when user not logged in and tt-rss.php/prefs.php is... X-Git-Tag: schema_freeze_for_1.1.4~4 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7ae65adfc5dc8254bb2749af1f4e0ccc418406ec;p=tt-rss.git prevent setting session cookie when user not logged in and tt-rss.php/prefs.php is requested --- diff --git a/functions.php b/functions.php index a7a17f9b..18546ca1 100644 --- a/functions.php +++ b/functions.php @@ -839,6 +839,17 @@ return true; } + function basic_nosid_redirect_check() { + if (!SINGLE_USER_MODE) { + if (!$_COOKIE["ttrss_sid"]) { + $redirect_uri = get_login_redirect(); + $return_to = preg_replace('/.*?\//', '', $_SERVER["REQUEST_URI"]); + header("Location: $redirect_uri?rt=$return_to"); + exit; + } + } + } + function login_sequence($link) { if (!SINGLE_USER_MODE) { diff --git a/prefs.php b/prefs.php index 7dd81e2b..639f5d86 100644 --- a/prefs.php +++ b/prefs.php @@ -1,11 +1,14 @@