diff options
author | Andrew Dolgov <[email protected]> | 2006-04-20 06:16:28 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2006-04-20 06:16:28 +0100 |
commit | 658e1cc10cff8d1b29cc72d086584a5d7a7f1cef (patch) | |
tree | 842b94decfcc16f4ec798095157963e60d64ff15 | |
parent | 3560a0be1d6042d21a835790bd5ddb4c01c7de5c (diff) |
add missing DISABLE_SESSIONS checks
-rw-r--r-- | db-prefs.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/db-prefs.php b/db-prefs.php index e9aaee304..eeadef892 100644 --- a/db-prefs.php +++ b/db-prefs.php @@ -17,10 +17,12 @@ $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 @@ -37,10 +39,13 @@ $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 { |