From b362974d1ecffbee7fc0876e40a962a1479d6ffc Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 17 Jan 2014 12:04:09 +0000 Subject: [PATCH] 2014-01-17 Miguel de Dios * godmode/agentes/agent_manager.php: fixed the PHP warnings and notices. Fixes: #2414 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9336 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++ .../godmode/agentes/agent_manager.php | 46 ++++++++++++------- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e7cd2050ff..7bc785b727 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2014-01-17 Miguel de Dios + + * godmode/agentes/agent_manager.php: fixed the PHP warnings and + notices. + + Fixes: #2414 + 2014-01-17 Juan Manuel Ramon Vigo * godmode/events/event_edit_filter.php diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 19cebfbfaa..536c44aef4 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -168,14 +168,21 @@ if ($id_agente) { // Remote configuration available if (!$new_agent) { - if (file_exists ($filename['md5'])) { - $agent_name = agents_get_name($id_agente); - $agent_name = io_safe_output($agent_name); - $agent_md5 = md5 ($agent_name, false); - - $table->data[0][1] .= '  '; - $table->data[0][1] .= html_print_image ("images/application_edit.png", true, array ("border" => 0, "title" => __('This agent can be remotely configured'))); - $table->data[0][1] .= ''.ui_print_help_tip (__('You can remotely edit this agent configuration'), true); + if (isset($filename)) { + if (file_exists ($filename['md5'])) { + $agent_name = agents_get_name($id_agente); + $agent_name = io_safe_output($agent_name); + $agent_md5 = md5 ($agent_name, false); + + $table->data[0][1] .= '  '; + $table->data[0][1] .= html_print_image( + "images/application_edit.png", + true, + array ("border" => 0, "title" => __('This agent can be remotely configured'))); + $table->data[0][1] .= '' . + ui_print_help_tip ( + __('You can remotely edit this agent configuration'), true); + } } } @@ -274,16 +281,21 @@ $table->data[2][1] .= __('Active') . ' ' . $table->data[3][0] = __('Remote configuration'); if (!$new_agent) { - if (file_exists ($filename['md5'])) { - $table->data[3][1] = date ("F d Y H:i:s", fileatime ($filename['md5'])); - // Delete remote configuration - $table->data[3][1] .= ''; - $table->data[3][1] .= html_print_image ("images/cross.png", true, array ('title' => __('Delete remote configuration file'), 'style' => 'vertical-align: middle;')).''; - $table->data[3][1] .= '' . - ui_print_help_tip (__('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), true); + $table->data[3][1] = '' . __('Not available') . ''; + if (isset($filename)) { + if (file_exists ($filename['md5'])) { + $table->data[3][1] = date ("F d Y H:i:s", fileatime ($filename['md5'])); + // Delete remote configuration + $table->data[3][1] .= ''; + $table->data[3][1] .= html_print_image( + "images/cross.png", true, + array ('title' => __('Delete remote configuration file'), 'style' => 'vertical-align: middle;')).''; + $table->data[3][1] .= '' . + ui_print_help_tip( + __('Delete this conf file implies that for restore you must reactive remote config in the local agent.'), + true); + } } - else - $table->data[3][1] = '' . __('Not available') . ''; } else $table->data[3][1] = '' . __('Not available') . '';