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(_host = 'localhost', _port = 389, _rootdn = '', _passdn = '', _filter = '(objectClass=*)', _scope = LDAP::LDAP_SCOPE_SUBTREE) ⇒ LdapTemplate

constructor for LdapTemplate

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

return a boolean



220
221
222
223
224
225
226
227
228
229
# File 'lib/ldapmapper.rb', line 220

def initialize(_host='localhost', _port=389, _rootdn='', _passdn='', _filter='(objectClass=*)', _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,_rootdn,_passdn)
  @passdn_ldap = _passdn # default empty
  @rootdn_ldap = _rootdn # default empty
  return true
end

Instance Attribute Details

#basedn_ldapObject

LDAP base DN for the instance



209
210
211
# File 'lib/ldapmapper.rb', line 209

def basedn_ldap
  @basedn_ldap
end

#filter_ldapObject

current filter for search



207
208
209
# File 'lib/ldapmapper.rb', line 207

def filter_ldap
  @filter_ldap
end

#host_ldapObject

hostname of the LDAP server



201
202
203
# File 'lib/ldapmapper.rb', line 201

def host_ldap
  @host_ldap
end

#passdn_ldapObject

credential for the instance



211
212
213
# File 'lib/ldapmapper.rb', line 211

def passdn_ldap
  @passdn_ldap
end

#port_ldapObject

TCP/IP port of the LDAP server



203
204
205
# File 'lib/ldapmapper.rb', line 203

def port_ldap
  @port_ldap
end

#rootdn_ldapObject

LDAP rootdn for LDAP



213
214
215
# File 'lib/ldapmapper.rb', line 213

def rootdn_ldap
  @rootdn_ldap
end

#scope_ldapObject

LDAP scope for search



205
206
207
# File 'lib/ldapmapper.rb', line 205

def scope_ldap
  @scope_ldap
end