Class: Ldapmapper::LdapTemplate
- Inherits:
-
Object
- Object
- Ldapmapper::LdapTemplate
- Defined in:
- lib/ldapmapper.rb
Overview
generic class for LDAP object
Direct Known Subclasses
Instance Attribute Summary collapse
-
#basedn_ldap ⇒ Object
LDAP base DN for the instance.
-
#filter_ldap ⇒ Object
current filter for search.
-
#host_ldap ⇒ Object
hostname of the LDAP server.
-
#passdn_ldap ⇒ Object
credential for the instance.
-
#port_ldap ⇒ Object
TCP/IP port of the LDAP server.
-
#rootdn_ldap ⇒ Object
LDAP rootdn for LDAP.
-
#scope_ldap ⇒ Object
LDAP scope for search.
Instance Method Summary collapse
-
#initialize(_host = 'localhost', _port = 389, _rootdn = '', _passdn = '', _filter = '(objectClass=*)', _scope = LDAP::LDAP_SCOPE_SUBTREE) ⇒ LdapTemplate
constructor
constructor for LdapTemplate.
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_ldap ⇒ Object
LDAP base DN for the instance
209 210 211 |
# File 'lib/ldapmapper.rb', line 209 def basedn_ldap @basedn_ldap end |
#filter_ldap ⇒ Object
current filter for search
207 208 209 |
# File 'lib/ldapmapper.rb', line 207 def filter_ldap @filter_ldap end |
#host_ldap ⇒ Object
hostname of the LDAP server
201 202 203 |
# File 'lib/ldapmapper.rb', line 201 def host_ldap @host_ldap end |
#passdn_ldap ⇒ Object
credential for the instance
211 212 213 |
# File 'lib/ldapmapper.rb', line 211 def passdn_ldap @passdn_ldap end |
#port_ldap ⇒ Object
TCP/IP port of the LDAP server
203 204 205 |
# File 'lib/ldapmapper.rb', line 203 def port_ldap @port_ldap end |
#rootdn_ldap ⇒ Object
LDAP rootdn for LDAP
213 214 215 |
# File 'lib/ldapmapper.rb', line 213 def rootdn_ldap @rootdn_ldap end |
#scope_ldap ⇒ Object
LDAP scope for search
205 206 207 |
# File 'lib/ldapmapper.rb', line 205 def scope_ldap @scope_ldap end |