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,