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



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

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



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

def basedn_ldap
  @basedn_ldap
end

#filter_ldapObject

current filter for search



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

def filter_ldap
  @filter_ldap
end

#host_ldapObject

hostname of the LDAP server



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

def host_ldap
  @host_ldap
end

#passdn_ldapObject

credential for the instance



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

def passdn_ldap
  @passdn_ldap
end

#port_ldapObject

TCP/IP port of the LDAP server



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

def port_ldap
  @port_ldap
end

#rootdn_ldapObject

LDAP rootdn for LDAP



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

def rootdn_ldap
  @rootdn_ldap
end

#scope_ldapObject

LDAP scope for search



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

def scope_ldap
  @scope_ldap
end