Show info in updater if running PHP < 5.6

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2016-12-06 00:05:56 +01:00
parent 8a65b56a03
commit 035be23f72
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
3 changed files with 10 additions and 1 deletions

View File

@ -114,7 +114,7 @@ class AdminController extends Controller implements ISettings {
'newVersionString' => (empty($updateState['updateVersion'])) ? '' : $updateState['updateVersion'],
'downloadLink' => (empty($updateState['downloadLink'])) ? '' : $updateState['downloadLink'],
'updaterEnabled' => (empty($updateState['updaterEnabled'])) ? false : $updateState['updaterEnabled'],
'outdatedPHP' => version_compare(PHP_VERSION, '5.6') === -1,
'notify_groups' => implode('|', $notifyGroups),
];

View File

@ -14,6 +14,13 @@
$currentChannel = $_['currentChannel'];
?>
<form id="oca_updatenotification_section" class="followupsection">
<?php if($_['outdatedPHP'] === true) { ?>
<p class="warning" style="margin-bottom: 15px;">
<?php p($l->t('You are running PHP %s. To allow you to upgrade to Nextcloud 11 and higher you need to run at least PHP 5.6. Once you upgraded your PHP version you will be able to receive update notifications for these newer versions.', [PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION])); ?>
</p>
<?php } ?>
<?php if($isNewVersionAvailable === true) { ?>
<strong><?php p($l->t('A new version is available: %s', [$newVersionString])); ?></strong>
<?php if ($_['updaterEnabled']) { ?>

View File

@ -125,6 +125,7 @@ class AdminControllerTest extends TestCase {
'newVersionString' => '8.1.2',
'downloadLink' => 'https://downloads.nextcloud.org/server',
'updaterEnabled' => true,
'outdatedPHP' => version_compare(PHP_VERSION, '5.6') === -1,
'notify_groups' => 'admin',
];
@ -171,6 +172,7 @@ class AdminControllerTest extends TestCase {
'newVersionString' => '',
'downloadLink' => '',
'updaterEnabled' => 0,
'outdatedPHP' => version_compare(PHP_VERSION, '5.6') === -1,
'notify_groups' => 'admin',
];