From d41b6007254fcd5edaa7c4001a11cd8d2597ec9a Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 24 Apr 2013 18:47:38 +0200 Subject: Add an update notification on every page for admin users --- lib/templatelayout.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/templatelayout.php') diff --git a/lib/templatelayout.php b/lib/templatelayout.php index 3c496f56e41..3d344058fac 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -18,6 +18,20 @@ class OC_TemplateLayout extends OC_Template { $this->assign('bodyid', 'body-user'); } + // Update notification + if(OC_Config::getValue('updatechecker', true) === true) { + $data=OC_Updater::check(); + if(isset($data['version']) && $data['version'] != '' and $data['version'] !== Array() && OC_User::isAdminUser(OC_User::getUser())) { + $this->assign('updateAvailable', true); + $this->assign('updateVersion', $data['versionstring']); + $this->assign('updateLink', $data['web']); + } else { + $this->assign('updateAvailable', false); // No update available or not an admin user + } + } else { + $this->assign('updateAvailable', false); // Update check is disabled + } + // Add navigation entry $this->assign( 'application', '', false ); $navigation = OC_App::getNavigation(); -- cgit v1.2.3