1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 22:45:56 +00:00

add optional AUTO_LOGIN for when remote authentication is allowed (closes #295)

This commit is contained in:
Andrew Dolgov
2011-01-11 11:36:35 +03:00
parent 86268d8ba0
commit 12df6592f3
3 changed files with 16 additions and 5 deletions

View File

@@ -1991,9 +1991,15 @@
}
if (!$_SESSION["uid"] || !validate_session($link)) {
render_login_form($link, $mobile);
//header("Location: login.php");
exit;
if (defined('ALLOW_REMOTE_USER_AUTH') && ALLOW_REMOTE_USER_AUTH
&& $_SERVER["REMOTE_USER"] && defined('AUTO_LOGIN') && AUTO_LOGIN) {
authenticate_user($link,$_SERVER['REMOTE_USER'],null);
$_SESSION["ref_schema_version"] = get_schema_version($link, true);
} else {
render_login_form($link, $mobile);
//header("Location: login.php");
exit;
}
} else {
/* bump login timestamp */
db_query($link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " .