Class: Adauth::Group
- Inherits:
-
Object
- Object
- Adauth::Group
- Defined in:
- lib/adauth/group.rb
Overview
Constant Summary collapse
- ATTR_SV =
Single vales where the method maps directly to one Active Directory attribute
{ :name => :name, :dn => :distinguishedname }
- ATTR_MV =
Multi values were the method needs to return an array for values.
{ :ous => [ :distinguishedname, Proc.new {|g| g.sub(/.*?OU=(.*?),.*/, '\1')} ] }
Class Method Summary collapse
-
.find(name) ⇒ Object
Finds the group specified.
Instance Method Summary collapse
-
#members ⇒ Object
Returns the members of the group.
Class Method Details
.find(name) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/adauth/group.rb', line 29 def self.find(name) @conn = Adauth::AdminConnection.bind if group = @conn.search(:filter => Net::LDAP::Filter.eq('name', name)).first return self.new(group) else return nil end end |
Instance Method Details
#members ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/adauth/group.rb', line 44 def members filters = Net::LDAP::Filter.eq("memberof","CN=#{name},#{dn}") members_ldap = @conn.search(:filter => filters) members = [] members_ldap.each do |member| user = Adauth::User.create_from_login(member.samaccountname.first) members.push(user) end return members end |