diff options
author | Andrew Dolgov <[email protected]> | 2011-01-11 11:36:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-01-11 11:36:35 +0300 |
commit | 12df6592f337083d9bb0f652851a11fba1310cfd (patch) | |
tree | 7925d336061216d14345fc5923aef4eb96268d98 /functions.php | |
parent | 86268d8ba0baaaef3372abacc8bc77513705d562 (diff) |
add optional AUTO_LOGIN for when remote authentication is allowed (closes #295)
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/functions.php b/functions.php index b2694f7ec..4184880fe 100644 --- a/functions.php +++ b/functions.php @@ -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 = " . |