We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 30d4b7f7 authored by Evan Prodromou's avatar Evan Prodromou

ensure rather than check for session

darcs-hash:20080517193520-84dde-e0e0ad44fa0b87e7964fa36375b656e7cfabf865.gz
parent 6b308f0d
......@@ -227,11 +227,10 @@ function common_set_user($nickname) {
function common_current_user() {
static $user = NULL; # FIXME: global memcached
if (is_null($user)) {
if (common_have_session()) {
$id = $_SESSION['userid'];
if ($id) {
$user = User::staticGet($id);
}
common_ensure_session();
$id = $_SESSION['userid'];
if ($id) {
$user = User::staticGet($id);
}
}
return $user;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment