summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-17 15:35:20 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-17 15:35:20 -0400
commit30d4b7f7919d51cd462c95310a4b32bfc0cad256 (patch)
tree5bc62ea08c7a2113d48d686e03b29c70aaa88350
parent6b308f0d1a3932cde5346cef509fdd49a8b626a4 (diff)
ensure rather than check for session
darcs-hash:20080517193520-84dde-e0e0ad44fa0b87e7964fa36375b656e7cfabf865.gz
-rw-r--r--lib/common.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/common.php b/lib/common.php
index b6e01a096..425fbccb4 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -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;