mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
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:
parent
ca1a7770e4
commit
c2bb044405
@ -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.
|
||||
|
||||
|
@ -6757,40 +6757,40 @@ 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,7 +6799,7 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -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,18 +852,18 @@ 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)));
|
||||
}
|
||||
|
||||
|
@ -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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user