Commit 17970cf5 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ldap-fixes' into 'master'

Ldap fixes

Will fix #193 by adding a proper active_directory check

See merge request !206
parents 878dfdbc 7389ab15
module Gitlab
module LDAP
class Group
attr_accessor :adapter
def self.find_by_cn(cn, adapter)
adapter.group(cn)
end
......@@ -36,7 +38,7 @@ module Gitlab
member_uids.include?(user.uid)
elsif member_dns.include?(user.dn)
true
elsif Gitlab.config.ldap.active_directory
elsif adapter.config.active_directory
adapter.dn_matches_filter?(user.dn, active_directory_recursive_memberof_filter)
end
end
......
......@@ -261,8 +261,8 @@ objectclass: posixGroup
describe 'ldap_groups' do
let(:ldap_group_1) do
Net::LDAP::Entry.from_single_ldif_string(
%Q{dn: cn=#{Gitlab.config.ldap['admin_group']},ou=groups,dc=bar,dc=com
cn: #{Gitlab.config.ldap['admin_group']}
%Q{dn: cn=#{access.ldap_config.admin_group},ou=groups,dc=bar,dc=com
cn: #{access.ldap_config.admin_group}
description: GitLab group 1
gidnumber: 42
memberuid: user1
......
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