From 80b92c76eee578eff98530c164cfb791a68f2ef0 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 16 Jan 2014 17:26:27 +0000 Subject: [PATCH] 2014-01-16 Miguel de Dios * godmode/agentes/modificar_agente.php, include/functions_agents.php: fixed the PHP warnings and notices. Fixes: #2412 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9330 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/godmode/agentes/modificar_agente.php | 2 +- pandora_console/include/functions_agents.php | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index cd71a1d00f..af79ddac18 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2014-01-16 Miguel de Dios + + * godmode/agentes/modificar_agente.php, + include/functions_agents.php: fixed the PHP warnings and notices. + + Fixes: #2412 + 2014-01-16 Miguel de Dios * general/header.php: fixed the PHP notices about the var diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 5b95ab5201..5f577ad503 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -89,7 +89,7 @@ if ($agent_to_delete) { // Check if the remote config file still exist if (isset ($config["remote_config"])) { enterprise_include_once('include/functions_config_agents.php'); - if (enterprise_hook('config_agents_has_remote_configuration', $id_agente)) { + if (enterprise_hook('config_agents_has_remote_configuration', array($id_agente))) { ui_print_error_message(__('Maybe the files conf or md5 could not be deleted')); } } diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index be993de515..ceeb7935c7 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1644,6 +1644,9 @@ function agents_delete_agent ($id_agents, $disableACL = false) { $nodes = db_get_all_rows_filter( "tnetworkmap_enterprise_nodes", array("id_agent" => $id_agent)); + if (empty($nodes)) { + $nodes = array(); + } foreach ($nodes as $node) { db_process_delete_temp ("tnetworkmap_enterprise_relation_nodes", @@ -1696,12 +1699,12 @@ function agents_delete_agent ($id_agents, $disableACL = false) { $agent_md5 = md5 ($agent_name, false); // Agent remote configuration editor - $file_name = $config["remote_config"]."/conf/".$agent_md5.".conf"; + $file_name = $config["remote_config"] . "/conf/" . $agent_md5 . ".conf"; $error = !@unlink ($file_name); if (!$error) { - $file_name = $config["remote_config"]."/md5/".$agent_md5.".md5"; + $file_name = $config["remote_config"] . "/md5/" . $agent_md5 . ".md5"; $error = !@unlink ($file_name); }