add status hook

git-svn-id: https://forge.glpi-project.org/svn/example/trunk@205 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
moyooo 2012-10-30 09:23:30 +00:00
parent c3b401049c
commit df4bbb9e79
2 changed files with 18 additions and 0 deletions

View File

@ -691,4 +691,20 @@ function plugin_retrieve_more_data_from_ldap_example(array $datas) {
function plugin_retrieve_more_field_from_ldap_example($fields) { function plugin_retrieve_more_field_from_ldap_example($fields) {
return $fields; return $fields;
} }
// Check to add to status page
function plugin_example_Status($param) {
// Do checks (no check for example)
$ok = true;
echo "example plugin: example";
if ($ok) {
echo "_OK";
} else {
echo "_PROBLEM";
// Only set ok to false if trouble (global status)
$param['ok'] = false;
}
echo "\n";
return $param;
}
?> ?>

View File

@ -164,6 +164,8 @@ function plugin_init_example() {
$PLUGIN_HOOKS['post_init']['example'] = 'plugin_example_postinit'; $PLUGIN_HOOKS['post_init']['example'] = 'plugin_example_postinit';
$PLUGIN_HOOKS['status']['example'] = 'plugin_example_Status';
// 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;
} }