summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-06-20 03:02:56 -0400
committerEvan Prodromou <evan@prodromou.name>2008-06-20 03:02:56 -0400
commit03dba4270a6f4fe53582d1cce9d6c713cdcaa115 (patch)
tree3afc615ff18f8a72614abfc7dc2a4c6ce24519b0 /lib
parent2025169b5040ebe57e98f701d2b4084736e48058 (diff)
go back to ensuring session
darcs-hash:20080620070256-84dde-215e2ccf2cc037208837353a3d979d69770301f6.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/util.php b/lib/util.php
index cb3d7e63c..e137799f2 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -415,14 +415,11 @@ function common_set_user($nickname) {
# who is the current user?
function common_current_user() {
- $user = NULL;
- 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;
}