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

master
Andrew Dolgov 14 years ago
parent 86268d8ba0
commit 12df6592f3

@ -136,6 +136,11 @@
// option can be used to integrate tt-rss with Apache's external // option can be used to integrate tt-rss with Apache's external
// authentication modules. // authentication modules.
define('AUTO_LOGIN', false);
// Set this to true if you use ALLOW_REMOTE_USER_AUTH and you want
// to skip the login form. If set to true, users won't be able to
// set application language and settings profile.
define('LOCK_DIRECTORY', 'lock'); define('LOCK_DIRECTORY', 'lock');
// Directory for lockfiles, must be writable to the user you run // Directory for lockfiles, must be writable to the user you run
// daemon process or cronjobs under. // daemon process or cronjobs under.
@ -184,7 +189,7 @@
// Your OAuth instance authentication information for Twitter, visit // Your OAuth instance authentication information for Twitter, visit
// http://twitter.com/oauth_clients to register your instance. // http://twitter.com/oauth_clients to register your instance.
define('CONFIG_VERSION', 20); define('CONFIG_VERSION', 21);
// Expected config version. Please update this option in config.php // Expected config version. Please update this option in config.php
// if necessary (after migrating all new options from this file). // if necessary (after migrating all new options from this file).

@ -1991,9 +1991,15 @@
} }
if (!$_SESSION["uid"] || !validate_session($link)) { if (!$_SESSION["uid"] || !validate_session($link)) {
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); render_login_form($link, $mobile);
//header("Location: login.php"); //header("Location: login.php");
exit; exit;
}
} else { } else {
/* bump login timestamp */ /* bump login timestamp */
db_query($link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " . db_query($link, "UPDATE ttrss_users SET last_login = NOW() WHERE id = " .

@ -1,7 +1,7 @@
<?php <?php
require_once "functions.php"; require_once "functions.php";
define('EXPECTED_CONFIG_VERSION', 20); define('EXPECTED_CONFIG_VERSION', 21);
define('SCHEMA_VERSION', 78); define('SCHEMA_VERSION', 78);
if (!file_exists("config.php")) { if (!file_exists("config.php")) {

Loading…
Cancel
Save