diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 3e85086573..cbae6d82e6 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -181,14 +181,15 @@ if ($get_module_detail) { "modules_format_time", "align" => "left", "width" => "50px"); - }else{ + } + else { $columns["Timestamp"] = array( "utimestamp", "modules_format_timestamp", "align" => "left", "width" => "50px"); } - + if ($selection_mode == "fromnow") { $date = get_system_time(); $period = $period; @@ -499,10 +500,10 @@ if ($list_modules) { $status_filter_sql = 'tagente_estado.estado = ' . $status_filter_monitor; } - if($status_module_group != -1){ + if ($status_module_group != -1) { $status_module_group_filter = 'id_module_group = ' . $status_module_group; } - else{ + else { $status_module_group_filter = 'id_module_group >= 0'; } @@ -900,15 +901,16 @@ if ($list_modules) { else $salida = 'FAIL'; break; - default: + default: $salida = format_numeric($module["datos"]); break; } - }else{ + } + else { $salida = format_numeric($module["datos"]); } // Show units ONLY in numeric data types - if (isset($module["unit"])){ + if (isset($module["unit"])) { $salida .= " " . ''. io_safe_output($module["unit"]) . ''; } } diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index bfd2e87af0..69aca67b38 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -1292,14 +1292,14 @@ class Tree { $module['serverID'] = $server['id']; $module['serverName'] = $server['server_name']; } - else{ + else { $module['serverName'] = false; $module['serverID'] = false; } if (!isset($module['value'])) $module['value'] = modules_get_last_value($module['id']); - + // Status switch ($module['status']) { case AGENT_MODULE_STATUS_CRITICAL_ALERT: diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 6f99ce8782..9efe726f85 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2246,7 +2246,7 @@ function print_audit_csv ($data) { echo io_safe_output($line['id_usuario']) . ';' . io_safe_output($line['accion']) . ';' . $line['fecha'] . ';' . $line['ip_origen'] . ';'. io_safe_output($line['descripcion']). "\n"; } } - else{ + else { echo __('No data found to export'); } } diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index f1905d43db..0411bd28ee 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -1627,23 +1627,27 @@ function modules_get_agentmodule_data ($id_agent_module, $period, case 21: case 31: if ( $config["render_proc"] ) { - $sql = sprintf ("SELECT IF(datos >= 1, 'OK', 'FAIL') as data, utimestamp + $sql = sprintf (" + SELECT IF(datos >= 1, 'OK', 'FAIL') as data, utimestamp + FROM tagente_datos + WHERE id_agente_modulo = %d + AND utimestamp > %d AND utimestamp <= %d + ORDER BY utimestamp %s", + $id_agent_module, $datelimit, $date, $order); + } + else { + $sql = sprintf (" + SELECT datos AS data, utimestamp FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d ORDER BY utimestamp %s", $id_agent_module, $datelimit, $date, $order); - }else{ - $sql = sprintf ("SELECT datos AS data, utimestamp - FROM tagente_datos - WHERE id_agente_modulo = %d - AND utimestamp > %d AND utimestamp <= %d - ORDER BY utimestamp %s", - $id_agent_module, $datelimit, $date, $order); } break; default: - $sql = sprintf ("SELECT datos AS data, utimestamp + $sql = sprintf (" + SELECT datos AS data, utimestamp FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 9178c1ad6d..b8e8128c89 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -5292,7 +5292,8 @@ function reporting_get_stats_alerts($data, $links = false) { __('Defined and fired alerts') . '' . html_print_table($table_al, true) . ''; - }else{ + } + else { $table_al->class = "tactical_view"; $table_al->style = array(); $output = '
'; } - else{ + else { $table_mbs->class = "tactical_view"; $table_mbs->style=array(); $output = ' diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 0e7dfa6089..f3d797ed20 100755 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2600,7 +2600,7 @@ function reporting_get_agents_by_status ($data, $graph_width = 250, $graph_heigh '' . html_print_table($table_agent, true) . ''; } - else{ + else { $table_agent->style=array(); $table_agent->class = "tactical_view"; $agents_data = ''; - }else{ + } + else { $table_node->style = array(); $table_node->class = "tactical_view"; $node_overview = ''; } - else{ + else { $table_events->class="tactical_view"; $table_events->styleTable="text-align:center;"; $table_events->size[0]="10%"; @@ -2915,7 +2916,7 @@ function reporting_get_event_histogram ($events) { '' . html_print_table($table, true) . ''; } - else{ + else { $table->class='tactical_view'; $event_graph = ''; diff --git a/pandora_console/install.php b/pandora_console/install.php index 1699d63c97..7ed947281a 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -299,7 +299,7 @@ function parse_oracle_dump($connection, $url, $debug = false) { $query .= $clean_line . ' '; $plsql_block = true; } - else{ + else { $query .= $clean_line; } diff --git a/pandora_console/operation/agentes/alerts_status.functions.php b/pandora_console/operation/agentes/alerts_status.functions.php index 587e71ef3a..25f0fdd661 100755 --- a/pandora_console/operation/agentes/alerts_status.functions.php +++ b/pandora_console/operation/agentes/alerts_status.functions.php @@ -106,7 +106,7 @@ function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_st $table->rowspan[0][7] = 2; $data = '"; ui_toggle($filters, __('Show Options')); } -else{ +else { $table->colspan[2][0] = 7; $table->data[2][0] = ui_toggle(html_print_table($table_custom_fields, true), __('Agent custom fields'),'',true,true); @@ -1247,7 +1248,8 @@ foreach ($result as $row) { $salida = format_numeric($row["datos"]); break; } - }else{ + } + else { $salida = format_numeric($row["datos"]); } diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 46e415b3a5..0f60dd1192 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -144,7 +144,7 @@ if (check_acl ($config['id_user'], 0, "AR")) { if ($layouts === false) { $layouts = array (); } - else{ + else { $id = (int) get_parameter ('id', -1); @@ -416,7 +416,7 @@ if (check_acl ($config['id_user'], 0, "AR")) { $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['subfatherId']]['sub2'][$extension_menu['sec2']]["enterprise"] = $extension['enterprise']; $menu_operation[$extension_menu['fatherId']]['hasExtensions'] = true; } - else{ + else { $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']); $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["refr"] = 0; $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["icon"] = $extension_menu['icon']; @@ -426,7 +426,7 @@ if (check_acl ($config['id_user'], 0, "AR")) { $menu_operation[$extension_menu['fatherId']]['hasExtensions'] = true; } } - else{ + else { $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["text"] = __($extension_menu['name']); $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["refr"] = 0; $menu_operation[$extension_menu['fatherId']]['sub'][$extension_menu['sec2']]["icon"] = $extension_menu['icon']; diff --git a/pandora_console/operation/netflow/nf_live_view.php b/pandora_console/operation/netflow/nf_live_view.php index 9f4cdff273..133921ae3c 100644 --- a/pandora_console/operation/netflow/nf_live_view.php +++ b/pandora_console/operation/netflow/nf_live_view.php @@ -180,7 +180,8 @@ enterprise_hook('open_meta_frame'); if (defined ('METACONSOLE')){ $class = "databox data"; -}else{ +} +else { $class = "databox filters"; } diff --git a/pandora_console/operation/servers/recon_view.php b/pandora_console/operation/servers/recon_view.php index b062a89fee..a2dcf241a1 100644 --- a/pandora_console/operation/servers/recon_view.php +++ b/pandora_console/operation/servers/recon_view.php @@ -30,30 +30,30 @@ if ($servers === false) { $servers = array (); return; } -else{ +else { $recon_task = db_get_all_rows_sql('SELECT * FROM trecon_task'); if ($recon_task === false) { ui_print_page_header (__('Recon View'), "images/op_recon.png", false, "", false); require_once ($config['homedir'] . "/general/firts_task/recon_view.php"); return; } - else{ + else { require_once ($config["homedir"] . '/include/functions_graph.php'); require_once ($config["homedir"] . '/include/functions_servers.php'); require_once ($config['homedir'] . "/include/functions_network_profiles.php"); - + if (check_acl ($config['id_user'], 0, "AW")) { $options['manage']['text'] = "" . html_print_image("images/setup.png", true, array('title' => __('Manage'))) . ""; } - + $options[]['text'] = "" . html_print_image("images/refresh_mc.png", true, array('title' => __('Refresh'))) . ""; - + ui_print_page_header (__('Recon View'), "images/op_recon.png", false, "", false, $options); - + $modules_server = 0; $total_modules = 0; $total_modules_data = 0; - + // -------------------------------- // FORCE A RECON TASK // -------------------------------- @@ -63,17 +63,17 @@ else{ servers_force_recon_task($id); } } - + foreach ($servers as $serverItem) { $id_server = $serverItem["id_server"]; $server_name = servers_get_name ($id_server); $recon_tasks = db_get_all_rows_field_filter ("trecon_task", "id_recon_server", $id_server); - + // Show network tasks for Recon Server if ($recon_tasks === false) { $recon_tasks = array (); } - + $table->cellpadding = 4; $table->cellspacing = 4; $table->width = "99%"; @@ -81,34 +81,34 @@ else{ $table->head = array (); $table->data = array (); $table->align = array (); - + $table->head[0] = __('Force'); $table->align[0] = "center"; - + $table->head[1] = __('Task name'); $table->align[1] = "center"; - + $table->head[2] = __('Interval'); $table->align[2] = "center"; - + $table->head[3] = __('Network'); $table->align[3] = "center"; - + $table->head[4] = __('Status'); $table->align[4] = "center"; - + $table->head[5] = __('Template'); $table->align[5] = "center"; - + $table->head[6] = __('Progress'); $table->align[6] = "center"; - + $table->head[7] = __('Updated at'); $table->align[7] = "center"; - + $table->head[8] = __('Edit'); $table->align[8] = "center"; - + foreach ($recon_tasks as $task) { $data = array (); @@ -122,9 +122,9 @@ else{ } $data[1] = ''. $task["name"].''; - + $data[2] = human_time_description_raw ($task["interval_sweep"]); - + if ($task["id_recon_script"] == 0){ $data[3] = $task["subnet"]; } @@ -138,7 +138,7 @@ else{ else { $data[4] = __('Pending'); } - + if ($task["id_recon_script"] == 0){ // Network recon task $data[5] = html_print_image ("images/network.png", true, array ("title" => __('Network recon task')))." "; @@ -149,7 +149,7 @@ else{ $data[5] = html_print_image ("images/plugin.png", true). " "; $data[5] .= db_get_sql (sprintf("SELECT name FROM trecon_script WHERE id_recon_script = %d", $task["id_recon_script"])); } - + if ($task["status"] <= 0 || $task["status"] > 100) { $data[6] = "-"; } @@ -158,7 +158,7 @@ else{ } $data[7] = ui_print_timestamp ($task["utimestamp"], true); - + if (check_acl ($config["id_user"], $task["id_group"], "PM")) { $data[8] = ''.html_print_image ("images/wrench_orange.png", true).''; } @@ -167,7 +167,7 @@ else{ } array_push ($table->data, $data); } - + if (empty ($table->data)) { echo '