Fixed problems of header response of ajax. Tiquet: #2630

(cherry picked from commit cda76e17c1)
This commit is contained in:
m-lopez-f 2015-09-09 15:01:12 +02:00
parent d9764c0f6a
commit 7f3d1e54f5
2 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,9 @@ enterprise_include_once ('include/functions_metaconsole.php');
$search_agents = (bool) get_parameter ('search_agents');
$get_agents_group = (bool) get_parameter('get_agents_group', false);
$force_local = (bool) get_parameter('force_local', false);
if ( https_is_running() ) {
header('Content-type: application/json');
}
if ($get_agents_group) {
$id_group = (int)get_parameter('id_group', -1);
@ -303,4 +306,4 @@ elseif ($search_agents && ($config['metaconsole'] == 1) && defined('METACONSOLE'
echo json_encode($data);
return;
}
?>
?>

View File

@ -32,6 +32,9 @@ $change_module_relation_updates = (bool) get_parameter('change_module_relation_u
$get_id_tag = (bool) get_parameter('get_id_tag', 0);
if ($get_plugin_macros) {
if ( https_is_running() ) {
header('Content-type: application/json');
}
$id_plugin = get_parameter('id_plugin', 0);
$plugin_macros = db_get_value('macros', 'tplugin', 'id',
@ -47,6 +50,9 @@ if ($get_plugin_macros) {
if ($search_modules) {
if ( https_is_running() ) {
header('Content-type: application/json');
}
$id_agents = json_decode(io_safe_output(get_parameter('id_agents')));
$filter = '%' . get_parameter('q', '') . '%';
$other_filter = json_decode(io_safe_output(get_parameter('other_filter')), true);