]> git.wh0rd.org Git - tt-rss.git/commitdiff
new option: ALLOW_REMOTE_USER_AUTH
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 5 Dec 2007 09:07:33 +0000 (10:07 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 5 Dec 2007 09:07:33 +0000 (10:07 +0100)
config.php-dist
functions.php
sanity_check.php

index 8001513d0c5c671a9cd1971295ecccda8b2fa6fd..5edb79aa34d25d513e412843570e134aabac3d27 100644 (file)
        define('DAEMON_FEED_LIMIT', 100);
        // Limits the amount of feeds daemon updates on one run
 
-       define('CONFIG_VERSION', 12);
+       define('ALLOW_REMOTE_USER_AUTH', false);
+   // Set to 'true' if you trust your web server's REMOTE_USER
+       // environment variable to validate that the user is logged in. This
+       // option can be used to integrate tt-rss with Apache's external
+       // authentication modules.
+
+       define('CONFIG_VERSION', 13);
        // Expected config version. Please update this option in config.php
        // if necessary (after migrating all new options from this file).
 
index 3644bc25d9e9b2b24664636151b897b667f93473..2df75f10a18d0262ad49c0776dc8ec8041116761 100644 (file)
                        $pwd_hash1 = encrypt_password($password);
                        $pwd_hash2 = encrypt_password($password, $login);
 
-                       if ($force_auth && defined('_DEBUG_USER_SWITCH')) {
+                       if (defined('ALLOW_REMOTE_USER_AUTH') && ALLOW_REMOTE_USER_AUTH 
+                                       && $_SERVER["REMOTE_USER"]) {
+
+                               $login = db_escape_string($_SERVER["REMOTE_USER"]);
+
                                $query = "SELECT id,login,access_level
                    FROM ttrss_users WHERE
-                        login = '$login'";
+                                       login = '$login'";
+
                        } else {
                                $query = "SELECT id,login,access_level,pwd_hash
                    FROM ttrss_users WHERE
index 5c90eae74a7372a52ae19296c81fdf9fe1fbf35a..1f0706dc06d1fb9ea6a4956edecc656f60723497 100644 (file)
@@ -1,7 +1,7 @@
 <?php
        require_once "functions.php";
 
-       define('EXPECTED_CONFIG_VERSION', 12);
+       define('EXPECTED_CONFIG_VERSION', 13);
        define('SCHEMA_VERSION', 27);
 
        if (!file_exists("config.php")) {