' . html_print_image ("images/zoom.png", true, array ("title" =>__('View'))) . ''; if($tab == 'view') $viewtab['active'] = true; else $viewtab['active'] = false; $onheader = array('view' => $viewtab); // Header ui_print_page_header (__('Agent configuration')." » ".__('Agents defined in Pandora'), "", false, "", true, $onheader); // Perform actions $agent_to_delete = (int)get_parameter('borrar_agente'); $enable_agent = (int)get_parameter('enable_agent'); $disable_agent = (int)get_parameter('disable_agent'); $result = null; if ($agent_to_delete) { $id_agente = $agent_to_delete; $agent_name = agents_get_name ($id_agente); $id_grupo = agents_get_agent_group($id_agente); if (check_acl ($config["id_user"], $id_grupo, "AW")) { $id_agentes[0] = $id_agente; $result = agents_delete_agent($id_agentes); } else { // NO permissions. db_pandora_audit("ACL Violation", "Trying to delete agent \'$agent_name\'"); require ("general/noaccess.php"); exit; } ui_print_result_message($result, __('Success deleted agent.'), __('Could not be deleted.')); // Check if the remote config file still exist if (isset ($config["remote_config"])) { $agent_md5 = md5 (agents_get_name($id_agente, ""), FALSE); if (file_exists ($config["remote_config"]."/md5/".$agent_md5.".md5") || file_exists ($config["remote_config"]."/conf/".$agent_md5.".conf")) { ui_print_error_message(__('Maybe the files conf or md5 could not be deleted')); } } } if($enable_agent) { $result = db_process_sql_update('tagente', array('disabled' => 0), array('id_agente' => $enable_agent)); if ($result) { db_pandora_audit("Agent management", 'Enable ' . $enable_agent); } else { db_pandora_audit("Agent management", 'Fail to enable ' . $enable_agent); } ui_print_result_message ($result, __('Successfully enabled'), __('Could not be enabled')); } if($disable_agent) { $result = db_process_sql_update('tagente', array('disabled' => 1), array('id_agente' => $disable_agent)); if ($result) { db_pandora_audit("Agent management", 'Disable ' . $disable_agent); } else { db_pandora_audit("Agent management", 'Fail to disable ' . $disable_agent); } ui_print_result_message ($result, __('Successfully disabled'), __('Could not be disabled')); } // Show group selector if (isset($_POST["ag_group"])) { $ag_group = get_parameter_post ("ag_group"); echo "