From 75964a0406e0dde220c4e28b33e9479da5b71428 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 12 Jan 2024 12:50:15 +0100 Subject: [PATCH 1/7] #12721 free licence change --- pandora_console/godmode/setup/license.php | 16 +++++++++++++++- pandora_console/include/constants.php | 6 ++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/setup/license.php b/pandora_console/godmode/setup/license.php index e3e25935f9..257b6cf9ec 100644 --- a/pandora_console/godmode/setup/license.php +++ b/pandora_console/godmode/setup/license.php @@ -68,7 +68,7 @@ if ($renew_license_result !== null) { } if ($update_settings) { - if (!is_metaconsole()) { + if (is_metaconsole() === false) { // Node. foreach ($_POST['keys'] as $key => $value) { db_process_sql_update( @@ -76,6 +76,20 @@ if ($update_settings) { [db_escape_key_identifier('value') => $value], [db_escape_key_identifier('key') => $key] ); + + if ($value === LICENSE_FREE) { + $exist = db_get_value('token', 'tconfig', 'token', 'expiry_date'); + if ($exist === false) { + $expiry_date = date('Ymd', strtotime(date('Ymd').'+ 1 month')); + db_process_sql_insert( + 'tconfig', + [ + db_escape_key_identifier('value') => base64_encode($expiry_date), + db_escape_key_identifier('token') => 'expiry_date', + ] + ); + } + } } $customer_key = $_POST['keys']['customer_key']; diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index b2ce8d88b4..055049bc37 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -877,6 +877,12 @@ define( // Pandora FMS Enterprise license. define('LICENSE_FILE', 'customer_key'); +// Pandora FMS license free. +define('LICENSE_FREE', 'PANDORA-FREE'); +// Total number of agents for free licence. +define('TOTAL_AGENTS_FREE', 50); +// Total number of modules for free licence. +define('TOTAL_MODULES_FREE', 600); // Pandora HA database list. define('PANDORA_HA_FILE', 'pandora_ha_hosts.conf'); From 5dad6bfb4bc683834cb00a5ebcc3ba92faae4ed0 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 15 Feb 2024 16:22:11 +0100 Subject: [PATCH 2/7] #12721 free licence change 2 --- pandora_console/godmode/setup/license.php | 4 ++-- pandora_console/include/constants.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/setup/license.php b/pandora_console/godmode/setup/license.php index 257b6cf9ec..3611b972ac 100644 --- a/pandora_console/godmode/setup/license.php +++ b/pandora_console/godmode/setup/license.php @@ -77,10 +77,10 @@ if ($update_settings) { [db_escape_key_identifier('key') => $key] ); - if ($value === LICENSE_FREE) { + if ($value === OTHER_LICENSE) { $exist = db_get_value('token', 'tconfig', 'token', 'expiry_date'); if ($exist === false) { - $expiry_date = date('Ymd', strtotime(date('Ymd').'+ 1 month')); + $expiry_date = date('Ymd', strtotime('+30 days')); db_process_sql_insert( 'tconfig', [ diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index de95ea8ff4..a699e72339 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -879,11 +879,11 @@ define( // Pandora FMS Enterprise license. define('LICENSE_FILE', 'customer_key'); // Pandora FMS license free. -define('LICENSE_FREE', 'PANDORA-FREE'); +define('OTHER_LICENSE', 'PANDORA-FREE'); // Total number of agents for free licence. -define('TOTAL_AGENTS_FREE', 50); +define('TOTAL_AGENTS_LICENSE', 50); // Total number of modules for free licence. -define('TOTAL_MODULES_FREE', 600); +define('TOTAL_MODULES_LICENSE', 600); // Pandora HA database list. define('PANDORA_HA_FILE', 'pandora_ha_hosts.conf'); From 5f0ed9f48c0bbed6bdb9272d3bb8a767ea01be29 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 22 Feb 2024 09:16:43 +0100 Subject: [PATCH 3/7] #12721 free licence change 3 --- pandora_console/godmode/setup/license.php | 14 ------------ pandora_console/godmode/um_client/index.php | 25 ++++++++++----------- pandora_console/include/constants.php | 6 ----- 3 files changed, 12 insertions(+), 33 deletions(-) diff --git a/pandora_console/godmode/setup/license.php b/pandora_console/godmode/setup/license.php index 3611b972ac..803291a1c8 100644 --- a/pandora_console/godmode/setup/license.php +++ b/pandora_console/godmode/setup/license.php @@ -76,20 +76,6 @@ if ($update_settings) { [db_escape_key_identifier('value') => $value], [db_escape_key_identifier('key') => $key] ); - - if ($value === OTHER_LICENSE) { - $exist = db_get_value('token', 'tconfig', 'token', 'expiry_date'); - if ($exist === false) { - $expiry_date = date('Ymd', strtotime('+30 days')); - db_process_sql_insert( - 'tconfig', - [ - db_escape_key_identifier('value') => base64_encode($expiry_date), - db_escape_key_identifier('token') => 'expiry_date', - ] - ); - } - } } $customer_key = $_POST['keys']['customer_key']; diff --git a/pandora_console/godmode/um_client/index.php b/pandora_console/godmode/um_client/index.php index 1a78e39b5f..07727cb5cf 100644 --- a/pandora_console/godmode/um_client/index.php +++ b/pandora_console/godmode/um_client/index.php @@ -113,19 +113,18 @@ if ($license_data !== ENTERPRISE_NOT_HOOK) { return; } - if (rtrim($license_data['licensed_to']) === Manager::PANDORA_TRIAL_ISSUER) { - $product_name = get_product_name(); - - ui_print_info_message( - __( - 'You cannot use update manager %s. This license is a trial license to test all %s features. Please update your license to unlock all %s features.', - $mode_str, - $product_name, - $product_name - ) - ); - return; - } + // if (rtrim($license_data['licensed_to']) === Manager::PANDORA_TRIAL_ISSUER) { + // $product_name = get_product_name(); + // ui_print_info_message( + // __( + // 'You cannot use update manager %s. This license is a trial license to test all %s features. Please update your license to unlock all %s features.', + // $mode_str, + // $product_name, + // $product_name + // ) + // ); + // return; + // } } else { $license_data = []; $license_data['count_enabled'] = db_get_value( diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index a699e72339..d68bba9c22 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -878,12 +878,6 @@ define( // Pandora FMS Enterprise license. define('LICENSE_FILE', 'customer_key'); -// Pandora FMS license free. -define('OTHER_LICENSE', 'PANDORA-FREE'); -// Total number of agents for free licence. -define('TOTAL_AGENTS_LICENSE', 50); -// Total number of modules for free licence. -define('TOTAL_MODULES_LICENSE', 600); // Pandora HA database list. define('PANDORA_HA_FILE', 'pandora_ha_hosts.conf'); From 30769852be2f47098cc753e26707ad37ba9a08e4 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 1 Mar 2024 13:04:28 +0100 Subject: [PATCH 4/7] #12721 free licence change 4 --- pandora_console/godmode/um_client/index.php | 13 ---------- .../include/javascript/jquery.pandora.js | 25 +++++++++++++++++++ pandora_console/index.php | 1 + 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/pandora_console/godmode/um_client/index.php b/pandora_console/godmode/um_client/index.php index 07727cb5cf..c33814291b 100644 --- a/pandora_console/godmode/um_client/index.php +++ b/pandora_console/godmode/um_client/index.php @@ -112,19 +112,6 @@ if ($license_data !== ENTERPRISE_NOT_HOOK) { ); return; } - - // if (rtrim($license_data['licensed_to']) === Manager::PANDORA_TRIAL_ISSUER) { - // $product_name = get_product_name(); - // ui_print_info_message( - // __( - // 'You cannot use update manager %s. This license is a trial license to test all %s features. Please update your license to unlock all %s features.', - // $mode_str, - // $product_name, - // $product_name - // ) - // ); - // return; - // } } else { $license_data = []; $license_data['count_enabled'] = db_get_value( diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index 5b39a98631..f0376c6d85 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -221,6 +221,31 @@ $(document).ready(function() { } } + if ($("#license_dialog").length) { + let height = 300; + + $("#license_dialog").dialog({ + dialogClass: "no-close", + closeOnEscape: false, + resizable: false, + draggable: true, + modal: true, + height: height, + width: 850, + overlay: { + opacity: 0.5, + background: "black" + }, + open: function() { + $("#ok_buttom").show(); + } + }); + + $("#ok_buttom").click(function() { + $("#license_dialog").dialog("close"); + }); + } + if ($("#msg_change_password").length) { $("#msg_change_password").dialog({ resizable: false, diff --git a/pandora_console/index.php b/pandora_console/index.php index 96d4ed6bb6..b328c55dda 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -662,6 +662,7 @@ if (isset($config['id_user']) === false) { db_logon($nick_in_db, $_SERVER['REMOTE_ADDR']); $_SESSION['id_usuario'] = $nick_in_db; $config['id_user'] = $nick_in_db; + $_SESSION['logged'] = true; config_prepare_expire_time_session(true); // Check if connection goes through F5 balancer. If it does, then From cc78caf6d172d1518c4d5c56163567eff819ca79 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Mon, 1 Apr 2024 11:52:59 +0200 Subject: [PATCH 5/7] 12721 Added messages --- pandora_console/godmode/um_client/index.php | 14 ++++++++++++++ .../include/javascript/jquery.pandora.js | 8 ++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/um_client/index.php b/pandora_console/godmode/um_client/index.php index c33814291b..1a78e39b5f 100644 --- a/pandora_console/godmode/um_client/index.php +++ b/pandora_console/godmode/um_client/index.php @@ -112,6 +112,20 @@ if ($license_data !== ENTERPRISE_NOT_HOOK) { ); return; } + + if (rtrim($license_data['licensed_to']) === Manager::PANDORA_TRIAL_ISSUER) { + $product_name = get_product_name(); + + ui_print_info_message( + __( + 'You cannot use update manager %s. This license is a trial license to test all %s features. Please update your license to unlock all %s features.', + $mode_str, + $product_name, + $product_name + ) + ); + return; + } } else { $license_data = []; $license_data['count_enabled'] = db_get_value( diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index f0376c6d85..7ac66aa1dc 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -221,10 +221,10 @@ $(document).ready(function() { } } - if ($("#license_dialog").length) { - let height = 300; + if ($("#license_dialog_message").length) { + let height = 350; - $("#license_dialog").dialog({ + $("#license_dialog_message").dialog({ dialogClass: "no-close", closeOnEscape: false, resizable: false, @@ -242,7 +242,7 @@ $(document).ready(function() { }); $("#ok_buttom").click(function() { - $("#license_dialog").dialog("close"); + $("#license_dialog_message").dialog("close"); }); } From 0ceee98de76f57dbe0b16fe0d00e1924fb90a3f1 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 3 Apr 2024 11:05:43 +0200 Subject: [PATCH 6/7] #12721 free licence change 5 --- pandora_console/include/javascript/jquery.pandora.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index 7ac66aa1dc..f1cffbb125 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -222,7 +222,7 @@ $(document).ready(function() { } if ($("#license_dialog_message").length) { - let height = 350; + let height = 570; $("#license_dialog_message").dialog({ dialogClass: "no-close", @@ -230,8 +230,8 @@ $(document).ready(function() { resizable: false, draggable: true, modal: true, - height: height, - width: 850, + height: "auto", + width: 800, overlay: { opacity: 0.5, background: "black" From a68905343ba9188126a6460fef284d54d57aa4c9 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 3 Apr 2024 11:11:54 +0200 Subject: [PATCH 7/7] #12721 added svg --- pandora_console/images/free_license.svg | 85 +++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 pandora_console/images/free_license.svg diff --git a/pandora_console/images/free_license.svg b/pandora_console/images/free_license.svg new file mode 100644 index 0000000000..a6a7ab5bb3 --- /dev/null +++ b/pandora_console/images/free_license.svg @@ -0,0 +1,85 @@ + + + 771F63E3-1B6F-4CAC-94BD-C4F0EC2141AA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file