LDAP Functions
Endpoint Privilege Management for Unix and Linux LDAP support is based on the LDAP version 2 API, as defined in RFC 1823. Specific parts of the LDAP API are mapped to a series of Endpoint Privilege Management for Unix and Linux functions.
The following table summarizes the Endpoint Privilege Management for Unix and Linux LDAP functions.
Function | Description |
ldap_attributes() | Returns the attributes that are associated with an LDAP entry. |
ldap_bind() | Binds an open LDAP connection to a user. |
ldap_dn2ufn() | Converts a DN to a user-friendly naming format. |
ldap_entry_count() | Returns the number of entries that are returned by an LDAP search. |
ldap_explodedn() | Returns the components of a DN in a list. |
ldap_firstentry() | Returns the first entry that is returned by a search. |
ldap_getdn() | Returns the DN of an LDAP entry. |
ldap_getvalues() | Returns values that are associated with an LDAP entry. |
ldap_init() |
Connects to an LDAP server. Version 3.5 and earlier: function available. Version 4.0 and later: function deprecated. |
ldap_nextentry() | Returns the next entry that is returned by a search. |
ldap_open() | Opens a connection to an LDAP server. |
ldap_search() | Opens a connection to an LDAP server. |
ldap_search() | Searches an LDAP tree. |
ldap_unbind() | Unbinds and disconnects a connection from an LDAP directory. |
Perform an LDAP Search
The general process for performing an LDAP search is outlined below.
- Use the ldap_open() function to establish an LDAP server connection.
- Bind the LDAP server connection to the user by using the ldap_bind() function.
- Use the function ldap_search() to search an LDAP directory.
- Use the ldap_entry_count() function to determine the number of entries that were found by the query.
- Loop through the entries that were found by the query by using the ldap_firstentry() and ldap_ nextentry() functions.
- Use the function ldap_attributes() to obtain a list of attributes that are available for an entry.
- Use the ldap_getvalues() function to retrieve the actual attribute values that are associated with an entry.
- Process the next entry. Repeat steps 5 through 7 until all entries are processed.
- Use the function ldap_unbind() to unbind and close the LDAP Server connection.
For more information on using LDAP, refer to your LDAP documentation.