From c5b43a43023f1fa392fd80b3637cecea35444d86 Mon Sep 17 00:00:00 2001 From: Simon L Date: Sat, 10 Jun 2023 09:47:04 +0200 Subject: [PATCH] allow to specify upgrade.cli-upgrade-link in order to link to the correct documentation Signed-off-by: Simon L --- config/config.sample.php | 5 +++++ core/ajax/update.php | 2 +- core/templates/update.use-cli.php | 10 +++++++--- lib/base.php | 2 ++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/config/config.sample.php b/config/config.sample.php index 870d09e24a705..7a6d215266204 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -2149,6 +2149,11 @@ */ 'upgrade.disable-web' => false, +/** + * Allows to modify the cli-upgrade link in order to link to a different documentation + */ +'upgrade.cli-upgrade-link' => '', + /** * Set this Nextcloud instance to debugging mode * diff --git a/core/ajax/update.php b/core/ajax/update.php index dae08ad0882f9..9fa163eef7149 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -100,7 +100,7 @@ public function handleRepairFeedback(Event $event): void { if (\OCP\Util::needUpgrade()) { $config = \OC::$server->getSystemConfig(); if ($config->getValue('upgrade.disable-web', false)) { - $eventSource->send('failure', $l->t('Please use the command line updater because updating via the browser is disabled in your config.php.')); + $eventSource->send('failure', $l->t('Please use the command line updater because updating via browser is disabled in your config.php.')); $eventSource->close(); exit(); } diff --git a/core/templates/update.use-cli.php b/core/templates/update.use-cli.php index 403de7feadcd3..ae82436d2f181 100644 --- a/core/templates/update.use-cli.php +++ b/core/templates/update.use-cli.php @@ -5,10 +5,14 @@ t('Please use the command line updater because you have a big instance with more than 50 users.')); } else { - p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.')); + p($l->t('Please use the command line updater because updating via browser is disabled in your config.php.')); } ?>

- t('For help, see the documentation.', [link_to_docs('admin-cli-upgrade')])); ?> + t('For help, see the documentation.', [$cliUpgradeLink])); ?> diff --git a/lib/base.php b/lib/base.php index 83f97963c4d06..09ec5be441b5b 100644 --- a/lib/base.php +++ b/lib/base.php @@ -312,6 +312,7 @@ public static function checkMaintenanceMode(\OC\SystemConfig $systemConfig): voi * Prints the upgrade page */ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void { + $cliUpgradeLink = $systemConfig->getValue('upgrade.cli-upgrade-link', ''); $disableWebUpdater = $systemConfig->getValue('upgrade.disable-web', false); $tooBig = false; if (!$disableWebUpdater) { @@ -358,6 +359,7 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void { $template->assign('productName', 'nextcloud'); // for now $template->assign('version', OC_Util::getVersionString()); $template->assign('tooBig', $tooBig); + $template->assign('cliUpgradeLink', $cliUpgradeLink); $template->printPage(); die();