mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-04 03:18:49 +03:00
Improved login default_domain with dynamic options
This commit is contained in:
parent
f3e6dda69b
commit
ba4b8f84cc
2 changed files with 11 additions and 1 deletions
|
|
@ -86,6 +86,11 @@ trait UserAuth
|
|||
if (!\str_contains($sEmail, '@')) {
|
||||
$sDefDomain = \trim($this->Config()->Get('login', 'default_domain', ''));
|
||||
if (\strlen($sDefDomain)) {
|
||||
if ('HTTP_HOST' === $sDefDomain || 'SERVER_NAME' === $sDefDomain) {
|
||||
$sDefDomain = \preg_replace('/:[0-9]+$/D', '', $_SERVER[$sDefDomain]);
|
||||
} else if ('gethostname' === $sDefDomain) {
|
||||
$sDefDomain = \gethostname();
|
||||
}
|
||||
$this->Logger()->Write('Default domain "' . $sDefDomain . '" was used. (' . $sEmail . ' > ' . $sEmail . '@' . $sDefDomain . ')',
|
||||
\LOG_INFO, 'LOGIN');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue