summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-09-27 14:47:59 +0200
committerJoas Schilling <coding@schilljs.com>2016-09-27 14:47:59 +0200
commit3e00554d35be995f52fba4ab49fc6ef1b01fc37b (patch)
treece7942f14193e9f6c85401cbdfd4045e2fa9a07c /apps/updatenotification/lib
parent6f955defe46b498f014d4e0f105d26324bb7ecd6 (diff)
downloadnextcloud-server-3e00554d35be995f52fba4ab49fc6ef1b01fc37b.tar.gz
nextcloud-server-3e00554d35be995f52fba4ab49fc6ef1b01fc37b.zip
Respect updater kill switch and fall back to download button
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/updatenotification/lib')
-rw-r--r--apps/updatenotification/lib/Controller/AdminController.php6
-rw-r--r--apps/updatenotification/lib/UpdateChecker.php4
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/updatenotification/lib/Controller/AdminController.php b/apps/updatenotification/lib/Controller/AdminController.php
index 9f10f1b32f2..56f41ebf3ee 100644
--- a/apps/updatenotification/lib/Controller/AdminController.php
+++ b/apps/updatenotification/lib/Controller/AdminController.php
@@ -107,11 +107,13 @@ class AdminController extends Controller implements ISettings {
$notifyGroups = json_decode($this->config->getAppValue('updatenotification', 'notify_groups', '["admin"]'), true);
$params = [
- 'isNewVersionAvailable' => ($updateState === []) ? false : true,
+ 'isNewVersionAvailable' => !empty($updateState['updateAvailable']),
'lastChecked' => $lastUpdateCheck,
'currentChannel' => $currentChannel,
'channels' => $channels,
- 'newVersionString' => ($updateState === []) ? '' : $updateState['updateVersion'],
+ 'newVersionString' => (empty($updateState['updateVersion'])) ? '' : $updateState['updateVersion'],
+ 'downloadLink' => (empty($updateState['downloadLink'])) ? '' : $updateState['downloadLink'],
+ 'updaterEnabled' => $updateState['updaterEnabled'],
'notify_groups' => implode('|', $notifyGroups),
];
diff --git a/apps/updatenotification/lib/UpdateChecker.php b/apps/updatenotification/lib/UpdateChecker.php
index dd51831007c..040a6c3a6ac 100644
--- a/apps/updatenotification/lib/UpdateChecker.php
+++ b/apps/updatenotification/lib/UpdateChecker.php
@@ -46,9 +46,13 @@ class UpdateChecker {
if(isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) {
$result['updateAvailable'] = true;
$result['updateVersion'] = $data['versionstring'];
+ $result['updaterEnabled'] = $data['autoupdater'] === '1';
if(substr($data['web'], 0, 8) === 'https://') {
$result['updateLink'] = $data['web'];
}
+ if(substr($data['url'], 0, 8) === 'https://') {
+ $result['downloadLink'] = $data['url'];
+ }
return $result;
}