Commit 797e8072 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Use LDAP::Access.open to reuse the LDAP connection

parent 11dba4ce
...@@ -66,8 +66,8 @@ module Gitlab ...@@ -66,8 +66,8 @@ module Gitlab
if Gitlab.config.ldap.enabled if Gitlab.config.ldap.enabled
if user.ldap_user? if user.ldap_user?
# Check if LDAP user exists and match LDAP user_filter # Check if LDAP user exists and match LDAP user_filter
unless Gitlab::LDAP::Access.new.allowed?(user) Gitlab::LDAP::Access.open do |adapter|
return false return false unless adapter.allowed?(user)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment