diff --git a/apps/updatenotification/css/admin.css b/apps/updatenotification/css/admin.css index cb03f6a15cb7a..9c707f9071b1b 100644 --- a/apps/updatenotification/css/admin.css +++ b/apps/updatenotification/css/admin.css @@ -31,3 +31,7 @@ #updatenotification .icon-triangle-n { opacity: 0.5; } + +#updatenotification .warning { + color: #ce3702; +} diff --git a/apps/updatenotification/js-src/app.js b/apps/updatenotification/js-src/app.js index bf96a2ff32686..0b28cabd6ac93 100644 --- a/apps/updatenotification/js-src/app.js +++ b/apps/updatenotification/js-src/app.js @@ -48,6 +48,7 @@ define(function (require) { this.vm.channels = data.channels; this.vm.notifyGroups = data.notifyGroups; this.vm.isDefaultUpdateServerURL = data.isDefaultUpdateServerURL; + this.vm.versionIsEol = data.versionIsEol; } }; }); diff --git a/apps/updatenotification/js-src/components/root.vue b/apps/updatenotification/js-src/components/root.vue index 11dfd351c63f9..08db5e0b0e35e 100644 --- a/apps/updatenotification/js-src/components/root.vue +++ b/apps/updatenotification/js-src/components/root.vue @@ -2,6 +2,13 @@
+ + + {{ t('updatenotification', 'The version you are running is not maintained anymore. Please make sure to update to a supported version as soon as possible.') }} + +
+
@@ -77,6 +84,7 @@
lastCheckedDate: '',
isUpdateChecked: false,
updaterEnabled: true,
+ versionIsEol: false,
downloadLink: '',
isNewVersionAvailable: false,
updateServerURL: '',
diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php
index 258cba35e80f1..5213eb905ee0c 100644
--- a/apps/updatenotification/lib/Settings/Admin.php
+++ b/apps/updatenotification/lib/Settings/Admin.php
@@ -94,6 +94,7 @@ public function getForm(): TemplateResponse {
'newVersionString' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'],
'downloadLink' => empty($updateState['downloadLink']) ? '' : $updateState['downloadLink'],
'updaterEnabled' => empty($updateState['updaterEnabled']) ? false : $updateState['updaterEnabled'],
+ 'versionIsEol' => empty($updateState['versionIsEol']) ? false : $updateState['versionIsEol'],
'isDefaultUpdateServerURL' => $updateServerURL === $defaultUpdateServerURL,
'updateServerURL' => $updateServerURL,
'notifyGroups' => $this->getSelectedGroups($notifyGroups),
diff --git a/apps/updatenotification/lib/UpdateChecker.php b/apps/updatenotification/lib/UpdateChecker.php
index 5f2712423d215..bba1fa5d48cae 100644
--- a/apps/updatenotification/lib/UpdateChecker.php
+++ b/apps/updatenotification/lib/UpdateChecker.php
@@ -49,6 +49,7 @@ public function getUpdateState(): array {
$result['updateAvailable'] = true;
$result['updateVersion'] = $data['versionstring'];
$result['updaterEnabled'] = $data['autoupdater'] === '1';
+ $result['versionIsEol'] = $data['eol'] === '1';
if (strpos($data['web'], 'https://') === 0) {
$result['updateLink'] = $data['web'];
}
diff --git a/apps/updatenotification/tests/Settings/AdminTest.php b/apps/updatenotification/tests/Settings/AdminTest.php
index 440e26cfd33e0..4e2ac3a53d9f5 100644
--- a/apps/updatenotification/tests/Settings/AdminTest.php
+++ b/apps/updatenotification/tests/Settings/AdminTest.php
@@ -100,6 +100,7 @@ public function testGetFormWithUpdate() {
'updateVersion' => '8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
'updaterEnabled' => true,
+ 'versionIsEol' => false,
]);
$group = $this->createMock(IGroup::class);
@@ -124,6 +125,7 @@ public function testGetFormWithUpdate() {
'newVersionString' => '8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
'updaterEnabled' => true,
+ 'versionIsEol' => false,
'isDefaultUpdateServerURL' => true,
'updateServerURL' => 'https://updates.nextcloud.com/updater_server/',
'notifyGroups' => [
diff --git a/apps/updatenotification/tests/UpdateCheckerTest.php b/apps/updatenotification/tests/UpdateCheckerTest.php
index 5502e1ce8ac6c..6f5edf0c78c53 100644
--- a/apps/updatenotification/tests/UpdateCheckerTest.php
+++ b/apps/updatenotification/tests/UpdateCheckerTest.php
@@ -52,12 +52,14 @@ public function testGetUpdateStateWithUpdateAndInvalidLink() {
'web'=> 'javascript:alert(1)',
'url'=> 'javascript:alert(2)',
'autoupdater'=> '0',
+ 'eol'=> '1',
]);
$expected = [
'updateAvailable' => true,
'updateVersion' => 'Nextcloud 123',
'updaterEnabled' => false,
+ 'versionIsEol' => true,
];
$this->assertSame($expected, $this->updateChecker->getUpdateState());
}
@@ -72,12 +74,14 @@ public function testGetUpdateStateWithUpdateAndValidLink() {
'web'=> 'https://docs.nextcloud.com/myUrl',
'url'=> 'https://downloads.nextcloud.org/server',
'autoupdater'=> '1',
+ 'eol'=> '0',
]);
$expected = [
'updateAvailable' => true,
'updateVersion' => 'Nextcloud 123',
'updaterEnabled' => true,
+ 'versionIsEol' => false,
'updateLink' => 'https://docs.nextcloud.com/myUrl',
'downloadLink' => 'https://downloads.nextcloud.org/server',
];
diff --git a/lib/private/Updater/VersionCheck.php b/lib/private/Updater/VersionCheck.php
index c7b829c9ec5e4..5cfc3c81a14cf 100644
--- a/lib/private/Updater/VersionCheck.php
+++ b/lib/private/Updater/VersionCheck.php
@@ -98,6 +98,7 @@ public function check() {
$tmp['url'] = (string)$data->url;
$tmp['web'] = (string)$data->web;
$tmp['autoupdater'] = (string)$data->autoupdater;
+ $tmp['eol'] = isset($data->eol) ? (string)$data->eol : '0';
} else {
libxml_clear_errors();
}
diff --git a/tests/lib/Updater/VersionCheckTest.php b/tests/lib/Updater/VersionCheckTest.php
index 89a335722d7a2..216510b66283c 100644
--- a/tests/lib/Updater/VersionCheckTest.php
+++ b/tests/lib/Updater/VersionCheckTest.php
@@ -85,6 +85,7 @@ public function testCheckWithoutUpdateUrl() {
'url' => 'https://download.example.org/community/owncloud-8.0.4.zip',
'web' => 'http://doc.example.org/server/8.0/admin_manual/maintenance/upgrade.html',
'autoupdater' => '0',
+ 'eol' => '1',
];
$this->config
@@ -123,6 +124,7 @@ public function testCheckWithoutUpdateUrl() {