]> git.wh0rd.org Git - tt-rss.git/commitdiff
add optional AUTO_LOGIN for when remote authentication is allowed (closes #295)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 11 Jan 2011 08:36:35 +0000 (11:36 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 11 Jan 2011 08:36:35 +0000 (11:36 +0300)
config.php-dist
functions.php
sanity_check.php

index 89135389f23d83ab4a896d25039796fff55e8e48..bd61c9bf0f3b461d663d94b023fd9e4bf058704d 100644 (file)
        // option can be used to integrate tt-rss with Apache's external
        // 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');
        // Directory for lockfiles, must be writable to the user you run
        // daemon process or cronjobs under.
        // Your OAuth instance authentication information for Twitter, visit
        // 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
        // if necessary (after migrating all new options from this file).
 
index b2694f7ecbb51a2bd1c1c897caf988c23d5dcc01..4184880fed2af5a57b2e590d53cfd143ceab0bcb 100644 (file)
                        }
 
                        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 = " . 
index 567be65eed023b7916e8e4a90042c872fc16d5cf..35d5c2a7f89c0f5d9c9ef63ffc71e96ac56626de 100644 (file)
@@ -1,7 +1,7 @@
 <?php
        require_once "functions.php";
 
-       define('EXPECTED_CONFIG_VERSION', 20);
+       define('EXPECTED_CONFIG_VERSION', 21);
        define('SCHEMA_VERSION', 78);
 
        if (!file_exists("config.php")) {