diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-04-19 13:15:41 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-04-19 13:15:41 +0000 |
| commit | eb289a859cda292ef660b64c59b1975e6bbf52c8 (patch) | |
| tree | cde5056d6edb03769539a5427a0508bd147c7df1 /lib/bootstrap.php | |
| parent | b3399e96283c7a86a3be6e5a9a8dbbb4afbce060 (diff) | |
fixes #4034
Closes #4034
Merge request studip/studip!2889
Diffstat (limited to 'lib/bootstrap.php')
| -rw-r--r-- | lib/bootstrap.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/bootstrap.php b/lib/bootstrap.php index c9f5103..06ddca5 100644 --- a/lib/bootstrap.php +++ b/lib/bootstrap.php @@ -65,6 +65,16 @@ if (isset($_SERVER['SERVER_NAME'])) { $GLOBALS['ASSETS_URL'] = $ABSOLUTE_URI_STUDIP . 'assets/'; $GLOBALS['ASSETS_PATH'] = $ABSOLUTE_PATH_STUDIP . 'assets/'; +// Check if instance is configured; redirect to install script if not +if (!file_exists($GLOBALS['STUDIP_BASE_PATH'] . '/config/config_local.inc.php') && php_sapi_name() !== 'cli') { + require_once __DIR__ . '/classes/URLHelper.php'; + + URLHelper::setBaseUrl($GLOBALS['ABSOLUTE_URI_STUDIP']); + header('Location: ' . URLHelper::getURL('install.php')); + die; +} + +// Load configuration require __DIR__ . '/classes/StudipFileloader.php'; $added_configs = []; @@ -80,14 +90,6 @@ if (!defined('Studip\ENV')) { define('Studip\ENV', DEFAULT_ENV); } -if (!file_exists($GLOBALS['STUDIP_BASE_PATH'] . '/config/config_local.inc.php') && php_sapi_name() !== 'cli') { - require_once __DIR__ . '/classes/URLHelper.php'; - - URLHelper::setBaseUrl($GLOBALS['ABSOLUTE_URI_STUDIP']); - header('Location: ' . URLHelper::getURL('install.php')); - die; -} - require __DIR__ . '/bootstrap-autoload.php'; // construct absolute URL for ASSETS_URL |
