glpi-plugin-auf : intégration Debian 8 et Ubuntu 14.04
[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();
749e76d6 14 $moduleId = 0;
277feb35 15 if ($Plugin->isActivated('auf')) { // check if plugin is active
749e76d6
P
16
17 Plugin::registerClass('PluginAufProfile',
18 array('addtabon'=>array('Profile')));
19 Plugin::registerClass('PluginAufComputer',
20 array('addtabon'=>array('Computer')));
21
22
23 $PLUGIN_HOOKS['change_profile']['auf'] = array('PluginAufProfile', 'changeProfile');
24
25 $PLUGIN_HOOKS['add_css']['auf'] = "auf.css";
26
27 // if (Session::getLoginUserID()) {
28 // }
29
277feb35
P
30 if (isset($_SESSION["glpiname"])) {
31 $report_list = array();
32 if (Session::haveRight("computer", "r")) {
1135f035
P
33 $report_list["rapport.migrationubuntu.php"] = "Progression des mises à niveau Ubuntu";
34 $report_list["rapport.migrationdebian.php"] = "Progression des mises à niveau Debian";
277feb35 35 $report_list["report.operatingsystems.php"] = "Systèmes d'exploitation par implantation";
118fab7c 36 $report_list["report.computers.php"] = "Nombre de machines par catégorie";
f87696f8 37 // $report_list["report.wip.php"] = 'WIP (rapport en cours de développement)';
277feb35
P
38 }
39 $PLUGIN_HOOKS['reports']['auf'] = $report_list;
40 }
41 }
42}
43
44// Get the name and the version of the plugin - Needed
45function plugin_version_auf() {
46 return array(
47 'name' => 'AUF',
1135f035 48 'version' => '0.3.0',
277feb35
P
49 'author' => 'Jean Christophe André',
50 'license' => 'GPLv2+',
c2b8eea0 51 'homepage' => 'http://git.auf.org/?p=auf-serveur.git;a=tree;f=glpi-plugin-auf',
277feb35
P
52 'minGlpiVersion' => '0.84');// For compatibility / no install in version < 0.80
53}
54
55// Optional : check prerequisites before install : may print errors or add to message after redirect
56function plugin_auf_check_prerequisites() {
57 if (version_compare(GLPI_VERSION,'0.84','lt') || version_compare(GLPI_VERSION,'0.85','ge')) {
749e76d6 58 echo 'This plugin requires GLPI >= 0.84 and GLPI < 0.85';
277feb35
P
59 return FALSE;
60 }
61 return TRUE;
62}
63
749e76d6
P
64// Uninstall process for plugin : need to return true if succeeded ;
65// may display messages or add to message after redirect
277feb35
P
66function plugin_auf_check_config() {
67 return TRUE;
68}
69
70function plugin_auf_haveRight($module,$right) {
71 return TRUE;
72}
73?>