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

@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.11');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-03-27');
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.12');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-04-01');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");

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;
}