From d8fdb22c891252eb5c2364a7deb45d4db0cc9779 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 2 Feb 2024 10:47:36 +0100 Subject: [PATCH 1/3] #12810 change value status license in diagnostics --- .../include/class/Diagnostics.class.php | 25 ++++++++++++++++++- .../include/functions_update_manager.php | 19 -------------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index 9d4a3b2901..1b76652a6c 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -483,7 +483,7 @@ class Diagnostics extends Wizard ], 'isEnterprise' => [ 'name' => __('Enterprise installed'), - 'value' => (enterprise_installed()) ? __('true') : __('false'), + 'value' => $this->getStatusLicense(), ], 'customerKey' => [ 'name' => __('Update Key'), @@ -505,6 +505,29 @@ class Diagnostics extends Wizard } + /** + * Return status of license. + * + * @return string + */ + private function getStatusLicense():string + { + global $config; + + if (enterprise_installed() === true) { + if (isset($config['license_mode']) + && (int) $config['license_mode'] === 0 + ) { + return __('FREE/TRIAL'); + } else { + return __('LICENCED'); + } + } else { + return __('OpenSource'); + } + } + + /** * PHP Status. * diff --git a/pandora_console/include/functions_update_manager.php b/pandora_console/include/functions_update_manager.php index f78b94d188..5c41828e11 100755 --- a/pandora_console/include/functions_update_manager.php +++ b/pandora_console/include/functions_update_manager.php @@ -98,25 +98,6 @@ function update_manager_get_current_package() } -/** - * Check if a trial license is in use. - * - * @return boolean true if a trial license is in use, false otherwise. - */ -function update_manager_verify_trial() -{ - global $config; - - if (isset($config['license_licensed_to']) - && strstr($config['license_licensed_to'], 'info@pandorafms.com') !== false - ) { - return true; - } - - return false; -} - - /** * Checks if there are packages available to be installed. * From 3e40558443045db8652c589a427c9eccb9f6c62c Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 2 Feb 2024 10:55:57 +0100 Subject: [PATCH 2/3] #12810 fixed license_mode status --- pandora_console/include/class/Diagnostics.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index 1b76652a6c..17ded9a8eb 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -516,7 +516,7 @@ class Diagnostics extends Wizard if (enterprise_installed() === true) { if (isset($config['license_mode']) - && (int) $config['license_mode'] === 0 + && (int) $config['license_mode'] === 1 ) { return __('FREE/TRIAL'); } else { From c6cb0c8747c3bf9956c23575500b450b382c50ce Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Fri, 2 Feb 2024 12:14:49 +0100 Subject: [PATCH 3/3] #12810 changed text licensed in info status --- pandora_console/include/class/Diagnostics.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/class/Diagnostics.class.php b/pandora_console/include/class/Diagnostics.class.php index 17ded9a8eb..b097bbba48 100644 --- a/pandora_console/include/class/Diagnostics.class.php +++ b/pandora_console/include/class/Diagnostics.class.php @@ -520,7 +520,7 @@ class Diagnostics extends Wizard ) { return __('FREE/TRIAL'); } else { - return __('LICENCED'); + return __('LICENSED'); } } else { return __('OpenSource');