Class: Ldapmapper::LdapTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/ldapmapper.rb

Overview

generic class for LDAP object

Direct Known Subclasses

LdapMapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_passdn, _rootdn = 'cn=root', _host = 'localhost', _filter = '(objectClass=*)', _port = 389, _scope = LDAP::LDAP_SCOPE_SUBTREE) ⇒ LdapTemplate

constructor for LdapTemplate

_passdn is required, _rootdn, _host, _filter, _port and _scope are optionals

return a boolean



129
130
131
132
133
134
135
136
137
138
# File 'lib/ldapmapper.rb', line 129

def initialize(_passdn,_rootdn='cn=root',_host='localhost', _filter='(objectClass=*)', _port=389, _scope=LDAP::LDAP_SCOPE_SUBTREE)  
  @host_ldap = _host # default localhost
  @port_ldap = _port # default 389
  @scope_ldap = _scope # default to SUBTREE
  @filter_ldap = _filter # default (objectClass=*)
  @basedn_ldap = get_basedn(_host,_port)
  @passdn_ldap = _passdn # no default
  @rootdn_ldap = _rootdn # default cn=root 
  return true
end

Instance Attribute Details

#basedn_ldapObject

LDAP base DN for the instance



118
119
120
# File 'lib/ldapmapper.rb', line 118

def basedn_ldap
  @basedn_ldap
end

#filter_ldapObject

current filter for search



116
117
118
# File 'lib/ldapmapper.rb', line 116

def filter_ldap
  @filter_ldap
end

#host_ldapObject

hostname of the LDAP server



110
111
112
# File 'lib/ldapmapper.rb', line 110

def host_ldap
  @host_ldap
end

#passdn_ldapObject

credential for the instance



120
121
122
# File 'lib/ldapmapper.rb', line 120

def passdn_ldap
  @passdn_ldap
end

#port_ldapObject

TCP/IP port of the LDAP server



112
113
114
# File 'lib/ldapmapper.rb', line 112

def port_ldap
  @port_ldap
end

#rootdn_ldapObject

LDAP rootdn for LDAP



122
123
124
# File 'lib/ldapmapper.rb', line 122

def rootdn_ldap
  @rootdn_ldap
end

#scope_ldapObject

LDAP scope for search



114
115
116
# File 'lib/ldapmapper.rb', line 114

def scope_ldap
  @scope_ldap
end