diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2013-04-24 18:47:38 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2013-04-24 18:47:38 +0200 |
commit | d41b6007254fcd5edaa7c4001a11cd8d2597ec9a (patch) | |
tree | 7c56f2d0e2d4320d4af6ba31e74d699fa3902099 /lib/templatelayout.php | |
parent | dd1c876009df15c97602f99b45e3c6e9cbcbf8af (diff) | |
download | nextcloud-server-d41b6007254fcd5edaa7c4001a11cd8d2597ec9a.tar.gz nextcloud-server-d41b6007254fcd5edaa7c4001a11cd8d2597ec9a.zip |
Add an update notification on every page for admin users
Diffstat (limited to 'lib/templatelayout.php')
-rw-r--r-- | lib/templatelayout.php | 14 |
1 files changed, 14 insertions, 0 deletions
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(); |