1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-24 18:11:28 +00:00

option to redirect to https url for login, option ENABLE_LOGIN_SSL (fixes some non-absolute redirects)

This commit is contained in:
Andrew Dolgov
2005-12-09 21:34:29 +01:00
parent a24f525cce
commit 75836f3386
4 changed files with 43 additions and 5 deletions

View File

@@ -723,12 +723,34 @@
session_destroy();
}
function get_script_urlpath() {
$request_uri = $_SERVER["REQUEST_URI"];
return preg_replace('/\/[^\/]+$/', "", $request_uri);
}
function get_login_redirect() {
$server = $_SERVER["SERVER_NAME"];
if (ENABLE_LOGIN_SSL) {
$protocol = "https";
} else {
$protocol = "http";
}
$url_path = get_script_urlpath();
$redirect_uri = "$protocol://$server$url_path/login.php";
return $redirect_uri;
}
function login_sequence($link) {
if (!SINGLE_USER_MODE) {
if (!USE_HTTP_AUTH) {
if (!$_SESSION["uid"]) {
header("Location: login.php?rt=tt-rss.php");
$redirect_uri = get_login_redirect();
header("Location: $redirect_uri?rt=tt-rss.php");
exit;
}
} else {