diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2014-01-30 16:11:19 +0400 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2014-02-18 22:38:22 +0400 |
commit | 91e7692b66f8916f634af6cf1d2dc1a459699733 (patch) | |
tree | 5eea73a96d6da98700187109ebcd30c844ba5218 /lib/gitlab/ldap/user.rb | |
parent | 5e935bfec6cefe0f295858e0d3eddc2d80a91dbd (diff) |
Fix searching by extern_uid for LDAP to be case-insensitive
Diffstat (limited to 'lib/gitlab/ldap/user.rb')
-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 fd36dda7d22..4ba69525f85 100644 --- a/lib/gitlab/ldap/user.rb +++ b/lib/gitlab/ldap/user.rb @@ -83,8 +83,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 provider |