Netscape DIRECTORY SERVER 7.0 - PLUG-IN Manual page 188

For plug-in
Table of Contents

Advertisement

Summary of Data Types and Structures
Code Example 14-1
Slapi_PBlock *rcpb;
LDAPMod attribute1;
LDAPMod *list_of_attrs[2];
char *mail_values[] = { "bab@example.com", NULL };
char *dn;
...
/* Identify the entry that you want changed */
dn = "cn=Barbara Jensen, ou=Product Development, o=Ace Industry,
c=US";
/* Specify that you want to replace the value of an attribute */
attribute1.mod_op = LDAP_MOD_REPLACE;
/* Specify that you want to change the value of the mail attribute
*/
attribute1.mod_type = "mail";
/* Specify the new value of the mail attribute */
attribute1.mod_values = mail_values;
/* Add the change to the list of attributes that you want changed
*/
list_of_attrs[0] = &attribute_change;
list_of_attrs[1] = NULL;
/* Update the entry with the change */
rcpb = slapi_modify_internal( dn, list_of_attrs, NULL, 1 );
...
The following table summarizes the front-end API functions that you can call to
specify changes to an attribute in an directory entry.
To ...
Translate from entry to LDAPMod.
Dump the contents of an LDAPMod
to the server log.
Get a reference to the LDAPMod in a
Slapi_Mod structure.
Retrieve the reference to the
LDAPMod contained in a
Slapi_Mod structure.
188
Netscape Directory Server Plug-in Programmer's Guide • October 2004
Sample Code for Changing the Email Address of a User's Entry
... Call this function
slapi_entry2mods()
slapi_mod_dump()
slapi_mod_get_ldapmod_byref()
slapi_mod_get_ldapmod_passout()

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netscape directory server 7.0

Table of Contents