Skip to content

Commit c9a4519

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 <[email protected]>
1 parent b6a6f74 commit c9a4519

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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)