diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5ab5115bfc..4c0b326103 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,4 +1,11 @@ -2013-04-17 Miguel de Dios +2013-04-19 Miguel de Dios + + * mobile/operation/modules.php: fixed the typo bugs in the code. + + * include/functions_tags.php, include/functions_html.php: cleaned + source code style. + +2013-04-18 Miguel de Dios * pandoradb.postgreSQL.sql: improved the code source style. diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 3ea889383f..003e20c63d 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -860,7 +860,7 @@ function html_print_div ($options, $return = false) { $options['style'] = 'display:none;'; } } - + foreach ($attrs as $attribute) { if (isset ($options[$attribute])) { $output .= ' '.$attribute.'="'.io_safe_input_html ($options[$attribute]).'"'; @@ -872,7 +872,7 @@ function html_print_div ($options, $return = false) { $output .= isset ($options['content']) ? $options['content'] : ''; $output .= ''; - + if ($return) { return $output; } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 8fce726385..bba0929e40 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -6756,41 +6756,41 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent') { // Store the counts in a data structure to print hidden divs with titles $stats = array(); - - if(isset($counts_info['total_count'])) { + + if (isset($counts_info['total_count'])) { $not_init = isset($counts_info['notinit_count']) ? $counts_info['notinit_count'] : 0; $total_count = $counts_info['total_count'] - $not_init; $stats[] = array('name' => 'total_count', 'count' => $total_count, 'title' => sprintf($template_title['total_count'], $total_count)); } - if(isset($counts_info['normal_count'])) { + if (isset($counts_info['normal_count'])) { $normal_count = $counts_info['normal_count']; $stats[] = array('name' => 'normal_count', 'count' => $normal_count, 'title' => sprintf($template_title['normal_count'], $normal_count)); } - if(isset($counts_info['critical_count'])) { + if (isset($counts_info['critical_count'])) { $critical_count = $counts_info['critical_count']; $stats[] = array('name' => 'critical_count', 'count' => $critical_count, 'title' => sprintf($template_title['critical_count'], $critical_count)); } - if(isset($counts_info['warning_count'])) { + if (isset($counts_info['warning_count'])) { $warning_count = $counts_info['warning_count']; $stats[] = array('name' => 'warning_count', 'count' => $warning_count, 'title' => sprintf($template_title['warning_count'], $warning_count)); } - if(isset($counts_info['unknown_count'])) { + if (isset($counts_info['unknown_count'])) { $unknown_count = $counts_info['unknown_count']; $stats[] = array('name' => 'unknown_count', 'count' => $unknown_count, 'title' => sprintf($template_title['unknown_count'], $unknown_count)); } - if(isset($counts_info['fired_count'])) { + if (isset($counts_info['fired_count'])) { $fired_count = $counts_info['fired_count']; $stats[] = array('name' => 'fired_count', 'count' => $fired_count, 'title' => sprintf($template_title['fired_count'], $fired_count)); } $uniq_id = uniqid(); - - foreach($stats as $stat) { + + foreach ($stats as $stat) { $params = array('id' => 'forced_title_' . $stat['name'] . '_' . $uniq_id, 'class' => 'forced_title_layer', 'content' => $stat['title'], @@ -6799,10 +6799,10 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent') { } // If total count is less than 0, is an error. Never show negative numbers - if($total_count < 0) { + if ($total_count < 0) { $total_count = 0; } - + $out .= '' . '' . $total_count . ''; if (isset($fired_count) && $fired_count > 0) $out .= ' : ' . $fired_count . ''; @@ -6814,7 +6814,7 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent') { $out .= ' : ' . $unknown_count . ''; if (isset($normal_count) && $normal_count > 0) $out .= ' : ' . $normal_count . ''; - + $out .= ''; if ($return) { diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 958be23b09..8c5bae2e7d 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -825,19 +825,19 @@ function tags_get_acl_tags_event_condition($acltags) { // Get all tags of the system $all_tags = tags_get_all_tags(false); - foreach($acltags as $group_id => $group_tags) { + foreach ($acltags as $group_id => $group_tags) { // Group condition (The module belongs to an agent of the group X) $group_condition = sprintf('id_grupo = %d',$group_id); // Tags condition (The module has at least one of the restricted tags) $tags_condition = ''; - foreach($group_tags as $tag) { + foreach ($group_tags as $tag) { // If the tag ID doesnt exist, ignore - if(!isset($all_tags[$tag])) { + if (!isset($all_tags[$tag])) { continue; } - if($tags_condition != '') { + if ($tags_condition != '') { $tags_condition .= " OR \n"; } @@ -852,21 +852,21 @@ function tags_get_acl_tags_event_condition($acltags) { } // If there is not tag condition ignore - if(empty($tags_condition)) { + if (empty($tags_condition)) { continue; } - if($condition != '') { + if ($condition != '') { $condition .= ' OR '; } $condition .= "($group_condition AND \n($tags_condition))\n"; } - if(!empty($condition)) { + if (!empty($condition)) { $condition = sprintf("\n((%s) OR id_grupo NOT IN (%s))", $condition, implode(',',array_keys($acltags))); } - + return $condition; } diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index 96cf2ac895..8097fd13e1 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -533,6 +533,8 @@ class Modules { } else { $html .= $table->getHTML(); + + return $html; } if (!$this->all_modules) { @@ -546,8 +548,6 @@ class Modules { } } } - - return $html; } private function addJavascriptAddBottom() { @@ -572,7 +572,7 @@ class Modules { postvars[\"group\"] = $(\"select[name='group']\").val(); postvars[\"status\"] = $(\"select[name='status']\").val(); postvars[\"type\"] = $(\"select[name='module_group']\").val(); - postvars[\"severity\"] = $(\"select[name='tag']\").val(); + postvars[\"tag\"] = $(\"select[name='tag']\").val(); postvars[\"free_search\"] = $(\"input[name='free_search']\").val(); postvars[\"page\"] = page; page++;