Skip to content

Commit ab5c202

Browse files
IONOS(base): add redirect for upgrade page if needed
in case you dont want to display upgrade button to users you can redirect them to other location (e.g. dedicated maintenance page) set desired location via ./occ config:system:set --type string --value /maintenance -- redirect_upgradepage_to_location Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
1 parent 573f449 commit ab5c202

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/base.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,15 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
360360
$tmpl->assign('productName', 'Nextcloud');
361361
}
362362
$tmpl->assign('oldTheme', $oldTheme);
363+
364+
$redirectUpgradePage = $systemConfig->getValue('redirect_upgradepage_to_location', null);
365+
if ($redirectUpgradePage !== null) {
366+
http_response_code(307);
367+
header('X-Nextcloud-needsDbUpgrade: 1');
368+
header("Location: ${redirectUpgradePage}#" . time());
369+
die();
370+
}
371+
363372
$tmpl->printPage();
364373
}
365374

0 commit comments

Comments
 (0)