Module: KU::LDAP

Extended by:
LDAP
Included in:
LDAP
Defined in:
lib/ku/ldap.rb,
lib/ku/ldap/filter.rb,
lib/ku/ldap/version.rb,
lib/ku/ldap/directory.rb,
lib/ku/ldap/entry/base.rb,
lib/ku/ldap/entry/user.rb,
lib/ku/ldap/entry/group.rb

Defined Under Namespace

Modules: Entry Classes: Directory, Filter

Constant Summary collapse

HOST =
ENV['KU_LDAP_HOST']
PORT =
ENV['KU_LDAP_PORT']
VERSION =
"0.0.3"

Instance Method Summary collapse

Instance Method Details

#authenticate(id, password, user_class = Entry::User) ⇒ Object



22
23
24
# File 'lib/ku/ldap.rb', line 22

def authenticate id, password, user_class=Entry::User
  user_class.authenticate directory, id, password
end

#group(id, group_class = Entry::Group) ⇒ Object



26
27
28
# File 'lib/ku/ldap.rb', line 26

def group id, group_class=Entry::Group
  group_class.first directory, id
end

#groups(attribute, value, matcher = :contains, group_class = Entry::Group) ⇒ Object



30
31
32
# File 'lib/ku/ldap.rb', line 30

def groups attribute, value, matcher=:contains, group_class=Entry::Group
  group_class.search directory, attribute.to_sym, value, matcher
end

#user(id, user_class = Entry::User) ⇒ Object



14
15
16
# File 'lib/ku/ldap.rb', line 14

def user id, user_class=Entry::User
  user_class.first directory, id
end

#users(attribute, value, matcher = :contains, user_class = Entry::User) ⇒ Object



18
19
20
# File 'lib/ku/ldap.rb', line 18

def users attribute, value, matcher=:contains, user_class=Entry::User
  user_class.search directory, attribute.to_sym, value, matcher
end