]> git.wh0rd.org - tt-rss.git/commitdiff
add missing DISABLE_SESSIONS checks
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 20 Apr 2006 05:16:28 +0000 (06:16 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 20 Apr 2006 05:16:28 +0000 (06:16 +0100)
db-prefs.php

index e9aaee304aa5f6108e5c61e9e0aa9c8a42a5a170..eeadef89205a3dcddfc427f9fae17813b5e9f293 100644 (file)
                        $user_id = sprintf("%d", $user_id);
                        $prefs_cache = false;
                }
-       
-               if ($_SESSION["prefs_cache"] && $_SESSION["prefs_cache"][$pref_name]) {
-                       $tuple = $_SESSION["prefs_cache"][$pref_name];
-                       return convert_pref_type($tuple["value"], $tuple["type"]);
+
+               if (!defined('DISABLE_SESSIONS')) {     
+                       if ($_SESSION["prefs_cache"] && $_SESSION["prefs_cache"][$pref_name]) {
+                               $tuple = $_SESSION["prefs_cache"][$pref_name];
+                               return convert_pref_type($tuple["value"], $tuple["type"]);
+                       }
                }
 
                $result = db_query($link, "SELECT 
                        $value = db_fetch_result($result, 0, "value");
                        $type_name = db_fetch_result($result, 0, "type_name");
 
-                       if ($user_id = $_SESSION["uid"]) {
-                               $_SESSION["prefs_cache"][$pref_name]["type"] = $type_name;
-                               $_SESSION["prefs_cache"][$pref_name]["value"] = $value;
+                       if (!defined('DISABLE_SESSIONS')) {     
+                               if ($user_id = $_SESSION["uid"]) {
+                                       $_SESSION["prefs_cache"][$pref_name]["type"] = $type_name;
+                                       $_SESSION["prefs_cache"][$pref_name]["value"] = $value;
+                               }
                        }
+
                        return convert_pref_type($value, $type_name);
                        
                } else {