summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-29 12:20:03 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-29 12:20:03 -0700
commit50c624ed1b5a09d965d4e0f18a32bf3c2a94db15 (patch)
tree60a01f84ea00ced367f4e66010f985ea21eb3af0
parent0d16cc1c106dc324fde59cac54fa82e4a70e04e2 (diff)
Fix active() to not use user::guest() as the fallback for our Session::get() call.
-rw-r--r--modules/user/helpers/user.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php
index 69a6ecb3..40acc2ec 100644
--- a/modules/user/helpers/user.php
+++ b/modules/user/helpers/user.php
@@ -159,7 +159,12 @@ class user_Core {
*/
static function active() {
// @todo (maybe) cache this object so we're not always doing session lookups.
- $user = Session::instance()->get("user", self::guest());
+ $user = Session::instance()->get("user", null);
+ if (!isset($user)) {
+ // Don't do this as a fallback in the Session::get() call because it can trigger unnecessary
+ // work.
+ $user = user::guest();
+ }
return $user;
}