mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-22 19:16:39 +10:00
Improve dn_matches_filter method
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
@@ -107,12 +107,7 @@ module Gitlab
|
||||
end
|
||||
|
||||
def dn_matches_filter?(dn, filter)
|
||||
results = ldap_search(base: dn, filter: filter, attributes: %w{dn})
|
||||
if results.blank?
|
||||
false # Net::LDAP encountered an LDAP error
|
||||
else
|
||||
results.any?
|
||||
end
|
||||
ldap_search(base: dn, filter: filter, attributes: %w{dn}).any?
|
||||
end
|
||||
|
||||
def ldap_search(*args)
|
||||
|
||||
Reference in New Issue
Block a user