Clean the source code style.

This commit is contained in:
mdtrooper 2015-06-08 09:32:01 +02:00
parent b96fdad6d8
commit 819b1d5d77
14 changed files with 76 additions and 64 deletions

View File

@ -181,7 +181,8 @@ if ($get_module_detail) {
"modules_format_time",
"align" => "left",
"width" => "50px");
}else{
}
else {
$columns["Timestamp"] = array(
"utimestamp",
"modules_format_timestamp",
@ -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';
}
@ -904,11 +905,12 @@ if ($list_modules) {
$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 .= "&nbsp;" . '<i>'. io_safe_output($module["unit"]) . '</i>';
}
}

View File

@ -1292,7 +1292,7 @@ class Tree {
$module['serverID'] = $server['id'];
$module['serverName'] = $server['server_name'];
}
else{
else {
$module['serverName'] = false;
$module['serverID'] = false;
}

View File

@ -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');
}
}

View File

@ -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

View File

@ -5292,7 +5292,8 @@ function reporting_get_stats_alerts($data, $links = false) {
__('Defined and fired alerts') .
'</legend>' .
html_print_table($table_al, true) . '</fieldset>';
}else{
}
else {
$table_al->class = "tactical_view";
$table_al->style = array();
$output = '<fieldset class="tactical_set">
@ -5391,7 +5392,7 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he
html_print_table($table_mbs, true) .
'</fieldset>';
}
else{
else {
$table_mbs->class = "tactical_view";
$table_mbs->style=array();
$output = '

View File

@ -2600,7 +2600,7 @@ function reporting_get_agents_by_status ($data, $graph_width = 250, $graph_heigh
'</legend>' .
html_print_table($table_agent, true) . '</fieldset>';
}
else{
else {
$table_agent->style=array();
$table_agent->class = "tactical_view";
$agents_data = '<fieldset class="tactical_set">
@ -2652,7 +2652,8 @@ function reporting_get_total_servers ($num_servers) {
__('Node overview') .
'</legend>' .
html_print_table($table_node, true) . '</fieldset>';
}else{
}
else {
$table_node->style = array();
$table_node->class = "tactical_view";
$node_overview = '<fieldset class="tactical_set">
@ -2691,7 +2692,7 @@ function reporting_get_events ($data, $links = false) {
$table_events->data[0][3] .= "&nbsp;&nbsp;&nbsp;" .
"<a style='color:#FFF; font-size: 12pt; font-weight: bold;" . $style . "' href='" . $links['unknown'] . "'>" . format_numeric($data['unknown'])."</a>";
}
else{
else {
$table_events->data[0][0] = html_print_image('images/module_critical.png', true, array('title' => __('Critical events')));
$table_events->data[0][0] .= "&nbsp;&nbsp;&nbsp;" .
"<a style='color: #FC4444;" . $style . "' href='" . $links['critical'] . "'><b><span style='font-size: 12pt; font-weight: bold; color: #FC4444;'>".
@ -2717,7 +2718,7 @@ function reporting_get_events ($data, $links = false) {
'</legend>' .
html_print_table($table_events, true) . '</fieldset>';
}
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) {
'</legend>' .
html_print_table($table, true) . '</fieldset>';
}
else{
else {
$table->class='tactical_view';
$event_graph = '<fieldset id="event_tactical" class="tactical_set">' .
html_print_table($table, true) . '</fieldset>';

View File

@ -299,7 +299,7 @@ function parse_oracle_dump($connection, $url, $debug = false) {
$query .= $clean_line . ' ';
$plsql_block = true;
}
else{
else {
$query .= $clean_line;
}

View File

@ -106,7 +106,7 @@ function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_st
$table->rowspan[0][7] = 2;
$data = '<form style="background-color: #ECECEC;" method="post" action="'.$url.'">';
}
else{
else {
$data = '<form method="post" action="'.$url.'">';
}
$data .= html_print_table ($table, true);

View File

@ -376,7 +376,7 @@ if ($print_agent) {
if(defined('METACONSOLE')){
ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, $tag_filter, true, $strict_user),__('Show Options'));;
}
else{
else {
ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, $tag_filter, true, $strict_user),__('Alert control filter'), __('Toggle filter(s)'));
}
}

View File

@ -100,7 +100,8 @@ if (!defined('METACONSOLE')){
$table->cellspacing = 0;
$table->cellpadding = 0;
$table->class = "databox filters";
}else{
}
else {
$filters = '<form class="filters_form" method="post" action="index.php?sec=estado&amp;sec2=operation/agentes/status_monitor&amp;refr=' . $refr . '&amp;ag_group=' .
$ag_group . '&amp;ag_freestring=' . $ag_freestring . '&amp;ag_modulename=' . $ag_modulename . '&amp;status=' . $status . '&amp;sort_field=' .
$sortField . '&amp;sort=' . $sort .'&amp;pure=' . $config['pure'] . $ag_custom_fields_params . '">';
@ -409,7 +410,7 @@ if(defined("METACONSOLE")){
$table->style[3] = 'vertical-align:middle; font-weight: bold;';
$table->style[4] = 'vertical-align:middle; font-weight: bold;';
}
else{
else {
$table->style[0] = 'font-weight: bold;';
$table->style[1] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold;';
@ -536,7 +537,7 @@ if(defined('METACONSOLE')){
$filters .= "</form>";
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"]);
}

View File

@ -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'];

View File

@ -180,7 +180,8 @@ enterprise_hook('open_meta_frame');
if (defined ('METACONSOLE')){
$class = "databox data";
}else{
}
else {
$class = "databox filters";
}

View File

@ -30,14 +30,14 @@ 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");

View File

@ -183,7 +183,8 @@ if (defined('METACONSOLE')) {
echo "<div class='view_tree'>";
ui_toggle($form_html, __('Show Options'));
echo "<br>";
}else{
}
else {
//echo "<br>";
ui_toggle($form_html, __('Tree search'));
}