login update user lang

This commit is contained in:
lgb
2024-04-01 21:39:43 +08:00
parent dea1677522
commit d3edc3c48b
4 changed files with 26 additions and 11 deletions

View File

@@ -470,20 +470,26 @@ function arr_set(&$array, $key, $value)
function isHttps(): bool
{
$schema = nexus()->getRequestSchema();
return $schema == 'https';
if (isRunningInConsole()) {
$securityLogin = get_setting("security.securelogin");
if ($securityLogin != "no") {
return true;
}
return false;
}
return nexus()->getRequestSchema() == 'https';
}
function getSchemeAndHttpHost()
function getSchemeAndHttpHost(bool $fromConfig = false)
{
global $BASEURL;
if (isRunningInConsole()) {
return $BASEURL;
if (isRunningInConsole() || $fromConfig) {
$host = get_setting("basic.BASEURL");
} else {
$host = nexus()->getRequestHost();
}
$isHttps = isHttps();
$protocol = $isHttps ? 'https' : 'http';
$host = nexus()->getRequestHost();
return "$protocol://" . $host;
}