Merge branch 'ent-8541-cambio-funcionamiento-licencia-satelite' into 'develop'

Ent 8541 cambio funcionamiento licencia satelite

See merge request artica/pandorafms!4792
This commit is contained in:
Daniel Rodriguez 2022-04-05 13:44:12 +00:00
commit fa62f8facc
3 changed files with 34 additions and 0 deletions

View File

@ -74,6 +74,12 @@ if ($update_settings) {
);
}
// Update the license file.
$result = file_put_contents($config['remote_config'].'/'.LICENSE_FILE, $_POST['keys']['customer_key']);
if ($result === false) {
ui_print_error_message(__('Failed to Update license file'));
}
ui_print_success_message(__('License updated'));
}
}

View File

@ -857,3 +857,6 @@ define(
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
]
);
// Pandora FMS Enterprise license.
define('LICENSE_FILE', 'customer_key');

View File

@ -14904,6 +14904,31 @@ function api_set_metaconsole_synch($keys)
}
function api_set_metaconsole_license_file($key)
{
global $config;
if (defined('METACONSOLE')) {
return;
}
if (empty($key) === true) {
returnError('Key cannot be empty.');
return;
}
// Update the license file.
$result = file_put_contents($config['remote_config'].'/'.LICENSE_FILE, $key);
if ($result === false) {
returnError('update-license', 'Failed to Update license file.');
} else {
returnData('string', ['type' => 'string', 'data' => true]);
}
return;
}
function api_set_new_cluster($thrash1, $thrash2, $other, $thrash3)
{
global $config;