mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-05-04 18:08:42 +02:00
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:
parent
c3b401049c
commit
df4bbb9e79
16
hook.php
16
hook.php
@ -691,4 +691,20 @@ function plugin_retrieve_more_data_from_ldap_example(array $datas) {
|
||||
function plugin_retrieve_more_field_from_ldap_example($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;
|
||||
}
|
||||
?>
|
@ -164,6 +164,8 @@ function plugin_init_example() {
|
||||
|
||||
$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();
|
||||
$PLUGIN_HOOKS['csrf_compliant']['example'] = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user