diff options
author | Peter Boehlke <project-management@media-proweb.de> | 2017-11-13 21:46:32 +0300 |
---|---|---|
committer | Stefan Giehl <stefan@piwik.org> | 2017-11-13 21:46:32 +0300 |
commit | 4fc3de649fbab314a920687634d9d365f64ccb2e (patch) | |
tree | 34bf1a93eea7930689d495055271f271326ec307 /core | |
parent | 3fc7101005c4432d35404072b9eb3c7044a6c9e4 (diff) |
Show update notification to super users only (#12224)
* Introduce config setting to show update notifications to superusers only. Fixes #7930
* By default, all users should see the update notification
* Changed description of config param
* Updates changelog
Diffstat (limited to 'core')
-rw-r--r-- | core/SettingsPiwik.php | 10 | ||||
-rw-r--r-- | core/View.php | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/core/SettingsPiwik.php b/core/SettingsPiwik.php index d8a04ec27a..ab90a67fcb 100644 --- a/core/SettingsPiwik.php +++ b/core/SettingsPiwik.php @@ -46,6 +46,16 @@ class SettingsPiwik } /** + * Should Piwik show the update notification to superusers only? + * + * @return bool True if show to superusers only; false otherwise + */ + public static function isShowUpdateNotificationToSuperUsersOnlyEnabled() + { + return Config::getInstance()->General['show_update_notification_to_superusers_only'] == 1; + } + + /** * Returns every stored segment to pre-process for each site during cron archiving. * * @return array The list of stored segments that apply to all sites. diff --git a/core/View.php b/core/View.php index 3c90b5f9a7..e3ef17f1ff 100644 --- a/core/View.php +++ b/core/View.php @@ -241,6 +241,7 @@ class View implements ViewInterface $this->userIsAnonymous = Piwik::isUserIsAnonymous(); $this->userIsSuperUser = Piwik::hasUserSuperUserAccess(); $this->latest_version_available = UpdateCheck::isNewestVersionAvailable(); + $this->showUpdateNotificationToUser = !SettingsPiwik::isShowUpdateNotificationToSuperUsersOnlyEnabled() || Piwik::hasUserSuperUserAccess(); $this->disableLink = Common::getRequestVar('disableLink', 0, 'int'); $this->isWidget = Common::getRequestVar('widget', 0, 'int'); $this->isMultiServerEnvironment = SettingsPiwik::isMultiServerEnvironment(); |