diff options
author | Jan-Willem van der Meer <mail@jewilmeer.nl> | 2014-10-14 12:08:47 +0400 |
---|---|---|
committer | Jan-Willem van der Meer <mail@jewilmeer.nl> | 2014-10-14 12:08:47 +0400 |
commit | d3056feb119de28a0e7333f80ee6d42ecf690dc5 (patch) | |
tree | 1e4f3ff22d33fde0ea946b7c2d24a81a12a690dc /lib | |
parent | b229b0f00327b210374d847b57760757fdcd8ee3 (diff) |
Make sure the filters are applied
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/ldap/authentication.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/gitlab/ldap/authentication.rb b/lib/gitlab/ldap/authentication.rb index 0eca9b26133..8d306a74c15 100644 --- a/lib/gitlab/ldap/authentication.rb +++ b/lib/gitlab/ldap/authentication.rb @@ -48,15 +48,16 @@ module Gitlab end def user_filter(login) - Net::LDAP::Filter.eq(config.uid, login).tap do |filter| - # Apply LDAP user filter if present - if config.user_filter.present? - Net::LDAP::Filter.join( - filter, - Net::LDAP::Filter.construct(config.user_filter) - ) - end + filter = Net::LDAP::Filter.eq(config.uid, login) + + # Apply LDAP user filter if present + if config.user_filter.present? + filter = Net::LDAP::Filter.join( + filter, + Net::LDAP::Filter.construct(config.user_filter) + ) end + filter end def user |