more aggressive prefs caching

This commit is contained in:
Andrew Dolgov 2011-11-11 00:55:02 +04:00
parent d0cafcf4a0
commit c648997b1c
2 changed files with 9 additions and 2 deletions

View File

@ -18,7 +18,7 @@
@$profile = $_SESSION["profile"]; @$profile = $_SESSION["profile"];
} else { } else {
$user_id = sprintf("%d", $user_id); $user_id = sprintf("%d", $user_id);
$prefs_cache = false; //$prefs_cache = false;
} }
if ($prefs_cache && !defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) { if ($prefs_cache && !defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) {
@ -130,7 +130,12 @@
$profile_qpart $profile_qpart
AND owner_uid = " . $_SESSION["uid"]); AND owner_uid = " . $_SESSION["uid"]);
$_SESSION["prefs_cache"] = array(); if (!defined('DISABLE_SESSIONS') && !SINGLE_USER_MODE) {
if ($user_id = $_SESSION["uid"]) {
$_SESSION["prefs_cache"][$pref_name]["type"] = $type_name;
$_SESSION["prefs_cache"][$pref_name]["value"] = $value;
}
}
} }
} }

View File

@ -2102,6 +2102,8 @@
} }
function login_sequence($link, $mobile = false) { function login_sequence($link, $mobile = false) {
$_SESSION["prefs_cache"] = array();
if (!SINGLE_USER_MODE) { if (!SINGLE_USER_MODE) {
$login_action = $_POST["login_action"]; $login_action = $_POST["login_action"];