This commit is contained in:
Matt Todd 2015-01-14 22:05:24 -08:00
Родитель 2a62c2112d
Коммит cb4bd2ce9f
1 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -89,12 +89,14 @@ module GitHub
end
end
# take found groups and combine groups and members into list of entries
found.values.each do |group|
# pull member DNs, discarding dupes and subgroup DNs
member_dns = found.values.each_with_object([]) do |group, member_dns|
entries << group
# just need member DNs as Net::LDAP::Entry objects
entries.concat member_dns(group).map { |dn| Net::LDAP::Entry.new(dn) }
end
member_dns.concat member_dns(group)
end.uniq.reject { |dn| found.key?(dn) }
# wrap member DNs in Net::LDAP::Entry objects
entries.concat member_dns.map { |dn| Net::LDAP::Entry.new(dn) }
entries
end