]> git.wh0rd.org - tt-rss.git/commitdiff
db prefs: ignore cache when preference requested for specified UID (in case cached...
authorAndrew Dolgov <noreply@fakecake.org>
Sat, 24 Jun 2017 11:29:07 +0000 (14:29 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sat, 24 Jun 2017 11:29:07 +0000 (14:29 +0300)
prefs: show (and set) enabled plugins for default profile only

classes/db/prefs.php
classes/pref/prefs.php

index 26562298d5a161d8df13cbf8627f3d3ac46f8935..d61cc107bbb09c40c1deb50543d05e3257fbca11 100644 (file)
@@ -67,7 +67,7 @@ class Db_Prefs {
                        $user_id = sprintf("%d", $user_id);
                }
 
-               if (isset($this->cache[$pref_name])) {
+               if (isset($this->cache[$pref_name]) && !$user_id) {
                        $tuple = $this->cache[$pref_name];
                        return $this->convert($tuple["value"], $tuple["type"]);
                }
index 0e58a34e256f982b9508971db2a9b4c1be1ccaa7..f003ba0272fd03f666ee1a4002e14da21818d4f2 100644 (file)
@@ -739,7 +739,7 @@ class Pref_Prefs extends Handler_Protected {
                                <td width='10%'>".__('Author')."</td></tr>";
 
                $system_enabled = array_map("trim", explode(",", PLUGINS));
-               $user_enabled = array_map("trim", explode(",", get_pref("_ENABLED_PLUGINS")));
+               $user_enabled = array_map("trim", explode(",", get_pref("_ENABLED_PLUGINS", $_SESSION['uid'])));
 
                $tmppluginhost = new PluginHost();
                $tmppluginhost->load_all($tmppluginhost::KIND_ALL, $_SESSION["uid"], true);
@@ -949,7 +949,7 @@ class Pref_Prefs extends Handler_Protected {
                else
                        $plugins = "";
 
-               set_pref("_ENABLED_PLUGINS", $plugins);
+               set_pref("_ENABLED_PLUGINS", $plugins, $_SESSION["uid"]);
        }
 
        function clearplugindata() {