summaryrefslogtreecommitdiff
path: root/app/Auth
diff options
context:
space:
mode:
authorAshish Kulkarni <kulkarni.ashish@gmail.com>2014-08-20 19:38:20 +0530
committerAshish Kulkarni <kulkarni.ashish@gmail.com>2014-08-20 20:12:05 +0530
commit3a0dd411287b2834ac34a1fa0f88b273bd60fbfb (patch)
treecb66ef0674acc83daf1c83e6d3a726269f3ad611 /app/Auth
parent9254d3b2502c1be2d511701d1e81386d2786a017 (diff)
support specifying default email domain for reverse proxy setup
Diffstat (limited to 'app/Auth')
-rw-r--r--app/Auth/ReverseProxy.php7
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,