diff --git a/setup.php b/setup.php index f1b614b..e27ec01 100644 --- a/setup.php +++ b/setup.php @@ -1,6 +1,6 @@ isInstalled('butterfly') && $plugin->isActivated('butterfly')) { @@ -102,8 +131,16 @@ function plugin_butterfly_check_prerequisites() } } -function plugin_butterfly_check_config() +function plugin_butterfly_check_config($verbose = false) { + plugin_butterfly_load_license(); + + if (!class_exists('\GlpiPlugin\Mindplace\License') || !\GlpiPlugin\Mindplace\License::isValid()) { + if ($verbose && !isCommandLine()) { + echo "
Licença Mindtek inativa ou Mind Place ausente. O plugin foi desativado por segurança.
"; + } + return false; + } return true; } diff --git a/src/Config.php b/src/Config.php index e213032..ad68821 100644 --- a/src/Config.php +++ b/src/Config.php @@ -25,7 +25,7 @@ class Config extends \CommonDBTM { function getTabNameForItem(\CommonGLPI $item, $withtemplate = 0) { switch (get_class($item)) { case 'Config': - return [1 => t_butterfly('Butterfly')]; + return [1 => self::createTabEntry(t_butterfly('Butterfly'), 0, null, 'ti ti-butterfly')]; default: return ''; }