ldapModifyEntry

function

Library: LDAP support (OMLDAP legacy)
Include: omldap.xin

Declaration
define external function ldapModifyEntry
               value      stream         distinct-name
       on      value      ldapConnection connection
       add     value      stream         add-attribute     optional
       replace value      stream         replace-attribute optional
       delete  value      stream         delete-attribute  optional
       with    value      integer        datatype          optional initial { LDAP_TEXT }
       values  modifiable stream         values            optional
       value   remainder  stream         value

Where:

Argument definitions

distinct-name
The distinct name of the entry to be modified.
connection
A connection to an LDAP server.
add-attribute
The attribute name you want to add.
replace-attribute
The attribute name you want to replace.
delete-attribute
The attribute name you want to delete.
datatype
The type of the attribute value. The default is LDAP_TEXT; the other option is LDAP_BINARY.
values
A shelf of attribute values.
value
A list of attribute values.


Purpose

This function modifies an entry by adding, replacing, or deleting a specified attribute and its values. You can specify only one of the three options -- "add", "replace", or "delete" -- or an error will occur. If you "add", all of the attribute values will be added to the entry. If the attribute does not exist, it will be created. If you "replace", all of the values of the attribute will be deleted and the new values added. If you "delete", the attribute values will be deleted. If no attribute values are specified with the delete operation, all of the values of the specified attribute will be deleted.

Example:

     include "omldap.xin"
  
     process
        local ldapConnection my-ldap
        local ldapAttribute my-entry variable
  
        ...
        ldapModifyEntry "cn=Lalime,Department=HR,O=omnimark.com"
           on    my-ldap
           add   "phonenumber"
           value "(123) 456-1212"
           value "(123) 456-1213"