2009-11-30 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_alerts.php: fix deletion of compound alerts in the
	function "delete_alert_agent_module".
	Fixes: 2902618
	* godmode/agentes/configurar_agente.php: use the "delete_alert_agent_module"
	instead the sql method.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2145 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2009-11-30 12:55:15 +00:00
parent 4533b0357f
commit 958aea710b
3 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2009-11-30 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_alerts.php: fix deletion of compound alerts in the
function "delete_alert_agent_module".
Fixes: 2902618
* godmode/agentes/configurar_agente.php: use the "delete_alert_agent_module"
instead the sql method.
2009-11-30 Miguel de Dios <miguel.dedios@artica.es>
* godmode/agentes/configurar_agente.php: delete the simple alerts

View File

@ -34,6 +34,7 @@ if (! give_acl ($config["id_user"], $group, "AW")) {
}
require_once ('include/functions_modules.php');
require_once ('include/functions_alerts.php');
// Get passed variables
$tab = get_parameter ('tab', 'main');
@ -593,7 +594,7 @@ if (isset ($_GET["delete_module"])){ // DELETE agent module !
if (process_sql ("DELETE FROM tagente_datos_inc WHERE id_agente_modulo = ".$id_borrar_modulo) === false)
$error++;
if (process_sql ("DELETE FROM talert_template_modules WHERE id_agent_module = ".$id_borrar_modulo) === false)
if (delete_alert_agent_module($id_borrar_modulo) === false)
$error++;

View File

@ -410,6 +410,15 @@ function delete_alert_agent_module ($id_alert_agent_module, $filter = false) {
if ($id_alert_agent_module)
$filter['id'] = $id_alert_agent_module;
$idAlertCompunds = get_db_all_rows_sql('SELECT id_alert_compound
FROM talert_compound_elements
WHERE id_alert_template_module = ' . $id_alert_agent_module);
if ($idAlertCompunds !== false) {
foreach($idAlertCompunds as $id)
delete_alert_compound($id);
}
return (@process_sql_delete ('talert_template_modules',
$filter)) !== false;
}