modify example for ticket #3955

git-svn-id: https://forge.glpi-project.org/svn/example/trunk@203 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
yllen 2012-10-18 13:35:32 +00:00
parent 2814d6dc83
commit 5fadd64292
2 changed files with 29 additions and 1 deletions

View File

@ -666,4 +666,29 @@ function plugin_example_postinit() {
// do something // do something
} }
} }
/**
* Hook to add more data from ldap
* fields from plugin_retrieve_more_field_from_ldap_example
*
* @param $datas array
*
* @return un tableau
**/
function plugin_retrieve_more_data_from_ldap_example(array $datas) {
return $datas;
}
/**
* Hook to add more fields from LDAP
*
* @param $fields array
*
* @return un tableau
**/
function plugin_retrieve_more_field_from_ldap_example($fields) {
return $fields;
}
?> ?>

View File

@ -148,6 +148,9 @@ function plugin_init_example() {
$PLUGIN_HOOKS['add_javascript']['example'] = 'example.js'; $PLUGIN_HOOKS['add_javascript']['example'] = 'example.js';
$PLUGIN_HOOKS['add_css']['example'] = 'example.css'; $PLUGIN_HOOKS['add_css']['example'] = 'example.css';
// request more attributes from ldap
//$PLUGIN_HOOKS['retrieve_more_field_from_ldap']['example']="plugin_retrieve_more_field_from_ldap_example";
// Retrieve others datas from LDAP // Retrieve others datas from LDAP
//$PLUGIN_HOOKS['retrieve_more_data_from_ldap']['example']="plugin_retrieve_more_data_from_ldap_example"; //$PLUGIN_HOOKS['retrieve_more_data_from_ldap']['example']="plugin_retrieve_more_data_from_ldap_example";
@ -161,7 +164,7 @@ function plugin_init_example() {
$PLUGIN_HOOKS['post_init']['example'] = 'plugin_example_postinit'; $PLUGIN_HOOKS['post_init']['example'] = 'plugin_example_postinit';
// CSRF compliance : All actions must be done via POST and forms closed by Html::closeForm(); // CSRF compliance : All actions must be done via POST and forms closed by Html::closeForm();
$PLUGIN_HOOKS['csrf_compliant']['example'] = true; $PLUGIN_HOOKS['csrf_compliant']['example'] = true;
} }