summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-10-11 22:53:11 +0000
committerRobert Speicher <robert@gitlab.com>2015-10-11 22:53:11 +0000
commit42603af3267bd1be0dcd18927d74bfc19a894c04 (patch)
tree084ddc0da8ac51405a04de24741a6dc10e9182a8 /lib
parent03b7fe71a5c5372fc8239a26e757685ab12eed87 (diff)
parentb7def88c02b3726259800a25ee8bb82c866fe673 (diff)
downloadgitlab-ce-42603af3267bd1be0dcd18927d74bfc19a894c04.tar.gz
Merge branch 'fix_email_downcasing' into 'master'
LDAP email address downcasing Fixes #2960 In the event we cannot match an LDAP user by DN we attempt to find an identity by email address and then update the DN. In this case the identity is matched by email address. If the user's email address in LDAP has an upper case character we cannot find a match in the GitLab database. GitLab downcases emails before the user object is saved. This merge request downcases the email from LDAP before we lookup by email. I also added a test to prevent a regression. See merge request !1550
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ldap/user.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb
index 1ea7751e27d..4be99dd88c2 100644
--- a/lib/gitlab/ldap/user.rb
+++ b/lib/gitlab/ldap/user.rb
@@ -35,7 +35,7 @@ module Gitlab
end
def find_by_email
- ::User.find_by(email: auth_hash.email)
+ ::User.find_by(email: auth_hash.email.downcase)
end
def update_user_attributes