LDAP SCL Interface |
Modifies an LDAP directory entry.
_MODIFY(entryName, attrs);
When invoked on an LDAPSERVICES instance, the _MODIFY method modifies the attributes and attribute values in an LDAP directory entry.
The attrs
parameter specifies the attributes and the values in
each attribute that are to be modified. The format of the attrs
parameter is a list of lists. Each list contains the modify type, attribute
name, and attribute values, if any. The lists must have the following format:
Item Number Value ----------- ----- 1 Character value representing the type of modification, which can be "ADD", "DELETE", or "REPLACE". 2 Character value representing an attribute name. 3 Numeric or character attribute value. ... n Numeric or character attribute value.
If the type of modification is DELETE and if no attribute values are specified, the entire attribute and all values are deleted. If DELETE is specified with one or more attribute values, only the specified values are deleted.
If the type of modification is REPLACE, the existing attribute is deleted and is replaced with the specified attribute and attribute values. You must specify all attribute values, because all of the existing attribute values are replaced with the attribute values specified with this method.
The following example modifies three attributes in an LDAP directory entry.
dn = "cn=srvr01.unx.com,o=Alpine Airways,c=US"; entry = makelist(); alist1 = makelist(); rc = insertc(alist1, "ADD", -1); /* modify type */ rc = insertc(alist1, "sasFrequency", -1); /* attribute name */ rc = insertc(alist1, "monthly", -1); /* attribute value */ rc = insertc(alist1, "weekly", -1); /* attribute value */ alist2 = makelist(); rc = insertc(alist2, "DELETE", -1); /* modify type */ rc = insertc(alist2, "sasNameValueFilter", -1); /* attribute name */ alist3 = makelist(); rc = insertc(alist3, "REPLACE", -1); /* modify type */ rc = insertc(alist3, "sasDeliveryTransport", -1); /* attribute name */ rc = insertc(alist3, "email", -1); rc = insertl(entry, alist1, -1); rc = insertl(entry, alist2, -1); rc = insertl(entry, alist3, -1); rc = ds._MODIFY(dn,entry); rc = dellist(alist1); rc = dellist(alist2); rc = dellist(alist3);
LDAP SCL Interface |