]> source.dussan.org Git - nextcloud-server.git/commitdiff
allow to specify upgrade.cli-upgrade-link in order to link to the correct documentation 38752/head
authorSimon L <szaimen@e.mail.de>
Sat, 10 Jun 2023 07:47:04 +0000 (09:47 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Mon, 12 Jun 2023 11:56:20 +0000 (11:56 +0000)
Signed-off-by: Simon L <szaimen@e.mail.de>
config/config.sample.php
core/templates/update.use-cli.php
lib/base.php

index 892f84601e451608371ae792b7206e32991e9c87..c3a15a8a985e2015d55c8dbd9d87e02e07e90662 100644 (file)
@@ -2137,6 +2137,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
  *
index 403de7feadcd3f13d84c3b27190b4e3efa3aa2e3..ae82436d2f181fa4f8386456dbf47d281ba2f4d6 100644 (file)
@@ -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>
 
index 32ac60c8c4fae0be4b823f3f026b42ac5c6ee643..3cca7ab3a96aa87a39f7ad26d1e5bdf9951cd6f6 100644 (file)
@@ -309,6 +309,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) {
@@ -355,6 +356,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();