From: Andrew Dolgov Date: Sun, 20 Nov 2005 10:14:38 +0000 (+0100) Subject: fix http basic authentication X-Git-Tag: schema_feature_freeze_for_1.1~162 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=8cb7480484d03a06663ac031ad3db33ea46b77ae;p=tt-rss.git fix http basic authentication --- diff --git a/functions.php b/functions.php index 77388106..b6c426f5 100644 --- a/functions.php +++ b/functions.php @@ -604,9 +604,9 @@ } - function http_authenticate_user($link) { + function http_authenticate_user($link, $force_logout) { - if (!$_SERVER['PHP_AUTH_USER']) { + if (!$_SERVER['PHP_AUTH_USER'] || $force_logout) { header('WWW-Authenticate: Basic realm="Tiny Tiny RSS"'); header('HTTP/1.0 401 Unauthorized'); diff --git a/logout.php b/logout.php index c43d86cb..cfc9fd03 100644 --- a/logout.php +++ b/logout.php @@ -1,12 +1,17 @@ diff --git a/prefs.php b/prefs.php index 0673fd36..ac874a8e 100644 --- a/prefs.php +++ b/prefs.php @@ -12,11 +12,12 @@ if (!USE_HTTP_AUTH) { if (!$_SESSION["uid"]) { - header("Location: login.php?rt=prefs.php"); + header("Location: login.php?rt=tt-rss.php"); exit; } } else { - authenticate_user($link); + $force_logout = $_POST["ForceLogout"]; + http_authenticate_user($link, $force_logout == "yes"); } } else { $_SESSION["uid"] = 1; diff --git a/tt-rss.css b/tt-rss.css index 0e919c10..7c325788 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -587,6 +587,12 @@ td.welcomePrompt { } +td.httpWelcomePrompt { + font-size : small; + color : gray; + text-align : right; +} + table.loginForm { background-image : url("images/vgrad_light_rev.png"); background-color : white; diff --git a/tt-rss.php b/tt-rss.php index 0f4a72dc..9e04bc67 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -16,7 +16,8 @@ exit; } } else { - authenticate_user($link); + $force_logout = $_POST["ForceLogout"]; + http_authenticate_user($link, $force_logout == "yes"); } } else { $_SESSION["uid"] = 1; @@ -77,7 +78,18 @@ - Hello, (Logout) + + + +
Hello,
+ + +
+
+ + Hello, (Logout) + +