This chapter explains how to write functions that the server calls before and after executing an LDAP operation. These functions are called pre-operation and post-operation plug-in functions.
How Pre/Post-Operation Plug-Ins Work
Writing Pre/Post-Operation Functions
Registering Pre/Post-Operation Functions
bind
unbind
search
modify
add
delete
modify RDN
compare
abandon
You can set up the Directory Server to call your own plug-in functions before and after executing these LDAP operations. For example, you can write a function that validates an entry before the server performs an LDAP add operation to add it to the directory. Or you can write a function that notifies a user whose entry has just been modified by an LDAP modify operation.
You can also set up the Directory Server to call your own plug-in functions before and after:
sending an LDAP entry back to the client
sending an LDAP result code back to the client
sending an LDAP referral back to the client
Figure 6.1 How the server calls pre-operation and post-operation plug-in functions
Types of Pre-Operation Functions
Table 6.1 lists the Directory Server pre-operation functions and the purpose of each function.
Table 6.1 Functions called before the Directory Server executes an operation
Types of Post-Operation Functions
Table 6.2 lists the Directory Server post-operation functions and the purpose of each function.
Table 6.2 Functions called after the Directory Server executes an operation
For details, follow the procedures outlined in "Writing an Initialization Function" on page 34 and "Configuring the Server" on page 39.
Note. Each pre-operation and post-operation plug-in is associated with a back-end. Make sure that the plugin directive that registers the plug-in is within the database section for that back-end in the slapd.conf file. (The plugin directive should be after the database directive and before the next database directive, if any.)