sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Global Vars: %s',implode('| ',array_keys($GLOBALS))),
'type'=>'info','special'=>true));
return true;
}
add_hook('post_session_init','example_post_session_init');
/**
* This pre_connect function is called before making a connection to the LDAP server.
* While PLA makes many calls to connect to the LDAP server, this is called only once
* when caching is turned on.
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @see post_connect
*/
function example_pre_connect() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:
',$args[0],$args[1]),
'type'=>'info','special'=>true));
return true;
}
add_hook('pre_connect','example_pre_connect');
/**
* This post_connect function is called after making a connection to the LDAP server.
* While PLA makes many calls to connect to the LDAP server, this is called only once
* when caching is turned on.
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string User ID of the user who successfully made the connection.
* @see pre_connect
*/
function example_post_connect() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- User DN: %s
',$args[0],$args[1],$args[2]),
'type'=>'info','special'=>true));
return true;
}
add_hook('post_connect','example_post_connect');
/**
* This pre_entry_create function is called before an entry is created in ds_ldap_pla::add().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the entry created
* @param array Attributes for the new DN
* @see post_entry_create
*/
function example_pre_entry_create() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attributes: %s
',$args[0],$args[1],$args[2],implode(',',(array_keys($args[3])))),
'type'=>'info','special'=>true));
return true;
}
add_hook('pre_entry_create','example_pre_entry_create');
/**
* This post_entry_create function is called after an entry is created in ds_ldap_pla::add().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the entry created
* @param array Attributes for the new DN
* @see pre_entry_create
*/
function example_post_entry_create() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attributes: %s
',$args[0],$args[1],$args[2],implode(',',(array_keys($args[3])))),
'type'=>'info','special'=>true));
return true;
}
add_hook('post_entry_create','example_post_entry_create');
/**
* This pre_entry_delete function is called before an entry is deleted in ds_ldap_pla::delete().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the entry deleted
* @see post_entry_delete
*/
function example_pre_entry_delete() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
',$args[0],$args[1],$args[2]),
'type'=>'info','special'=>true));
return true;
}
add_hook('pre_entry_delete','example_pre_entry_delete');
/**
* This post_entry_delete function is called after an entry is deleted in ds_ldap_pla::delete().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the entry deleted
* @see pre_entry_delete
*/
function example_post_entry_delete() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
',$args[0],$args[1],$args[2]),
'type'=>'info','special'=>true));
return true;
}
add_hook('post_entry_delete','example_post_entry_delete');
/**
* This pre_entry_rename function is called before an entry is renamed in ds_ldap_pla::rename().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string Old DN of the entry to be renamed
* @param string New RDN for the new entry
* @param string Container for the new entry
* @see post_entry_rename
*/
function example_pre_entry_rename() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- New RDN: %s
- New Container: %s
',$args[0],$args[1],$args[2],$args[3],$args[4]),
'type'=>'info','special'=>true));
return true;
}
add_hook('pre_entry_rename','example_pre_entry_rename');
/**
* This post_entry_rename function is called after an entry is renamed in ds_ldap_pla::rename().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string Old DN of the entry to be renamed
* @param string New RDN for the new entry
* @param string Container for the new entry
* @see pre_entry_rename
*/
function example_post_entry_rename() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- New RDN: %s
- New Container: %s
',$args[0],$args[1],$args[2],$args[3],$args[4]),
'type'=>'info','special'=>true));
return true;
}
add_hook('post_entry_rename','example_post_entry_rename');
/**
* This pre_entry_modify function is called before an entry is modified in ds_ldap_pla::modify().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the entry to be modified
* @param array Attributes to be modified
* @see post_entry_modify
*/
function example_pre_entry_modify() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attributes: %s
',$args[0],$args[1],$args[2],implode('|',array_keys($args[3]))),
'type'=>'info','special'=>true));
return true;
}
add_hook('pre_entry_modify','example_pre_entry_modify');
/**
* This post_entry_modify function is called after an entry is modified in ds_ldap_pla::modify().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the entry to be modified
* @param array Attributes to be modified
* @see pre_entry_modify
*/
function example_post_entry_modify() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attributes: %s
',$args[0],$args[1],$args[2],implode('|',array_keys($args[3]))),
'type'=>'info','special'=>true));
return true;
}
add_hook('post_entry_modify','example_post_entry_modify');
// pre_attr_add
// post_attr_add
/**
* This pre_attr_add function is called before an attribute is deleted in ds_ldap_pla::modify().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the attribute to be deleted
* @param string Attribute to be deleted
* @param array Old values
* @see post_attr_add
*/
function example_pre_attr_add() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attribute: %s
- New Values: %s
',$args[0],$args[1],$args[2],$args[3],implode('|',$args[4])),
'type'=>'info','special'=>true));
return true;
}
add_hook('pre_attr_add','example_pre_attr_add');
/**
* This post_attr_add function is called after an attribute is added in ds_ldap_pla::modify().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the attribute to be added
* @param string Attribute to be added
* @param array New values
* @see pre_attr_add
*/
function example_post_attr_add() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attribute: %s
- New Values: %s
',$args[0],$args[1],$args[2],$args[3],implode('|',$args[4])),
'type'=>'info','special'=>true));
return true;
}
add_hook('post_attr_add','example_post_attr_add');
// pre_attr_modify
// post_attr_modify
/**
* This pre_attr_modify function is called before an attribute is modified in ds_ldap_pla::modify().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the attribute to be modified
* @param string Attribute to be modified
* @param array New values
* @see post_attr_modify
*/
function example_pre_attr_modify() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attribute: %s
- Old Values: %s
- New Values: %s
',$args[0],$args[1],$args[2],$args[3],implode('|',$args[4]),implode('|',$args[5])),
'type'=>'info','special'=>true));
return true;
}
add_hook('pre_attr_modify','example_pre_attr_modify');
/**
* This post_attr_modify function is called after an attribute is deleted in ds_ldap_pla::modify().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the attribute to be deleted
* @param string Attribute to be deleted
* @param array Old values
* @see pre_attr_modify
*/
function example_post_attr_modify() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attribute: %s
- Old Values: %s
- New Values: %s
',$args[0],$args[1],$args[2],$args[3],implode('|',$args[4]),implode('|',$args[5])),
'type'=>'info','special'=>true));
return true;
}
add_hook('post_attr_modify','example_post_attr_modify');
/**
* This pre_attr_delete function is called before an attribute is deleted in ds_ldap_pla::modify().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the attribute to be deleted
* @param string Attribute to be deleted
* @param array Old values
* @see post_attr_delete
*/
function example_pre_attr_delete() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attribute: %s
- Old Values: %s
',$args[0],$args[1],$args[2],$args[3],implode('|',$args[4])),
'type'=>'info','special'=>true));
return true;
}
add_hook('pre_attr_delete','example_pre_attr_delete');
/**
* This post_attr_delete function is called after an attribute is deleted in ds_ldap_pla::modify().
*
* Arguments available are:
* @param int Server ID of the server to be connected to
* @param string Method. The user connection method, normally 'user'.
* @param string DN of the attribute to be deleted
* @param string Attribute to be deleted
* @param array Old values
* @see pre_attr_delete
*/
function example_post_attr_delete() {
$args = func_get_args();
system_message(array(
'title'=>sprintf('Hook called [%s]',__METHOD__),
'body'=>sprintf('Arguments:- Server ID: %s
- Method: %s
- DN: %s
- Attribute: %s
- Old Values: %s
',$args[0],$args[1],$args[2],$args[3],implode('|',$args[4])),
'type'=>'info','special'=>true));
return true;
}
add_hook('post_attr_delete','example_post_attr_delete');