diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-29 16:08:31 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-29 16:08:31 +0400 |
commit | fdeacf0ad19424850105fbe38d7bf5901d2d3c39 (patch) | |
tree | 59cf611f9f147d796036320407064056fcf8cbfe /lib | |
parent | 5fef54589d5a73223ed0c3e18d43b8d747091bf2 (diff) | |
parent | 91e7692b66f8916f634af6cf1d2dc1a459699733 (diff) |
Merge pull request #6317 from jirutka/fix-ldap-dn-case
Fix searching by extern_uid for LDAP to be case-insensitive
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ldap/user.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb index 6bc587df3ce..01d86430f02 100644 --- a/lib/gitlab/ldap/user.rb +++ b/lib/gitlab/ldap/user.rb @@ -81,8 +81,13 @@ module Gitlab private + def find_by_uid_and_provider + find_by_uid(uid) + end + def find_by_uid(uid) - model.where(provider: provider, extern_uid: uid).last + # LDAP distinguished name is case-insensitive + model.where("provider = ? and lower(extern_uid) = ?", provider, uid.downcase).last end def username |