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(_passdn, _rootdn = 'cn=root', _host = 'localhost', _filter = '(objectClass=*)', _port = 389, _scope = LDAP::LDAP_SCOPE_SUBTREE) ⇒ LdapTemplate
constructor
constructor for LdapTemplate.
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
140 141 142 143 144 145 146 147 148 149 |
# File 'lib/ldapmapper.rb', line 140 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_ldap ⇒ Object
LDAP base DN for the instance
129 130 131 |
# File 'lib/ldapmapper.rb', line 129 def basedn_ldap @basedn_ldap end |
#filter_ldap ⇒ Object
current filter for search
127 128 129 |
# File 'lib/ldapmapper.rb', line 127 def filter_ldap @filter_ldap end |
#host_ldap ⇒ Object
hostname of the LDAP server
121 122 123 |
# File 'lib/ldapmapper.rb', line 121 def host_ldap @host_ldap end |
#passdn_ldap ⇒ Object
credential for the instance
131 132 133 |
# File 'lib/ldapmapper.rb', line 131 def passdn_ldap @passdn_ldap end |
#port_ldap ⇒ Object
TCP/IP port of the LDAP server
123 124 125 |
# File 'lib/ldapmapper.rb', line 123 def port_ldap @port_ldap end |
#rootdn_ldap ⇒ Object
LDAP rootdn for LDAP
133 134 135 |
# File 'lib/ldapmapper.rb', line 133 def rootdn_ldap @rootdn_ldap end |
#scope_ldap ⇒ Object
LDAP scope for search
125 126 127 |
# File 'lib/ldapmapper.rb', line 125 def scope_ldap @scope_ldap end |