diff options
author | Simon L <szaimen@e.mail.de> | 2023-06-10 09:47:04 +0200 |
---|---|---|
committer | Simon L <szaimen@e.mail.de> | 2023-06-10 10:05:36 +0200 |
commit | 918859cafdbb1c0439e34e75d6d1d5c74160c3d7 (patch) | |
tree | 3148d2fa7dcc37ffa88e3537d960dc0a586eef11 | |
parent | 99e1014ff1d039cf37e75e1facdae57399c58074 (diff) | |
download | nextcloud-server-918859cafdbb1c0439e34e75d6d1d5c74160c3d7.tar.gz nextcloud-server-918859cafdbb1c0439e34e75d6d1d5c74160c3d7.zip |
allow to specify upgrade.cli-upgrade-link in order to link to the correct documentation
Signed-off-by: Simon L <szaimen@e.mail.de>
-rw-r--r-- | config/config.sample.php | 5 | ||||
-rw-r--r-- | core/ajax/update.php | 2 | ||||
-rw-r--r-- | core/templates/update.use-cli.php | 10 | ||||
-rw-r--r-- | lib/base.php | 2 |
4 files changed, 15 insertions, 4 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index 366b6fbbc75..94b8a5d0552 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -2155,6 +2155,11 @@ $CONFIG = [ '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 * * Only enable this for local development and not in production environments diff --git a/core/ajax/update.php b/core/ajax/update.php index c28f2cdcd7c..2348e205283 100644 --- a/core/ajax/update.php +++ b/core/ajax/update.php @@ -103,7 +103,7 @@ class FeedBackHandler { 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 403de7feadc..ae82436d2f1 100644 --- a/core/templates/update.use-cli.php +++ b/core/templates/update.use-cli.php @@ -5,10 +5,14 @@ <?php if ($_['tooBig']) { p($l->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.')); } ?><br><br> - <?php - print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?> + <?php if (is_string($_['cliUpgradeLink']) && $_['cliUpgradeLink'] !== '') { + $cliUpgradeLink = $_['cliUpgradeLink']; + } else { + $cliUpgradeLink = link_to_docs('admin-cli-upgrade'); + } + print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [$cliUpgradeLink])); ?> </div> </div> diff --git a/lib/base.php b/lib/base.php index 83f97963c4d..09ec5be441b 100644 --- a/lib/base.php +++ b/lib/base.php @@ -312,6 +312,7 @@ class OC { * 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 @@ class OC { $template->assign('productName', 'nextcloud'); // for now $template->assign('version', OC_Util::getVersionString()); $template->assign('tooBig', $tooBig); + $template->assign('cliUpgradeLink', $cliUpgradeLink); $template->printPage(); die(); |