Commit cc768fdd authored by Jacob Vosmaer's avatar Jacob Vosmaer

Reuse LDAP adapter in Group instances

parent b040f5da
...@@ -63,7 +63,7 @@ module Gitlab ...@@ -63,7 +63,7 @@ module Gitlab
options.merge!(size: size) if size options.merge!(size: size) if size
ldap.search(options).map do |entry| ldap.search(options).map do |entry|
Gitlab::LDAP::Group.new(entry) Gitlab::LDAP::Group.new(entry, self)
end end
end end
......
...@@ -12,9 +12,10 @@ module Gitlab ...@@ -12,9 +12,10 @@ module Gitlab
adapter.group(cn) adapter.group(cn)
end end
def initialize(entry) def initialize(entry, adapter=nil)
Rails.logger.debug { "Instantiating #{self.class.name} with LDIF:\n#{entry.to_ldif}" } Rails.logger.debug { "Instantiating #{self.class.name} with LDIF:\n#{entry.to_ldif}" }
@entry = entry @entry = entry
@adapter = adapter
end end
def cn def cn
......
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