add missing DISABLE_SESSIONS checks

This commit is contained in:
Andrew Dolgov 2006-04-20 06:16:28 +01:00
parent 3560a0be1d
commit 658e1cc10c
1 changed files with 12 additions and 7 deletions

View File

@ -18,10 +18,12 @@
$prefs_cache = false;
}
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,ttrss_prefs_types.type_name as type_name
@ -37,10 +39,13 @@
$value = db_fetch_result($result, 0, "value");
$type_name = db_fetch_result($result, 0, "type_name");
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 {