Previous: , Up: The Low-Level LDAP API   [Contents][Index]


60.2.3.3 Low-level Operations on a LDAP Server

ldap-search-basic is the low-level primitive to perform a search on a LDAP server. It works directly on an open LDAP connection thus requiring a preliminary call to ldap-open. Multiple searches can be made on the same connection, then the session must be closed with ldap-close.

Function: ldap-search-basic ldap filter &optional base scope attrs attrsonly withdn verbose

Perform a search on an open connection ldap created with ldap-open. filter is a filter string for the search see Syntax of Search Filters base is the distinguished name at which to start the search. scope is one of the symbols base, onelevel or subtree indicating the scope of the search limited to a base object, to a single level or to the whole subtree. The default is subtree. attrs is a list of strings indicating which attributes to retrieve for each matching entry. If nil all available attributes are returned. If attrsonly is non-nil then only the attributes are retrieved, not their associated values. If withdn is non-nil then each entry in the result is prepended with its distinguished name DN. If verbose is non-nil then progress messages are echoed The function returns a list of matching entries. Each entry is itself an alist of attribute/value pairs optionally preceded by the DN of the entry according to the value of withdn.

Function: ldap-add ldap dn entry

Add entry to a LDAP directory which a connection ldap has been opened to with ldap-open. dn is the distinguished name of the entry to add. entry is an entry specification, i.e., a list of cons cells containing attribute/value string pairs.

Function: ldap-modify ldap dn mods

Modify an entry in an LDAP directory. ldap is an LDAP connection object created with ldap-open. dn is the distinguished name of the entry to modify. mods is a list of modifications to apply. A modification is a list of the form (MOD-OP ATTR VALUE1 VALUE2 ...) mod-op and attr are mandatory, values are optional depending on mod-op. mod-op is the type of modification, one of the symbols add, delete or replace. attr is the LDAP attribute type to modify.

Function: ldap-delete ldap dn

Delete an entry to an LDAP directory. ldap is an LDAP connection object created with ldap-open. dn is the distinguished name of the entry to delete.


Previous: , Up: The Low-Level LDAP API   [Contents][Index]