Class LDAP::Conn
In: conn.c
lib/ldap/schema.rb
Parent: Data

Create and manipulate unencrypted LDAP connections.

Methods

add   add_ext   bind   bound?   compare   compare_ext   delete   delete_ext   err   err2string   get_option   modify   modify_ext   modrdn   new   open   perror   result2error   root_dse   schema   search   search2   search_ext   search_ext2   set_option   simple_bind   start_tls   unbind  

Public Class methods

Return a new LDAP::Conn connection to the server, host, on port port.

Return a new LDAP::Conn connection to the server, host, on port port.

Public Instance methods

Add an entry with the DN, dn, and the attributes, attrs. attrs should be either an array of LDAP#Mod objects or a hash of attribute/value array pairs.

Add an entry with the DN, dn, and the attributes, attrs. attrs should be either an array of LDAP#Mod objects or a hash of attribute/value array pairs. sctrls is an array of server controls, whilst cctrls is an array of client controls.

Bind an LDAP connection, using the DN, dn, the credential, password, and the bind method, method. If a block is given, self is yielded to the block.

Return true if the LDAP connection is still bound.

Compare the DN given as dn to see whether it has the attribute attr with a value of val.

Compare the DN given as dn to see whether it has the attribute attr with a value of val. sctrls is an array of server controls, whilst cctrls is an array of client controls.

Delete the entry with the DN, dn.

Delete the entry with the DN, dn. sctrls is an array of server controls, whilst cctrls is an array of client controls.

Return the error associated with the most recent LDAP operation.

Return the text string associated with the LDAP error, err.

Return the value associated with the option, opt.

Modify an entry with the DN, dn, and the attributes, mods. mods should be either an array of LDAP#Mod objects or a hash of attribute/value array pairs.

Modify an entry with the DN, dn, and the attributes, mods. mods should be either an array of LDAP#Mod objects or a hash of attribute/value array pairs. sctrls is an array of server controls, whilst cctrls is an array of client controls.

Modify the RDN of the entry with DN, dn, giving it the new RDN, new_rdn. If delete_old_rdn is true, the old RDN value will be deleted from the entry.

Print the text string associated with the error code of the last LDAP operation. msg is used to prefix the error.

Return the error code associated with the LDAP message, msg.

Fetch the root DSE (DSA-specific Entry) for the connection. DSA stands for Directory System Agent and simply refers to the LDAP server you are using.

attrs, if given, is an array of attributes that should be returned from the server. The default list is subschemaSubentry, namingContexts, monitorContext, altServer, supportedControl, supportedExtension, supportedFeatures, supportedSASLMechanisms and supportedLDAPVersion.

sec and usec can be used to specify a time-out for the search in seconds and microseconds, respectively.

Fetch the schema data for the connection.

If base is given, it gives the base DN for the search. attrs, if given, is an array of attributes that should be returned from the server. The default list is objectClasses, attributeTypes, matchingRules, matchingRuleUse, dITStructureRules, dITContentRules, nameForms and ldapSyntaxes.

sec and usec can be used to specify a time-out for the search in seconds and microseconds, respectively.

Perform a search, with the base DN base_dn, a scope of scope and a search filter of filter.

If attrs is present, it should be an array of the attributes that the search should return. By default, all attributes are returned, which is the same as specifying an empty array or nil. Alternatively, attrs may be a single string, in which case it will be treated as a single element array.

If attrsonly is true, attributes will be returned, but not their values.

If sec and/or usec are given, they define the time-out for the search in seconds and microseconds, respectively.

If s_attr is given, it specifies the attribute on which to sort the entries returned by the server. If s_proc is given, it specifies a Proc object that will be used to sort the entries returned by the server.

Note that not all results may be returned by this method. If a size limit has been set for the number of results to be returned and this limit is exceeded, the results set will be truncated. You can check for this by calling LDAP::Conn#err immediately after this method and comparing the result to LDAP::LDAP_SIZELIMIT_EXCEEDED.

Perform a search, with the base DN base_dn, a scope of scope and a search filter of filter.

If attrs is present, it should be an array of the attributes that the search should return. By default, all attributes are returned, which is the same as specifying an empty array or nil. Alternatively, attrs may be a single string, in which case it will be treated as a single element array.

If attrsonly is true, attributes will be returned, but not their values.

If sec and/or usec are given, they define the time-out for the search in seconds and microseconds, respectively.

If s_attr is given, it specifies the attribute on which to sort the entries returned by the server. If s_proc is given, it specifies a Proc object that will be used to sort the entries returned by the server.

Note that not all results may be returned by this method. If a size limit has been set for the number of results to be returned and this limit is exceeded, the results set will be truncated. You can check for this by calling LDAP::Conn#err immediately after this method and comparing the result to LDAP::LDAP_SIZELIMIT_EXCEEDED.

Perform a search, with the base DN base_dn, a scope of scope and a search filter of filter.

If attrs is present, it should be an array of the attributes that the search should return. By default, all attributes are returned, which is the same as specifying an empty array or nil. Alternatively, attrs may be a single string, in which case it will be treated as a single element array.

If attrsonly is true, attributes will be returned, but not their values.

sctrls is an array of server controls, whilst cctrls is an array of client controls.

If sec and/or usec are given, they define the time-out for the search in seconds and microseconds, respectively.

If s_attr is given, it specifies the attribute on which to sort the entries returned by the server. If s_proc is given, it specifies a Proc object that will be used to sort the entries returned by the server.

Note that not all results may be returned by this method. If a size limit has been set for the number of results to be returned and this limit is exceeded, the results set will be truncated. You can check for this by calling LDAP::Conn#err immediately after this method and comparing the result to LDAP::LDAP_SIZELIMIT_EXCEEDED.

Perform a search, with the base DN base_dn, a scope of scope and a search filter of filter.

If attrs is present, it should be an array of the attributes that the search should return. By default, all attributes are returned, which is the same as specifying an empty array or nil. Alternatively, attrs may be a single string, in which case it will be treated as a single element array.

If attrsonly is true, attributes will be returned, but not their values.

sctrls is an array of server controls, whilst cctrls is an array of client controls.

If sec and/or usec are given, they define the time-out for the search in seconds and microseconds, respectively.

If s_attr is given, it specifies the attribute on which to sort the entries returned by the server. If s_proc is given, it specifies a Proc object that will be used to sort the entries returned by the server.

Note that not all results may be returned by this method. If a size limit has been set for the number of results to be returned and this limit is exceeded, the results set will be truncated. You can check for this by calling LDAP::Conn#err immediately after this method and comparing the result to LDAP::LDAP_SIZELIMIT_EXCEEDED.

Set a session-wide option for this LDAP connection.

For example:

conn.set_option( LDAP::LDAP_OPT_PROTOCOL_VERSION, 3 )

would set the protocol of this connection to LDAPv3.

Bind an LDAP connection, using the DN, dn, and the credential, password. If a block is given, self is yielded to the block.

Initiate START_TLS for the connection, conn.

Unbind the LDAP connection from the server.

[Validate]