#8541 Added file customer_key

This commit is contained in:
Daniel Maya 2022-03-31 16:52:50 +02:00
parent a94f729237
commit 55e847a5c9
2 changed files with 30 additions and 2 deletions

View File

@ -75,7 +75,10 @@ if ($update_settings) {
}
// Update the license file.
file_put_contents($config["remote_config"] . '/' . LICENSE_FILE, $_POST['keys']['customer_key']);
$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

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