]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
force session again and correctly get ID
authorEvan Prodromou <evan@controlezvous.ca>
Tue, 24 Jun 2008 03:17:46 +0000 (23:17 -0400)
committerEvan Prodromou <evan@controlezvous.ca>
Tue, 24 Jun 2008 03:17:46 +0000 (23:17 -0400)
darcs-hash:20080624031746-34904-3719874e1e0afa201e5c81e267531f0768ddacd9.gz

lib/util.php

index 5ef7f641b876fe11106d07d58bf7cf22d63c92dc..afbb7b7e861e9b5dfd28c2029dec0617f596b869 100644 (file)
@@ -457,7 +457,7 @@ function common_rememberme() {
        }
        $rm = new Remember_me();
        $rm->code = common_good_rand(16);
-       $rm->user_id = $user->id();
+       $rm->user_id = $user->id;
        if (!$rm->insert()) {
                common_log_db_error($rm, 'INSERT', __FILE__);
                return false;
@@ -506,13 +506,12 @@ function common_forgetme() {
 # who is the current user?
 function common_current_user() {
 
-       if (common_have_session()) {
-               $id = $_SESSION['userid'];
-               if ($id) {
-                       # note: this should cache
-                       $user = User::staticGet($id);
-                       return $user;
-               }
+       common_ensure_session();
+       $id = $_SESSION['userid'];
+       if ($id) {
+               # note: this should cache
+               $user = User::staticGet($id);
+               return $user;
        }
 
        # that didn't work; try to remember