diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2021-01-18 03:58:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 03:58:32 +0300 |
commit | 6e102bfdc95c4a699a3655e71986390f19551a02 (patch) | |
tree | 206f35cc4803d64d229737a10dddbcb676d192ed /plugins/CoreUpdater | |
parent | 3e67f4d1d62ae67a3ed832250b15b5c9a521144f (diff) |
Disable newVersionAvailable when auto update enabled. (#17105)
fix https://github.com/matomo-org/matomo/issues/17096
Diffstat (limited to 'plugins/CoreUpdater')
-rw-r--r-- | plugins/CoreUpdater/Controller.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/CoreUpdater/Controller.php b/plugins/CoreUpdater/Controller.php index 555f978eef..2ae4374e6a 100644 --- a/plugins/CoreUpdater/Controller.php +++ b/plugins/CoreUpdater/Controller.php @@ -120,6 +120,11 @@ class Controller extends \Piwik\Plugin\Controller public function newVersionAvailable() { Piwik::checkUserHasSuperUserAccess(); + + if (!SettingsPiwik::isAutoUpdateEnabled()) { + throw new Exception('Auto updater is disabled'); + } + $this->checkNewVersionIsAvailableOrDie(); $newVersion = $this->updater->getLatestVersion(); @@ -154,6 +159,10 @@ class Controller extends \Piwik\Plugin\Controller { Piwik::checkUserHasSuperUserAccess(); + if (!SettingsPiwik::isAutoUpdateEnabled()) { + throw new Exception('Auto updater is disabled'); + } + Nonce::checkNonce('oneClickUpdate'); $view = new OneClickDone(Piwik::getCurrentUserTokenAuth()); |