setup.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. /*
  3. * @version $Id: setup.php 234 2019-12-12 14:34:31Z yllen $
  4. -------------------------------------------------------------------------
  5. LICENSE
  6. This file is part of Archires plugin for GLPI.
  7. Archires is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU Affero General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11. Archires is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU Affero General Public License for more details.
  15. You should have received a copy of the GNU Affero General Public License
  16. along with Archires. If not, see <http://www.gnu.org/licenses/>.
  17. @package archires
  18. @author Nelly Mahu-Lasson, Xavier Caillaud
  19. @copyright Copyright (c) 2016-2021 Archires plugin team
  20. @license AGPL License 3.0 or (at your option) any later version
  21. http://www.gnu.org/licenses/agpl-3.0-standalone.html
  22. @link https://forge.glpi-project.org/projects/archires
  23. @since version 2.2
  24. --------------------------------------------------------------------------
  25. */
  26. // Init the hooks of the plugins -Needed
  27. function plugin_init_archires() {
  28. global $PLUGIN_HOOKS,$CFG_GLPI;
  29. $PLUGIN_HOOKS['csrf_compliant']['archires'] = true;
  30. Plugin::registerClass('PluginArchiresProfile', ['addtabon' => ['Profile']]);
  31. $PLUGIN_HOOKS['pre_item_purge']['archires'] = ['Profile' => ['PluginArchiresProfile',
  32. 'purgeProfiles']];
  33. if (Session::getLoginUserID()) {
  34. if (Session::haveRight("plugin_archires", READ)) {
  35. $PLUGIN_HOOKS["menu_toadd"]['archires'] = ['tools' => 'PluginArchiresMenu'];
  36. }
  37. if (Session::haveRight("plugin_archires", CREATE)) {
  38. $PLUGIN_HOOKS['use_massive_action']['archires'] = 1;
  39. }
  40. // Config page
  41. if (Session::haveRight("plugin_archires", UPDATE)
  42. || Session::haveRight("config", UPDATE)) {
  43. $PLUGIN_HOOKS['config_page']['archires'] = 'front/config.form.php';
  44. }
  45. }
  46. }
  47. // Get the name and the version of the plugin - Needed
  48. function plugin_version_archires() {
  49. return ['name' => _n('Network Architecture', 'Network Architectures', 2, 'archires'),
  50. 'version' => '2.8.0',
  51. 'author' => 'Xavier Caillaud, Nelly Mahu-Lasson',
  52. 'license' => 'AGPLv3+',
  53. 'homepage' => ' https://forge.glpi-project.org/projects/archires',
  54. 'minGlpiVersion' => '9.4',
  55. 'requirements' => ['glpi' => ['min' => '9.5',
  56. 'max' => '9.6']]];
  57. }
  58. // Uninstall process for plugin : need to return true if succeeded : may display messages or add to message after redirect
  59. function plugin_archires_check_config() {
  60. return true;
  61. }