diff options
author | Evan Prodromou <evan@controlezvous.ca> | 2008-06-23 23:17:46 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlezvous.ca> | 2008-06-23 23:17:46 -0400 |
commit | 8cc7e4723d0b43f524feccf7d4b55a6cad57065c (patch) | |
tree | 40c8fe4f034782f2aa3b558a312f6aa5193914a6 /lib/util.php | |
parent | ae2603ec1327dd058b15317f46232707cd12cd95 (diff) |
force session again and correctly get ID
darcs-hash:20080624031746-34904-3719874e1e0afa201e5c81e267531f0768ddacd9.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/util.php b/lib/util.php index 5ef7f641b..afbb7b7e8 100644 --- a/lib/util.php +++ b/lib/util.php @@ -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 |