From cfde0cd8bbea076887c6b9a34320dc05aaa5823a Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 16 May 2024 17:44:51 +0200 Subject: [PATCH] #13312 fixed limit and about message 2 --- .../include/class/ConsoleSupervisor.php | 15 +++++++++++++++ pandora_console/include/functions_menu.php | 14 ++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index b2d9acea41..2c154842fd 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -1082,6 +1082,21 @@ class ConsoleSupervisor global $config; if (license_enterprise_free() === true) { + if (isset($config['limit_exceeded']) === true && (int) $config['limit_exceeded'] === 1) { + update_config_token('limit_exceeded', 0); + + $message = __('When the limit is exceeded the system automatically deactivates the latest agents and modules exceeding license.'); + + $this->notify( + [ + 'type' => 'NOTIF.LICENSE.LIMITED', + 'title' => __('You have exceeded the limit of the free version'), + 'message' => $message, + 'url' => '__url__/index.php?sec=gagente&sec2=godmode/agentes/modificar_agente', + ] + ); + } + return true; } diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 967dda5a44..2a0b88314d 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -909,6 +909,11 @@ if (is_ajax()) { $license_expired = true; } + $text = (enterprise_installed()) ? 'Enterprise' : 'Community'; + if ($license === 'PANDORA-ENTERPRISE-FREE') { + $text = 'FREE'; + } + include_once $config['homedir'].'/include/class/Diagnostics.class.php'; $d = new Diagnostics; $db_health = json_decode($d->getDatabaseHealthStatus()); @@ -971,7 +976,7 @@ if (is_ajax()) {

'.$product_name.'

-

'.__('Version').' '.$pandora_version.$lts_name.' - '.(enterprise_installed() ? 'Enterprise' : 'Community').'

+

'.__('Version').' '.$pandora_version.$lts_name.' - '.$text.'

'.__('Current package').' '.$config['current_package'].'

'.__('MR version').' MR'.$config['MR'].'

Build'.$build_version.'

'; @@ -1292,6 +1297,11 @@ if (is_ajax()) { $license_expired = true; } + $text = (enterprise_installed()) ? 'Enterprise' : 'Community'; + if ($license === 'PANDORA-ENTERPRISE-FREE') { + $text = 'FREE'; + } + $lts_name = ''; if (empty($config['lts_name']) === false) { $lts_name = ' '.$config['lts_name'].''; @@ -1317,7 +1327,7 @@ if (is_ajax()) {

'.$product_name.'

-

'.__('Version').' '.$pandora_version.$lts_name.' - '.(enterprise_installed() ? 'Enterprise' : 'Community').'

+

'.__('Version').' '.$pandora_version.$lts_name.' - '.$text.'

'.__('MR version').' MR'.$config['MR'].'

Build'.$build_version.'

'; if (enterprise_installed() === true && $license !== 'PANDORA-ENTERPRISE-FREE') {