#12721 free licence change

This commit is contained in:
Daniel Maya 2024-01-12 12:50:15 +01:00
parent 3a509b9415
commit 75964a0406
2 changed files with 21 additions and 1 deletions

View File

@ -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'];

View File

@ -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');