summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/upgrader.php
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-11-15 19:44:47 -0800
committerAndy Staudacher <andy.st@gmail.com>2009-11-15 19:44:47 -0800
commit0733dc37fda27a5ba35f9020edf3c66aa41a95a0 (patch)
tree6877946232f1b01b1c8709054c689f6658cef34f /modules/gallery/controllers/upgrader.php
parent218493c50be9362d4abed6900a816308fee5d978 (diff)
parent9379308f91a476f790fb8d444536719535c584e4 (diff)
Merge commit 'upstream/master'
Conflicts: modules/gallery/tests/xss_data.txt
Diffstat (limited to 'modules/gallery/controllers/upgrader.php')
-rw-r--r--modules/gallery/controllers/upgrader.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php
index 0f6cbc2c..48769bce 100644
--- a/modules/gallery/controllers/upgrader.php
+++ b/modules/gallery/controllers/upgrader.php
@@ -40,10 +40,10 @@ class Upgrader_Controller extends Controller {
}
$view = new View("upgrader.html");
- $view->can_upgrade = user::active()->admin || $session->get("can_upgrade");
+ $view->can_upgrade = identity::active_user()->admin || $session->get("can_upgrade");
$view->upgrade_token = $upgrade_token;
$view->available = module::available();
- $view->done = ($available_upgrades == 0);
+ $view->done = $available_upgrades == 0;
print $view;
}
@@ -52,13 +52,17 @@ class Upgrader_Controller extends Controller {
// @todo this may screw up some module installers, but we don't have a better answer at
// this time.
$_SERVER["HTTP_HOST"] = "example.com";
- } else if (!user::active()->admin && !Session::instance()->get("can_upgrade", false)) {
+ } else if (!identity::active_user()->admin && !Session::instance()->get("can_upgrade", false)) {
access::forbidden();
}
- // Upgrade gallery and user first
- module::upgrade("gallery");
- module::upgrade("user");
+ $available = module::available();
+ // Upgrade gallery first
+ $gallery = $available["gallery"];
+ if ($gallery->code_version != $gallery->version) {
+ module::upgrade("gallery");
+ module::activate("gallery");
+ }
// Then upgrade the rest
foreach (module::available() as $id => $module) {