Class: KU::LDAP::Entry::User
- Inherits:
-
Base
- Object
- Base
- KU::LDAP::Entry::User
show all
- Defined in:
- lib/ku/ldap/entry/user.rb
Constant Summary
Constants inherited
from Base
Base::BASE
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#==, first, #initialize, search
Class Method Details
.authenticate(directory, id, password) ⇒ Object
9
10
11
12
|
# File 'lib/ku/ldap/entry/user.rb', line 9
def self.authenticate directory, id, password
entry = Array(directory.authenticate(base, KU::LDAP::Filter.new.eq(identifier, id), password)).first
new entry if entry
end
|
Instance Method Details
#department ⇒ Object
38
39
40
|
# File 'lib/ku/ldap/entry/user.rb', line 38
def department
self[:departmentnumber]
end
|
#email ⇒ Object
42
43
44
|
# File 'lib/ku/ldap/entry/user.rb', line 42
def email
self[:mail]
end
|
#first_name ⇒ Object
18
19
20
|
# File 'lib/ku/ldap/entry/user.rb', line 18
def first_name
self[:givenname]
end
|
#full_name ⇒ Object
26
27
28
|
# File 'lib/ku/ldap/entry/user.rb', line 26
def full_name
self[:displayname]
end
|
#group_ids ⇒ Object
54
55
56
|
# File 'lib/ku/ldap/entry/user.rb', line 54
def group_ids
groups.map(&:id)
end
|
#groups ⇒ Object
50
51
52
|
# File 'lib/ku/ldap/entry/user.rb', line 50
def groups
@groups ||= KU::LDAP.groups(:memberuid, id, :eq)
end
|
#id ⇒ Object
14
15
16
|
# File 'lib/ku/ldap/entry/user.rb', line 14
def id
self[:uid]
end
|
#last_name ⇒ Object
22
23
24
|
# File 'lib/ku/ldap/entry/user.rb', line 22
def last_name
self[:sn]
end
|
#primary_group ⇒ Object
46
47
48
|
# File 'lib/ku/ldap/entry/user.rb', line 46
def primary_group
Group.new self[:employeetype]
end
|
#primary_institution ⇒ Object
34
35
36
|
# File 'lib/ku/ldap/entry/user.rb', line 34
def primary_institution
self[:o]
end
|
#title ⇒ Object
30
31
32
|
# File 'lib/ku/ldap/entry/user.rb', line 30
def title
self[:title]
end
|