91,9 → 91,13 |
throw new OIDplusConfigInitializationException('File userdata/baseconfig/config.inc.php is missing, but setup can\'t be started because its directory missing.'); |
} else { |
if (self::$html) { |
if (strpos($_SERVER['REQUEST_URI'], OIDplus::getSystemUrl(true).'setup/') !== 0) { |
header('Location:'.OIDplus::getSystemUrl().'setup/'); |
die('Redirecting to setup...'); |
} else { |
return self::$baseConfig; |
} |
} else { |
// This can be displayed in e.g. ajax.php |
throw new OIDplusConfigInitializationException('File userdata/baseconfig/config.inc.php is missing. Please run setup again.'); |
} |
641,10 → 645,13 |
if (!$relative) { |
$res = OIDplus::baseConfig()->getValue('EXPLICIT_ABSOLUTE_SYSTEM_URL', ''); |
if ($res !== '') { |
try { |
OIDplus::config()->setValue('last_known_system_url', $res); |
return $res; |
} catch (Exception $e) { |
} |
} |
} |
|
if (!isset($_SERVER["SCRIPT_NAME"])) return false; |
|
669,8 → 676,11 |
|
if (!$relative) { |
if (php_sapi_name() == 'cli') { |
try { |
return OIDplus::config()->getValue('last_known_system_url', false); |
} catch (Exception $e) { |
} |
} |
|
$is_ssl = isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on'); |
$protocol = $is_ssl ? 'https' : 'http'; |
685,8 → 695,11 |
} |
$res = $protocol.'://'.$host.$port_add.$res; |
|
try { |
OIDplus::config()->setValue('last_known_system_url', $res); |
} catch (Exception $e) { |
} |
} |
|
return $res; |
} |