From 72c7fed975ce797da1f33ea82651c5a91ce3957e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 8 Mar 2009 21:21:09 +0000 Subject: Log the user in as admin after running the web installer, and give them a nice "Welcome to Gallery 3" dialog. The text in there needs a little work but it's a start. In the process, re-build the install.sql using the scaffolding code. --- modules/user/helpers/user.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules/user/helpers') diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index 22fe6a28..a15fa463 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -118,6 +118,13 @@ class user_Core { $session->set("user", $user = user::guest()); } + // The installer cannot set a user into the session, so it just sets an id which we should + // upconvert into a user. + if ($user === 2) { + $user = model_cache::get("user", 2); + $session->set("user", $user); + } + if (!$session->get("group_ids")) { $ids = array(); foreach ($user->groups as $group) { @@ -142,7 +149,9 @@ class user_Core { * @return User_Model */ static function active() { - return Session::instance()->get("user", self::guest()); + // @todo (maybe) cache this object so we're not always doing session lookups. + $user = Session::instance()->get("user", self::guest()); + return $user; } /** -- cgit v1.2.3