File tree Expand file tree Collapse file tree 8 files changed +26
-0
lines changed
Expand file tree Collapse file tree 8 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 11# oca_updatenotification_section p {
22 margin : 25px 0 ;
33}
4+ # updatenotification .warning {
5+ color : # ce3702 ;
6+ }
Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ public function displayPanel() {
119119 'newVersionString ' => (empty ($ updateState ['updateVersion ' ])) ? '' : $ updateState ['updateVersion ' ],
120120 'downloadLink ' => (empty ($ updateState ['downloadLink ' ])) ? '' : $ updateState ['downloadLink ' ],
121121 'updaterEnabled ' => (empty ($ updateState ['updaterEnabled ' ])) ? false : $ updateState ['updaterEnabled ' ],
122+ 'versionIsEol ' => empty ($ updateState ['versionIsEol ' ]) ? false : $ updateState ['versionIsEol ' ],
122123 'isDefaultUpdateServerURL ' => $ updateServerURL === $ defaultUpdateServerURL ,
123124 'updateServerURL ' => $ updateServerURL ,
124125 'notify_groups ' => implode ('| ' , $ notifyGroups ),
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ public function getUpdateState() {
4848 $ result ['updateAvailable ' ] = true ;
4949 $ result ['updateVersion ' ] = $ data ['versionstring ' ];
5050 $ result ['updaterEnabled ' ] = $ data ['autoupdater ' ] === '1 ' ;
51+ $ result ['versionIsEol ' ] = $ data ['eol ' ] === '1 ' ;
5152 if (substr ($ data ['web ' ], 0 , 8 ) === 'https:// ' ) {
5253 $ result ['updateLink ' ] = $ data ['web ' ];
5354 }
Original file line number Diff line number Diff line change 3030 <?php if (!empty ($ _ ['downloadLink ' ])) { ?>
3131 <a href="<?php p ($ _ ['downloadLink ' ]); ?> " class="button<?php if ($ _ ['updaterEnabled ' ]) { p (' hidden ' ); } ?> "><?php p ($ l ->t ('Download now ' )) ?> </a>
3232 <?php } ?>
33+
34+ <?php if (!empty ($ _ ['versionIsEol ' ])) { ?>
35+ <p>
36+ <span class="warning">
37+ <span class="icon icon-error"></span>
38+ <?php p ($ l ->t ('The version you are running is not maintained anymore. Please make sure to update to a supported version as soon as possible. ' )); ?>
39+ </span>
40+ </p>
41+ <?php } ?>
42+
3343 <?php } elseif (!$ isUpdateChecked ) { ?>
3444 <?php p ($ l ->t ('The update check is not yet finished. Please refresh the page. ' )); ?>
3545 <?php } else { ?>
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ public function testDisplayPanelWithUpdate() {
122122 'updateVersion ' => '8.1.2 ' ,
123123 'downloadLink ' => 'https://downloads.nextcloud.org/server ' ,
124124 'updaterEnabled ' => true ,
125+ 'versionIsEol ' => false ,
125126 ]);
126127
127128 $ params = [
@@ -133,6 +134,7 @@ public function testDisplayPanelWithUpdate() {
133134 'newVersionString ' => '8.1.2 ' ,
134135 'downloadLink ' => 'https://downloads.nextcloud.org/server ' ,
135136 'updaterEnabled ' => true ,
137+ 'versionIsEol ' => false ,
136138 'isDefaultUpdateServerURL ' => true ,
137139 'updateServerURL ' => 'https://updates.nextcloud.com/updater_server/ ' ,
138140 'notify_groups ' => 'admin ' ,
Original file line number Diff line number Diff line change @@ -52,12 +52,14 @@ public function testGetUpdateStateWithUpdateAndInvalidLink() {
5252 'web ' => 'javascript:alert(1) ' ,
5353 'url ' => 'javascript:alert(2) ' ,
5454 'autoupdater ' => '0 ' ,
55+ 'eol ' => '1 ' ,
5556 ]);
5657
5758 $ expected = [
5859 'updateAvailable ' => true ,
5960 'updateVersion ' => 'Nextcloud 123 ' ,
6061 'updaterEnabled ' => false ,
62+ 'versionIsEol ' => true ,
6163 ];
6264 $ this ->assertSame ($ expected , $ this ->updateChecker ->getUpdateState ());
6365 }
@@ -72,12 +74,14 @@ public function testGetUpdateStateWithUpdateAndValidLink() {
7274 'web ' => 'https://docs.nextcloud.com/myUrl ' ,
7375 'url ' => 'https://downloads.nextcloud.org/server ' ,
7476 'autoupdater ' => '1 ' ,
77+ 'eol ' => '0 ' ,
7578 ]);
7679
7780 $ expected = [
7881 'updateAvailable ' => true ,
7982 'updateVersion ' => 'Nextcloud 123 ' ,
8083 'updaterEnabled ' => true ,
84+ 'versionIsEol ' => false ,
8185 'updateLink ' => 'https://docs.nextcloud.com/myUrl ' ,
8286 'downloadLink ' => 'https://downloads.nextcloud.org/server ' ,
8387 ];
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ public function check() {
9898 $ tmp ['url ' ] = (string )$ data ->url ;
9999 $ tmp ['web ' ] = (string )$ data ->web ;
100100 $ tmp ['autoupdater ' ] = (string )$ data ->autoupdater ;
101+ $ tmp ['eol ' ] = isset ($ data ->eol ) ? (string )$ data ->eol : '0 ' ;
101102 } else {
102103 libxml_clear_errors ();
103104 }
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ public function testCheckWithoutUpdateUrl() {
8585 'url ' => 'https://download.example.org/community/owncloud-8.0.4.zip ' ,
8686 'web ' => 'http://doc.example.org/server/8.0/admin_manual/maintenance/upgrade.html ' ,
8787 'autoupdater ' => '0 ' ,
88+ 'eol ' => '1 ' ,
8889 ];
8990
9091 $ this ->config
@@ -123,6 +124,7 @@ public function testCheckWithoutUpdateUrl() {
123124 <url>https://download.example.org/community/owncloud-8.0.4.zip</url>
124125 <web>http://doc.example.org/server/8.0/admin_manual/maintenance/upgrade.html</web>
125126 <autoupdater>0</autoupdater>
127+ <eol>1</eol>
126128</owncloud> ' ;
127129 $ this ->updater
128130 ->expects ($ this ->once ())
@@ -180,6 +182,7 @@ public function testCheckWithEmptyValidXmlResponse() {
180182 'url ' => '' ,
181183 'web ' => '' ,
182184 'autoupdater ' => '' ,
185+ 'eol ' => '0 ' ,
183186 ];
184187
185188 $ this ->config
@@ -273,6 +276,7 @@ public function testCheckWithMissingAttributeXmlResponse() {
273276 'url ' => '' ,
274277 'web ' => '' ,
275278 'autoupdater ' => '' ,
279+ 'eol ' => '0 ' ,
276280 ];
277281
278282 $ this ->config
You can’t perform that action at this time.
0 commit comments