don't keep cached user

darcs-hash:20080620065455-84dde-0c3bd495205e49ba2c5a8e040495339f35f9b215.gz
This commit is contained in:
Evan Prodromou 2008-06-20 02:54:55 -04:00
parent f72329a13d
commit 6f74a091e1

View File

@ -415,14 +415,14 @@ function common_set_user($nickname) {
# who is the current user? # who is the current user?
function common_current_user() { function common_current_user() {
static $user = NULL; # FIXME: global memcached $user = NULL;
if (is_null($user)) { if (common_have_session()) {
common_ensure_session(); $id = $_SESSION['userid'];
$id = $_SESSION['userid'];
if ($id) { if ($id) {
$user = User::staticGet($id); $user = User::staticGet($id);
} }
} }
return $user; return $user;
} }
@ -899,4 +899,4 @@ function common_copy_args($from) {
$to[$k] = ($strip) ? stripslashes($v) : $v; $to[$k] = ($strip) ? stripslashes($v) : $v;
} }
return $to; return $to;
} }