Commit f4bca105 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Backport Adapter#ldap_search from EE

parent f18f8e67
......@@ -64,7 +64,7 @@ module Gitlab
end
end
entries = ldap.search(options).select do |entry|
entries = ldap_search(options).select do |entry|
entry.respond_to? config.uid
end
......@@ -77,6 +77,22 @@ module Gitlab
users(*args).first
end
def ldap_search(*args)
results = ldap.search(*args)
if results.nil?
response = ldap.get_operation_result
unless response.code.zero?
Rails.logger.warn("LDAP search error: #{response.message}")
end
[]
else
results
end
end
private
def config
......
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