From 4db58f5fc75e42e19a0b0f7217dbe263f7659010 Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Tue, 15 May 2012 14:30:47 +0200 Subject: [PATCH] MDL-32610 available updates info at the admin Notifications page can be hidden --- admin/index.php | 4 +++- admin/renderer.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/index.php b/admin/index.php index 6ef4b206b51..5b01be2749b 100644 --- a/admin/index.php +++ b/admin/index.php @@ -240,7 +240,9 @@ if ($version > $CFG->version) { // upgrade if ($fetchupdates) { // no sesskey support guaranteed here - available_update_checker::instance()->fetch(); + if (empty($CFG->disableupdatenotifications)) { + available_update_checker::instance()->fetch(); + } redirect($reloadurl); } diff --git a/admin/renderer.php b/admin/renderer.php index 9efc5172ee7..05521fa2c71 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -230,11 +230,12 @@ class core_admin_renderer extends plugin_renderer_base { */ public function admin_notifications_page($maturity, $insecuredataroot, $errorsdisplayed, $cronoverdue, $dbproblems, $maintenancemode, $availableupdates, $availableupdatesfetch) { + global $CFG; $output = ''; $output .= $this->header(); $output .= $this->maturity_info($maturity); - $output .= $this->available_updates($availableupdates, $availableupdatesfetch); + $output .= empty($CFG->disableupdatenotifications) ? $this->available_updates($availableupdates, $availableupdatesfetch) : ''; $output .= $this->insecure_dataroot_warning($insecuredataroot); $output .= $this->display_errors_warning($errorsdisplayed); $output .= $this->cron_overdue_warning($cronoverdue);