From 237794752e8028596fbd9a6e5fa42b71029420d0 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 25 Sep 2009 16:21:20 +0000 Subject: [PATCH] 2009-09-18 Miguel de Dios * godmode/agentes/configurar_agente.php: add the feature to delete remote conf file in the agent configuration. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1979 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++++ .../godmode/agentes/configurar_agente.php | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 33d6fd7422..8d3a72b2e4 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2009-09-18 Miguel de Dios + + * godmode/agentes/configurar_agente.php: add the feature to delete remote + conf file in the agent configuration. + 2009-09-18 Miguel de Dios * include/functions_db.php: fix the delete the conf and md5 files of agent diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 2cd3b70342..cd2ef517d8 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -230,6 +230,30 @@ if ($id_agente) { echo '
 
'; } +$delete_conf_file = (bool) get_parameter('delete_conf_file'); + +if ($delete_conf_file) { + $correct = false; + // Delete remote configuration + if (isset ($config["remote_config"])) { + $agent_md5 = md5 (get_agent_name ($id_agente,'none'), FALSE); + + if (file_exists ($config["remote_config"]."/md5/".$agent_md5.".md5")) { + // Agent remote configuration editor + $file_name = $config["remote_config"]."/conf/".$agent_md5.".conf"; + $correct = @unlink ($file_name); + + $file_name = $config["remote_config"]."/md5/".$agent_md5.".md5"; + $correct = @unlink ($file_name); + } + } + + print_result_message ($correct, + __('Successfully delete conf file'), + __('Could not be delete conf file')); +} + + // Show agent creation results if ($create_agent) { print_result_message ($agent_created_ok,