]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
ensure rather than check for session
authorEvan Prodromou <evan@prodromou.name>
Sat, 17 May 2008 19:35:20 +0000 (15:35 -0400)
committerEvan Prodromou <evan@prodromou.name>
Sat, 17 May 2008 19:35:20 +0000 (15:35 -0400)
darcs-hash:20080517193520-84dde-e0e0ad44fa0b87e7964fa36375b656e7cfabf865.gz

lib/common.php

index b6e01a09625a3e21b10bb3917e5350f3716d9e53..425fbccb4fcf67cb722abc38c81f567d2ad5513b 100644 (file)
@@ -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;