]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't keep cached user
authorEvan Prodromou <evan@prodromou.name>
Fri, 20 Jun 2008 06:54:55 +0000 (02:54 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 20 Jun 2008 06:54:55 +0000 (02:54 -0400)
darcs-hash:20080620065455-84dde-0c3bd495205e49ba2c5a8e040495339f35f9b215.gz

lib/util.php

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