From 391a90e3cedd1cca7631f9a4d786c6c513b1dd48 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 8 Sep 2010 20:36:22 -0700 Subject: Detect when a module fails to upgrade properly and put up an informative message to help the user know that she needs to get a newer copy of the module. Fixes ticket #1189. --- modules/gallery/views/upgrader.html.php | 53 ++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 17 deletions(-) (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 0ce24ef8..c2d8a552 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -10,7 +10,7 @@ >
- " /> + " />
+
-

"> - -

+
+

"> + +

+
+ + +
+ +
+ +
+ "> + + +
+ + "> @@ -68,7 +99,7 @@ $module): ?> active): ?> - " > + " > @@ -85,18 +116,6 @@
name) ?>
- -
- -
- -
- "> - - -
- -

"> -- cgit v1.2.3 From 67f45cfa781ef4b446676e199470e421f5463812 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Sep 2010 01:46:45 -0700 Subject: Add CSRF protection to the upgrader. And update the CLI output so that it tells you which modules failed to upgrade properly. Fixes ticket #1359. --- modules/gallery/controllers/upgrader.php | 21 ++++++++++++++++++--- modules/gallery/views/upgrader.html.php | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'modules/gallery/views') diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index 6613d671..b2646874 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -54,8 +54,16 @@ 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 (!identity::active_user()->admin && !Session::instance()->get("can_upgrade", false)) { - access::forbidden(); + } else { + if (!identity::active_user()->admin && !Session::instance()->get("can_upgrade", false)) { + access::forbidden(); + } + + try { + access::verify_csrf(); + } catch (Exception $e) { + url::redirect("upgrader"); + } } $available = module::available(); @@ -87,7 +95,14 @@ class Upgrader_Controller extends Controller { site_status::clear("upgrade_now"); if (php_sapi_name() == "cli") { - print "Upgrade complete\n"; + if ($failed) { + print "Upgrade completed ** WITH FAILURES **\n"; + print "The following modules were not successfully upgraded:\n"; + print " " . implode($failed, "\n ") . "\n"; + print "Try getting newer versions or deactivating those modules\n"; + } else { + print "Upgrade complete\n"; + } } else { url::redirect("upgrader?failed=" . join(",", $failed)); } diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index c2d8a552..554cf30d 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -84,7 +84,7 @@

-- cgit v1.2.3 From 14ae1fde25eb8b22a2fc92453ba12c8e74aba433 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Sep 2010 10:41:47 -0700 Subject: Use the actual csrf token, not the placeholder (url::site doesn't replace that). Fixes ticket #1361 --- modules/gallery/views/upgrader.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index 554cf30d..1ec49c77 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -84,7 +84,7 @@ -- cgit v1.2.3 From 4b8d6beb5e59402d68b1daf5e4f7220066d1b707 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 14 Sep 2010 19:40:54 -0700 Subject: Report the graphics toolkit in the platform block. --- modules/gallery/views/admin_block_platform.html.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/admin_block_platform.html.php b/modules/gallery/views/admin_block_platform.html.php index b1b8a2f9..379ab0aa 100644 --- a/modules/gallery/views/admin_block_platform.html.php +++ b/modules/gallery/views/admin_block_platform.html.php @@ -18,4 +18,7 @@
  • $load_average)) ?>
  • +
  • + module::get_var("gallery", "graphics_toolkit"))) ?> +
  • -- cgit v1.2.3 From de2f9baeee0a05968ef0c3809c90e335180cffd0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 16 Sep 2010 19:34:42 -0700 Subject: Add a link to http://codex.gallery2.org/Gallery3:Choosing_A_Graphics_Toolkit to help users choose a graphics toolkit. Fixes ticket #1372. --- modules/gallery/views/admin_graphics.html.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/gallery/views') diff --git a/modules/gallery/views/admin_graphics.html.php b/modules/gallery/views/admin_graphics.html.php index 3a48e087..ae76f1e1 100644 --- a/modules/gallery/views/admin_graphics.html.php +++ b/modules/gallery/views/admin_graphics.html.php @@ -16,6 +16,7 @@

    + We can help!", array("url" => "http://codex.gallery2.org/Gallery3:Choosing_A_Graphics_Toolkit")) ?>

    -- cgit v1.2.3