diff options
Diffstat (limited to 'app/Auth')
-rw-r--r-- | app/Auth/ReverseProxy.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/Auth/ReverseProxy.php b/app/Auth/ReverseProxy.php index e23ee24f..361e9634 100644 --- a/app/Auth/ReverseProxy.php +++ b/app/Auth/ReverseProxy.php @@ -63,8 +63,13 @@ class ReverseProxy extends Base */ private function createUser($login) { + $email = strpos($login, '@') !== false ? $login : ''; + if (REVERSE_PROXY_DEFAULT_DOMAIN !== '' && empty($email)) { + $email = $login . '@' . REVERSE_PROXY_DEFAULT_DOMAIN; + } + return $this->user->create(array( - 'email' => strpos($login, '@') !== false ? $login : '', + 'email' => $email, 'username' => $login, 'is_admin' => REVERSE_PROXY_DEFAULT_ADMIN === $login, 'is_ldap_user' => 1, |