mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-19 01:26:08 +10:00
Backport Adapter#ldap_search from EE
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user