From 70abfb2a20734802c922c0e9917d2a1778aef3f2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Jan 2011 22:16:09 -0800 Subject: Upgrade checking code is now here, along with a bump of the Gallery module to v46. There's a new block in the admin dashboard which controls whether automatic checking happens, and lets you check immediately. If a newer version is detected, a site status message appears for admins providing upgrade instructions. Automatic checking is not yet implemented (even though the UI claims that it exists). This is all for #1605. --- .../gallery/controllers/admin_upgrade_checker.php | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 modules/gallery/controllers/admin_upgrade_checker.php (limited to 'modules/gallery/controllers/admin_upgrade_checker.php') diff --git a/modules/gallery/controllers/admin_upgrade_checker.php b/modules/gallery/controllers/admin_upgrade_checker.php new file mode 100644 index 00000000..4b1467cd --- /dev/null +++ b/modules/gallery/controllers/admin_upgrade_checker.php @@ -0,0 +1,49 @@ +server("HTTP_REFERER")) { + url::redirect($referer); + } else { + url::redirect(item::root()->abs_url()); + } + } + + function set_auto($val) { + access::verify_csrf(); + module::set_var("gallery", "upgrade_checker_auto_enabled", (bool)$val); + + if ((bool)$val) { + message::success(t("Automatic upgrade checking is enabled.")); + } else { + message::success(t("Automatic upgrade checking is disabled.")); + } + url::redirect("admin/dashboard"); + } +} -- cgit v1.2.3