mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +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');
|
||||
|
||||
|
|
|
|||
|
|
@ -225,7 +225,12 @@ class Application extends \RainLoop\Config\AbstractConfig
|
|||
|
||||
'login' => array(
|
||||
|
||||
'default_domain' => array(''),
|
||||
'default_domain' => array('',
|
||||
'If someone logs in without "@domain.tld", this value will be used
|
||||
When this value is HTTP_HOST, the $_SERVER["HTTP_HOST"] value is used.
|
||||
When this value is SERVER_NAME, the $_SERVER["SERVER_NAME"] value is used.
|
||||
When this value is gethostname, the gethostname() value is used.
|
||||
'),
|
||||
|
||||
'allow_languages_on_login' => array(true,
|
||||
'Allow language selection on webmail login screen'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue