glpi-plugin-auf : rapport sur la migration Ubuntu
[auf-serveur.git] / glpi-plugin-auf / plugin / setup.php
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
8 function plugin_init_auf() {
9 global $PLUGIN_HOOKS;
10
11 $PLUGIN_HOOKS['csrf_compliant']['auf'] = TRUE;
12
13 $Plugin = new Plugin();
14 $moduleId = 0;
15 if ($Plugin->isActivated('auf')) { // check if plugin is active
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
30 if (isset($_SESSION["glpiname"])) {
31 $report_list = array();
32 if (Session::haveRight("computer", "r")) {
33 $report_list["rapport.migrationubuntu.php"] = "Suivi de la migration vers Ubuntu 12.04";
34 $report_list["report.operatingsystems.php"] = "Systèmes d'exploitation par implantation";
35 $report_list["report.computers.php"] = "Ordinateurs par implantation";
36 // $report_list["report.wip.php"] = 'WIP (rapport en cours de développement)';
37 }
38 $PLUGIN_HOOKS['reports']['auf'] = $report_list;
39 }
40 }
41 }
42
43 // Get the name and the version of the plugin - Needed
44 function plugin_version_auf() {
45 return array(
46 'name' => 'AUF',
47 'version' => '0.2.0',
48 'author' => 'Jean Christophe André',
49 'license' => 'GPLv2+',
50 'homepage' => 'http://git.auf.org/?p=auf-serveur.git;a=tree;f=glpi-plugin-auf',
51 'minGlpiVersion' => '0.84');// For compatibility / no install in version < 0.80
52 }
53
54 // Optional : check prerequisites before install : may print errors or add to message after redirect
55 function plugin_auf_check_prerequisites() {
56 if (version_compare(GLPI_VERSION,'0.84','lt') || version_compare(GLPI_VERSION,'0.85','ge')) {
57 echo 'This plugin requires GLPI >= 0.84 and GLPI < 0.85';
58 return FALSE;
59 }
60 return TRUE;
61 }
62
63 // Uninstall process for plugin : need to return true if succeeded ;
64 // may display messages or add to message after redirect
65 function plugin_auf_check_config() {
66 return TRUE;
67 }
68
69 function plugin_auf_haveRight($module,$right) {
70 return TRUE;
71 }
72 ?>