| 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"] = "Progression de la migration vers Ubuntu 12.04 (Precise)"; |
| 34 | $report_list["rapport.migrationdebian.php"] = "Progression de la migration vers Debian 7 (Wheezy)"; |
| 35 | $report_list["report.operatingsystems.php"] = "Systèmes d'exploitation par implantation"; |
| 36 | $report_list["report.computers.php"] = "Nombre de machines par catégorie"; |
| 37 | // $report_list["report.wip.php"] = 'WIP (rapport en cours de développement)'; |
| 38 | } |
| 39 | $PLUGIN_HOOKS['reports']['auf'] = $report_list; |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | // Get the name and the version of the plugin - Needed |
| 45 | function plugin_version_auf() { |
| 46 | return array( |
| 47 | 'name' => 'AUF', |
| 48 | 'version' => '0.2.0', |
| 49 | 'author' => 'Jean Christophe André', |
| 50 | 'license' => 'GPLv2+', |
| 51 | 'homepage' => 'http://git.auf.org/?p=auf-serveur.git;a=tree;f=glpi-plugin-auf', |
| 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 |
| 56 | function plugin_auf_check_prerequisites() { |
| 57 | if (version_compare(GLPI_VERSION,'0.84','lt') || version_compare(GLPI_VERSION,'0.85','ge')) { |
| 58 | echo 'This plugin requires GLPI >= 0.84 and GLPI < 0.85'; |
| 59 | return FALSE; |
| 60 | } |
| 61 | return TRUE; |
| 62 | } |
| 63 | |
| 64 | // Uninstall process for plugin : need to return true if succeeded ; |
| 65 | // may display messages or add to message after redirect |
| 66 | function plugin_auf_check_config() { |
| 67 | return TRUE; |
| 68 | } |
| 69 | |
| 70 | function plugin_auf_haveRight($module,$right) { |
| 71 | return TRUE; |
| 72 | } |
| 73 | ?> |