From: Andrew Dolgov Date: Thu, 1 Mar 2007 12:57:31 +0000 (+0100) Subject: login system fixes (3) X-Git-Tag: 1.2.9~70 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a885f0ec2a4b20f9a0efb910815684422c15c945;p=tt-rss.git login system fixes (3) --- diff --git a/functions.php b/functions.php index 70cc16cc..ada1b716 100644 --- a/functions.php +++ b/functions.php @@ -1168,14 +1168,15 @@ } } - if ($_SESSION["cookie_lifetime"] && $_SESSION["uid"]) { +/* if ($_SESSION["cookie_lifetime"] && $_SESSION["uid"]) { //print_r($_SESSION); if (time() > $_SESSION["cookie_lifetime"]) { return false; } - } + } */ + return true; } @@ -1190,6 +1191,10 @@ } } + if ($_COOKIE["ttrss_sid"]) { + require_once "sessions.php"; + } + if (!validate_session($link)) { logout_user(); render_login_form($link); @@ -1204,13 +1209,21 @@ $password = $_POST["password"]; $remember_me = $_POST["remember_me"]; + if ($remember_me) { + session_set_cookie_params(SESSION_COOKIE_LIFETIME_REMEMBER); + } else { + session_set_cookie_params(SESSION_COOKIE_LIFETIME); + } + + require_once "sessions.php"; + if (authenticate_user($link, $login, $password)) { $_POST["password"] = ""; if ($remember_me) { $_SESSION["cookie_lifetime"] = time() + SESSION_COOKIE_LIFETIME_REMEMBER; - } else if (SESSION_COOKIE_LIFETIME > 0) { + } else if (SESSION_COOKIE_LIFETIME) { $_SESSION["cookie_lifetime"] = time() + SESSION_COOKIE_LIFETIME; } @@ -1230,6 +1243,7 @@ } } else { + require_once "sessions.php"; return authenticate_user($link, "admin", null); } } diff --git a/opml.php b/opml.php index ff888d24..dd73a846 100644 --- a/opml.php +++ b/opml.php @@ -1,5 +1,5 @@ diff --git a/tt-rss.php b/tt-rss.php index ef9f2437..f39396ec 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -1,6 +1,6 @@