Class: Goz::User::LDAP

Inherits:
Base
  • Object
show all
Defined in:
lib/goz/user/ldap.rb

Overview

Goz::User::LDAP - TODO

Usage

TODO

Author

blair christensen. <[email protected]>

Homepage

github.com/blairc/goz/

Constant Summary collapse

TAG =

TODO How am I handling configuration?

self.name

Instance Attribute Summary

Attributes inherited from Base

#email, #identifier, #klass, #login, #name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#[], configuration, #to_hash, #to_s

Constructor Details

#initialize(u) ⇒ LDAP

Returns a new instance of LDAP.



34
35
36
37
38
39
40
# File 'lib/goz/user/ldap.rb', line 34

def initialize(u)
  @email      = u[ @@cf['attributes']['email'] ].first
  @identifier = u[ @@cf['attributes']['identifier'] ].first
  @klass      = self.class.name
  @login      = u[ @@cf['attributes']['login'] ].first
  @name       = u[ @@cf['attributes']['name'] ].first
end

Class Method Details

.find_by_identifier(identifier) ⇒ Object

Find Goz::User by identifier or return nil



45
46
47
48
49
50
51
52
53
# File 'lib/goz/user/ldap.rb', line 45

def self.find_by_identifier(identifier)
  Goz::Logger.debug TAG, "find_by_identifier( identifier=#{identifier} )"
  u = find 'identifier', identifier
  if u.nil?
    Goz::Logger.warn TAG, "find_by_identifier( identifier=#{identifier} ) - not found"
    return nil
  end
  self.new u
end

.find_by_login(login) ⇒ Object

Find Goz::User by login or return nil



59
60
61
62
63
64
65
66
67
# File 'lib/goz/user/ldap.rb', line 59

def self.()
  Goz::Logger.debug TAG, "find_by_login( login=#{} )"
  u = find 'login', 
  if u.nil?
    Goz::Logger.warn TAG, "find_by_login( login=#{} ) - not found"
    return nil
  end
  self.new u
end