Solve issue and added correct headers

This commit is contained in:
Jose Gonzalez 2021-01-14 19:08:01 +01:00
parent 0ec39bd135
commit 579b8d4965
4 changed files with 101 additions and 37 deletions

View File

@ -2125,6 +2125,8 @@ function get_group_alerts(
$disabled = $filter;
}
$filter .= ' AND talert_template_modules.disabled = 0 ';
switch ($disabled) {
case 'notfired':
$filter .= ' AND times_fired = 0 AND talert_template_modules.disabled = 0';
@ -2181,7 +2183,7 @@ function get_group_alerts(
if (empty($id_group)) {
$subQuery = 'SELECT id_agente_modulo
FROM tagente_modulo
WHERE 1 = 0';
WHERE 1 = 0';
} else {
$subQuery = 'SELECT id_agente_modulo
FROM tagente_modulo
@ -2190,7 +2192,8 @@ function get_group_alerts(
FROM tagente ta
LEFT JOIN tagent_secondary_group tasg
ON ta.id_agente = tasg.id_agent
WHERE
WHERE ta.disable = 0
AND
id_grupo IN ('.implode(',', $id_group).')
OR id_group IN ('.implode(',', $id_group).'))';
}
@ -2199,7 +2202,7 @@ function get_group_alerts(
FROM tagente_modulo
WHERE delete_pending = 0
AND id_agente IN (SELECT id_agente
FROM tagente WHERE id_grupo = '.$idGroup.')';
FROM tagente WHERE id_grupo = '.$idGroup.' AND tagente.disabled = 0)';
}
} else {
// ALL GROUP

View File

@ -1,16 +1,46 @@
<?php
/**
* Tactical view functions script
*
* @category Functions
* @package Pandora FMS
* @subpackage Tactical View
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Begin.
/**
* Undocumented function
*
* @param boolean $id_user
* @param boolean $user_strict
* @param [type] $acltags
* @param boolean $returnAllGroup
* @param string $mode
* @param array $agent_filter
* @param array $module_filter
* @return void
*/
function tactical_get_data($id_user=false, $user_strict=false, $acltags, $returnAllGroup=false, $mode='group', $agent_filter=[], $module_filter=[])
{
global $config;
@ -368,7 +398,7 @@ function tactical_get_data($id_user=false, $user_strict=false, $acltags, $return
break;
case AGENT_MODULE_STATUS_NORMAL_ALERT:
// Do nothing.
break;
case AGENT_MODULE_STATUS_NORMAL:

View File

@ -1,16 +1,32 @@
<?php
/**
* Alerts Status functions script
*
* @category Functions
* @package Pandora FMS
* @subpackage Alert Status
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Begin.
function forceExecution($id_group)
{
global $config;

View File

@ -1,16 +1,31 @@
<?php
/**
* Alerts Status
*
* @category Alerts
* @package Pandora FMS
* @subpackage Alert Status View
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
// Login check