Commit 5a616649 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Allow passing an adapter to Gitlab::LDAP::Person

parent 50670948
module Gitlab module Gitlab
module LDAP module LDAP
class Person class Person
def self.find_by_uid(uid) def self.find_by_uid(uid, adapter=nil)
Gitlab::LDAP::Adapter.new.user(config.uid, uid) adapter ||= Gitlab::LDAP::Adapter.new
adapter.user(config.uid, uid)
end end
def self.find_by_dn(dn) def self.find_by_dn(dn, adapter=nil)
Gitlab::LDAP::Adapter.new.user('dn', dn) adapter ||= Gitlab::LDAP::Adapter.new
adapter.user('dn', dn)
end end
def initialize(entry) def initialize(entry)
......
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