]> git.wh0rd.org Git - tt-rss.git/commitdiff
remove SESSION_CHECK_ADDRESS
authorAndrew Dolgov <noreply@fakecake.org>
Fri, 21 Aug 2015 06:02:16 +0000 (09:02 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Fri, 21 Aug 2015 06:02:16 +0000 (09:02 +0300)
config.php-dist
include/sessions.php

index 311b94df08412b31a7aa3a37452e13a08fe407fb..2eaaab6173de0d68bb01243338346957399abf7f 100644 (file)
        // Default lifetime of a session (e.g. login) cookie. In seconds, 
        // 0 means cookie will be deleted when browser closes.
 
-       define('SESSION_CHECK_ADDRESS', 1);
-       // Check client IP address when validating session:
-       // 0 - disable checking
-       // 1 - check first 3 octets of an address (recommended)
-       // 2 - check first 2 octets of an address
-       // 3 - check entire address
-
        // *********************************
        // *** Email and digest settings ***
        // *********************************
index 30d502641dd9c3e5cae512a528bdd09616618cc4..c0ec64c3d905782e011a4432b086633a9dd8c4aa 100644 (file)
        function validate_session() {
                if (SINGLE_USER_MODE) return true;
 
-               //if (VERSION_STATIC != $_SESSION["version"]) return false;
-
-               $check_ip = $_SESSION['ip_address'];
-
-               switch (SESSION_CHECK_ADDRESS) {
-               case 0:
-                       $check_ip = '';
-                       break;
-               case 1:
-                       $check_ip = substr($check_ip, 0, strrpos($check_ip, '.')+1);
-                       break;
-               case 2:
-                       $check_ip = substr($check_ip, 0, strrpos($check_ip, '.'));
-                       $check_ip = substr($check_ip, 0, strrpos($check_ip, '.')+1);
-                       break;
-               };
-
-               if ($check_ip && strpos($_SERVER['REMOTE_ADDR'], $check_ip) !== 0) {
-                       $_SESSION["login_error_msg"] =
-                               __("Session failed to validate (incorrect IP)");
-                       return false;
-               }
-
                if (isset($_SESSION["ref_schema_version"]) && $_SESSION["ref_schema_version"] != session_get_schema_version(true)) {
                        $_SESSION["login_error_msg"] =
                                __("Session failed to validate (schema version changed)");
                        return false;
                }
 
-               /* if (sha1($_SERVER['HTTP_USER_AGENT']) != $_SESSION["user_agent"]) {
-                       $_SESSION["login_error_msg"] =
-                               __("Session failed to validate (user agent changed)");
-                       return false;
-               } */
-
                if ($_SESSION["uid"]) {
                        $result = Db::get()->query(
                                "SELECT pwd_hash FROM ttrss_users WHERE id = '".$_SESSION["uid"]."'");