2013-04-19 Miguel de Dios <miguel.dedios@artica.es>

* mobile/operation/modules.php: fixed the typo bugs in the code.
	
	* include/functions_tags.php, include/functions_html.php: cleaned
	source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8016 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-04-19 11:39:41 +00:00
parent ca1a7770e4
commit c2bb044405
5 changed files with 33 additions and 26 deletions

View File

@ -1,4 +1,11 @@
2013-04-17 Miguel de Dios <miguel.dedios@artica.es>
2013-04-19 Miguel de Dios <miguel.dedios@artica.es>
* 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 <miguel.dedios@artica.es>
* pandoradb.postgreSQL.sql: improved the code source style.

View File

@ -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 .= '</div>';
if ($return) {
return $output;
}

View File

@ -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 .= '<b>' . '<span id="total_count_' . $uniq_id . '" class="forced_title">' . $total_count . '</span>';
if (isset($fired_count) && $fired_count > 0)
$out .= ' : <span class="orange forced_title" id="fired_count_' . $uniq_id . '">' . $fired_count . '</span>';
@ -6814,7 +6814,7 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent') {
$out .= ' : <span class="grey forced_title" id="unknown_count_' . $uniq_id . '">' . $unknown_count . '</span>';
if (isset($normal_count) && $normal_count > 0)
$out .= ' : <span class="green forced_title" id="normal_count_' . $uniq_id . '">' . $normal_count . '</span>';
$out .= '</b>';
if ($return) {

View File

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

View File

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