From 7e8b2333e9d0dd9d44bfdec31b9c3fad89004038 Mon Sep 17 00:00:00 2001 From: alexhigh Date: Tue, 6 May 2014 17:28:34 +0000 Subject: [PATCH] 2014-05-06 Alejandro Gallardo * godmode/alerts/alert_list.list.php: Now the form and sort values are keeped. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9873 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++++ .../extensions/files_repo/files_repo_list.php | 1 + .../godmode/alerts/alert_list.list.php | 30 +++++++++++++------ pandora_console/include/functions_netflow.php | 1 + 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index bb9d66bb18..a2dea49f32 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2014-05-06 Alejandro Gallardo + + * godmode/alerts/alert_list.list.php: Now the form and + sort values are keeped. + 2014-05-06 Junichi Satoh * extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql: Added missing '`'. diff --git a/pandora_console/extensions/files_repo/files_repo_list.php b/pandora_console/extensions/files_repo/files_repo_list.php index c9a1601be8..2377566891 100644 --- a/pandora_console/extensions/files_repo/files_repo_list.php +++ b/pandora_console/extensions/files_repo/files_repo_list.php @@ -70,6 +70,7 @@ if (!empty($files)) { $data[3] = date('F j, Y - H:m', $file['mtime']); // Last modification // Public URL + $data[4] = ""; if (!empty($file['hash'])) { $public_url = ui_get_full_url(EXTENSIONS_DIR . "/files_repo/files_repo_get_file.php?file=" . $file['hash']); $message = __('Copy to clipboard') . ": Ctrl+C -> Enter"; diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 386b5bbab2..6e289bc031 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -40,8 +40,15 @@ else { $sec = 'galertas'; } +if ($id_agente) { + $sec2 = 'godmode/agentes/configurar_agente&tab=alert&id_agente=' . $id_agente; +} +else { + $sec2 = 'godmode/alerts/alert_list'; +} + // Table for filter controls -$form_filter = '
'; +$form_filter = ''; $form_filter .= "\n"; $form_filter .= ''."\n"; $form_filter .= "\n"; @@ -295,11 +302,14 @@ switch ($sortField) { break; } +$form_params = '&template_name=' . $templateName . '&agent_name=' . $agentName . '&module_name=' . $moduleName . '&action_id=' . $actionID . '&field_content=' . $fieldContent. '&priority=' . $priority . '&enabledisable=' . $enabledisable . '&standby=' . $standby; +$sort_params = '&sort_field=' . $sortField . '&sort=' . $sort; + if ($id_agente) { - ui_pagination ($total, 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=' . $id_agente); + ui_pagination ($total, 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=' . $id_agente . $form_params . $sort_params); } else { - ui_pagination ($total, 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&search=1' . '&template_name=' . $templateName . '&agent_name=' . $agentName . '&module_name=' . $moduleName . '&action_id=' . $actionID . '&field_content=' . $fieldContent. '&priority=' . $priority . '&enabledisable=' . $enabledisable . '&standby=' . $standby); + ui_pagination ($total, 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list' . $form_params . $sort_params); } $simple_alerts = agents_get_alerts_simple (array_keys ($agents), false, array ('offset' => (int) get_parameter ('offset'), @@ -308,10 +318,10 @@ $simple_alerts = agents_get_alerts_simple (array_keys ($agents), false, $offset = get_parameter('offset'); if (!$id_agente) { - $url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'&offset=' . $offset; + $url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'&offset=' . $offset . $form_params; } else { - $url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente=' . $id_agente; + $url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente=' . $id_agente . '&offset=' . $offset . $form_params; } $table->class = 'alert_list databox'; @@ -370,6 +380,8 @@ $table->valign[4] = 'middle'; $table->data = array (); +$url .= $sort_params; + $rowPair = true; $iterator = 0; @@ -492,7 +504,7 @@ foreach ($simple_alerts as $alert) { // Is possible manage actions if have LW permissions in the agent group of the alert module if (check_acl ($config['id_user'], $agent_group, "LW")) { $data[2] .= "
"; - $data[2] .= ''; + $data[2] .= ''; $data[2] .= html_print_input_image ('delete', 'images/cross.png', 1, 'padding:0px;', true, array('title' => __('Delete'))); @@ -588,7 +600,7 @@ foreach ($simple_alerts as $alert) { $data[3] = ui_print_status_image($status, $title, true); - $data[4] = ''; + $data[4] = ''; if ($alert['disabled']) { $data[4] .= html_print_input_image ('enable', 'images/lightbulb_off.png', 1, 'padding:0px', true); $data[4] .= html_print_input_hidden ('enable_alert', 1, true); @@ -602,7 +614,7 @@ foreach ($simple_alerts as $alert) { // To manage alert is necessary LW permissions in the agent group if(check_acl ($config['id_user'], $agent_group, "LW")) { - $data[4] .= '  '; + $data[4] .= '  '; if (!$alert['standby']) { $data[4] .= html_print_input_image ('standby_off', 'images/bell.png', 1, 'padding:0px;', true); $data[4] .= html_print_input_hidden ('standbyon_alert', 1, true); @@ -633,7 +645,7 @@ foreach ($simple_alerts as $alert) { // To manage alert is necessary LW permissions in the agent group if(check_acl ($config['id_user'], $agent_group, "LW")) { - $data[4] .= '  '; + $data[4] .= '  '; if ($alert['disabled']) { $data[4] .= html_print_image('images/add.disabled.png', true, array('title' => __("Add action"))); diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 4261e333b0..da25bc6426 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -509,6 +509,7 @@ function netflow_get_data ($start_date, $end_date, $interval_length, $filter, $a } // Address resolution start + $get_hostnames = false; if ($config['netflow_get_ip_hostname'] && ($aggregate == "srcip" || $aggregate == "dstip")) { $get_hostnames = true; global $hostnames;