From 32da1d287bbbdbb59dbb2aeb7e1faa087e828369 Mon Sep 17 00:00:00 2001 From: Tatiana Llorente Date: Mon, 28 Oct 2019 15:19:39 +0100 Subject: [PATCH] Fixed API function set_module_data --- pandora_console/include/functions_api.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 5aa1020214..2b124f5435 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -9080,7 +9080,9 @@ function api_set_delete_module($id, $id2, $other, $trash1) function api_set_module_data($id, $thrash2, $other, $trash1) { - if (defined('METACONSOLE')) { + global $config; + + if (is_metaconsole()) { return; } @@ -9129,8 +9131,9 @@ function api_set_module_data($id, $thrash2, $other, $trash1) ); if (false === @file_put_contents($config['remote_config'].'/'.io_safe_output($agent['nombre']).'.'.$time.'.data', $xml)) { - returnError('error_file', 'Can save agent data xml.'); + returnError('error_file', 'XML file could not be generated in path: '.$config['remote_config']); } else { + echo __('XML file was generated successfully in path: ').$config['remote_config']; returnData('string', ['type' => 'string', 'data' => $xml]); return; }