summaryrefslogtreecommitdiff
path: root/modules/user/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-03-08 21:21:09 +0000
committerBharat Mediratta <bharat@menalto.com>2009-03-08 21:21:09 +0000
commit72c7fed975ce797da1f33ea82651c5a91ce3957e (patch)
tree4e84359029adcd40e31c3b20031c1096018e50aa /modules/user/helpers
parent7cbc904be722b493a060e2ad69849344124fbe91 (diff)
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.
Diffstat (limited to 'modules/user/helpers')
-rw-r--r--modules/user/helpers/user.php11
1 files changed, 10 insertions, 1 deletions
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;
}
/**