]> git.wh0rd.org Git - tt-rss.git/commitdiff
get_pref: do not use cache when querying prefs for specific user
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 30 Oct 2007 06:35:16 +0000 (07:35 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 30 Oct 2007 06:35:16 +0000 (07:35 +0100)
db-prefs.php

index 0858c2ce46a773236a774f184e4524fd8eea8423..f9b57e6b11e9b863b3f6552c11223320b920738e 100644 (file)
@@ -10,6 +10,7 @@
        function get_pref($link, $pref_name, $user_id = false, $die_on_error = false) {
 
                $pref_name = db_escape_string($pref_name);
+               $prefs_cache = true;
 
                if (!$user_id) {
                        $user_id = $_SESSION["uid"];
@@ -18,7 +19,7 @@
                        $prefs_cache = false;
                }
 
-               if (!defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) {        
+               if ($prefs_cache && !defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) {        
                        if ($_SESSION["prefs_cache"] && $_SESSION["prefs_cache"][$pref_name]) {
                                $tuple = $_SESSION["prefs_cache"][$pref_name];
                                return convert_pref_type($tuple["value"], $tuple["type"]);