Création d'un paquet glpi-plugin-auf.
[auf-serveur.git] / glpi-plugin-auf / plugin / setup.php
CommitLineData
277feb35
P
1<?php
2/*
3 AUF plugin for GLPI
4 Copyright (C) 2014 AUF -- www.auf.org
5 */
6
7// Init the hooks of the plugins -Needed
8function plugin_init_auf() {
9 global $PLUGIN_HOOKS;
10
11 $PLUGIN_HOOKS['csrf_compliant']['auf'] = TRUE;
12
13 $Plugin = new Plugin();
14 if ($Plugin->isActivated('auf')) { // check if plugin is active
15 if (Session::getLoginUserID()) {
16 $PLUGIN_HOOKS['add_css']['auf'] = "auf.css";
17 }
18 if (isset($_SESSION["glpiname"])) {
19 $report_list = array();
20 if (Session::haveRight("computer", "r")) {
21 $report_list["report.operatingsystems.php"] = "Systèmes d'exploitation par implantation";
22 $report_list["report.wip.php"] = 'WIP (rapport en cours de développement)';
23 }
24 $PLUGIN_HOOKS['reports']['auf'] = $report_list;
25 }
26 }
27}
28
29// Get the name and the version of the plugin - Needed
30function plugin_version_auf() {
31 return array(
32 'name' => 'AUF',
33 'version' => '0.1.0',
34 'author' => 'Jean Christophe André',
35 'license' => 'GPLv2+',
36 'homepage' => 'http://git.auf.org/?p=glpi',
37 'minGlpiVersion' => '0.84');// For compatibility / no install in version < 0.80
38}
39
40// Optional : check prerequisites before install : may print errors or add to message after redirect
41function plugin_auf_check_prerequisites() {
42 if (version_compare(GLPI_VERSION,'0.84','lt') || version_compare(GLPI_VERSION,'0.85','ge')) {
43 _e('This plugin requires GLPI >= 0.84', 'auf');
44 return FALSE;
45 }
46 return TRUE;
47}
48
49// Uninstall process for plugin : need to return true if succeeded : may display messages or add to message after redirect
50function plugin_auf_check_config() {
51 return TRUE;
52}
53
54function plugin_auf_haveRight($module,$right) {
55 return TRUE;
56}
57?>