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

This commit is contained in:
Jacob Vosmaer 2014-05-14 19:04:00 +02:00
parent 11dba4cee7
commit 797e807249
1 changed files with 2 additions and 2 deletions

View File

@ -66,8 +66,8 @@ module Gitlab
if Gitlab.config.ldap.enabled
if user.ldap_user?
# Check if LDAP user exists and match LDAP user_filter
unless Gitlab::LDAP::Access.new.allowed?(user)
return false
Gitlab::LDAP::Access.open do |adapter|
return false unless adapter.allowed?(user)
end
end
end