diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-08-20 10:44:00 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-08-20 10:44:00 -0700 |
commit | 7fb7455814090c3a4cf13fc502511257cf046535 (patch) | |
tree | 5f22b87a0fe9575f94574ef9eeec57982c633de8 | |
parent | 3a0dd411287b2834ac34a1fa0f88b273bd60fbfb (diff) |
Improve default email domain for reverse-prxy auth
-rw-r--r-- | README.markdown | 1 | ||||
-rw-r--r-- | app/Auth/ReverseProxy.php | 3 | ||||
-rw-r--r-- | app/common.php | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/README.markdown b/README.markdown index efd16676..167b214c 100644 --- a/README.markdown +++ b/README.markdown @@ -107,6 +107,7 @@ Original author: [Frédéric Guillot](http://fredericguillot.com/) Contributors: - Alex Butum: https://github.com/dZkF9RWJT6wN8ux +- Ashish Kulkarni: https://github.com/ashkulz - Claudio Lobo - Cmer: https://github.com/chncsu - Floaltvater: https://github.com/floaltvater diff --git a/app/Auth/ReverseProxy.php b/app/Auth/ReverseProxy.php index 361e9634..6880f5fa 100644 --- a/app/Auth/ReverseProxy.php +++ b/app/Auth/ReverseProxy.php @@ -64,8 +64,9 @@ 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; + $email = $login.'@'.REVERSE_PROXY_DEFAULT_DOMAIN; } return $this->user->create(array( diff --git a/app/common.php b/app/common.php index 6b5bc729..f295ab5f 100644 --- a/app/common.php +++ b/app/common.php @@ -84,6 +84,7 @@ defined('GITHUB_CLIENT_SECRET') or define('GITHUB_CLIENT_SECRET', ''); defined('REVERSE_PROXY_AUTH') or define('REVERSE_PROXY_AUTH', false); defined('REVERSE_PROXY_USER_HEADER') or define('REVERSE_PROXY_USER_HEADER', 'REMOTE_USER'); defined('REVERSE_PROXY_DEFAULT_ADMIN') or define('REVERSE_PROXY_DEFAULT_ADMIN', ''); +defined('REVERSE_PROXY_DEFAULT_DOMAIN') or define('REVERSE_PROXY_DEFAULT_DOMAIN', ''); // Mail configuration defined('MAIL_FROM') or define('MAIL_FROM', 'notifications@kanboard.net'); |