lib/cratus/group.rb in cratus-0.2.7 vs lib/cratus/group.rb in cratus-0.3.7
- old
+ new
@@ -31,10 +31,14 @@
STDERR.puts "WARNING: Group '#{@name}' appears to be invalid or beyond the search scope!"
return []
end
# TODO: move the search filter to a configurable param
- raw_groups = @raw_ldap_data[memrof_attr].reject { |g| g.match(/OU=Distribution Groups/) }
+ if Cratus.config.include_distribution_groups
+ raw_groups = @raw_ldap_data[memrof_attr]
+ else
+ raw_groups = @raw_ldap_data[memrof_attr].reject { |g| g.match(/OU=Distribution Groups/) }
+ end
initial_groups = raw_groups.map do |raw_group|
Group.new(raw_group.match(/^#{Group.ldap_dn_attribute.to_s.upcase}=([^,]+),/)[1])
end
all_the_groups = initial_groups
initial_groups.each do |group|