Skip to content

Commit

Permalink
Update setup
Browse files Browse the repository at this point in the history
  • Loading branch information
charleneauger committed May 5, 2023
1 parent 11de4d5 commit 556cbb5
Showing 1 changed file with 48 additions and 31 deletions.
79 changes: 48 additions & 31 deletions setup.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
<?php
/**
* @package gdprcompliance
* @author Rudy Laurent
* @copyright Copyright (c) 2015-2019 FactorFX
* @license AGPL License 3.0 or (at your option) any later version
* http://www.gnu.org/licenses/agpl-3.0-standalone.html
* @link https://www.factorfx.com
* @since 2019
* ---------------------------------------------------------------------
* ITSM-NG
* Copyright (C) 2022 ITSM-NG and contributors.
*
* --------------------------------------------------------------------------
* https://www.itsm-ng.org
*
* based on GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2003-2014 by the INDEPNET Development Team.
*
* ---------------------------------------------------------------------
*
* LICENSE
*
* This file is part of ITSM-NG.
*
* ITSM-NG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* ITSM-NG is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ITSM-NG. If not, see <http://www.gnu.org/licenses/>.
* ---------------------------------------------------------------------
*/

/**
* Init hooks of the plugin.
* REQUIRED
* plugin_init_gdprcompliance
*
* @return void
*/
function plugin_init_gdprcompliance() {
global $PLUGIN_HOOKS,$CFG_GLPI;
global $PLUGIN_HOOKS;

$PLUGIN_HOOKS['change_profile']['gdprcompliance'] = array(PluginGdprcomplianceProfile::class,'initProfile');

Plugin::registerClass('PluginGdprcompliance', array('addtabon' => array('Tools')));
Plugin::registerClass(PluginGdprcomplianceConfig::class, ['addtabon' => 'Config']);
Plugin::registerClass(PluginGdprcomplianceAction::class, ['addtabon' => 'Entity']);
Expand All @@ -31,44 +50,42 @@ function plugin_init_gdprcompliance() {
$PLUGIN_HOOKS['menu_toadd']['gdprcompliance'] = ['tools' => 'PluginGdprcomplianceConfig'];

$PLUGIN_HOOKS['csrf_compliant']['gdprcompliance'] = true;


}


/**
* Get the name and the version of the plugin
* REQUIRED
* plugin_version_gdprcompliance
*
* @return array
* @return void
*/
function plugin_version_gdprcompliance() {
return [
'name' => 'Plugin Gdprcompliance',
'name' => __('GDPR Compliance', 'gdprcompliance'),
'version' => '1.0',
'author' => 'Rudy Laurent',
'author' => 'Rudy Laurent, Charlène Auger',
'license' => 'AGPLv3+',
'minGlpiVersion' => '9.4'
'minGlpiVersion' => '9.5'
];
}

/**
* @return bool
* plugin_gdprcompliance_check_prerequisites
*
* @return void
*/
function plugin_gdprcompliance_check_prerequisites() {

if (version_compare(GLPI_VERSION,'9.4','lt') || version_compare(GLPI_VERSION,'9.6','ge')) {
echo "This plugin requires GLPI >= 9.4";
return false;
}
return true;
if (version_compare(GLPI_VERSION,'9.5','lt') || version_compare(GLPI_VERSION,'9.6','ge')) {
echo "This plugin requires GLPI >= 9.5";
return false;
}
return true;
}


/**
* @param bool $verbose
* @return bool
* plugin_gdprcompliance_check_config
*
* @param mixed $verbose
* @return void
*/
function plugin_gdprcompliance_check_config($verbose=false) {
return true;
return true;
}

0 comments on commit 556cbb5

Please sign in to comment.