From f9d123603b2154c158d25a28b4620917cdf753b0 Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Mon, 11 Mar 2019 18:03:05 +0100
Subject: [PATCH 01/83] Resolved

Former-commit-id: f5628a1fd34771329b2b06664b552beaacf4c369
---
 pandora_console/include/functions_events.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index fa8287f406..c5669d808a 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -431,7 +431,7 @@ function events_change_status(
         $ack_user = $config['id_user'];
     } else {
         $acl_utimestamp = 0;
-        $ack_user = '';
+        $ack_user = $config['id_user'];
     }
 
     switch ($new_status) {

From aba2ef509a2da8a16862a7f6bb1530ca06170131 Mon Sep 17 00:00:00 2001
From: samucarc <samuel.carcases>
Date: Wed, 13 Mar 2019 11:58:21 +0100
Subject: [PATCH 02/83] Fixed messages count

Former-commit-id: df7b230fe009e6f73d836cf2290f33deb8a743d9
---
 pandora_console/include/functions_messages.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/include/functions_messages.php b/pandora_console/include/functions_messages.php
index 5374fb7b1e..63c12d019d 100644
--- a/pandora_console/include/functions_messages.php
+++ b/pandora_console/include/functions_messages.php
@@ -383,7 +383,7 @@ function messages_get_count(
     }
 
     $sql = sprintf(
-        'SELECT count(*) as "n" FROM (
+        'SELECT count(distinct id_mensaje) as "n" FROM (
             SELECT
                 tm.*,
                 utimestamp_read > 0 as "read"

From 0863c2ffd64c3d8338dcd7eda6153eb6750b36e5 Mon Sep 17 00:00:00 2001
From: samucarc <samuel.carcases>
Date: Fri, 15 Mar 2019 11:51:39 +0100
Subject: [PATCH 03/83] Hidden buttons template and wizard in the open visual
 console

Former-commit-id: 42796373226cf112f1abda8b54a780b1546f46c3
---
 pandora_console/godmode/reporting/map_builder.php             | 2 +-
 pandora_console/godmode/reporting/visual_console_favorite.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php
index 6a20eeb30d..4471f8cbd8 100644
--- a/pandora_console/godmode/reporting/map_builder.php
+++ b/pandora_console/godmode/reporting/map_builder.php
@@ -61,7 +61,7 @@ $buttons['visual_console_favorite'] = [
     'text'   => '<a href="'.$url_visual_console_favorite.'">'.html_print_image('images/list.png', true, ['title' => __('Visual Favourite Console')]).'</a>',
 ];
 
-if ($is_enterprise && $vconsoles_manage) {
+if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
     $buttons['visual_console_template'] = [
         'active' => false,
         'text'   => '<a href="'.$url_visual_console_template.'">'.html_print_image('images/templates.png', true, ['title' => __('Visual Console Template')]).'</a>',
diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php
index df13291539..d6fb18de15 100644
--- a/pandora_console/godmode/reporting/visual_console_favorite.php
+++ b/pandora_console/godmode/reporting/visual_console_favorite.php
@@ -54,7 +54,7 @@ $buttons['visual_console_favorite'] = [
     'text'   => '<a href="'.$url_visual_console_favorite.'">'.html_print_image('images/list.png', true, ['title' => __('Visual Favourite Console')]).'</a>',
 ];
 
-if ($is_enterprise && $vconsoles_manage) {
+if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
     $buttons['visual_console_template'] = [
         'active' => false,
         'text'   => '<a href="'.$url_visual_console_template.'">'.html_print_image('images/templates.png', true, ['title' => __('Visual Console Template')]).'</a>',

From 1a01c311d6e0d208a98177371d3fb65a8a7fd88e Mon Sep 17 00:00:00 2001
From: samucarc <samuel.carcases>
Date: Wed, 20 Mar 2019 18:30:52 +0100
Subject: [PATCH 04/83] Fixed down paginations in manage agents

Former-commit-id: 28f7546b2d0cc8f4e1d13763e9c92ac99c2de2f9
---
 pandora_console/godmode/agentes/modificar_agente.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php
index 4673bf2f46..82078fc109 100644
--- a/pandora_console/godmode/agentes/modificar_agente.php
+++ b/pandora_console/godmode/agentes/modificar_agente.php
@@ -670,7 +670,7 @@ if ($agents !== false) {
     }
 
     echo '</table>';
-    ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
+    ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
     echo "<table width='100%'><tr><td align='right'>";
 } else {
     ui_print_info_message(['no_close' => true, 'message' => __('There are no defined agents') ]);

From 4b6c21bb309c82ae67daf826739437254d700db8 Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Tue, 4 Jun 2019 11:44:11 +0200
Subject: [PATCH 05/83] Add policies to general search and deleted help
 functions

---
 pandora_console/operation/search_main.php     |  11 +-
 .../operation/search_policies.getdata.php     | 199 ++++++++++++++++++
 pandora_console/operation/search_policies.php |  65 ++++++
 pandora_console/operation/search_results.php  |  41 ++--
 4 files changed, 294 insertions(+), 22 deletions(-)
 create mode 100644 pandora_console/operation/search_policies.getdata.php
 create mode 100644 pandora_console/operation/search_policies.php

diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php
index ffc9d93f74..d5ae3bff42 100644
--- a/pandora_console/operation/search_main.php
+++ b/pandora_console/operation/search_main.php
@@ -20,6 +20,7 @@ $searchGraphs = check_acl($config['id_user'], 0, 'RR');
 $searchMaps = check_acl($config['id_user'], 0, 'RR');
 $searchReports = check_acl($config['id_user'], 0, 'RR');
 $searchUsers = check_acl($config['id_user'], 0, 'UM');
+$searchPolicies = check_acl($config['id_user'], 0, 'UM');
 $searchHelps = true;
 
 echo '<br><div style="margin:auto; width:90%; padding: 10px; background: #fff">';
@@ -44,8 +45,12 @@ $table->style[9] = 'font-weight: bold; text-align: center;';
 $table->style[10] = 'font-weight: bold; text-align: center;';
 $table->style[11] = 'font-weight: bold; text-align: center;';
 $table->style[13] = 'font-weight: bold; text-align: center;';
+$table->style[14] = 'font-weight: bold; text-align: center;';
 $table->style[15] = 'font-weight: bold; text-align: center;';
 
+
+
+
 $table->data[0][0] = html_print_image('images/agent.png', true, ['title' => __('Agents found')]);
 $table->data[0][1] = "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalAgents).'</a>';
 $table->data[0][2] = html_print_image('images/module.png', true, ['title' => __('Modules found')]);
@@ -64,8 +69,10 @@ $table->data[0][10] = html_print_image('images/reporting.png', true, ['title' =>
 $table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
 $table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Maps found')]);
 $table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
-$table->data[0][14] = html_print_image('images/help.png', true, ['title' => __('Helps found')]);
-$table->data[0][15] = "<a href='index.php?search_category=helps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalHelps).'</a>';
+if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
+    $table->data[0][14] = html_print_image('images/policies.png', true, ['title' => __('Policies')]);
+    $table->data[0][15] = "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalPolicies).'</a>';
+}
 
 html_print_table($table);
 
diff --git a/pandora_console/operation/search_policies.getdata.php b/pandora_console/operation/search_policies.getdata.php
new file mode 100644
index 0000000000..c91e7e4279
--- /dev/null
+++ b/pandora_console/operation/search_policies.getdata.php
@@ -0,0 +1,199 @@
+<?php
+
+// Pandora FMS - http://pandorafms.com
+// ==================================================
+// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
+// Please see http://pandorafms.org for full contribution list
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; version 2
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+global $config;
+
+
+require_once $config['homedir'].'/enterprise/include/functions_policies.php';
+
+
+$searchpolicies = check_acl($config['id'], 0, 'UM');
+
+$selectpolicieIDUp = '';
+$selectpolicieIDDown = '';
+$selectNameUp = '';
+$selectNameDown = '';
+$selectDescriptionUp = '';
+$selectDescriptionDown = '';
+$selectId_groupUp = '';
+$selectId_groupDown = '';
+$selectStatusUp = '';
+$selectStatusDown = '';
+
+switch ($sortField) {
+    case 'id':
+        switch ($sort) {
+            case 'up':
+                $selectpolicieIDUp = $selected;
+                $order = [
+                    'field' => 'id',
+                    'order' => 'ASC',
+                ];
+            break;
+
+            case 'down':
+                $selectpolicieIDDown = $selected;
+                $order = [
+                    'field' => 'id',
+                    'order' => 'DESC',
+                ];
+            break;
+        }
+    break;
+
+    case 'name':
+        switch ($sort) {
+            case 'up':
+                $selectNameUp = $selected;
+                $order = [
+                    'field' => 'name',
+                    'order' => 'ASC',
+                ];
+            break;
+
+            case 'down':
+                $selectNameDown = $selected;
+                $order = [
+                    'field' => 'name',
+                    'order' => 'DESC',
+                ];
+            break;
+        }
+    break;
+
+    case 'description':
+        switch ($sort) {
+            case 'up':
+                $selectId_groupUp = $selected;
+                $order = [
+                    'field' => 'description',
+                    'order' => 'ASC',
+                ];
+            break;
+
+            case 'down':
+                $selectDescriptionDown = $selected;
+                $order = [
+                    'field' => 'description',
+                    'order' => 'DESC',
+                ];
+            break;
+        }
+    break;
+
+    case 'last_contact':
+        switch ($sort) {
+            case 'up':
+                $selectId_groupUp = $selected;
+                $order = [
+                    'field' => 'last_connect',
+                    'order' => 'ASC',
+                ];
+            break;
+
+            case 'down':
+                $selectId_groupDown = $selected;
+                $order = [
+                    'field' => 'last_connect',
+                    'order' => 'DESC',
+                ];
+            break;
+        }
+    break;
+
+    case 'id_group':
+        switch ($sort) {
+            case 'up':
+                $selectId_groupUp = $selected;
+                $order = [
+                    'field' => 'last_connect',
+                    'order' => 'ASC',
+                ];
+            break;
+
+            case 'down':
+                $selectId_groupDown = $selected;
+                $order = [
+                    'field' => 'last_connect',
+                    'order' => 'DESC',
+                ];
+            break;
+        }
+    break;
+
+    case 'status':
+        switch ($sort) {
+            case 'up':
+                $selectStatusUp = $selected;
+                $order = [
+                    'field' => 'is_admin',
+                    'order' => 'ASC',
+                ];
+            break;
+
+            case 'down':
+                $selectStatusDown = $selected;
+                $order = [
+                    'field' => 'is_admin',
+                    'order' => 'DESC',
+                ];
+            break;
+        }
+    break;
+
+    default:
+        $selectpolicieIDUp = $selected;
+        $selectpolicieIDDown = '';
+        $selectNameUp = '';
+        $selectNameDown = '';
+        $selectDescriptionUp = '';
+        $selectDescriptionDown = '';
+        $selectId_groupUp = '';
+        $selectId_groupDown = '';
+        $selectStatusUp = '';
+        $selectStatusDown = '';
+
+        $order = [
+            'field' => 'id',
+            'order' => 'ASC',
+        ];
+    break;
+}
+
+if ($searchpolicies == 0) {
+            $sql = "SELECT id, name, description, id_group, status FROM tpolicies
+				    WHERE   name LIKE '%".$stringSearchSQL."%' OR
+					        description LIKE '%".$stringSearchSQL."%'
+				    ORDER BY ".$order['field'].' '.$order['order'];
+}
+
+        $sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0);
+
+
+    $policies = db_process_sql($sql);
+
+if ($policies !== false) {
+    if ($only_count) {
+        unset($policies);
+    }
+
+    $sql = "SELECT COUNT(id) AS count FROM tpolicies
+				WHERE name LIKE '%".$stringSearchSQL."%' OR
+					  description LIKE '%".$stringSearchSQL."%'";
+
+
+    // q$totalPolicies = db_get_value_sql($sql);
+    $totalPolicies = count($policies);
+} else {
+    $totalPolicies = 0;
+}
diff --git a/pandora_console/operation/search_policies.php b/pandora_console/operation/search_policies.php
new file mode 100644
index 0000000000..8f339b7c1b
--- /dev/null
+++ b/pandora_console/operation/search_policies.php
@@ -0,0 +1,65 @@
+<?php
+
+// Pandora FMS - http://pandorafms.com
+// ==================================================
+// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
+// Please see http://pandorafms.org for full contribution list
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; version 2
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+global $config;
+
+// require_once $config['homedir'].'/include/functions_status.php';
+require_once $config['homedir'].'/enterprise/include/functions_policies.php';
+require_once $config['homedir'].'/enterprise/include/functions_groups.php';
+
+$searchpolicies = check_acl($config['id_user'], 0, 'UM');
+
+if (!$policies || !$searchpolicies) {
+    echo "<br><div class='nf'>".__('Zero results found')."</div>\n";
+} else {
+    $table->cellpadding = 4;
+    $table->cellspacing = 4;
+    $table->width = '98%';
+    $table->class = 'databox';
+
+    $table->align = [];
+    $table->align[4] = 'center';
+
+    $table->head = [];
+    $table->head[0] = __('ID').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectpolicieIDUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectpolicieIDDown]).'</a>';
+    $table->head[1] = __('Name').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>';
+    $table->head[2] = __('Description').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectDescriptionUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectDescriptionDown]).'</a>';
+    $table->head[3] = __('Id_group').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectId_groupUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectId_groupDown]).'</a>';
+    $table->head[4] = __('Status').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectstatusDown]).'</a>';
+
+    $table->data = [];
+
+    foreach ($policies as $policie) {
+        $policieIDCell = "<a href='?sec=gmodules&sec2=enterprise/godmode/policies/policies&id=".$policies['id']."'>".$policies['id'].'</a>';
+
+
+        array_push(
+            $table->data,
+            [
+                $policie['id'],
+                $policie['name'],
+                $policie['description'],
+                $policie['id_group'],
+                $policie['status'],
+
+            ]
+        );
+    }
+
+    $totalPolicies = count($policies);
+    echo '<br />';
+    ui_pagination($totalPolicies);
+    html_print_table($table);
+    unset($table);
+    ui_pagination($totalPolicies);
+}
diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php
index d59e6908cb..cbd49ccc28 100644
--- a/pandora_console/operation/search_results.php
+++ b/pandora_console/operation/search_results.php
@@ -18,7 +18,7 @@ require_once $config['homedir'].'/include/functions_reporting.php';
 enterprise_include('operation/reporting/custom_reporting.php');
 
 $searchAgents = $searchAlerts = $searchModules = check_acl($config['id_user'], 0, 'AR');
-$searchUsers = check_acl($config['id_user'], 0, 'UM');
+$searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'UM');
 $searchMaps = $searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'IR');
 $searchMain = true;
 $searchHelps = true;
@@ -43,6 +43,7 @@ if ($config['search_category'] == 'all') {
 // INI SECURITY ACL
 if ((!$searchAgents && !$searchUsers && !$searchMaps)
     || (!$searchUsers && $searchTab == 'users')
+    || (!$searchPolicies && $searchTab == 'policies')
     || (!$searchAgents && ($searchTab == 'agents' || $searchTab == 'alerts'))
     || (!$searchGraphs && ($searchTab == 'graphs' || $searchTab == 'maps' || $searchTab == 'reports'))
 ) {
@@ -161,29 +162,29 @@ if ($searchModules) {
     $modules_tab = '';
 }
 
-if ($searchHelps) {
-    $helps_tab = [
-        'text'   => "<a href='index.php?search_category=helps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
-            'images/help_w.png',
+if ($searchPolicies) {
+    $policies_tab = [
+        'text'   => "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
+            'images/policies.png',
             true,
-            ['title' => __('Helps')]
+            ['title' => __('Policies')]
         ).'</a>',
-        'active' => $searchTab == 'helps',
+        'active' => $searchTab == 'policies',
     ];
 } else {
-    $helps_tab = '';
+    $policies_tab = '';
 }
 
 $onheader = [
-    'main'    => $main_tab,
-    'agents'  => $agents_tab,
-    'modules' => $modules_tab,
-    'alerts'  => $alerts_tab,
-    'users'   => $users_tab,
-    'graphs'  => $graphs_tab,
-    'reports' => $reports_tab,
-    'maps'    => $maps_tab,
-    'helps'   => $helps_tab,
+    'main'     => $main_tab,
+    'agents'   => $agents_tab,
+    'modules'  => $modules_tab,
+    'alerts'   => $alerts_tab,
+    'users'    => $users_tab,
+    'graphs'   => $graphs_tab,
+    'reports'  => $reports_tab,
+    'maps'     => $maps_tab,
+    'policies' => $policies_tab,
 ];
 
 ui_print_page_header(
@@ -251,8 +252,8 @@ switch ($searchTab) {
         include_once 'search_modules.php';
     break;
 
-    case 'helps':
-        include_once 'search_helps.getdata.php';
-        include_once 'search_helps.php';
+    case 'policies':
+        include_once 'search_policies.getdata.php';
+        include_once 'search_policies.php';
     break;
 }

From c5cb76b2714e559a9acc6a60267653e8c476da5e Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Tue, 4 Jun 2019 11:52:56 +0200
Subject: [PATCH 06/83] Add policies to general search

---
 pandora_console/operation/search_policies.getdata.php | 1 +
 pandora_console/operation/search_results.php          | 1 +
 2 files changed, 2 insertions(+)

diff --git a/pandora_console/operation/search_policies.getdata.php b/pandora_console/operation/search_policies.getdata.php
index c91e7e4279..fd97335421 100644
--- a/pandora_console/operation/search_policies.getdata.php
+++ b/pandora_console/operation/search_policies.getdata.php
@@ -177,6 +177,7 @@ if ($searchpolicies == 0) {
 				    ORDER BY ".$order['field'].' '.$order['order'];
 }
 
+
         $sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0);
 
 
diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php
index cbd49ccc28..e4dbe38a0c 100644
--- a/pandora_console/operation/search_results.php
+++ b/pandora_console/operation/search_results.php
@@ -255,5 +255,6 @@ switch ($searchTab) {
     case 'policies':
         include_once 'search_policies.getdata.php';
         include_once 'search_policies.php';
+
     break;
 }

From 22efc4ba44c2d2fe4b1a820e436d40156ea92506 Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Tue, 4 Jun 2019 17:05:17 +0200
Subject: [PATCH 07/83] Resolved problem with counts on search main

---
 pandora_console/operation/search_graphs.getdata.php   | 4 ++++
 pandora_console/operation/search_main.php             | 1 +
 pandora_console/operation/search_policies.getdata.php | 6 ++----
 pandora_console/operation/search_policies.php         | 2 +-
 pandora_console/operation/search_results.php          | 1 +
 5 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/pandora_console/operation/search_graphs.getdata.php b/pandora_console/operation/search_graphs.getdata.php
index aefd6e2073..bd3159d72f 100644
--- a/pandora_console/operation/search_graphs.getdata.php
+++ b/pandora_console/operation/search_graphs.getdata.php
@@ -26,6 +26,7 @@ if ($searchGraphs) {
     $usergraphs_id = array_keys($usergraphs);
 
     if (empty($usergraphs_id)) {
+        $totalGraphs = 0;
         return;
     }
 
@@ -37,6 +38,7 @@ if ($searchGraphs) {
         'id_graph',
         'name',
         'description',
+
     ];
 
     $totalGraphs = (int) db_get_value_filter('COUNT(id_graph) AS count', 'tgraph', $filter);
@@ -46,4 +48,6 @@ if ($searchGraphs) {
         $filter['offset'] = (int) get_parameter('offset');
         $graphs = db_get_all_rows_filter('tgraph', $filter, $columns);
     }
+
+    $totalGraphs = 0;
 }
diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php
index d5ae3bff42..f4ba5e3f91 100644
--- a/pandora_console/operation/search_main.php
+++ b/pandora_console/operation/search_main.php
@@ -86,4 +86,5 @@ if ($searchAgents && $totalAgents > 0) {
     ).'</a>';
 }
 
+
 echo '</div>';
diff --git a/pandora_console/operation/search_policies.getdata.php b/pandora_console/operation/search_policies.getdata.php
index fd97335421..0a28651e7a 100644
--- a/pandora_console/operation/search_policies.getdata.php
+++ b/pandora_console/operation/search_policies.getdata.php
@@ -13,8 +13,7 @@
 // GNU General Public License for more details.
 global $config;
 
-
-require_once $config['homedir'].'/enterprise/include/functions_policies.php';
+enterprise_include_once('include/functions_policies.php');
 
 
 $searchpolicies = check_acl($config['id'], 0, 'UM');
@@ -193,8 +192,7 @@ if ($policies !== false) {
 					  description LIKE '%".$stringSearchSQL."%'";
 
 
-    // q$totalPolicies = db_get_value_sql($sql);
-    $totalPolicies = count($policies);
+    $totalPolicies = db_get_value_sql($sql);
 } else {
     $totalPolicies = 0;
 }
diff --git a/pandora_console/operation/search_policies.php b/pandora_console/operation/search_policies.php
index 8f339b7c1b..c048e12c7c 100644
--- a/pandora_console/operation/search_policies.php
+++ b/pandora_console/operation/search_policies.php
@@ -14,7 +14,7 @@
 global $config;
 
 // require_once $config['homedir'].'/include/functions_status.php';
-require_once $config['homedir'].'/enterprise/include/functions_policies.php';
+enterprise_include_once('include/functions_policies.php');
 require_once $config['homedir'].'/enterprise/include/functions_groups.php';
 
 $searchpolicies = check_acl($config['id_user'], 0, 'UM');
diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php
index e4dbe38a0c..11b4aedec9 100644
--- a/pandora_console/operation/search_results.php
+++ b/pandora_console/operation/search_results.php
@@ -213,6 +213,7 @@ switch ($searchTab) {
         include_once 'search_maps.getdata.php';
         include_once 'search_modules.getdata.php';
         include_once 'search_helps.getdata.php';
+        include_once 'search_policies.getdata.php';
 
         include_once 'search_main.php';
     break;

From 9bc83b4ffd7c2275ab53a83ae237faef499f5d5b Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Tue, 4 Jun 2019 17:08:08 +0200
Subject: [PATCH 08/83] Add new else

---
 pandora_console/operation/search_graphs.getdata.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pandora_console/operation/search_graphs.getdata.php b/pandora_console/operation/search_graphs.getdata.php
index bd3159d72f..4dc6f3ba74 100644
--- a/pandora_console/operation/search_graphs.getdata.php
+++ b/pandora_console/operation/search_graphs.getdata.php
@@ -47,7 +47,7 @@ if ($searchGraphs) {
         $filter['limit'] = $config['block_size'];
         $filter['offset'] = (int) get_parameter('offset');
         $graphs = db_get_all_rows_filter('tgraph', $filter, $columns);
+    } else {
+        $totalGraphs = 0;
     }
-
-    $totalGraphs = 0;
 }

From 1ee347684e5357766142b3c4b0ff34f7dcf61ad8 Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Wed, 5 Jun 2019 10:17:28 +0200
Subject: [PATCH 09/83] Added condition if enterprise installed

---
 pandora_console/operation/search_main.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php
index f4ba5e3f91..2da3377ff4 100644
--- a/pandora_console/operation/search_main.php
+++ b/pandora_console/operation/search_main.php
@@ -69,7 +69,7 @@ $table->data[0][10] = html_print_image('images/reporting.png', true, ['title' =>
 $table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
 $table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Maps found')]);
 $table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
-if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
+if (enterprise_installed()) {
     $table->data[0][14] = html_print_image('images/policies.png', true, ['title' => __('Policies')]);
     $table->data[0][15] = "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalPolicies).'</a>';
 }

From 738958386a0e70e53823ca561e3457d0741dc8ed Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Tue, 11 Jun 2019 10:01:51 +0200
Subject: [PATCH 10/83] guardo cambios

---
 pandora_console/operation/search_main.php     |  2 +-
 .../operation/search_policies.getdata.php     | 20 ++++++++++++++++---
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php
index 2da3377ff4..b236539695 100644
--- a/pandora_console/operation/search_main.php
+++ b/pandora_console/operation/search_main.php
@@ -69,7 +69,7 @@ $table->data[0][10] = html_print_image('images/reporting.png', true, ['title' =>
 $table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
 $table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Maps found')]);
 $table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
-if (enterprise_installed()) {
+if (enterprise_installed() || is_metaconsole()) {
     $table->data[0][14] = html_print_image('images/policies.png', true, ['title' => __('Policies')]);
     $table->data[0][15] = "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalPolicies).'</a>';
 }
diff --git a/pandora_console/operation/search_policies.getdata.php b/pandora_console/operation/search_policies.getdata.php
index 0a28651e7a..0288c24d1b 100644
--- a/pandora_console/operation/search_policies.getdata.php
+++ b/pandora_console/operation/search_policies.getdata.php
@@ -177,19 +177,33 @@ if ($searchpolicies == 0) {
 }
 
 
-        $sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0);
+    $sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0);
 
 
     $policies = db_process_sql($sql);
 
+    $sql = "SELECT id_grupo FROM tusuario_perfil
+    WHERE   id_usuario LIKE '%".$config['id_user']."%'";
+
+    $groups_for_search = db_process_sql($sql);
+
+
+foreach ($policies as $p) {
+    foreach ($groups_for_search as $group) {
+        if ($p['id_group'] == $group['id_grupo'] || $group['id_grupo'] == 0) {
+            $policies_final = $p;
+        }
+    }
+}
+
+$policies = $policies_final;
 if ($policies !== false) {
     if ($only_count) {
         unset($policies);
     }
 
     $sql = "SELECT COUNT(id) AS count FROM tpolicies
-				WHERE name LIKE '%".$stringSearchSQL."%' OR
-					  description LIKE '%".$stringSearchSQL."%'";
+				WHERE id = '".$policies_final['id']."'";
 
 
     $totalPolicies = db_get_value_sql($sql);

From 23469796f89cdee6c959eeb75addc843e8f4f826 Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Tue, 11 Jun 2019 16:23:42 +0200
Subject: [PATCH 11/83] Limited result for user groups

---
 .../operation/search_policies.getdata.php     | 38 ++++++-------------
 1 file changed, 11 insertions(+), 27 deletions(-)

diff --git a/pandora_console/operation/search_policies.getdata.php b/pandora_console/operation/search_policies.getdata.php
index 0288c24d1b..980a71cec8 100644
--- a/pandora_console/operation/search_policies.getdata.php
+++ b/pandora_console/operation/search_policies.getdata.php
@@ -170,43 +170,27 @@ switch ($sortField) {
 }
 
 if ($searchpolicies == 0) {
-            $sql = "SELECT id, name, description, id_group, status FROM tpolicies
-				    WHERE   name LIKE '%".$stringSearchSQL."%' OR
-					        description LIKE '%".$stringSearchSQL."%'
-				    ORDER BY ".$order['field'].' '.$order['order'];
+    $user_groups = users_get_groups($config['id_user'], 'AR', false);
+    $id_user_groups = array_keys($user_groups);
+    $id_user_groups_str = implode(',', $id_user_groups);
+
+            $sql = "SELECT id, name, description, id_group, status
+					FROM tpolicies 
+					WHERE name LIKE '$stringSearchSQL'
+                    AND id_group IN ($id_user_groups_str)";
 }
 
 
-    $sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0);
-
+        $sql .= ' LIMIT '.$config['block_size'].' OFFSET '.get_parameter('offset', 0);
 
     $policies = db_process_sql($sql);
 
-    $sql = "SELECT id_grupo FROM tusuario_perfil
-    WHERE   id_usuario LIKE '%".$config['id_user']."%'";
-
-    $groups_for_search = db_process_sql($sql);
-
-
-foreach ($policies as $p) {
-    foreach ($groups_for_search as $group) {
-        if ($p['id_group'] == $group['id_grupo'] || $group['id_grupo'] == 0) {
-            $policies_final = $p;
-        }
-    }
-}
-
-$policies = $policies_final;
 if ($policies !== false) {
+    $totalPolicies = count($policies);
+
     if ($only_count) {
         unset($policies);
     }
-
-    $sql = "SELECT COUNT(id) AS count FROM tpolicies
-				WHERE id = '".$policies_final['id']."'";
-
-
-    $totalPolicies = db_get_value_sql($sql);
 } else {
     $totalPolicies = 0;
 }

From 4b224d1314d9b71dae9c58e94d3a7731193b471e Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Wed, 12 Jun 2019 10:13:37 +0200
Subject: [PATCH 12/83] ad coments and delete is_metaconsole() condition

---
 pandora_console/operation/search_main.php             | 2 +-
 pandora_console/operation/search_policies.getdata.php | 4 ++++
 pandora_console/operation/search_policies.php         | 1 -
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php
index b236539695..2da3377ff4 100644
--- a/pandora_console/operation/search_main.php
+++ b/pandora_console/operation/search_main.php
@@ -69,7 +69,7 @@ $table->data[0][10] = html_print_image('images/reporting.png', true, ['title' =>
 $table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
 $table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Maps found')]);
 $table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
-if (enterprise_installed() || is_metaconsole()) {
+if (enterprise_installed()) {
     $table->data[0][14] = html_print_image('images/policies.png', true, ['title' => __('Policies')]);
     $table->data[0][15] = "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalPolicies).'</a>';
 }
diff --git a/pandora_console/operation/search_policies.getdata.php b/pandora_console/operation/search_policies.getdata.php
index 980a71cec8..aec8298170 100644
--- a/pandora_console/operation/search_policies.getdata.php
+++ b/pandora_console/operation/search_policies.getdata.php
@@ -170,6 +170,10 @@ switch ($sortField) {
 }
 
 if ($searchpolicies == 0) {
+    /*
+        We take the user groups to get policies that meet the requirements of the search
+        and which the user have permission on this groups
+    */
     $user_groups = users_get_groups($config['id_user'], 'AR', false);
     $id_user_groups = array_keys($user_groups);
     $id_user_groups_str = implode(',', $id_user_groups);
diff --git a/pandora_console/operation/search_policies.php b/pandora_console/operation/search_policies.php
index c048e12c7c..a71d76a733 100644
--- a/pandora_console/operation/search_policies.php
+++ b/pandora_console/operation/search_policies.php
@@ -13,7 +13,6 @@
 // GNU General Public License for more details.
 global $config;
 
-// require_once $config['homedir'].'/include/functions_status.php';
 enterprise_include_once('include/functions_policies.php');
 require_once $config['homedir'].'/enterprise/include/functions_groups.php';
 

From f74b32fe3c120796c6fa185d595b3d3004c71e98 Mon Sep 17 00:00:00 2001
From: alejandro-campos <alejandro.campos@artica.es>
Date: Fri, 14 Jun 2019 10:34:51 +0200
Subject: [PATCH 13/83] Added more parameters to SAML configuration

---
 pandora_console/include/constants.php        |  8 ----
 pandora_console/include/functions_config.php | 48 ++++++++++++++++++++
 pandora_console/index.php                    |  4 +-
 3 files changed, 50 insertions(+), 10 deletions(-)

diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php
index 7266e9eff4..e9373ce2f3 100644
--- a/pandora_console/include/constants.php
+++ b/pandora_console/include/constants.php
@@ -526,14 +526,6 @@ define('NODE_MODULE', 1);
 define('NODE_PANDORA', 2);
 define('NODE_GENERIC', 3);
 
-// SAML attributes constants.
-define('SAML_ROLE_AND_TAG', 'eduPersonEntitlement');
-define('SAML_USER_DESC', 'commonName');
-define('SAML_ID_USER_IN_PANDORA', 'eduPersonTargetedId');
-define('SAML_GROUP_IN_PANDORA', 'schacHomeOrganization');
-define('SAML_MAIL_IN_PANDORA', 'mail');
-define('SAML_DEFAULT_PROFILES_AND_TAGS_FORM', 'urn:mace:rediris.es:entitlement:monitoring:');
-
 // Other constants.
 define('STATUS_OK', 0);
 define('STATUS_ERROR', 1);
diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php
index 87d0601a4f..24a9b7301d 100644
--- a/pandora_console/include/functions_config.php
+++ b/pandora_console/include/functions_config.php
@@ -652,6 +652,30 @@ function config_update_config()
                         $error_update[] = __('Saml path');
                     }
 
+                    if (!config_update_value('saml_source', get_parameter('saml_source'))) {
+                        $error_update[] = __('Saml source');
+                    }
+
+                    if (!config_update_value('saml_user_id', get_parameter('saml_user_id'))) {
+                        $error_update[] = __('Saml user id parameter');
+                    }
+
+                    if (!config_update_value('saml_mail', get_parameter('saml_mail'))) {
+                        $error_update[] = __('Saml mail parameter');
+                    }
+
+                    if (!config_update_value('saml_group_name', get_parameter('saml_group_name'))) {
+                        $error_update[] = __('Saml group name parameter');
+                    }
+
+                    if (!config_update_value('saml_profiles_and_tags', get_parameter('saml_profiles_and_tags'))) {
+                        $error_update[] = __('Saml profiles and tags parameter');
+                    }
+
+                    if (!config_update_value('saml_profile_tag_separator', get_parameter('saml_profile_tag_separator'))) {
+                        $error_update[] = __('Saml profile and tag separator');
+                    }
+
                     if (!config_update_value('double_auth_enabled', get_parameter('double_auth_enabled'))) {
                         $error_update[] = __('Double authentication');
                     }
@@ -2364,6 +2388,30 @@ function config_process_config()
         config_update_value('saml_path', '/opt/');
     }
 
+    if (!isset($config['saml_source'])) {
+        config_update_value('saml_source', '');
+    }
+
+    if (!isset($config['saml_user_id'])) {
+        config_update_value('saml_user_id', '');
+    }
+
+    if (!isset($config['saml_mail'])) {
+        config_update_value('saml_mail', '');
+    }
+
+    if (!isset($config['saml_group_name'])) {
+        config_update_value('saml_group_name', '');
+    }
+
+    if (!isset($config['saml_profiles_and_tags'])) {
+        config_update_value('saml_profiles_and_tags', '');
+    }
+
+    if (!isset($config['saml_profile_tag_separator'])) {
+        config_update_value('saml_profile_tag_separator', '');
+    }
+
     if (!isset($config['autoupdate'])) {
         config_update_value('autoupdate', 1);
     }
diff --git a/pandora_console/index.php b/pandora_console/index.php
index 06793c1a87..bb3500f721 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -366,7 +366,7 @@ if (! isset($config['id_user'])) {
             $nick_in_db = $saml_user_id;
             if (!$nick_in_db) {
                 include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
-                $as = new SimpleSAML_Auth_Simple('PandoraFMS');
+                $as = new SimpleSAML_Auth_Simple($config['saml_source']);
                 $as->logout();
             }
         } else {
@@ -868,7 +868,7 @@ if (isset($_GET['bye'])) {
 
     if ($config['auth'] == 'saml') {
         include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
-        $as = new SimpleSAML_Auth_Simple('PandoraFMS');
+        $as = new SimpleSAML_Auth_Simple($config['saml_source']);
         $as->logout();
     }
 

From 988eb2e257fdc7e3e2e0e937d475a2561f56762f Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Wed, 19 Jun 2019 17:36:55 +0200
Subject: [PATCH 14/83] Add module filter by text -#2094

---
 .../godmode/massive/massive_edit_modules.php  |  8 ++++
 .../include/javascript/pandora_modules.js     | 39 +++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php
index a803fa4725..1a18b410d5 100755
--- a/pandora_console/godmode/massive/massive_edit_modules.php
+++ b/pandora_console/godmode/massive/massive_edit_modules.php
@@ -388,6 +388,11 @@ $table->data['form_modules_4'][1] = html_print_select(
     true
 );
 
+$table->rowstyle['form_modules_filter'] = 'vertical-align: top;';
+$table->rowclass['form_modules_filter'] = 'select_modules_row select_modules_row_2';
+$table->data['form_modules_filter'][0] = __('Filter Modules');
+$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
+
 $table->rowstyle['form_modules_2'] = 'vertical-align: top;';
 $table->rowclass['form_modules_2'] = 'select_modules_row select_modules_row_2';
 $table->data['form_modules_2'][0] = __('Modules');
@@ -1247,6 +1252,9 @@ $(document).ready (function () {
                 });
                 $("#module_loading").hide ();
                 $("#module_name").removeAttr ("disabled");
+                //Filter modules. Call the function when the select is fully loaded.
+                var textNoData = "<?php echo __('None'); ?>";
+                filterByText($('#module_name'), $("#text-filter_modules"), textNoData);
             },
             "json"
         );
diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js
index 0487923b38..049bb9e96b 100644
--- a/pandora_console/include/javascript/pandora_modules.js
+++ b/pandora_console/include/javascript/pandora_modules.js
@@ -1223,3 +1223,42 @@ function get_explanation_recon_script(id, id_rt, url) {
 
   taskManager.addTask(xhr);
 }
+
+// Filter modules in a select (bulk operations)
+function filterByText(selectbox, textbox, textNoData) {
+  return selectbox.each(function() {
+    var select = selectbox;
+    var options = [];
+    $(select)
+      .find("option")
+      .each(function() {
+        options.push({ value: $(this).val(), text: $(this).text() });
+      });
+    $(select).data("options", options);
+    $(textbox).bind("change keyup", function() {
+      var options = $(select)
+        .empty()
+        .scrollTop(0)
+        .data("options");
+      var search = $(this).val();
+      var regex = new RegExp(search, "gi");
+      $.each(options, function(i) {
+        var option = options[i];
+        if (option.text.match(regex) !== null) {
+          $(select).append(
+            $("<option>")
+              .text(option.text)
+              .val(option.value)
+          );
+        }
+      });
+      if ($(select)[0].length == 0) {
+        $(select).append(
+          $("<option>")
+            .text(textNoData)
+            .val(textNoData)
+        );
+      }
+    });
+  });
+}

From c084adfa278caa730e0275629fc10de0ba3a2d9b Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Thu, 20 Jun 2019 09:31:36 +0200
Subject: [PATCH 15/83] Add module filter by text -#2094

---
 pandora_console/godmode/massive/massive_copy_modules.php | 8 ++++++++
 .../godmode/massive/massive_delete_modules.php           | 9 +++++++++
 2 files changed, 17 insertions(+)

diff --git a/pandora_console/godmode/massive/massive_copy_modules.php b/pandora_console/godmode/massive/massive_copy_modules.php
index b79a64460e..5ca25ebc11 100755
--- a/pandora_console/godmode/massive/massive_copy_modules.php
+++ b/pandora_console/godmode/massive/massive_copy_modules.php
@@ -177,6 +177,9 @@ $table->data['operations'][1] .= html_print_checkbox('copy_alerts', 1, true, tru
 $table->data['operations'][1] .= html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true);
 $table->data['operations'][1] .= '</span>';
 
+$table->data['form_modules_filter'][0] = __('Filter Modules');
+$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
+
 $table->data[1][0] = __('Modules');
 $table->data[1][1] = '<span class="with_modules'.(empty($modules) ? ' invisible' : '').'">';
 $table->data[1][1] .= html_print_select(
@@ -302,6 +305,8 @@ echo '<h3 class="error invisible" id="message">&nbsp;</h3>';
 ui_require_jquery_file('form');
 ui_require_jquery_file('pandora.controls');
 ?>
+
+<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
 <script type="text/javascript">
 /* <![CDATA[ */
 var module_alerts;
@@ -478,6 +483,9 @@ $(document).ready (function () {
                         }
                         $("#fieldset_targets").show ();
                         $("#target_modules, #target_alerts").enable ();
+                        //Filter modules. Call the function when the select is fully loaded.
+                        var textNoData = "<?php echo __('None'); ?>";
+                        filterByText($('#target_modules'), $("#text-filter_modules"), textNoData);
                     },
                     "json"
                 );
diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php
index 334669c2bf..c52878c5da 100755
--- a/pandora_console/godmode/massive/massive_delete_modules.php
+++ b/pandora_console/godmode/massive/massive_delete_modules.php
@@ -429,6 +429,11 @@ $table->data['form_modules_3'][1] = html_print_select(
 );
 $table->data['form_modules_3'][3] = '';
 
+$table->rowstyle['form_modules_filter'] = 'vertical-align: top;';
+$table->rowclass['form_modules_filter'] = 'select_modules_row select_modules_row_2';
+$table->data['form_modules_filter'][0] = __('Filter Modules');
+$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true);
+
 $table->rowstyle['form_modules_2'] = 'vertical-align: top;';
 $table->rowclass['form_modules_2'] = 'select_modules_row select_modules_row_2';
 $table->data['form_modules_2'][0] = __('Modules');
@@ -571,6 +576,7 @@ if ($selection_mode == 'modules') {
 }
 ?>
 
+<script type="text/javascript" src="include/javascript/pandora_modules.js"></script>
 <script type="text/javascript">
 /* <![CDATA[ */
 
@@ -650,6 +656,9 @@ $(document).ready (function () {
                 });
                 $("#module_loading").hide();
                 $("#module_name").removeAttr ("disabled");
+                //Filter modules. Call the function when the select is fully loaded.
+                var textNoData = "<?php echo __('None'); ?>";
+                filterByText($('#module_name'), $("#text-filter_modules"), textNoData);
             },
             "json"
         );

From 58009b43c66dd70625ec9038835a0eb7309ac54f Mon Sep 17 00:00:00 2001
From: alejandro-campos <alejandro.campos@artica.es>
Date: Fri, 21 Jun 2019 13:39:48 +0200
Subject: [PATCH 16/83] fix bug: custom graphs not showing properly

---
 pandora_console/include/functions_graph.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php
index 72bc9b5c91..b1e70b5c1a 100644
--- a/pandora_console/include/functions_graph.php
+++ b/pandora_console/include/functions_graph.php
@@ -2235,7 +2235,6 @@ function combined_graph_summatory_average(
                         $data_array_pop[$key_reverse] = array_pop(
                             $data_array_reverse[$key_reverse]
                         );
-                        $count_data_array_reverse--;
                     }
                 }
 
@@ -2287,6 +2286,7 @@ function combined_graph_summatory_average(
                 }
 
                 $count++;
+                $count_data_array_reverse--;
             }
 
             if ($summatory && isset($array_sum_reverse)

From 43b83af2c6eb0637425b428f57011378e3735daf Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Mon, 24 Jun 2019 11:59:17 +0200
Subject: [PATCH 17/83] Changed default images status set for css - #4195

---
 .../default/module_alertsfired_rounded.png    | Bin 251 -> 0 bytes
 .../default/module_critical_rounded.png       | Bin 250 -> 0 bytes
 .../default/module_no_data_rounded.png        | Bin 251 -> 0 bytes
 .../status_sets/default/module_ok_rounded.png | Bin 251 -> 0 bytes
 .../default/module_unknown_rounded.png        | Bin 246 -> 0 bytes
 .../default/module_warning_rounded.png        | Bin 249 -> 0 bytes
 pandora_console/include/ajax/module.php       |   2 +-
 pandora_console/include/functions_modules.php |  41 +++-
 pandora_console/include/functions_ui.php      | 179 ++++++++++++------
 pandora_console/include/styles/pandora.css    |  42 ++++
 pandora_console/include/styles/tree.css       |   4 +
 11 files changed, 201 insertions(+), 67 deletions(-)
 delete mode 100644 pandora_console/images/status_sets/default/module_alertsfired_rounded.png
 delete mode 100644 pandora_console/images/status_sets/default/module_critical_rounded.png
 delete mode 100644 pandora_console/images/status_sets/default/module_no_data_rounded.png
 delete mode 100644 pandora_console/images/status_sets/default/module_ok_rounded.png
 delete mode 100644 pandora_console/images/status_sets/default/module_unknown_rounded.png
 delete mode 100644 pandora_console/images/status_sets/default/module_warning_rounded.png

diff --git a/pandora_console/images/status_sets/default/module_alertsfired_rounded.png b/pandora_console/images/status_sets/default/module_alertsfired_rounded.png
deleted file mode 100644
index 7a9b5ae0cdbf28de7a92696c9381bfddecbcc168..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 251
zcmeAS@N?(olHy`uVBq!ia0vp^wm>Yy!3HERP1;@sq$EpRBT9nv(@M${i&7aJQ}UBi
z6+Ckj(^G>|6H_V+Po~-c70vZ@aSW-r_2$M#-UbDM*2FCvj`6NpBYRLVrs0s_ofAhK
zOIWg{We?6erEHc_()d`t(o!!ZUN0cQr%Ah8+Wu;om-@;nmi#A!cD$`vz<S4HrfS&7
z3Du4LhE?Gf57&o23k+5*S~}b2XgiNd#)Sor&1}3<2*wNfFOwR+Pg!GFW$=CZj<gQ}
qJKmnTr(U-zdg%+(hQrT<5*U88OKrVgzcLu;PzFy|KbLh*2~7arx?)BE

diff --git a/pandora_console/images/status_sets/default/module_critical_rounded.png b/pandora_console/images/status_sets/default/module_critical_rounded.png
deleted file mode 100644
index 7fceda18dad688b1eccc63bebbf6b27430565f5c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 250
zcmeAS@N?(olHy`uVBq!ia0vp^wm>Yy!3HERP1;@sq$EpRBT9nv(@M${i&7aJQ}UBi
z6+Ckj(^G>|6H_V+Po~-c70vN<aSW-r_2z~lZ-aqA>q9xN1B^lw8dxMGCpIXXxv2zj
zmNEzxFt|r>F*0A@fAaL#OD|6^m3<Y{<o)Q`i(4_?i#2;K&3mV3-jmB<4UZD@&8s-E
z_t0^Py;5^NT-VyPLQ{C>rO;`QoY|yIGA=A|Y-Zy{Fuw5LQh#vQRMCz9-9M4-JaQ?s
o$}8u~#70ZIwsY6y`Z2OG#6OnWnk?Aa2XrTcr>mdKI;Vst0D06|UjP6A

diff --git a/pandora_console/images/status_sets/default/module_no_data_rounded.png b/pandora_console/images/status_sets/default/module_no_data_rounded.png
deleted file mode 100644
index fd5e433ece26563296312403d351e64ecc4b0471..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 251
zcmeAS@N?(olHy`uVBq!ia0vp^wm>Yy!3HERP1;@sq$EpRBT9nv(@M${i&7aJQ}UBi
z6+Ckj(^G>|6H_V+Po~-c70vZ@aSW-r_2$Mx-Ub7K)`y2!78v$i5Zqv4(kFO><0#iu
z119N!;PV_Z2Su2;WB#k@U-!N`-CH}$r%Ahe_PtgoFZGpEE%&C(y?x650@Jo2G0%k+
zCz=l|m)NU4=fica&ns36@4RH@|51^dSIQ*g!UD%;HU#4r`(CvNwkpv*a%cZ)u9LJm
rms^_he)7FmH_fWu2d+O8Nnj9&liDgYZ{-c3Lm50>{an^LB{Ts5@*7@o

diff --git a/pandora_console/images/status_sets/default/module_ok_rounded.png b/pandora_console/images/status_sets/default/module_ok_rounded.png
deleted file mode 100644
index d47f2ef4ff90a0c2d335c60e338b2f1158c22948..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 251
zcmeAS@N?(olHy`uVBq!ia0vp^wm>Yy!3HERP1;@sq$EpRBT9nv(@M${i&7aJQ}UBi
z6+Ckj(^G>|6H_V+Po~-c70vZ@aSW-r_2xz(Z-ausu|ktZGleGJ0<{fIf;tbHJ$)A4
zIKU=#kVEb>>s&F5e>wO2r2Y5beZZJ36cc%eXS4Q_Ekdi$RC@fmvF13l?gOt=N}3}4
zJB5FUEG};q{uh-hXKFT4JNBujUCIK-W;R|alZ*>UjQ<O2neGK|I{M<?o%xSu9sGM^
pP5L)G$+U27*L+49v*`@X49A~IZEbz}K?dkh22WQ%mvv4FO#tsIUdaFe

diff --git a/pandora_console/images/status_sets/default/module_unknown_rounded.png b/pandora_console/images/status_sets/default/module_unknown_rounded.png
deleted file mode 100644
index 2ec6d98f39a059562c5107196a774513ecd58dad..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 246
zcmeAS@N?(olHy`uVBq!ia0vp^wm>Yy!3HERP1;@sq$EpRBT9nv(@M${i&7aJQ}UBi
z6+Ckj(^G>|6H_V+Po~-c70vK;aSW-r_2z~nZ-W6(>%&H-f(8~9g~sUf9tQ-kuVUb|
zVBnnWAg<Tk(D*L?(<M{u+RSZ-oiqwUD;KZooqF+-W%0aezAoq3Zyne>_39-Hxlbt{
zRNdwI)c<U~WtF|lX<bSD^dA!%*?6T)GA=A|Y(_BtHs9m=;C6c6;^zhRUDa&om4sG*
l?_9;_cd?pj`B~Ki3==e^wjNCs-3N3dgQu&X%Q~loCIHe5UW@<$

diff --git a/pandora_console/images/status_sets/default/module_warning_rounded.png b/pandora_console/images/status_sets/default/module_warning_rounded.png
deleted file mode 100644
index c28924178df6993295d3ef46c601b8e89ed6863d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 249
zcmeAS@N?(olHy`uVBq!ia0vp^wm>Yy!3HERP1;@sq$EpRBT9nv(@M${i&7aJQ}UBi
z6+Ckj(^G>|6H_V+Po~-c70vc^aSW-r_2z~lZ-aqA>%-=mj4~TaU73V7G_+V9;`B&J
zW#Z)Fc)-QX%gB6v|H;!|FTFgyR90)!gHw;5MJ%~;DKjhioUgIyyH)&A2YaUl2205m
zt^c6tww_J>&(>8oS+88yl}uj#V?rYvuarr~g$0hy2*%&$c|srF&9Zc>-f4eSx4HIV
o%K3Zh$CcIwevvtlSj=U>py(^MH8r_+1JIcap00i_>zopr0Q5dzRR910

diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php
index ef998be34a..5ec365849e 100755
--- a/pandora_console/include/ajax/module.php
+++ b/pandora_console/include/ajax/module.php
@@ -1011,7 +1011,7 @@ if (check_login()) {
                 $title
             );
 
-            $data[5] = ui_print_module_status($module['estado'], $title, true, false, true);
+            $data[5] = ui_print_status_image($status, $title, true);
             if (!$show_context_help_first_time) {
                 $show_context_help_first_time = true;
 
diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php
index 0335e851c9..8e42c186fb 100755
--- a/pandora_console/include/functions_modules.php
+++ b/pandora_console/include/functions_modules.php
@@ -2308,32 +2308,67 @@ function modules_get_color_status($status)
         return COL_UNKNOWN;
     }
 
-    switch ($status) {
-        case AGENT_MODULE_STATUS_NORMAL:
-        case AGENT_STATUS_NORMAL:
+    switch ((string) $status) {
+        case (string) AGENT_MODULE_STATUS_NORMAL:
+        case (string) AGENT_STATUS_NORMAL:
+        case STATUS_MODULE_OK:
+        case STATUS_AGENT_OK:
+        case STATUS_ALERT_NOT_FIRED:
+        case STATUS_SERVER_OK:
+        case STATUS_MODULE_OK_BALL:
+        case STATUS_AGENT_OK_BALL:
+        case STATUS_ALERT_NOT_FIRED_BALL:
         return COL_NORMAL;
 
         case AGENT_MODULE_STATUS_NOT_INIT:
         case AGENT_STATUS_NOT_INIT:
+        case STATUS_MODULE_NO_DATA:
+        case STATUS_AGENT_NOT_INIT:
+        case STATUS_AGENT_NO_DATA:
+        case STATUS_MODULE_NO_DATA_BALL:
+        case STATUS_AGENT_NO_DATA_BALL:
+        case STATUS_AGENT_NO_MONITORS_BALL:
         return COL_NOTINIT;
 
         case AGENT_MODULE_STATUS_CRITICAL_BAD:
         case AGENT_STATUS_CRITICAL:
+        case STATUS_MODULE_CRITICAL:
+        case STATUS_AGENT_CRITICAL:
+        case STATUS_MODULE_CRITICAL_BALL:
+        case STATUS_AGENT_CRITICAL_BALL:
         return COL_CRITICAL;
 
         case AGENT_MODULE_STATUS_WARNING:
         case AGENT_STATUS_WARNING:
+        case STATUS_MODULE_WARNING:
+        case STATUS_AGENT_WARNING:
+        case STATUS_MODULE_WARNING_BALL:
+        case STATUS_AGENT_WARNING_BALL:
         return COL_WARNING;
 
         case AGENT_MODULE_STATUS_CRITICAL_ALERT:
         case AGENT_MODULE_STATUS_WARNING_ALERT:
         case AGENT_STATUS_ALERT_FIRED:
+        case STATUS_ALERT_FIRED:
+        case STATUS_ALERT_FIRED_BALL:
         return COL_ALERTFIRED;
 
         case AGENT_MODULE_STATUS_UNKNOWN:
         case AGENT_STATUS_UNKNOWN:
+        case STATUS_MODULE_UNKNOWN:
+        case STATUS_AGENT_UNKNOWN:
+        case STATUS_AGENT_DOWN:
+        case STATUS_ALERT_DISABLED:
+        case STATUS_MODULE_UNKNOWN_BALL:
+        case STATUS_AGENT_UNKNOWN_BALL:
+        case STATUS_AGENT_DOWN_BALL:
+        case STATUS_ALERT_DISABLED_BALL:
         return COL_UNKNOWN;
 
+        case STATUS_SERVER_DOWN:
+        case STATUS_SERVER_DOWN_BALL:
+        return '#444';
+
         default:
             // Ignored.
         break;
diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php
index ea07c20d6a..9ffb578a07 100755
--- a/pandora_console/include/functions_ui.php
+++ b/pandora_console/include/functions_ui.php
@@ -2592,12 +2592,12 @@ function ui_get_status_images_path()
 /**
  * Prints an image representing a status.
  *
- * @param string  $type          Type.
- * @param string  $title         Title.
- * @param boolean $return        Whether to return an output string or echo now (optional, echo by default).
- * @param array   $options       Options to set image attributes: I.E.: style.
- * @param string  $path          Path of the image, if not provided use the status path.
- * @param boolean $rounded_image Round.
+ * @param string  $type           Type.
+ * @param string  $title          Title.
+ * @param boolean $return         Whether to return an output string or echo now (optional, echo by default).
+ * @param array   $options        Options to set image attributes: I.E.: style.
+ * @param string  $path           Path of the image, if not provided use the status path.
+ * @param boolean $image_with_css Don't use an image. Draw an image with css styles.
  *
  * @return string HTML code if return parameter is true.
  */
@@ -2607,37 +2607,8 @@ function ui_print_status_image(
     $return=false,
     $options=false,
     $path=false,
-    $rounded_image=false
+    $image_with_css=false
 ) {
-    // This is for the List of Modules in Agent View.
-    if ($rounded_image === true) {
-        switch ($type) {
-            case 'module_ok.png':
-                $type = 'module_ok_rounded.png';
-            break;
-
-            case 'module_critical.png':
-                $type = 'module_critical_rounded.png';
-            break;
-
-            case 'module_warning.png':
-                $type = 'module_warning_rounded.png';
-            break;
-
-            case 'module_no_data.png':
-                $type = 'module_no_data_rounded.png';
-            break;
-
-            case 'module_unknown.png':
-                $type = 'module_unknown_rounded.png';
-            break;
-
-            default:
-                $type = $type;
-            break;
-        }
-    }
-
     if ($path === false) {
         $imagepath_array = ui_get_status_images_path();
         $imagepath = $imagepath_array[0];
@@ -2645,35 +2616,112 @@ function ui_print_status_image(
         $imagepath = $path;
     }
 
-    $imagepath .= '/'.$type;
-
-    if ($options === false) {
-        $options = [];
+    if ($imagepath == 'images/status_sets/default') {
+        $image_with_css = true;
     }
 
-    $options['title'] = $title;
+    $imagepath .= '/'.$type;
 
-    return html_print_image($imagepath, $return, $options, false, false, false, true);
+    if ($image_with_css === true) {
+        $shape_status = get_shape_status_set($type);
+        return ui_print_status_sets($type, $title, $return, $shape_status);
+    } else {
+        if ($options === false) {
+            $options = [];
+        }
+
+        $options['title'] = $title;
+
+        return html_print_image($imagepath, $return, $options, false, false, false, true);
+    }
+}
+
+
+/**
+ * Get the shape of an image by assigning it a CSS class. Prints an image with CSS representing a status.
+ *
+ * @param string $type Module/Agent/Alert status.
+ *
+ * @return array With CSS class.
+ */
+function get_shape_status_set($type)
+{
+    switch ($type) {
+        // Small rectangles.
+        case STATUS_ALERT_NOT_FIRED:
+        case STATUS_ALERT_FIRED:
+        case STATUS_ALERT_DISABLED:
+            $return = ['class' => 'status_small_rectangles'];
+        break;
+
+        // Rounded rectangles.
+        case STATUS_MODULE_OK:
+        case STATUS_AGENT_OK:
+        case STATUS_MODULE_NO_DATA:
+        case STATUS_AGENT_NO_DATA:
+        case STATUS_MODULE_CRITICAL:
+        case STATUS_AGENT_CRITICAL:
+        case STATUS_MODULE_WARNING:
+        case STATUS_AGENT_WARNING:
+        case STATUS_MODULE_UNKNOWN:
+        case STATUS_AGENT_UNKNOWN:
+        case STATUS_AGENT_DOWN:
+            $return = ['class' => 'status_rounded_rectangles'];
+        break;
+
+        // Small squares.
+        case STATUS_SERVER_OK:
+        case STATUS_SERVER_DOWN:
+            $return = ['class' => 'status_small_squares'];
+        break;
+
+        // Balls.
+        case STATUS_AGENT_CRITICAL_BALL:
+        case STATUS_AGENT_WARNING_BALL:
+        case STATUS_AGENT_DOWN_BALL:
+        case STATUS_AGENT_UNKNOWN_BALL:
+        case STATUS_AGENT_OK_BALL:
+        case STATUS_AGENT_NO_DATA_BALL:
+        case STATUS_AGENT_NO_MONITORS_BALL:
+            $return = ['class' => 'status_balls'];
+        break;
+
+        // Small Balls.
+        case STATUS_MODULE_OK_BALL:
+        case STATUS_MODULE_CRITICAL_BALL:
+        case STATUS_MODULE_WARNING_BALL:
+        case STATUS_MODULE_NO_DATA_BALL:
+        case STATUS_MODULE_UNKNOWN_BALL:
+        case STATUS_ALERT_FIRED_BALL:
+        case STATUS_ALERT_NOT_FIRED_BALL:
+        case STATUS_ALERT_DISABLED_BALL:
+            $return = ['class' => 'status_small_balls'];
+        break;
+
+        default:
+            // Ignored.
+        break;
+    }
+
+    return $return;
 }
 
 
 /**
  * Prints an image representing a status.
  *
- * @param string  $status        Module status.
- * @param string  $title         Title.
- * @param boolean $return        Whether to return an output string or echo now (optional, echo by default).
- * @param array   $options       Options to set image attributes: I.E.: style.
- * @param boolean $rounded_image Round.
+ * @param string  $status  Module status.
+ * @param string  $title   Title.
+ * @param boolean $return  Whether to return an output string or echo now (optional, echo by default).
+ * @param array   $options Options to set image attributes: I.E.: style.
  *
  * @return string HTML.
  */
-function ui_print_module_status(
+function ui_print_status_sets(
     $status,
     $title='',
     $return=false,
-    $options=false,
-    $rounded_image=false
+    $options=false
 ) {
     global $config;
 
@@ -2681,21 +2729,26 @@ function ui_print_module_status(
         $options = [];
     }
 
-    $options['style'] .= 'width: 50px;';
-    $options['style'] .= 'height: 2em;';
-    $options['style'] .= 'display: inline-block;';
-
-    include_once __DIR__.'/functions_modules.php';
-    $options['style'] .= 'background: '.modules_get_color_status($status).';';
-
-    if ($rounded_image === true) {
-        $options['style'] .= 'border-radius: 5px;';
+    if (isset($options['style'])) {
+        $options['style'] .= ' background: '.modules_get_color_status($status).'; display: inline-block;';
+    } else {
+        $options['style'] = 'background: '.modules_get_color_status($status).'; display: inline-block;';
     }
 
-    $options['title'] = $title;
-    $options['data-title'] = $title;
-    $options['data-use_title_for_force_title'] = 1;
-    $options['class'] = 'forced_title';
+    if (isset($options['class'])) {
+        $options['class'] = $options['class'];
+    }
+
+    if ($title != '') {
+        $options['title'] = $title;
+        $options['data-title'] = $title;
+        $options['data-use_title_for_force_title'] = 1;
+        if (isset($options['class'])) {
+            $options['class'] .= ' forced_title';
+        } else {
+            $options['class'] = 'forced_title';
+        }
+    }
 
     $output = '<div ';
     foreach ($options as $k => $v) {
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index 06507058ee..002a20db79 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -5803,3 +5803,45 @@ div#status_pie {
   align-items: center;
   grid-template-columns: 50px auto;
 }
+
+/*
+ * ---------------------------------------------------------------------
+ * - IMAGES FOR STATUS. This replaces the images of /images/status_sets/default/ 
+ * - Don't delete this
+ * ---------------------------------------------------------------------
+ */
+.status_small_rectangles {
+  width: 20px;
+  height: 10px;
+  display: inline-block;
+}
+
+.status_rounded_rectangles {
+  width: 50px;
+  height: 2em;
+  display: inline-block;
+  border-radius: 5px;
+}
+
+.status_small_squares,
+.status_balls {
+  width: 12px;
+  height: 12px;
+  display: inline-block;
+}
+
+.status_balls {
+  border-radius: 50%;
+}
+
+.status_small_balls {
+  width: 8px;
+  height: 8px;
+  display: inline-block;
+  border-radius: 50%;
+}
+/*
+ * ---------------------------------------------------------------------
+ * - END - IMAGES FOR STATUS. Don't delete this
+ * ---------------------------------------------------------------------
+ */
diff --git a/pandora_console/include/styles/tree.css b/pandora_console/include/styles/tree.css
index f35339a886..42649bd048 100644
--- a/pandora_console/include/styles/tree.css
+++ b/pandora_console/include/styles/tree.css
@@ -138,3 +138,7 @@ div#tree-controller-recipient {
   width: 98%;
   margin-top: 10px;
 }
+
+.tree-node > .node-content > div + div:not(.tree-node-counters) {
+  margin-left: 3px;
+}

From f69fea81c281524f81cca2f2d2d7438bd53de750 Mon Sep 17 00:00:00 2001
From: Luis Calvo <luis.calvo@artica.es>
Date: Tue, 25 Jun 2019 14:28:33 +0200
Subject: [PATCH 18/83] Added satellite remote conficg check in snmp wizard

---
 .../agent_wizard.snmp_interfaces_explorer.php | 36 +++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php
index b08dc62c4f..2dca9353ac 100644
--- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php
+++ b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php
@@ -23,7 +23,6 @@ $idAgent = (int) get_parameter('id_agente', 0);
 $ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent);
 
 check_login();
-
 $ip_target = (string) get_parameter('ip_target', $ipAgent);
 $use_agent = get_parameter('use_agent');
 $snmp_community = (string) get_parameter('snmp_community', 'public');
@@ -469,6 +468,9 @@ if (enterprise_installed()) {
         if ($row['server_type'] != 13) {
             $s_type = ' (Standard)';
         } else {
+            // Check if satellite server has remote configuration enabled
+            $satellite_remote = config_agents_has_remote_configuration($id_agent);
+            $id_satellite = $row['id_server'];
             $s_type = ' (Satellite)';
         }
 
@@ -477,7 +479,17 @@ if (enterprise_installed()) {
 }
 
 $table->data[1][2] = '<b>'.__('Server to execute command').'</b>';
-$table->data[1][3] = html_print_select($servers_to_exec, 'server_to_exec', $server_to_exec, '', '', '', true);
+$table->data[1][2] .= '<span id=satellite_remote_tip>'.ui_print_help_tip(__('In order to use remote executions you need to enable remote execution in satellite server'), true, 'images/tip_help.png', false, 'display:').'</span>';
+$table->data[1][4] = html_print_select(
+    $servers_to_exec,
+    'server_to_exec',
+    $server_to_exec,
+    'satellite_remote_warn('.$id_satellite.','.$satellite_remote.')
+',
+    '',
+    '',
+    true
+);
 
 $snmp_versions['1'] = 'v. 1';
 $snmp_versions['2'] = 'v. 2';
@@ -607,8 +619,12 @@ ui_require_jquery_file('bgiframe');
 /* <![CDATA[ */
 
 $(document).ready (function () {
+
+
     var inputActive = true;
 
+    $('#server_to_exec option').trigger('change');
+    
     $(document).data('text_for_module', $("#none_text").html());
 
     $("#id_snmp").change(snmp_changed_by_multiple_snmp);
@@ -628,6 +644,7 @@ $(document).ready (function () {
         $("#no_snmp").hide ();
         $("#form_interfaces").hide ();
     });
+
 });
 
 function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
@@ -682,5 +699,20 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
         "json");
 }
 
+
+function satellite_remote_warn(id_satellite, remote)
+{
+    if(!remote)
+    {
+        $('#server_to_exec option[value='+id_satellite+']').prop('disabled', true);
+        $('#satellite_remote_tip').removeAttr("style").show();
+    }
+    else
+    {
+        $('#satellite_remote_tip').removeAttr("style").hide();
+    }
+
+}
+
 /* ]]> */
 </script>

From 058abdd552c986199450fc4e5fcf736f0ce5687c Mon Sep 17 00:00:00 2001
From: alejandro-campos <alejandro.campos@artica.es>
Date: Wed, 26 Jun 2019 17:17:56 +0200
Subject: [PATCH 19/83] Add condition in tactical view to exclude disabled
 alerts from count of triggered alerts

---
 pandora_console/include/functions_tactical.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pandora_console/include/functions_tactical.php b/pandora_console/include/functions_tactical.php
index c10f194386..39f44a9beb 100644
--- a/pandora_console/include/functions_tactical.php
+++ b/pandora_console/include/functions_tactical.php
@@ -444,7 +444,7 @@ function tactical_monitor_fired_alerts($group_array, $strict_user=false, $id_gro
 		WHERE tagente.id_grupo IN $group_clause_strict AND tagente_modulo.id_agente = tagente.id_agente
 			AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
 			AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo 
-			AND times_fired > 0 ";
+			AND times_fired > 0 AND talert_template_modules.disabled = 0";
 
         $count = db_get_sql($sql);
         return $count;
@@ -456,7 +456,7 @@ function tactical_monitor_fired_alerts($group_array, $strict_user=false, $id_gro
 			WHERE tagente.id_grupo IN $group_clause AND tagente_modulo.id_agente = tagente.id_agente
 				AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
 				AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo 
-				AND times_fired > 0"
+				AND times_fired > 0 AND talert_template_modules.disabled = 0"
         );
     }
 

From 3d75e045f9f9141dc421659ef1c84934b7939722 Mon Sep 17 00:00:00 2001
From: alejandro-campos <alejandro.campos@artica.es>
Date: Thu, 27 Jun 2019 17:42:29 +0200
Subject: [PATCH 20/83] added new fields to saml configuration and added check
 to not allow user creation with all group in case an empty value was
 specified in group name attribute input

---
 pandora_console/include/functions_config.php | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php
index 5a11249f74..61e16be8ab 100644
--- a/pandora_console/include/functions_config.php
+++ b/pandora_console/include/functions_config.php
@@ -668,10 +668,22 @@ function config_update_config()
                         $error_update[] = __('Saml group name parameter');
                     }
 
+                    if (!config_update_value('saml_attr_type', (bool) get_parameter('saml_attr_type'))) {
+                        $error_update[] = __('Saml attr type parameter');
+                    }
+
                     if (!config_update_value('saml_profiles_and_tags', get_parameter('saml_profiles_and_tags'))) {
                         $error_update[] = __('Saml profiles and tags parameter');
                     }
 
+                    if (!config_update_value('saml_profile', get_parameter('saml_profile'))) {
+                        $error_update[] = __('Saml profile parameters');
+                    }
+
+                    if (!config_update_value('saml_tag', get_parameter('saml_tag'))) {
+                        $error_update[] = __('Saml tag parameter');
+                    }
+
                     if (!config_update_value('saml_profile_tag_separator', get_parameter('saml_profile_tag_separator'))) {
                         $error_update[] = __('Saml profile and tag separator');
                     }
@@ -2404,10 +2416,22 @@ function config_process_config()
         config_update_value('saml_group_name', '');
     }
 
+    if (!isset($config['saml_attr_type'])) {
+        config_update_value('saml_attr_type', false);
+    }
+
     if (!isset($config['saml_profiles_and_tags'])) {
         config_update_value('saml_profiles_and_tags', '');
     }
 
+    if (!isset($config['saml_profile'])) {
+        config_update_value('saml_profile', '');
+    }
+
+    if (!isset($config['saml_tag'])) {
+        config_update_value('saml_tag', '');
+    }
+
     if (!isset($config['saml_profile_tag_separator'])) {
         config_update_value('saml_profile_tag_separator', '');
     }

From 63e0df4434e62781057ae94bc9358f00ef3e7172 Mon Sep 17 00:00:00 2001
From: Daniel Maya <daniel.maya@artica.es>
Date: Fri, 28 Jun 2019 12:11:25 +0200
Subject: [PATCH 21/83] Fixed unordered groups

---
 pandora_console/godmode/agentes/modificar_agente.php | 2 +-
 pandora_console/include/functions_users.php          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php
index 9e7ce18c4e..4f51ede323 100644
--- a/pandora_console/godmode/agentes/modificar_agente.php
+++ b/pandora_console/godmode/agentes/modificar_agente.php
@@ -163,7 +163,7 @@ echo '<td>';
 
 echo __('Group').'&nbsp;';
 $own_info = get_user_info($config['id_user']);
-if (!$own_info['is_admin'] && check_acl($config['id_user'], 0, 'AW')) {
+if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_acl($config['id_user'], 0, 'AW')) {
     $return_all_group = false;
 } else {
     $return_all_group = true;
diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php
index 3b4af210d0..d461ca9754 100755
--- a/pandora_console/include/functions_users.php
+++ b/pandora_console/include/functions_users.php
@@ -293,7 +293,7 @@ function users_get_groups(
         }
         // Per-group permissions.
         else {
-            $query  = 'SELECT * FROM tgrupo ORDER BY parent,id_grupo DESC';
+            $query  = 'SELECT * FROM tgrupo ORDER BY nombre';
             $raw_groups = db_get_all_rows_sql($query);
 
             $query = sprintf(

From a6327a16ad6f3493e07c5e421ed10700458754bf Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Mon, 1 Jul 2019 12:46:09 +0200
Subject: [PATCH 22/83] Session expiration ignoring notifications checks

---
 pandora_console/ajax.php                     |  55 +++++---
 pandora_console/include/functions_config.php |  12 +-
 pandora_console/include/load_session.php     | 130 ++++++++++++++++---
 3 files changed, 159 insertions(+), 38 deletions(-)

diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php
index 92f6c146bc..beb07e7752 100644
--- a/pandora_console/ajax.php
+++ b/pandora_console/ajax.php
@@ -1,17 +1,34 @@
 <?php
+/**
+ * Ajax handler.
+ *
+ * @category   Ajax handler.
+ * @package    Pandora FMS.
+ * @subpackage OpenSource.
+ * @version    1.0.0
+ * @license    See below
+ *
+ *    ______                 ___                    _______ _______ ________
+ *   |   __ \.-----.--.--.--|  |.-----.----.-----. |    ___|   |   |     __|
+ *  |    __/|  _  |     |  _  ||  _  |   _|  _  | |    ___|       |__     |
+ * |___|   |___._|__|__|_____||_____|__| |___._| |___|   |__|_|__|_______|
+ *
+ * ============================================================================
+ * Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
+ * Please see http://pandorafms.org for full contribution list
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation for version 2.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * ============================================================================
+ */
+
+// Begin.
+define('AJAX', true);
 
-// Pandora FMS - http://pandorafms.com
-// ==================================================
-// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
-// Please see http://pandorafms.org for full contribution list
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License
-// as published by the Free Software Foundation; version 2
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-// Enable profiler for testing
 if (!defined('__PAN_XHPROF__')) {
     define('__PAN_XHPROF__', 0);
 }
@@ -56,7 +73,7 @@ if (isset($_GET['loginhash'])) {
 
 $public_hash = get_parameter('hash', false);
 
-// Check user
+// Check user.
 if ($public_hash == false) {
     check_login();
 } else {
@@ -68,9 +85,9 @@ if ($public_hash == false) {
     }
 }
 
-define('AJAX', true);
 
-// Enterprise support
+
+// Enterprise support.
 if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
     include_once ENTERPRISE_DIR.'/load_enterprise.php';
 }
@@ -86,11 +103,9 @@ if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
     $config['relative_path'] = enterprise_hook('skins_set_image_skin_path', [$config['id_user']]);
 }
 
-if (isset($config['metaconsole'])) {
-    // Not cool way of know if we are executing from metaconsole or normal console
-    if ($config['metaconsole']) {
-        define('METACONSOLE', true);
-    }
+if (is_metaconsole()) {
+    // Backward compatibility.
+    define('METACONSOLE', true);
 }
 
 if (file_exists($page)) {
diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php
index 1d346f3b6d..9196168901 100644
--- a/pandora_console/include/functions_config.php
+++ b/pandora_console/include/functions_config.php
@@ -2879,7 +2879,17 @@ function config_prepare_session()
 
     // Reset the expiration time upon page load //session_name() is default name of session PHPSESSID.
     if (isset($_COOKIE[session_name()])) {
-        setcookie(session_name(), $_COOKIE[session_name()], (time() + $sessionCookieExpireTime), '/');
+        $update_cookie = true;
+        if (is_ajax()) {
+            // Avoid session upadte while processing ajax responses - notifications.
+            if (get_parameter('check_new_notifications', false)) {
+                $update_cookie = false;
+            }
+        }
+
+        if ($update_cookie === true) {
+            setcookie(session_name(), $_COOKIE[session_name()], (time() + $sessionCookieExpireTime), '/');
+        }
     }
 
     ini_set('post_max_size', $config['max_file_size']);
diff --git a/pandora_console/include/load_session.php b/pandora_console/include/load_session.php
index 22a7226a8f..99bae81244 100644
--- a/pandora_console/include/load_session.php
+++ b/pandora_console/include/load_session.php
@@ -1,32 +1,75 @@
 <?php
+/**
+ * Session manager.
+ *
+ * @category   Session handler.
+ * @package    Pandora FMS.
+ * @subpackage OpenSource.
+ * @version    1.0.0
+ * @license    See below
+ *
+ *    ______                 ___                    _______ _______ ________
+ *   |   __ \.-----.--.--.--|  |.-----.----.-----. |    ___|   |   |     __|
+ *  |    __/|  _  |     |  _  ||  _  |   _|  _  | |    ___|       |__     |
+ * |___|   |___._|__|__|_____||_____|__| |___._| |___|   |__|_|__|_______|
+ *
+ * ============================================================================
+ * Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
+ * Please see http://pandorafms.org for full contribution list
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation for version 2.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * ============================================================================
+ */
 
-// Pandora FMS - http://pandorafms.com
-// ==================================================
-// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
-// Please see http://pandorafms.org for full contribution list
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the  GNU Lesser General Public License
-// as published by the Free Software Foundation; version 2
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// Begin.
+
+
+/**
+ * Open session.
+ *
+ * @param string $save_path    Save path.
+ * @param string $session_name Session name.
+ *
+ * @return boolean
+ */
 function pandora_session_open($save_path, $session_name)
 {
     return true;
 }
 
 
+/**
+ * Close session.
+ *
+ * @return boolean
+ */
 function pandora_session_close()
 {
     return true;
 }
 
 
+/**
+ * Read a session.
+ *
+ * @param string $session_id Session ID.
+ *
+ * @return string Session data.
+ */
 function pandora_session_read($session_id)
 {
     $session_id = addslashes($session_id);
-    $session_data = db_get_value('data', 'tsessions_php', 'id_session', $session_id);
+    $session_data = db_get_value(
+        'data',
+        'tsessions_php',
+        'id_session',
+        $session_id
+    );
 
     if (!empty($session_data)) {
         return $session_data;
@@ -36,10 +79,25 @@ function pandora_session_read($session_id)
 }
 
 
+/**
+ * Write session data.
+ *
+ * @param string $session_id Session id.
+ * @param string $data       Data.
+ *
+ * @return boolean
+ */
 function pandora_session_write($session_id, $data)
 {
     $session_id = addslashes($session_id);
 
+    if (is_ajax()) {
+        // Avoid session upadte while processing ajax responses - notifications.
+        if (get_parameter('check_new_notifications', false)) {
+            return false;
+        }
+    }
+
     $values = [];
     $values['last_active'] = time();
 
@@ -47,29 +105,55 @@ function pandora_session_write($session_id, $data)
         $values['data'] = addslashes($data);
     }
 
-    $session_exists = (bool) db_get_value('COUNT(id_session)', 'tsessions_php', 'id_session', $session_id);
+    $session_exists = (bool) db_get_value(
+        'COUNT(id_session)',
+        'tsessions_php',
+        'id_session',
+        $session_id
+    );
 
     if (!$session_exists) {
         $values['id_session'] = $session_id;
         $retval_write = db_process_sql_insert('tsessions_php', $values);
     } else {
-        $retval_write = db_process_sql_update('tsessions_php', $values, ['id_session' => $session_id]);
+        $retval_write = db_process_sql_update(
+            'tsessions_php',
+            $values,
+            ['id_session' => $session_id]
+        );
     }
 
     return $retval_write !== false;
 }
 
 
+/**
+ * Destroy a session.
+ *
+ * @param string $session_id Session Id.
+ *
+ * @return boolean
+ */
 function pandora_session_destroy($session_id)
 {
     $session_id = addslashes($session_id);
 
-    $retval = (bool) db_process_sql_delete('tsessions_php', ['id_session' => $session_id]);
+    $retval = (bool) db_process_sql_delete(
+        'tsessions_php',
+        ['id_session' => $session_id]
+    );
 
     return $retval;
 }
 
 
+/**
+ * Session garbage collector.
+ *
+ * @param integer $max_lifetime Max lifetime.
+ *
+ * @return boolean.
+ */
 function pandora_session_gc($max_lifetime=300)
 {
     global $config;
@@ -80,7 +164,12 @@ function pandora_session_gc($max_lifetime=300)
 
     $time_limit = (time() - $max_lifetime);
 
-    $retval = (bool) db_process_sql_delete('tsessions_php', ['last_active' => '<'.$time_limit]);
+    $retval = (bool) db_process_sql_delete(
+        'tsessions_php',
+        [
+            'last_active' => '<'.$time_limit,
+        ]
+    );
 
     return $retval;
 }
@@ -88,5 +177,12 @@ function pandora_session_gc($max_lifetime=300)
 
 // FIXME: SAML should work with pandora session handlers
 if (db_get_value('value', 'tconfig', 'token', 'auth') != 'saml') {
-    $result_handler = session_set_save_handler('pandora_session_open', 'pandora_session_close', 'pandora_session_read', 'pandora_session_write', 'pandora_session_destroy', 'pandora_session_gc');
+    $result_handler = session_set_save_handler(
+        'pandora_session_open',
+        'pandora_session_close',
+        'pandora_session_read',
+        'pandora_session_write',
+        'pandora_session_destroy',
+        'pandora_session_gc'
+    );
 }

From 6349c29eb50b052e63cdcf0273460f93b9c559f7 Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Mon, 1 Jul 2019 13:45:42 +0200
Subject: [PATCH 23/83] Add message for autenticaition error SAML

---
 pandora_console/general/noaccesssaml.php | 164 ++++++++++++++++++++++
 pandora_console/include/auth/saml.php    | 166 +++++++++++++++++++++++
 pandora_console/index.php                |  11 +-
 3 files changed, 338 insertions(+), 3 deletions(-)
 create mode 100644 pandora_console/general/noaccesssaml.php
 create mode 100755 pandora_console/include/auth/saml.php

diff --git a/pandora_console/general/noaccesssaml.php b/pandora_console/general/noaccesssaml.php
new file mode 100644
index 0000000000..e357e040dc
--- /dev/null
+++ b/pandora_console/general/noaccesssaml.php
@@ -0,0 +1,164 @@
+<html>
+<head>
+    
+<style>
+
+#alert_messages_na{
+    z-index:2;
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    transform: translate(-50%, -50%);
+    -webkit-transform: translate(-50%, -50%);   
+    width:650px;
+    height: 400px;
+    background:white;
+    background-image:url('images/imagen-no-acceso.jpg');
+    background-repeat:no-repeat;
+    justify-content: center;
+    display: flex;
+    flex-direction: column;
+    box-shadow:4px 5px 10px 3px rgba(0, 0, 0, 0.4);
+}
+
+.modalheade{
+    text-align:center;
+    width:100%;
+    position:absolute;
+    top:0;
+}
+.modalheadertex{
+    color:#000;
+    font-family:Nunito;
+    line-height: 40px;
+    font-size: 23pt;
+    margin-bottom:30px;
+}
+.modalclose{
+    cursor:pointer;
+    display:inline;
+    float:right;
+    margin-right:10px;
+    margin-top:10px;
+}
+.modalconten{
+    color:black;
+    width:300px;
+    margin-left: 30px;
+}
+.modalcontenttex{
+    text-align:left;
+    color:black;
+    font-size: 11pt;
+    line-height:13pt;
+    margin-bottom:30px;
+}
+.modalokbutto{
+    cursor:pointer;
+    text-align:center;
+    display: inline-block;
+    padding: 6px 45px;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    background-color:white;
+    border: 1px solid #82b92e;
+}
+.modalokbuttontex{
+    color:#82b92e;
+    font-family:Nunito;
+    font-size:13pt;
+}
+.modalgobutto{
+    cursor:pointer;
+    text-align:center;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    background-color:white;
+    border: 1px solid #82b92e;
+}
+.modalgobuttontex{
+color:#82b92e;
+font-family:Nunito;
+font-size:10pt;
+}
+
+
+#opacidad{
+    position:fixed;
+    background:black;
+    opacity:0.6;
+    z-index:-1;
+    left:0px;
+    top:0px;
+    width:100%;
+    height:100%;
+}
+/*
+.textodialog{
+    margin-left: 0px;
+    color:#333;
+    padding:20px;
+    font-size:9pt;
+}
+
+.cargatextodialog{
+    max-width:58.5%;
+    width:58.5%;
+    min-width:58.5%;
+    float:left;
+    margin-left: 0px;
+    font-size:18pt;
+    padding:20px;
+    text-align:center;
+}
+
+.cargatextodialog p, .cargatextodialog b, .cargatextodialog a{
+    font-size:18pt; 
+}
+*/
+</style>
+</head>
+<body>
+    
+    <div id="alert_messages_na">
+        
+        <div class='modalheade'>
+            <img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>  
+        </div>
+
+        <div class='modalconten'>
+            <div class='modalheadertex'>
+                <?php echo __("You don't have access to this page"); ?>
+            </div>
+
+            <div class='modalcontenttex'>
+                <?php
+                echo __('Access to this page is restricted to authorized users SAML only, please contact system administrator if you need assistance.');
+                    echo '<br/> <br/>';
+                    echo __('Please make sure you have SAML authentication properly configured. For more information the error to access this page are recorded in security logs of %s System Database', get_product_name());
+                ?>
+                      
+            </div>
+
+            <div class='modalokbutto cerrar'>
+                <span class='modalokbuttontex'>OK</span>
+            </div>
+        </div>
+    </div>
+        
+    <div id="opacidad"></div>
+    
+</body>
+</html>
+
+<script>
+
+    $(".cerrar").click(function(){
+    window.location=".";
+    });
+
+    $('div#page').css('background-color','#d3d3d3');
+
+</script>
diff --git a/pandora_console/include/auth/saml.php b/pandora_console/include/auth/saml.php
new file mode 100755
index 0000000000..6ffbc8cf4b
--- /dev/null
+++ b/pandora_console/include/auth/saml.php
@@ -0,0 +1,166 @@
+<?php
+// ______                 __                     _______ _______ _______
+// |   __ \.---.-.-----.--|  |.-----.----.---.-. |    ___|   |   |     __|
+// |    __/|  _  |     |  _  ||  _  |   _|  _  | |    ___|       |__     |
+// |___|   |___._|__|__|_____||_____|__| |___._| |___|   |__|_|__|_______|
+//
+// ============================================================================
+// Copyright (c) 2007-2010 Artica Soluciones Tecnologicas, http://www.artica.es
+// This code is NOT free software. This code is NOT licenced under GPL2 licence
+// You cannnot redistribute it without written permission of copyright holder.
+// ============================================================================
+global $config;
+
+if (!file_exists($config['saml_path'].'simplesamlphp/lib/_autoload.php')) {
+    return false;
+}
+
+
+/**
+ * Authenticate in saml system (red.es)
+ *
+ * @param string Login
+ * @param string Password
+ *
+ * @return boolean True if the login succeeds, false otherwise
+ */
+function saml_process_user_login()
+{
+    global $config;
+
+    // SAML authentication attributes
+    $as = new SimpleSAML_Auth_Simple('PandoraFMS');
+    $as->requireAuth();
+    $session = SimpleSAML_Session::getSessionFromRequest();
+    $session->cleanup();
+    $attributes = $as->getAttributes();
+
+    if (empty($attributes)) {
+        return false;
+    }
+
+    $id_user = $attributes[SAML_MAIL_IN_PANDORA][0];
+    $email = $attributes[SAML_MAIL_IN_PANDORA][0];
+    $group_name = $attributes[SAML_GROUP_IN_PANDORA][0];
+    $profiles_and_tags = $attributes[SAML_ROLE_AND_TAG];
+
+    $profile_names = [];
+    $tag_names = [];
+    // Manages array with tags and roles to separate them
+    foreach ($profiles_and_tags as $profile_or_tag) {
+        $is_profile_or_tag = explode(SAML_DEFAULT_PROFILES_AND_TAGS_FORM, $profile_or_tag);
+        $is_profile_or_tag2 = explode(':', $is_profile_or_tag[1]);
+        if ($is_profile_or_tag2[0] == 'role') {
+            $profile_names[] = $is_profile_or_tag2[1];
+        } else if ($is_profile_or_tag2[0] == 'tag') {
+            $tag_names[] = $is_profile_or_tag2[1];
+        }
+    }
+
+    // Connect to Pandora db
+    $connection = mysql_connect_db(
+        $config['pandora_server'],
+        $config['pandora_dbname'],
+        $config['pandora_user'],
+        $config['pandora_pass']
+    );
+
+    if ($connection === false) {
+        return false;
+    }
+
+    // Get the red.es user id
+    $rows = db_get_all_rows_sql(
+        "SELECT * FROM tusuario
+		WHERE id_user = '".$id_user."'",
+        false,
+        false,
+        $connection
+    );
+
+    // Checks group id, profiles id and tags id
+    $group_id = '';
+    $profile_id = [];
+    $tag_id = '';
+    $tags_to_profile = '';
+    if ($group_name != '') {
+        $group_id = db_get_all_rows_sql("SELECT id_grupo FROM tgrupo WHERE nombre = '".$group_name."'");
+        $group_id = $group_id[0]['id_grupo'];
+        if (empty($group_id)) {
+            $config['auth_error'] = 'Group not found in database';
+            db_pandora_audit('Logon Failed', 'Group '.$group_name.' not found in database', $_SERVER['REMOTE_ADDR']);
+            return false;
+        }
+    }
+
+    if (!empty($profile_names)) {
+        foreach ($profile_names as $profile_name) {
+            $profile_id[] = db_get_row_sql("SELECT id_perfil FROM tperfil WHERE name = '".io_safe_input($profile_name)."'");
+        }
+    }
+
+    if (!empty($tag_names)) {
+        $i = 0;
+        foreach ($tag_names as $tag_name) {
+            $tag_id = db_get_row_sql("SELECT id_tag FROM ttag WHERE name = '".io_safe_input($tag_name)."'");
+            if ($i == 0) {
+                $tags_to_profile = (String) $tag_id['id_tag'];
+            } else {
+                $tags_to_profile .= ','.(String) $tag_id['id_tag'];
+            }
+
+            $i++;
+        }
+    }
+
+    // If user does not exist in Pandora
+    if (empty($rows)) {
+        if ($id_user != '') {
+            $values_user = [];
+            $values_user['id_user'] = $id_user;
+            $values_user['email'] = $email;
+            $result_insert_user = db_process_sql_insert('tusuario', $values_user);
+
+            // Separates user insert of profile insert
+            $values_user_profile = [];
+            $values_user_profile['id_usuario'] = $id_user;
+            $values_user_profile['id_grupo'] = $group_id;
+            $values_user_profile['tags'] = $tags_to_profile;
+            foreach ($profile_id as $id) {
+                $values_user_profile['id_perfil'] = $id['id_perfil'];
+                $result_insert_user_profile = db_process_sql_insert('tusuario_perfil', $values_user_profile);
+            }
+
+            if (!$result_insert_user_profile) {
+                $config['auth_error'] = 'Login error';
+                return false;
+            }
+
+            return $id_user;
+        } else {
+            return false;
+        }
+    } else {
+        $user = $rows[0];
+        // To update the profiles, delete the old and insert the new
+        $have_profiles = db_get_all_rows_sql("SELECT id_up FROM tusuario_perfil WHERE id_usuario = '".$user['id_user']."'");
+        if ($have_profiles) {
+            $delete_old_profiles = db_process_sql("DELETE FROM tusuario_perfil WHERE id_usuario = '".$user['id_user']."'");
+        }
+
+        $values_user_profile = [];
+        $values_user_profile['id_usuario'] = $user['id_user'];
+        $values_user_profile['id_grupo'] = $group_id;
+        $values_user_profile['tags'] = $tags_to_profile;
+        foreach ($profile_id as $id) {
+            $values_user_profile['id_perfil'] = $id['id_perfil'];
+            $result_insert_user_profile = db_process_sql_insert('tusuario_perfil', $values_user_profile);
+        }
+
+        return $user['id_user'];
+    }
+
+    $config['auth_error'] = 'User not found in database or incorrect password';
+
+    return false;
+}
diff --git a/pandora_console/index.php b/pandora_console/index.php
index 3c95074171..a543829bb7 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -359,12 +359,17 @@ if (! isset($config['id_user'])) {
             $nick_in_db = $_SESSION['prepared_login_da']['id_user'];
             $expired_pass = false;
         } else if (($config['auth'] == 'saml') && ($login_button_saml)) {
-            include_once ENTERPRISE_DIR.'/include/auth/saml.php';
-
-            $saml_user_id = saml_process_user_login();
+            if (!include_once 'include/auth/saml.php') {
+                include_once 'general/noaccesssaml.php';
+            } else {
+                $saml_user_id = saml_process_user_login();
+            }
 
             $nick_in_db = $saml_user_id;
+
             if (!$nick_in_db) {
+                include_once 'general/noaccesssaml.php';
+
                 include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
                 $as = new SimpleSAML_Auth_Simple('PandoraFMS');
                 $as->logout();

From 9163f725eda92e59f021b3172a86dfe03e027ffa Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Mon, 1 Jul 2019 16:57:33 +0200
Subject: [PATCH 24/83] Created black theme - #4194

---
 pandora_console/extras/pandora_diag.php       |    2 +-
 pandora_console/include/functions_ui.php      |   14 +-
 pandora_console/include/styles/pandoraPDF.css |    2 +
 .../include/styles/pandora_black.css          | 4365 +----------------
 pandora_console/index.php                     |    9 +-
 5 files changed, 189 insertions(+), 4203 deletions(-)

diff --git a/pandora_console/extras/pandora_diag.php b/pandora_console/extras/pandora_diag.php
index f3b11177d1..9258a3be42 100644
--- a/pandora_console/extras/pandora_diag.php
+++ b/pandora_console/extras/pandora_diag.php
@@ -362,7 +362,7 @@ if ($console_mode == 1) {
         true
     );
 
-    echo "<table width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
+    echo "<table id='diagnostic_info' width='1000px' border='0' style='border:0px;' class='databox data' cellpadding='4' cellspacing='4'>";
     echo "<tr><th style='background-color:#b1b1b1;font-weight:bold;font-style:italic;border-radius:2px;' align=center colspan='2'>".__('Pandora status info').'</th></tr>';
 }
 
diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php
index ef8089ac3a..33603c8072 100755
--- a/pandora_console/include/functions_ui.php
+++ b/pandora_console/include/functions_ui.php
@@ -1755,6 +1755,12 @@ function ui_process_page_head($string, $bitfield)
     // Add the dialog styles CSS.
     $config['css']['dialog'] = 'include/styles/js/introjs.css';
 
+    // If the theme is the default, we don't load it twice.
+    if ($config['style'] !== 'pandora') {
+        // It loads the last of all.
+        $config['css']['theme'] = 'include/styles/'.$config['style'].'.css';
+    }
+
     // If skin's css files exists then add them.
     if ($exists_css) {
         foreach ($skin_styles as $filename => $name) {
@@ -1766,10 +1772,10 @@ function ui_process_page_head($string, $bitfield)
         // User style should go last so it can rewrite common styles.
         $config['css'] = array_merge(
             [
-                'common'         => 'include/styles/common.css',
-                'menu'           => 'include/styles/menu.css',
-                'tables'         => 'include/styles/tables.css',
-                $config['style'] => 'include/styles/'.$config['style'].'.css',
+                'common'  => 'include/styles/common.css',
+                'menu'    => 'include/styles/menu.css',
+                'tables'  => 'include/styles/tables.css',
+                'general' => 'include/styles/pandora.css',
             ],
             $config['css']
         );
diff --git a/pandora_console/include/styles/pandoraPDF.css b/pandora_console/include/styles/pandoraPDF.css
index 37d527c30b..5bb0e15174 100644
--- a/pandora_console/include/styles/pandoraPDF.css
+++ b/pandora_console/include/styles/pandoraPDF.css
@@ -1,4 +1,6 @@
 /**
+ * Exclude css from visual styles
+ *
  * Extension to manage a list of gateways and the node address where they should
  * point to.
  *
diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css
index 8e2d756e0c..e2a4f41602 100644
--- a/pandora_console/include/styles/pandora_black.css
+++ b/pandora_console/include/styles/pandora_black.css
@@ -21,4242 +21,217 @@ Description: The default Pandora FMS theme layout
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
-/* Tree view styles */
-@import url(tree.css);
-
-* {
-  font-family: verdana, sans-serif;
-  letter-spacing: 0.03pt;
-  font-size: 8pt;
-  color: #fff;
-}
-svg * {
-  font-size: 11pt;
-}
-body {
-  background-color: #5b5b5b;
-  margin: 0 auto;
-}
-
-div#page {
-  background: #5b5b5b;
-  background-image: none;
-}
-
-body.pure {
-  background-color: #5b5b5b;
-}
-input,
-textarea {
-  border: 1px solid #ddd;
-}
-
-textarea {
-  padding: 5px;
-  min-height: 100px;
-  width: 99%;
-}
-textarea.conf_editor {
-  padding: 5px;
-  width: 650px;
-  height: 350px;
-}
-textarea.conf_error {
-  background-image: url(../../images/err.png);
-  background-repeat: no-repeat;
-  background-position: top right;
-}
-input {
-  padding: 2px 3px 4px 3px;
-  vertical-align: middle;
-}
-
-input[type="checkbox"] {
-  display: inline;
-}
-
-select {
-  padding: 2px 3px 3px 3px;
-  vertical-align: middle;
-}
-input.button {
-  font-family: Arial, Sans-serif;
-  border: 4px solid #ccc;
-  background: #5b5b5b;
-  padding: 2px 3px;
-  margin: 10px 15px;
-}
-
-input[type="submit"],
-input[type="button"] {
-  cursor: pointer;
-}
-
-select {
-  border: 1px solid #ddd;
-}
-checkbox {
-  padding: 4px;
-  border: 1px solid #eee;
-}
-h1,
-h2,
-h3,
-h4 {
-  font-weight: bold;
-  font-size: 1em;
-  font-family: Arial, Sans-serif;
-  text-transform: uppercase;
-  color: #fff;
-  padding-bottom: 4px;
-  padding-top: 7px;
-}
-h1 {
-  font-size: 16px;
-}
-h2 {
-  font-size: 15px;
-}
-h3 {
-  font-size: 14px;
-}
-h4 {
-  margin-bottom: 10px;
-  font-size: 13px;
-  color: #fff;
-  text-transform: none;
-}
-a {
-  color: #fff;
-  text-decoration: none;
-}
-a:hover {
-  color: #fff;
-  text-decoration: underline;
-}
-a.white_bold {
-  color: #eee;
-  text-decoration: none;
-  font-weight: bold;
-}
-a.white {
-  color: #eee;
-  text-decoration: none;
-}
-p.center {
-  text-align: center;
-}
-h1#log_title {
-  font-size: 18px;
-  margin-bottom: 0px;
-  color: #fff;
-  width: 300px;
-}
-div#log_msg {
-  display: none;
-}
-div#error_buttons {
-  margin-top: 20px;
-}
-div#error_buttons a {
-  margin: 14px;
-}
-
-#noaccess {
-  position: relative;
-  margin-top: 25px;
-  left: 15px;
-  padding-top: 5px;
-  background-color: #5b5b5b;
-  border-top-left-radius: 2px;
-  border-top-right-radius: 2px;
-  border-bottom-left-radius: 2px;
-  border-bottom-right-radius: 2px;
-}
-
-#noaccess-title {
-  color: #fff;
-  font-weight: bold;
-  padding-top: 5px;
-  margin-left: 5px;
-  background: none repeat scroll 0% 0% #82b92e;
-  border-top-left-radius: 2px;
-  border-top-right-radius: 2px;
-  border-bottom-left-radius: 2px;
-  border-bottom-right-radius: 2px;
-  text-align: center;
-}
-
-#noaccess-text {
-  font-size: 12px;
-  text-align: justify;
-  padding-top: 25px;
-  padding-right: 50px;
-  float: right;
-}
-
-#noaccess-image {
-  position: relative;
-  left: 10px;
-  top: 10px;
-  float: left;
-}
-
-div#activity {
-  padding-top: 0px;
-  padding-bottom: 18px;
-}
-div#noa {
-  float: right;
-  padding-right: 50px;
-  margin-top: 25px;
-}
-div#db_f {
-  text-align: justify;
-  margin: auto;
-  padding: 0.5em;
-  width: 55em;
-  margin-top: 3em;
-}
-div#db_ftxt {
-  float: right;
-  padding-top: 10px;
-}
-div#container {
-  margin: 0 auto;
-  min-width: 960px;
-  text-align: left;
-  #border-left: solid 2px #000;
-  #border-right: solid 2px #000;
-  #border-top: solid 2px #000;
-  #margin-top: 5px;
-  height: 100%;
-  background: #5b5b5b;
-}
-div#page {
-  width: 960px;
-  clear: both;
-}
-div#main {
-  width: auto;
-  margin: 0px 2% 0px 0%;
-  float: right;
-  position: relative;
-  min-height: 850px;
-}
-div#main_help {
-  width: 100%;
-  padding-left: 0px;
-  padding-top: 0px;
-  background-color: #5b5b5b;
-  margin-top: 0px;
-  margin-left: 0px;
-  margin-right: 0px;
-  border-radius: 10px;
-}
-div#main_help div.databox,
-.license_databox {
-  background: F3F3F3;
-  -moz-border-radius: 8px;
-  -webkit-border-radius: 8px;
-  border-radius: 8px;
-  border: 0px;
-  padding-left: 25px;
-  padding-right: 25px;
-  margin-top: 10px;
-  -moz-box-shadow: -1px 1px 6px #aaa;
-  -webkit-box-shadow: -1px 1px 6px #aaa;
-  box-shadow: -1px 1px 6px #aaa;
-}
-
-div#main_help div.databox h1 {
-  padding-bottom: 0px;
-  margin-bottom: 0px;
-  font-weight: bold;
-  font-family: sans-serif, verdana;
-}
-
-div#main_help div.databox h3,
-div#main_help div.databox h2 {
-  color: #6eb432;
-  font-family: sans-serif, verdana;
-}
-
-div#main_help div.databox h3 {
-  font-size: 12px;
-}
-
-div#main_help a.footer,
-div#main_help span {
-  color: #999;
-}
-
-a.footer,
-a.footer span {
-  font-size: 9px;
-  color: white;
-}
-
-div#main_help div.databox hr {
-  width: 100%;
-  border: 0px;
-  height: 1px;
-  background-color: #222;
-  margin: 0px;
-}
-
-div#main_help div.databox p {
-  line-height: 15px;
-  text-align: justify;
-}
-
-div#menu_container {
-  -moz-border-top-right-radius: 6px;
-  -webkit-border-top-right-radius: 6px;
-  border-top-right-radius: 6px;
-  z-index: 1010;
-  width: 40px;
-  height: 100%;
-}
-
-div#menu {
-  width: 45px;
-  float: left;
-  z-index: 2000;
-  position: absolute;
-}
-
-div#head {
-  font-size: 8pt;
-  width: 100%;
-  height: 60px;
-  padding-top: 0px;
-  margin-bottom: 20px;
-  border-bottom-style: solid;
-  border-bottom-width: 3px;
-  border-color: #82b92e;
-  min-width: 882px;
-  background-color: #333;
-  color: white;
-  background-image: url("../../images/header_f2b.jpg");
-}
-
-.fixed_header {
-  z-index: 9999;
-  position: fixed;
-  left: 0;
-  top: 0;
-  width: 100%;
-}
-
-div#foot {
-  font-size: 6pt;
-  border-top: solid 2px #222;
-  padding-top: 8px;
-  padding-bottom: 5px;
-  text-align: center;
-  background: #333333;
-  height: 30px;
-  clear: both;
-  width: auto;
-}
-#ver {
-  margin-bottom: 25px;
-}
-
-/****************/
-/* LOGIN STYLES */
-/****************/
-
-@font-face {
-  font-family: "Nunito";
-  font-style: normal;
-  font-weight: 400;
-  src: local("Nunito-Regular"), url(../../fonts/nunito.woff) format("woff");
-}
-
-@font-face {
-  font-family: "roboto";
-  src: url("../../fonts/roboto.woff2") format("woff2");
-}
-
-@font-face {
-  font-family: "opensans";
-  src: url("../../fonts/opensans.woff2") format("woff2");
-}
-
-@font-face {
-  font-family: "lato";
-  src: url("../../fonts/lato.woff2") format("woff2");
-}
-
-@font-face {
-  font-family: "leaguegothic";
-  src: url("../../fonts/leaguegothic.woff") format("woff");
-}
-
-#login_body {
-  /* Set rules to fill background */
-  min-height: 100%;
-  min-width: 1024px;
-  width: 100%;
-  z-index: -9999;
-  position: absolute;
-}
-
-@media screen and (max-width: 1024px) {
-  /* Specific to this particular image */
-  #login_body {
-    left: 50%;
-    margin-left: -512px; /* 50% */
-  }
-}
-@media screen and (max-width: 1100px) {
-  /* Specific to this particular image */
-  #login_body {
-    background-image: url("../../images/backgrounds/fondo_madera_bn_1100.jpg");
-    background-repeat: repeat;
-    background-position: center center;
-  }
-}
-@media screen and (max-width: 1400px) {
-  /* Specific to this particular image */
-  #login_body {
-    background-image: url("../../images/backgrounds/fondo_madera_bn_1400.jpg");
-    background-repeat: repeat;
-    background-position: center center;
-  }
-}
-@media screen and (max-width: 2000px) {
-  /* Specific to this particular image */
-  #login_body {
-    background-image: url("../../images/backgrounds/fondo_madera_bn_2000.jpg");
-    background-repeat: repeat;
-    background-position: center center;
-  }
-}
-@media screen and (min-width: 2000px) {
-  /* Specific to this particular image */
-  #login_body {
-    background-image: url("../../images/backgrounds/fondo_madera_bn_2500.jpg");
-    background-repeat: repeat;
-    background-position: center center;
-  }
-}
-
-p.log_in {
-  color: #fff;
-  padding: 0px 10px;
-  width: 300px;
-}
-h1#log_f {
-  color: #c00;
-  border-bottom: 1px solid #c00;
-  padding-bottom: 3px;
-}
-div#login {
-  border-width: 2px 2px 2px 2px;
-  border-style: solid;
-  border-color: #000;
-  font-size: 12px;
-}
-div#login_in,
-#login_f {
-  /*margin: 0 auto 0 140px;
-	width: 400px;*/
-}
-
-.databox_login,
-.databox_logout {
-  border-radius: 5px;
-  height: 200px;
-}
-
-#login_inner {
-  width: 100%;
-  height: 100%;
-  border-radius: 5px;
-  /* Browser without multibackground support */
-  background-color: #373737;
-}
-#login_outer {
-  border-radius: 11px;
-  background-color: #000;
-  width: 500px;
-  color: #fff;
-  margin: 0px auto;
-}
-
-.version_login {
-  transform: rotate(36deg);
-  /* Old browser support */
-  -ms-transform: rotate(36deg); /* IE */
-  -moz-transform: rotate(36deg); /* FF */
-  -o-transform: rotate(36deg); /* Opera */
-  -webkit-transform: rotate(36deg); /* Safari and Chrome */
-
-  float: right;
-  margin-top: 18px;
-  width: 80px;
-  height: 0px;
-  border-right: 13px solid transparent;
-  border-left: 25px solid transparent;
-  border-bottom: 18px solid #82b92e;
-  left: 16px;
-  position: relative;
-}
-
-#login_outer * {
-  font-family: Nunito, "Arial Rounded MT", Arial, Helvetica, sans-serif;
-  font-weight: bold;
-}
-.login_border {
-  border-right: 1px solid #fff;
-  text-align: center;
-}
-table#login_layout {
-  width: 100%;
-  height: 160px;
-  position: absolute;
-}
-
-div#error_login {
-  text-align: center;
-  margin-top: 5px;
-  margin-left: 5px;
-  width: 75%;
-  float: right;
-  text-align: left;
-  top: 100px;
-}
-
-div#error_login_icon {
-  #margin: 0 auto;
-  margin-top: 10px;
-  margin-right: 7px;
-  text-align: center;
-  #margin-left: 20px;
-  width: 20%;
-  float: right;
-}
-
-div#login_f {
-  margin-top: 10px;
-  margin-bottom: 25px;
-}
-
-a:focus,
-input:focus,
-button:focus {
-  utline-width: 0;
-  outline: 0;
-}
-
-/*DIV.login_links {
-	margin: 10px 0px 0px;
-	color: #FFF;
-	text-align: center;
-}
-
-DIV.login_links>a {
-	color: #FFF;
-}
-
-DIV.login_button{
-	text-align:right;
-	width: 100%;
-	margin-top: 15px;
-}
-
-DIV.login_button>input{
-	background-color: #373737;
-	border: 0px none;
-	background-image: url("../../images/input_go.png");
-	padding-right: 25px;
-}
-
-.login_page{
-	height: 200px;
-	padding-top: 10%;
-	text-align: center;
-	width: 100%;
-	position: absolute;
-}
-
-input.next_login {
-	padding-right: 12px;
-	padding-left: 12px;
-	height: 23px;
-	text-align: center;
-	font-weight: 600;
-	letter-spacing: 0.5pt;
-	font-size: 12px;
-	border-radius: 3px;
-}
-
-DIV.login_nick, DIV.login_pass {
-	text-align:left;
-	padding-left: 15px;
-	margin-top: 10px;
-}
-
-DIV.login_nick>input, DIV.login_pass>input {
-	height: 20px;
-	border-radius:0px;
-	margin-left: 10px;
-}
-
-DIV.login_nick>input:focus,DIV.login_pass>input:focus {
-    outline-width: 0px;
-	border-color: #82b92e;
-	background-color: #82b92e;
-	font-size: 12px;
-	height: 20px;
-	box-shadow: 0px 0px 3px 3px #82b92e;
-}
-
-DIV.login_nick>img, DIV.login_pass>img {
-	vertical-align: middle;
-}
-
-DIV.login_links a {
-	letter-spacing: 0.8pt;
-}
-
-DIV.login_links a:first-child {
-	margin-right: 5px;
-}
-
-DIV.login_links a:last-child {
-	margin-left: 5px;
-}
-
-DIV.login_nick_text {
-	text-align: left;
-	margin-bottom: 3px;
-	width: 191px;
-	margin: 5px 0px;
-	font-size: 12px;
-	letter-spacing: 0.4pt;
-}
-
-DIV.login_pass_text {
-	text-align: left;
-	width: 191px;
-	margin: 13px 0px 5px 0px;
-	font-size: 12px;
-	letter-spacing: 0.4pt;
-}
-
-DIV.login_pass {
-}
-
-input.login {
-	border: 0px none;
-	margin: 0px 0px;
-	width: 135px;
-	height: 18px;
-	font-weight: 100;
-
-	letter-spacing: 0.3pt;
-}
-
-input.login_user {
-	 
-	color: #373737;
-	padding-left: 8px;
-	width: 179px;
-	color: #222;
-	height: 18px;
-}
-
-input.login_password {
-	
-	padding-left: 8px;
-	width: 179px;
-	color: #222;
-	height: 20px;
-}
-*/
-
-.databox_error {
-  width: 657px;
-  height: 400px;
-  border: none;
-  background-color: #fafafa;
-  background: url(../../images/splash_error.png) no-repeat;
-}
-
-#ver_num {
-  margin: 0px auto;
-  width: 100%;
-  position: absolute;
-  bottom: 10px;
-  color: #fff;
-  text-align: center;
-}
-
-input:-webkit-autofill {
-  #-webkit-box-shadow: 0 0 0px 1000px #ddd inset;
-}
-/***********************/
-/* END OF LOGIN STYLES */
-/***********************/
-
-th > label {
-  padding-top: 7px;
-}
-input.chk {
-  margin-right: 0px;
-  border: 0px none;
-  height: 14px;
-}
-input.datos {
-  background-color: #f5f5f5;
-}
-input.datos_readonly {
-  background-color: #050505;
-}
-
-input.sub {
-  font-weight: normal;
-
-  -moz-border-radius: 2px;
-  -webkit-border-radius: 2px;
-  border-radius: 2px;
-
-  font-size: 8pt;
-
-  background-color: #333;
-  background-repeat: no-repeat;
-  background-position: 92% 3px;
-
-  color: white;
-  padding: 3px 3px 5px 12px;
-
-  border-color: #333;
-}
-
-input.sub[disabled] {
-  color: #b4b4b4;
-  background-color: #f3f3f3;
-  border-color: #b6b6b6;
-  cursor: default;
-}
-
-input.next,
-input.upd,
-input.ok,
-input.wand,
-input.delete,
-input.cog,
-input.target,
-input.search,
-input.copy,
-input.add,
-input.graph,
-input.percentile,
-input.binary,
-input.camera,
-input.config,
-input.cancel,
-input.default,
-input.filter,
-input.pdf {
-  padding-right: 30px;
-  height: 23px;
-}
-
-input.next {
-  background-image: url(../../images/input_go.png);
-}
-input.upd {
-  background-image: url(../../images/input_update.png);
-}
-input.wand {
-  background-image: url(../../images/input_wand.png);
-}
-input.wand:disabled {
-  background-image: url(../../images/input_wand.disabled.png);
-}
-input.search {
-  background-image: url(../../images/input_zoom.png);
-}
-input.search:disabled {
-  background-image: url(../../images/input_zoom.disabled.png);
-}
-input.ok {
-  background-image: url(../../images/input_tick.png);
-}
-input.ok:disabled {
-  background-image: url(../../images/input_tick.disabled.png);
-}
-input.add {
-  background-image: url(../../images/input_add.png);
-}
-input.add:disabled {
-  background-image: url(../../images/input_add.disabled.png);
-}
-input.cancel {
-  background-image: url(../../images/input_cross.png);
-}
-input.cancel:disabled {
-  background-image: url(../../images/input_cross.disabled.png);
-}
-input.delete {
-  background-image: url(../../images/input_delete.png);
-}
-input.delete:disabled {
-  background-image: url(../../images/input_delete.disabled.png);
-}
-input.cog {
-  background-image: url(../../images/input_cog.png);
-}
-input.cog:disabled {
-  background-image: url(../../images/input_cog.disabled.png);
-}
-input.config {
-  background-image: url(../../images/input_config.png);
-}
-input.config:disabled {
-  background-image: url(../../images/input_config.disabled.png);
-}
-input.filter {
-  background-image: url(../../images/input_filter.png);
-}
-input.filter:disabled {
-  background-image: url(../../images/input_filter.disabled.png);
-}
-input.pdf {
-  background-image: url(../../images/input_pdf.png);
-}
-input.pdf:disabled {
-  background-image: url(../../images/input_pdf.disabled.png);
-}
-input.camera {
-  background-image: url(../../images/input_camera.png);
-}
-
-#toolbox #auto_save {
-  padding-top: 5px;
-}
-
-#toolbox {
-  margin-top: 13px;
-}
-input.visual_editor_button_toolbox {
-  padding-right: 15px;
-  padding-top: 10px;
-  margin-top: 5px;
-}
-input.delete_min {
-  background: #fefefe url(../../images/cross.png) no-repeat center;
-}
-input.delete_min[disabled] {
-  background: #fefefe url(../../images/cross.disabled.png) no-repeat center;
-}
-input.graph_min {
-  background: #fefefe url(../../images/chart_curve.png) no-repeat center;
-}
-input.graph_min[disabled] {
-  background: #fefefe url(../../images/chart_curve.disabled.png) no-repeat
-    center;
-}
-input.percentile_min {
-  background: #fefefe url(../../images/chart_bar.png) no-repeat center;
-}
-input.percentile_min[disabled] {
-  background: #fefefe url(../../images/chart_bar.disabled.png) no-repeat center;
-}
-input.percentile_item_min {
-  background: #fefefe url(../../images/percentile_item.png) no-repeat center;
-}
-input.percentile_item_min[disabled] {
-  background: #fefefe url(../../images/percentile_item.disabled.png) no-repeat
-    center;
-}
-input.binary_min {
-  background: #fefefe url(../../images/binary.png) no-repeat center;
-}
-input.binary_min[disabled] {
-  background: #fefefe url(../../images/binary.disabled.png) no-repeat center;
-}
-input.camera_min {
-  background: #fefefe url(../../images/camera.png) no-repeat center;
-}
-input.camera_min[disabled] {
-  background: #fefefe url(../../images/camera.disabled.png) no-repeat center;
-}
-input.config_min {
-  background: #fefefe url(../../images/config.png) no-repeat center;
-}
-input.config_min[disabled] {
-  background: #fefefe url(../../images/config.disabled.png) no-repeat center;
-}
-input.label_min {
-  background: #fefefe url(../../images/tag_red.png) no-repeat center;
-}
-input.label_min[disabled] {
-  background: #fefefe url(../../images/tag_red.disabled.png) no-repeat center;
-}
-input.icon_min {
-  background: #fefefe url(../../images/photo.png) no-repeat center;
-}
-input.icon_min[disabled] {
-  background: #fefefe url(../../images/photo.disabled.png) no-repeat center;
-}
-input.box_item {
-  background: #fefefe url(../../images/box_item.png) no-repeat center;
-}
-input.box_item[disabled] {
-  background: #fefefe url(../../images/box_item.disabled.png) no-repeat center;
-}
-input.line_item {
-  background: #fefefe url(../../images/line_item.png) no-repeat center;
-}
-input.line_item[disabled] {
-  background: #fefefe url(../../images/line_item.disabled.png) no-repeat center;
-}
-input.copy_item {
-  background: #fefefe url(../../images/copy_visualmap.png) no-repeat center;
-}
-input.copy_item[disabled] {
-  background: #fefefe url(../../images/copy_visualmap.disabled.png) no-repeat
-    center;
-}
-input.grid_min {
-  background: #fefefe url(../../images/grid.png) no-repeat center;
-}
-input.grid_min[disabled] {
-  background: #fefefe url(../../images/grid.disabled.png) no-repeat center;
-}
-input.save_min {
-  background: #fefefe url(../../images/file.png) no-repeat center;
-}
-input.save_min[disabled] {
-  background: #fefefe url(../../images/file.disabled.png) no-repeat center;
-}
-input.service_min {
-  background: #fefefe url(../../images/box.png) no-repeat center;
-}
-input.service_min[disabled] {
-  background: #fefefe url(../../images/box.disabled.png) no-repeat center;
-}
-
-input.group_item_min {
-  background: #fefefe url(../../images/group_green.png) no-repeat center;
-}
-input.group_item_min[disabled] {
-  background: #fefefe url(../../images/group_green.disabled.png) no-repeat
-    center;
-}
-
-div#cont {
-  position: fixed;
-  max-height: 320px;
-  overflow-y: auto;
-  overflow-x: hidden;
-}
-
-.termframe {
-  background-color: #82b92e;
-}
-
-table,
-img {
-  border: 0px;
-}
-
-tr:first-child > th {
-  background-color: #373737;
-}
-
-th {
-  color: #fff;
-  background-color: #666;
-  font-size: 7.5pt;
-  letter-spacing: 0.3pt;
-}
-tr.datos,
-tr.datost,
-tr.datosb,
-tr.datos_id,
-tr.datosf9 {
-  #background-color: #eaeaea;
-}
-
-tr.datos2,
-tr.datos2t,
-tr.datos2b,
-tr.datos2_id,
-tr.datos2f9 {
-  #background-color: #f2f2f2;
-}
-
-tr.datos:hover,
-tr.datost:hover,
-tr.datosb:hover,
-tr.datos_id:hover,
-tr.datosf9:hover,
-tr.datos2:hover,
-tr.datos2t:hover,
-tr.datos2b:hover,
-tr.datos2_id:hover,
-tr.datos2f9:hover {
-  #background-color: #efefef;
-}
-
-/* Checkbox styles */
-td input[type="checkbox"] {
-  /* Double-sized Checkboxes */
-  -ms-transform: scale(1.3); /* IE */
-  -moz-transform: scale(1.3); /* FF */
-  -o-transform: scale(1.3); /* Opera */
-  -webkit-transform: scale(1.3); /* Safari and Chrome */
-  padding: 10px;
-  margin-top: 2px;
-  display: table-cell;
-}
-
-td.datos3,
-td.datos3 * {
-  background-color: #666;
-  color: white;
-}
-
-td.datos4,
-td.datos4 * {
-  /*Add because in php the function html_print_table write style in cell and this is style head.*/
-  text-align: center;
-  background-color: #666;
-  color: white;
-}
-
-td.datos_id {
-  color: #1a313a;
-}
-
-tr.disabled_row_user * {
-  color: grey;
-}
-
-.bg {
-  /* op menu */
-  background: #82b92e;
-}
-
-.bg2 {
-  /* main page */
-  background-color: #0a160c;
-}
-.bg3 {
-  /* godmode */
-  background: #666666;
-}
-.bg4 {
-  /* links */
-  background-color: #989898;
-}
-.bg,
-.bg2,
-.bg3,
-.bg4 {
-  position: relative;
-  width: 100%;
-}
-.bg {
-  height: 20px;
-}
-.bg2,
-.bg3,
-.bg4 {
-  height: 18px;
-}
-.f10,
-#ip {
-  font-size: 7pt;
-  text-align: center;
-}
-.f9,
-.f9i,
-.f9b,
-.datos_greyf9,
-.datos_bluef9,
-.datos_greenf9,
-.datos_redf9,
-.datos_yellowf9,
-td.f9,
-td.f9i,
-td.datosf9,
-td.datos2f9 {
-  font-size: 6.5pt;
-}
-.f9i,
-.redi {
-  font-style: italic;
-}
-.tit {
-  padding: 6px 0px;
-  height: 14px;
-}
-.tit,
-.titb {
-  font-weight: bold;
-  color: #fff;
-  text-align: center;
-}
-
-.suc * {
-  color: #5a8629;
-}
-
-.info * {
-  color: #006f9d;
-}
-
-.error * {
-  color: #f85858;
-}
-
-.warning * {
-  color: #f3b200;
-}
-
-.help {
-  background: url(../../images/help.png) no-repeat;
-}
-.red,
-.redb,
-.redi,
-.error {
-  color: #c00;
-}
-
-.sep {
-  margin-left: 30px;
-  border-bottom: 1px solid #708090;
-  width: 100%;
-}
-.orange {
-  color: #fd7304;
-}
-.green {
-  color: #5a8629;
-}
-.yellow {
-  color: #f3c500;
-}
-.greenb {
-  color: #00aa00;
-}
-.grey {
-  color: #808080;
-  font-weight: bold;
-}
-.blue {
-  color: #5ab7e5;
-  font-weight: bold;
-}
-.redb,
-.greenb,
-td.datos_id,
-td.datos2_id,
-f9b {
-  font-weight: bold;
-}
-.p10 {
-  padding-top: 1px;
-  padding-bottom: 0px;
-}
-.p21 {
-  padding-top: 2px;
-  padding-bottom: 1px;
-}
-.w120 {
-  width: 120px;
-}
-.w130,
-#table-agent-configuration select {
-  width: 130px;
-}
-.w135 {
-  width: 135px;
-}
-.w155,
-#table_layout_data select {
-  width: 155px;
-}
-.top,
-.top_red,
-.bgt,
-td.datost,
-td.datos2t {
-  vertical-align: top;
-}
-.top_red {
-  background: #ff0000;
-}
-.bot,
-.titb,
-td.datosb {
-  vertical-align: bottom;
-}
-.msg {
-  margin-top: 15px;
-  text-align: justify;
-}
-ul.mn {
-  list-style: none;
-  padding: 0px 0px 0px 0px;
-  margin: 0px 0px 0px 0px;
-  line-height: 15px;
-}
-.gr {
-  font-size: 10pt;
-  font-weight: bold;
-}
-a.mn,
-.gr {
-  font-family: Arial, Verdana, sans-serif, Helvetica;
-}
-div.nf {
-  background: url(../../images/info.png) no-repeat scroll 0 50% transparent;
-  margin-left: 7px;
-  padding: 8px 1px 6px 25px;
-}
-div.title_line {
-  background-color: #4e682c;
-  height: 5px;
-  width: 762px;
-}
-
-.alpha50 {
-  filter: alpha(opacity=50);
-  -moz-opacity: 0.5;
-  opacity: 0.5;
-  -khtml-opacity: 0.5;
-}
-
+div#page,
 #menu_tab_frame,
-#menu_tab_frame_view {
-  display: block;
-  border-bottom: 1px solid #82b92e;
-  /*	float:left; */
-  margin-left: 0px;
-  max-height: 31px;
-  min-height: 31px;
-  padding-right: 28px;
-  width: 100%;
-}
-
-#menu_tab {
-  margin: 0px 0px 0px 0px;
-}
-
-#menu_tab .mn,
-#menu_tab ul,
-#menu_tab .mn ul {
-  padding: 0px;
-  list-style: none;
-  margin: 0px 0px 0px 0px;
-}
-#menu_tab .mn li {
-  float: right;
-  position: relative;
-  margin: 0px 0px 0px 0px;
-}
-/*
-#menu_tab li a, #menu_tab a {
-	padding: 2px 0px;
-	font-weight: bold;
-	line-height: 18px;
-	margin-left: 3px;
-	margin-right: 0px;
-
-	-moz-border-top-right-radius: 5px;
-	-webkit-border-top-right-radius: 5px;
-	border-top-right-radius: 5px;
-
-	-moz-border-top-left-radius: 5px;
-	-webkit-border-top-left-radius: 5px;
-	border-top-left-radius: 5px;
-}
-
-#menu_tab li>form {
-	padding-left: 7px;
-	padding-top: 4px;
-}
-*/
-
-#menu_tab li.separator_view {
-  padding: 4px;
-}
-
-#menu_tab li.separator {
-  padding: 4px;
-}
-
-#menu_tab li.nomn_high a {
-  /*background: #82b92e;*/
-  color: #fff;
-}
-#menu_tab .mn li a {
-  display: block;
-  text-decoration: none;
-  padding: 0px;
-  margin: 0px;
-  height: 21px;
-  width: 21px;
-}
-#menu_tab li.nomn:hover a,
-#menu_tab li:hover ul a:hover {
-  /*background: #82b92e;*/
-  color: #fff;
-}
-#menu_tab li:hover a {
-  /*background: #b2b08a url("../../images/arrow.png") no-repeat right 3px;*/
-}
-
-#menu_tab li.nomn {
-  min-width: 30px;
-  height: 28px;
-}
-#menu_tab li.nomn_high {
-  min-width: 30px;
-  height: 28px;
-}
-/* TAB TITLE */
-#menu_tab_left {
-  margin-left: 0px;
-}
-
-#menu_tab_left .mn,
-#menu_tab_left ul,
-#menu_tab_left .mn ul {
-  background-color: #000;
-  color: #fff;
-  font-weight: bold;
-  padding: 0px 0px 0px 0px;
-  list-style: none;
-  margin: 0px 0px 0px 0px;
-}
-#menu_tab_left .mn li {
-  float: left;
-  position: relative;
-  height: 26px;
-  max-height: 26px;
-}
-#menu_tab_left li a,
-#menu_tab_left li span {
-  /*	text-transform: uppercase; */
-  padding: 0px 0px 0px 0px;
-  color: #fff;
-  font-size: 8.5pt;
-  font-weight: bold;
-  line-height: 20px;
-}
-#menu_tab_left .mn li a {
-  display: block;
-  text-decoration: none;
-}
-#menu_tab_left li.view a {
-  padding: 2px 10px 2px 10px;
-  color: #fff;
-  font-weight: bold;
-  line-height: 18px;
-  display: none;
-}
-
-#menu_tab_left li.view {
-  background: #82b92e;
-  max-width: 40%;
-  min-width: 20%;
-  padding: 5px 5px 0px;
-  text-align: center;
-  -moz-border-top-right-radius: 3px;
-  -webkit-border-top-right-radius: 3px;
-  border-top-right-radius: 3px;
-
-  -moz-border-top-left-radius: 3px;
-  -webkit-border-top-left-radius: 3px;
-  border-top-left-radius: 3px;
-  margin-left: 0px;
-  overflow-y: hidden;
-}
-
-#menu_tab_left li.view img.bottom {
-  width: 24px;
-  height: 24px;
-}
-
-#menu_tab_frame *,
-#menu_tab_frame_view * {
-  #margin: 0px 0px 0px 0px;
-}
-
-span.users {
-  background: url(../../images/group.png) no-repeat;
-}
-span.agents {
-  background: url(../../images/bricks.png) no-repeat;
-}
-span.data {
-  background: url(../../images/data.png) no-repeat;
-}
-span.alerts {
-  background: url(../../images/bell.png) no-repeat;
-}
-span.time {
-  background: url(../../images/hourglass.png) no-repeat;
-}
-span.net {
-  background: url(../../images/network.png) no-repeat;
-}
-span.master {
-  background: url(../../images/master.png) no-repeat;
-}
-span.wmi {
-  background: url(../../images/wmi.png) no-repeat;
-}
-span.prediction {
-  background: url(../../images/chart_bar.png) no-repeat;
-}
-span.plugin {
-  background: url(../../images/plugin.png) no-repeat;
-}
-span.export {
-  background: url(../../images/database_refresh.png) no-repeat;
-}
-span.snmp {
-  background: url(../../images/snmp.png) no-repeat;
-}
-span.binary {
-  background: url(../../images/binary.png) no-repeat;
-}
-span.recon {
-  background: url(../../images/recon.png) no-repeat;
-}
-span.rmess {
-  background: url(../../images/email_open.png) no-repeat;
-}
-span.nrmess {
-  background: url(../../images/email.png) no-repeat;
-}
-span.recon_server {
-  background: url(../../images/recon.png) no-repeat;
-}
-span.wmi_server {
-  background: url(../../images/wmi.png) no-repeat;
-}
-span.export_server {
-  background: url(../../images/server_export.png) no-repeat;
-}
-span.inventory_server {
-  background: url(../../images/page_white_text.png) no-repeat;
-}
-span.web_server {
-  background: url(../../images/world.png) no-repeat;
-}
-/* This kind of span do not have any sense, should be replaced on PHP code
-by a real img in code. They are not useful because insert too much margin around
-(for example, not valid to use in the table of server view */
-span.users,
-span.agents,
-span.data,
-span.alerts,
-span.time,
-span.net,
-span.master,
-span.snmp,
-span.binary,
-span.recon,
-span.wmi,
-span.prediction,
-span.plugin,
-span.plugin,
-span.export,
-span.recon_server,
-span.wmi_server,
-span.export_server,
-span.inventory_server,
-span.web_server {
-  margin-left: 4px;
-  margin-top: 10px;
-  padding: 4px 8px 12px 30px;
-  display: block;
-}
-span.rmess,
-span.nrmess {
-  margin-left: 14px;
-  padding: 1px 0px 10px 30px;
-  display: block;
-}
-/* New styles for data box */
-.databox,
-.databox_color,
-.databox_frame {
-  margin-bottom: 5px;
-  margin-top: 0px;
-  margin-left: 0px;
-  border: 1px solid #e2e2e2;
-  -moz-border-radius: 4px;
-  -webkit-border-radius: 4px;
-  border-radius: 4px;
-}
-.databox_color {
-  padding-top: 5px;
-}
-
-table.databox {
-  background-color: #5b5b5b;
-  border-spacing: 0px;
-  -moz-box-shadow: 0px 0px 0px #ddd;
-  -webkit-box-shadow: 0px 0px 0px #ddd;
-  box-shadow: 0px 0px 0px #ddd;
-}
-
-.databox td {
-  -moz-border-radius: 0px;
-  -webkit-border-radius: 0px;
-  border-radius: 0px;
-  border: 0px none #e2e2e2;
-}
-
-.databox th {
-  padding: 9px 7px;
-  font-weight: normal;
-  color: #fff;
-}
-.databox td {
-  #border-bottom: 1px solid #e2e2e2;
-}
-
-.databox th * {
-  color: #fff;
-}
-
-.databox th input,
-.databox th textarea,
-.databox th select,
-.databox th select option {
-  color: #222;
-}
-
-.tabletitle {
-  color: #333;
-}
-
-.tactical_set legend {
-  text-align: left;
-  color: #fff;
-}
-
-.tactical_set {
-  background: #5b5b5b;
-  border: 1px solid #e2e2e2;
-  margin-left: auto;
-  margin-right: auto;
-  width: auto;
-}
-
-/* For use in Netflow */
-
-table.databox_grid {
-  margin: 25px;
-}
-
-table.databox_grid th {
-  font-size: 12px;
-}
-
-table.databox_grid td {
-  padding: 6px;
-  margin: 4px;
-  border-bottom: 1px solid #acacac;
-  border-right: 1px solid #acacac;
-}
-
-table.alternate tr:nth-child(odd) td {
-  background-color: #5b5b5b;
-}
-table.alternate tr:nth-child(even) td {
-  background-color: #e4e5e4;
-}
-
-table.rounded_cells td {
-  padding: 4px 4px 4px 10px;
-  -moz-border-radius: 6px;
-  -webkit-border-radius: 6px;
-  border-radius: 6px;
-}
-
-.databox_color {
-  background-color: #fafafa;
-}
-#head_l {
-  float: left;
-  margin: 0;
-  padding: 0;
-}
-#head_r {
-  float: right;
-  text-align: right;
-  margin-right: 10px;
-  padding-top: 0px;
-}
-#head_m {
-  position: absolute;
-  padding-top: 6px;
-  padding-left: 12em;
-}
-span#logo_text1 {
-  font: bolder 3em Arial, Sans-serif;
-  letter-spacing: -2px;
-  color: #eee;
-}
-span#logo_text2 {
-  font: 3em Arial, Sans-serif;
-  letter-spacing: -2px;
-  color: #aaa;
-}
-
-div#logo_text3 {
-  text-align: right;
-  font: 2em Arial, Sans-serif;
-  letter-spacing: 6px;
-  color: #aaa;
-  font-weight: bold;
-  margin-top: 0px;
-  margin-left: 4px;
-  padding-top: 0px;
-}
-
-.bb0 {
-  border-bottom: 0px;
-}
-.bt0 {
-  border-top: 0px;
-}
-.action-buttons {
-  text-align: right;
-}
-#table-add-item select,
-#table-add-sla select {
-  width: 180px;
-}
-
-/* end of classes for event priorities */
-div#main_pure {
-  background-color: #fefefe;
-  text-align: left;
-  margin-bottom: 25px;
-  margin-top: 30px;
-  margin-left: 10px;
-  margin-right: 10px;
-  height: 1000px;
-  width: 98%;
-  position: static;
-}
-#table-agent-configuration radio {
-  margin-right: 40px;
-}
-.ui-draggable {
-  cursor: move;
-}
-#layout_trash_drop {
-  float: right;
-  width: 300px;
-  height: 180px;
-  background: #fff url("../../images/trash.png") no-repeat bottom left;
-}
-#layout_trash_drop div {
-  display: block;
-}
-#layout_editor_drop {
-  float: left;
-  width: 300px;
-}
-.agent_reporting {
-  margin: 5px;
-  padding: 5px;
-}
-.report_table,
-.agent_reporting {
-  border: #ccc outset 3px;
-}
-.img_help {
-  cursor: help;
-}
-#loading {
-  position: fixed;
-  width: 200px;
-  margin-left: 30%;
-  text-align: center;
-  top: 50%;
-  background-color: #999999;
-  padding: 20px;
-}
-/* IE 7 Hack */
-#editor {
-  *margin-top: 10px;
-}
-/* big_data is used in tactical and logon_ok */
-.big_data {
-  text-decoration: none;
-  font: bold 2em Arial, Sans-serif;
-}
-
-.med_data {
-  text-decoration: none;
-  font: bold 1.5em Arial, Sans-serif;
-}
-
-.notify {
-  background-color: #f7ffa5;
-  text-align: center;
-  font-weight: bold;
-  padding: 8px;
-  margin: 0px 0px 0px 0px;
-  z-index: -1;
-}
-
-.notify a {
-  color: #003a3a;
-  text-decoration: underline;
-}
-
-.listing {
-  border-collapse: collapse;
-}
-.listing td {
-  border-bottom: 1px solid #cccccc;
-  border-top: 1px solid #cccccc;
-}
-ul {
-  list-style-type: none;
-  padding-left: 0;
-  margin-left: 0;
-}
-span.actions {
-  margin-left: 30px;
-}
-.actions {
-  min-width: 200px;
-}
-code,
-pre {
-  font-family: courier, serif;
-}
-select#template,
-select#action {
-  width: 250px;
-}
-#label-checkbox-matches_value,
-#label-checkbox-copy_modules,
-#label-checkbox-copy_alerts {
-  display: inline;
-  font-weight: normal;
-}
-input[type="image"] {
-  border: 0px;
-  background-color: transparent;
-}
-table#simple select#id_module_type,
-table#alert_search select#id_agent,
-table#alert_search select#id_group,
-table#network_component select#type {
-  width: 200px;
-}
-table#simple select#select_snmp_oid,
-table#simple select#id_plugin,
-table#network_component select#id_plugin {
-  width: 270px;
-}
-table#simple select#prediction_id_group,
-table#simple select#prediction_id_agent,
-table#simple select#prediction_module {
-  width: 50%;
-  display: block;
-}
-table#simple input#text-plugin_parameter,
-table#simple input#text-snmp_oid,
-table#source_table select,
-table#destiny_table select,
-table#target_table select,
-table#filter_compound_table select,
-table#filter_compound_table #text-search,
-table#delete_table select {
-  width: 100%;
-}
-table#simple select#network_component_group,
-table#simple select#network_component {
-  width: 90%;
-}
-table#simple span#component_group,
-table#simple span#component {
-  width: 45%;
-  font-style: italic;
-}
-table#simple label {
-  display: inline;
-  font-weight: normal;
-  font-style: italic;
-}
-.clickable {
-  cursor: pointer;
-}
-table#agent_list tr,
-table.alert_list tr {
-  vertical-align: top;
-}
-.toggle {
-  border-collapse: collapse;
-}
-.toggle td {
-  border-left: 1px solid #d3d3d3;
-}
-
-ul.actions_list {
-  list-style-image: url(../../images/arrow.png);
-  list-style-position: inside;
-  margin-top: 0;
-}
-div.loading {
-  background-color: #fff1a8;
-  margin-left: auto;
-  margin-right: auto;
-  padding: 5px;
-  text-align: center;
-  font-style: italic;
-  width: 95%;
-}
-div.loading img {
-  float: right;
-}
-/* Tablesorter jQuery pager */
-div.pager {
-  margin-left: 10px;
-  margin-top: 5px;
-}
-div.pager img {
-  position: relative;
-  top: 4px;
-  padding-left: 5px;
-}
-div.pager input {
-  padding-left: 5px;
-}
-.pagedisplay {
-  border: 0;
-  width: 35px;
-}
-/* Steps style */
-ol.steps {
-  margin-bottom: 15px;
-  padding: 0;
-  list-style-type: none;
-  list-style-position: outside;
-}
-ol.steps li {
-  float: left;
-  background-color: #efefef;
-  padding: 5px;
-  margin-left: 5px;
-  width: 150px;
-}
-ol.steps li a {
-  color: #111;
-}
-ol.steps li.visited a {
-  color: #999;
-}
-ol.steps li span {
-  font-weight: normal;
-  display: block;
-}
-ol.steps li span {
-  color: #777;
-}
-ol.steps li.visited span {
-  color: #999;
-}
-ol.steps li.current {
-  border-left: 5px solid #778866;
-  margin-left: 0;
-  font-weight: bold;
-  background-color: #e9f3d2;
-}
-ol.steps li.visited {
-  color: #999;
-}
-
-fieldset {
-  background-color: #5b5b5b;
-  border: 1px solid #e2e2e2;
-  padding: 0.5em;
-  margin-bottom: 20px;
-  position: relative;
-}
-fieldset legend {
-  font-size: 1.1em;
-  font-weight: bold;
-  #color: #3f4e2f;
-  line-height: 20px;
-  color: #3f3f3f;
-  #top: -2em;
-}
-
-fieldset .databox {
-  border: 0px solid;
-}
-
-fieldset.databox {
-  padding: 14px;
-}
-
-fieldset legend span,
-span#latest_value {
-  font-style: italic;
-}
-span#latest_value span#value {
-  font-style: normal;
-}
-form#filter_form {
-  margin-bottom: 15px;
-}
-ul.action_list {
-  margin: 0;
-  list-style: none inside circle;
-}
-ul.action_list li div {
-  margin-left: 15px;
-}
-span.action_name {
-  float: none;
-}
-div.actions_container {
-  overflow: auto;
-  width: 100%;
-  max-height: 200px;
-}
-div.actions_container label {
-  display: inline;
-  font-weight: normal;
-  font-style: italic;
-}
-a.add_action {
-  clear: both;
-  display: block;
-}
-
-/* timeEntry styles */
-.timeEntry_control {
-  vertical-align: middle;
-  margin-left: 2px;
-}
-div#steps_clean {
-  clear: both;
-}
-div#event_control {
-  clear: right;
-}
-
-/* Autocomplete styles */
-.ac_results {
-  padding: 0px;
-  border: 1px solid black;
-  background-color: white;
-  overflow: hidden;
-  z-index: 99999;
-}
-
-.ac_results ul {
-  width: 100%;
-  list-style-position: outside;
-  list-style: none;
-  padding: 0;
-  margin: 0;
-  text-align: left;
-}
-
-.ac_results li {
-  margin: 0px;
-  padding: 2px 5px;
-  cursor: default;
-  display: block;
-  /*
-	if width will be 100% horizontal scrollbar will apear
-	when scroll mode will be used
-	*/
-  /*width: 100%;*/
-  font: menu;
-  font-size: 12px;
-  /*
-	it is very important, if line-height not setted or setted
-	in relative units scroll will be broken in firefox
-	*/
-  line-height: 16px;
-}
-
-.ac_loading {
-  background: white url("../images/loading.gif") right center no-repeat;
-}
-
-.ac_over {
-  background-color: #efefef;
-}
-span.ac_extra_field,
-span.ac_extra_field strong {
-  font-style: italic;
-  font-size: 9px;
-}
-
-div#pandora_logo_header {
-  /*	Put here your company logo (139x60 pixels) like this: */
-  /*	background: url(../../images/MiniLogoArtica.jpg); */
-  background: url(../../images/pandora_logo_head.png);
-  background-position: 0% 0%;
-  width: 139px;
-  height: 60px;
-  float: left;
-}
-
-#header_table img {
-  margin-top: 0px;
-}
-
-.autorefresh_disabled {
-  cursor: not-allowed;
-}
-
-a.autorefresh {
-  padding-right: 8px;
-}
-
-#refrcounter {
-  color: white;
-}
-
-#combo_refr select {
-  margin-right: 8px;
-}
-
-.disabled_module {
-  color: #aaa;
-}
-div.warn {
-  background: url(../../images/info.png) no-repeat;
-  margin-top: 7px;
-  padding: 2px 1px 6px 25px;
-}
-
-.submenu_not_selected {
-  transition-property: background-color;
-  transition-duration: 0.5s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color;
-  -webkit-transition-duration: 0.5s;
-  -webkit-transition-timing-function: ease-out;
-  -moz-transition-property: background-color;
-  -moz-transition-duration: 0.5s;
-  -moz-transition-timing-function: ease-out;
-  -o-transition-property: background-color;
-  -o-transition-duration: 0.5s;
-  -o-transition-timing-function: ease-out;
-  font-weight: normal;
-}
-
-/* Submenus havent borders */
-.submenu_not_selected,
-.submenu_selected,
-.submenu2 {
-  border: 0px;
-  min-height: 35px;
-}
-
-/* Pandora width style theme */
-
-div#container {
-  width: 100%;
-}
-div#page {
-  width: auto;
-}
-div#main {
-  max-width: 93%;
-  min-width: 93%;
-}
-
-ol.steps {
-  margin-bottom: 70px;
-}
-div#steps_clean {
-  display: none;
-}
-
-#menu_tab_frame,
-#menu_tab_frame_view {
-  width: 100%;
-  padding-right: 0px;
-  margin-left: 0px;
-  margin-bottom: 20px;
-  height: 31px;
-}
-div#events_list {
-  float: left;
-  width: 100%;
-}
-span#logo_text1 {
-  font: bolder 3em Arial, Sans-serif;
-  letter-spacing: -2px;
-  color: #eee;
-}
-span#logo_text2 {
-  font: 3em Arial, Sans-serif;
-  letter-spacing: -2px;
-  color: #aaa;
-}
-div#logo_text3 {
-  text-align: right;
-  font: 2em Arial, Sans-serif;
-  letter-spacing: 6px;
-  color: #aaa;
-  font-weight: bold;
-  margin-top: 0px;
-  margin-left: 4px;
-  padding-top: 0px;
-}
-.pagination {
-  margin-top: 15px;
-  margin-bottom: 5px;
-}
-.pagination * {
-  margin-left: 0px;
-  margin-right: 0px;
-  vertical-align: middle;
-}
-
-/*CALENDAR TOOLTIP STYLE*/
-
-/* Calendar background */
-table.scw {
-  background-color: #82b92e;
-  border: 0;
-  border-radius: 4px;
-}
-
-/* Week number heading */
-td.scwWeekNumberHead {
-  color: #111;
-}
-
-td.scwWeek {
-  color: #111;
-}
-
-Today selector td.scwFoot {
-  background-color: #daedae;
-  color: #111;
-}
-
-td.scwFootDisabled {
-  background-color: #000;
-  color: #ffffff;
-}
-
-tfoot.scwFoot {
-  color: #111;
-}
-
-.scwFoot :hover {
-  color: #3f3f3f;
-}
-
-table.scwCells {
-  background-color: #5b5b5b;
-  color: #3c3c3c;
-}
-
-table.scwCells:hover {
-  background-color: #5b5b5b;
-}
-
-td.scwCellsExMonth {
-  background-color: #eee;
-  color: #3c3c3c;
-}
-
-td.scwCellsWeekend {
-  background-color: #3c3c3c;
-  color: #fff;
-  border: 0;
-}
-
-td.scwInputDate {
-  background-color: #777;
-  color: #ffffff;
-  border: 0;
-}
-
-td.scwFoot {
-  background-color: #5b5b5b;
-  color: #3c3c3c;
-  border: 0;
-}
-
-/* Cells divs to set individual styles with the table objects */
-div.cellBold {
-  width: 100%;
-  height: 100%;
-  font-weight: bold;
-}
-
-div.cellRight {
-  width: 100%;
-  height: 100%;
-  text-align: right;
-}
-
-div.cellCenter {
-  width: 100%;
-  height: 100%;
-  text-align: center;
-}
-
-div.cellWhite {
-  width: 100%;
-  height: 100%;
-  background: #5b5b5b;
-  color: #111;
-}
-
-div.cellNormal {
-  width: 100%;
-  height: 100%;
-  background: #6eb432;
-  color: #fff;
-}
-
-div.cellCritical {
-  width: 100%;
-  height: 100%;
-  background: #f85858;
-  color: #fff;
-}
-
-div.cellWarning {
-  width: 100%;
-  height: 100%;
-  background: #ffea59;
-  color: #111;
-}
-
-div.cellUnknown {
-  width: 100%;
-  height: 100%;
-  background: #aaaaaa;
-  color: #ffffff;
-}
-
-div.cellNotInit {
-  width: 100%;
-  height: 100%;
-  background: #4a83f3;
-  color: #ffffff;
-}
-
-div.cellAlert {
-  width: 100%;
-  height: 100%;
-  background: #ff8800;
-  color: #111;
-}
-
-div.cellBorder1 {
-  width: 100%;
-  height: 100%;
-  border: 1px solid #666;
-}
-
-div.cellBig {
-  width: 100%;
-  height: 100%;
-  font-size: 18px;
-}
-
-.info_box {
-  background: #5b5b5b;
-  margin-top: 10px;
-  margin-bottom: 10px;
-  padding: 0px 5px 5px 10px;
-  border-color: #e2e2e2;
-  border-style: solid;
-  border-width: 1px;
-  width: 100%;
-  -moz-border-radius: 4px;
-  -webkit-border-radius: 4px;
-  border-radius: 4px;
-}
-
-.info_box .title * {
-  font-size: 10pt;
-  font-weight: bolder;
-}
-
-.info_box .icon {
-  width: 30px;
-  text-align: center;
-}
-
-/* Standard styles for status colos (groups, events, backgrounds...) */
-
-.opacity_cell {
-  filter: alpha(opacity=80);
-  -moz-opacity: 0.8;
-  opacity: 0.8;
-  -khtml-opacity: 0.8;
-}
-
-tr.group_view_data,
-.group_view_data {
-  color: #3f3f3f;
-}
-
-tr.group_view_crit,
-.group_view_crit {
-  background-color: #e63c52;
-  color: #fff;
-}
-
-tr.group_view_norm,
-.group_view_norm,
-tr.group_view_normal,
-.group_view_normal {
-  #background-color: #5b5b5b;
-}
-tr.group_view_ok,
-.group_view_ok {
-  background-color: #82b92e;
-  color: #fff;
-}
-
-tr.group_view_not_init,
-.group_view_not_init,
-tr.group_view_not_init,
-.group_view_not_init {
-  background-color: #5bb6e5;
-  color: #fff;
-}
-
-tr.group_view_warn,
-.group_view_warn,
-tr.group_view_warn.a,
-a.group_view_warn,
-tr.a.group_view_warn {
-  background-color: #f3b200;
-  color: #3f3f3f;
-}
-
-a.group_view_warn {
-  color: #f3b200;
-}
-
-tr.group_view_alrm,
-.group_view_alrm {
-  background-color: #ffa631;
-  color: #fff;
-}
-
-tr.group_view_unk,
-.group_view_unk {
-  background-color: #b2b2b2;
-  color: #fff;
-}
-
-/* classes for event priorities. Sits now in functions.php */
-.datos_green,
-.datos_greenf9,
-.datos_green a,
-.datos_greenf9 a,
-.datos_green * {
-  background-color: #82b92e;
-  color: #fff;
-}
-.datos_red,
-.datos_redf9,
-.datos_red a,
-.datos_redf9 a,
-.datos_red * {
-  background-color: #e63c52;
-  color: #fff;
-}
-
-.datos_yellow,
-.datos_yellowf9,
-.datos_yellow * {
-  background-color: #f3b200;
-  color: #111;
-}
-
-a.datos_blue,
-.datos_bluef9,
-.datos_blue,
-.datos_blue * {
-  background-color: #4ca8e0;
-  color: #fff;
-}
-
-.datos_grey,
-.datos_greyf9,
-.datos_grey * {
-  background-color: #999999;
-  color: #fff;
-}
-
-.datos_pink,
-.datos_pinkf9,
-.datos_pink * {
-  background-color: #fdc4ca;
-  color: #111;
-}
-
-.datos_brown,
-.datos_brownf9,
-.datos_brown * {
-  background-color: #a67c52;
-  color: #fff;
-}
-
-.datos_orange,
-.datos_orangef9,
-.datos_orange * {
-  background-color: #f7931e;
-  color: #111;
-}
-
-td.datos_greyf9,
-td.datos_bluef9,
-td.datos_greenf9,
-td.datos_redf9,
-td.datos_yellowf9,
-td.datos_pinkf9,
-td.datos_brownf9,
-td.datos_orangef9 {
-  padding: 5px 5px 5px 5px;
-}
-
-.menu li.selected {
-  font-weight: bold;
-}
-
-ul.operation li a:hover {
-  #font-weight: bold;
-}
-
-.menu_icon {
-  transition-property: background-color;
-  transition-duration: 0.5s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color;
-  -webkit-transition-duration: 0.5s;
-  -webkit-transition-timing-function: ease-out;
-  -moz-transition-property: background-color;
-  -moz-transition-duration: 0.5s;
-  -moz-transition-timing-function: ease-out;
-  -o-transition-property: background-color;
-  -o-transition-duration: 0.5s;
-  -o-transition-timing-function: ease-out;
-}
-
-.menu_icon:hover {
-  transition-property: background-color;
-  transition-duration: 0.5s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color;
-  -webkit-transition-duration: 0.5s;
-  -webkit-transition-timing-function: ease-out;
-  -moz-transition-property: background-color;
-  -moz-transition-duration: 0.5s;
-  -moz-transition-timing-function: ease-out;
-  -o-transition-property: background-color;
-  -o-transition-duration: 0.5s;
-  -o-transition-timing-function: ease-out;
-  background-color: #b1b1b1;
-}
-.submenu_not_selected:hover {
-  transition-property: background-color;
-  transition-duration: 0.5s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color;
-  -webkit-transition-duration: 0.5s;
-  -webkit-transition-timing-function: ease-out;
-  -moz-transition-property: background-color;
-  -moz-transition-duration: 0.5s;
-  -moz-transition-timing-function: ease-out;
-  -o-transition-property: background-color;
-  -o-transition-duration: 0.5s;
-  -o-transition-timing-function: ease-out;
-  background-color: #b1b1b1;
-}
-
-.submenu_selected:hover {
-  background-color: #b1b1b1;
-}
-
-.sub_subMenu {
-  transition-property: background-color;
-  transition-duration: 0.5s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color;
-  -webkit-transition-duration: 0.5s;
-  -webkit-transition-timing-function: ease-out;
-  -moz-transition-property: background-color;
-  -moz-transition-duration: 0.5s;
-  -moz-transition-timing-function: ease-out;
-  -o-transition-property: background-color;
-  -o-transition-duration: 0.5s;
-}
-.sub_subMenu:hover {
-  transition-property: background-color;
-  transition-duration: 0.5s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color;
-  -webkit-transition-duration: 0.5s;
-  -webkit-transition-timing-function: ease-out;
-  -moz-transition-property: background-color;
-  -moz-transition-duration: 0.5s;
-  -moz-transition-timing-function: ease-out;
-  -o-transition-property: background-color;
-  -o-transition-duration: 0.5s;
-  background-color: #b1b1b1;
-}
-
-.submenu_text {
-  color: #fff;
-}
-
-.menu li.selected {
-  box-shadow: inset 4px 0 #b1b1b1;
-}
-
-li.links a:hover {
-  #font-weight: bold;
-}
-
-.is_submenu2 li {
-  background-color: #ff0000;
-}
-
-.is_submenu2 {
-  background-color: #222222;
-}
-
-.operation {
-  background-color: #333;
-}
-
-.operation .selected {
-  background-color: #b1b1b1;
-}
-
-.menu li,
-.menu .li.not_selected {
-  border-radius: 0px 0px 0px 0px;
-  display: block;
-  min-height: 35px;
-  border-bottom: 0px none #424242;
-  vertical-align: middle;
-}
-
-#menu_tab li.separator {
-  /* Empty */
-}
-
-.operation {
-  border-top-right-radius: 5px;
-  border-right-style: solid;
-  border-right-width: 0px;
-}
-
+#menu_tab_frame_view,
+#menu_tab_frame_view_bc,
+input.search_input,
+.filters input,
 input#text-id_parent.ac_input,
 input,
 textarea,
-select {
-  background-color: #5b5b5b;
-  border: 1px solid #cbcbcb;
-  -moz-border-radius: 3px;
-  -webkit-border-radius: 3px;
-  border-radius: 3px;
-}
-
-span#plugin_description {
-  font-size: 9px;
-}
-
-/*FOR TINYMCE*/
-#tinymce {
-  text-align: left;
-}
-.visual_font_size_4pt,
-.visual_font_size_4pt > em,
-.visual_font_size_4pt > strong,
-.visual_font_size_4pt > strong > span,
-.visual_font_size_4pt > span,
-.visual_font_size_4pt > strong > em,
-.visual_font_size_4pt > em > strong,
-.visual_font_size_4pt em span,
-.visual_font_size_4pt span em {
-  font-size: 4pt;
-  line-height: 4pt;
-}
-.visual_font_size_6pt,
-.visual_font_size_6pt > em,
-.visual_font_size_6pt > strong,
-.visual_font_size_6pt > strong > span,
-.visual_font_size_6pt > span,
-.visual_font_size_6pt > strong > em,
-.visual_font_size_6pt > em > strong,
-.visual_font_size_6pt em span,
-.visual_font_size_6pt span em {
-  font-size: 6pt;
-  line-height: 6pt;
-}
-.visual_font_size_8pt,
-.visual_font_size_8pt > em,
-.visual_font_size_8pt > strong,
-.visual_font_size_8pt > strong > span,
-.visual_font_size_8pt > span,
-.visual_font_size_8pt > strong > em,
-.visual_font_size_8pt > em > strong,
-.visual_font_size_8pt em span,
-.visual_font_size_8pt span em {
-  font-size: 8pt;
-  line-height: 8pt;
-}
-.visual_font_size_10pt,
-.visual_font_size_10pt > em,
-.visual_font_size_10pt > strong,
-.visual_font_size_10pt > strong > em,
-.visual_font_size_10pt > em > strong,
-.visual_font_size_10pt em span,
-.visual_font_size_10pt span em {
-  font-size: 10pt;
-  line-height: 10pt;
-}
-.visual_font_size_12pt,
-.visual_font_size_12pt > em,
-.visual_font_size_12pt > strong,
-.visual_font_size_12pt > strong > em,
-.visual_font_size_12pt > em > strong,
-.visual_font_size_12pt em span,
-.visual_font_size_12pt span em {
-  font-size: 12pt;
-  line-height: 12pt;
-}
-.visual_font_size_14pt,
-.visual_font_size_14pt > em,
-.visual_font_size_14pt > strong,
-.visual_font_size_14pt > strong > span,
-.visual_font_size_14pt > span,
-.visual_font_size_14pt > strong > em,
-.visual_font_size_14pt > em > strong,
-.visual_font_size_14pt em span,
-.visual_font_size_14pt span em {
-  font-size: 14pt;
-  line-height: 14pt;
-}
-.visual_font_size_18pt,
-.visual_font_size_18pt > em,
-.visual_font_size_18pt > strong,
-.visual_font_size_18pt > strong > span,
-.visual_font_size_18pt > span,
-.visual_font_size_18pt > strong > em,
-.visual_font_size_18pt > em > strong,
-.visual_font_size_18pt em span,
-.visual_font_size_18pt span em {
-  font-size: 18pt;
-  line-height: 18pt;
-}
-.visual_font_size_24pt,
-.visual_font_size_24pt > em,
-.visual_font_size_24pt > strong,
-.visual_font_size_24pt > strong > span,
-.visual_font_size_24pt > span,
-.visual_font_size_24pt > strong > em,
-.visual_font_size_24pt > em > strong,
-.visual_font_size_24pt em span,
-.visual_font_size_24pt span em {
-  font-size: 24pt;
-  line-height: 24pt;
-}
-.visual_font_size_28pt,
-.visual_font_size_28pt > em,
-.visual_font_size_28pt > strong,
-.visual_font_size_28pt > strong > span,
-.visual_font_size_28pt > span,
-.visual_font_size_28pt > strong > em,
-.visual_font_size_28pt > em > strong,
-.visual_font_size_28pt em span,
-.visual_font_size_28pt span em {
-  font-size: 28pt;
-  line-height: 28pt;
-}
-.visual_font_size_36pt,
-.visual_font_size_36pt > em,
-.visual_font_size_36pt > strong,
-.visual_font_size_36pt > strong > span,
-.visual_font_size_36pt > span,
-.visual_font_size_36pt > strong > em,
-.visual_font_size_36pt > em > strong,
-.visual_font_size_36pt em span,
-.visual_font_size_36pt span em {
-  font-size: 36pt;
-  line-height: 36pt;
-}
-.visual_font_size_48pt,
-.visual_font_size_48pt > em,
-.visual_font_size_48pt > strong,
-.visual_font_size_48pt > strong > span,
-.visual_font_size_48pt > span,
-.visual_font_size_48pt > strong > em,
-.visual_font_size_48pt > em > strong,
-.visual_font_size_48pt em span,
-.visual_font_size_48pt span em {
-  font-size: 48pt;
-  line-height: 48pt;
-}
-.visual_font_size_60pt,
-.visual_font_size_60pt > em,
-.visual_font_size_60pt > strong,
-.visual_font_size_60pt > strong > span,
-.visual_font_size_60pt > span,
-.visual_font_size_60pt > strong > em,
-.visual_font_size_60pt > em > strong,
-.visual_font_size_60pt em span,
-.visual_font_size_60pt span em {
-  font-size: 60pt;
-  line-height: 60pt;
-}
-.visual_font_size_72pt,
-.visual_font_size_72pt > em,
-.visual_font_size_72pt > strong,
-.visual_font_size_72pt > strong > span,
-.visual_font_size_72pt > span,
-.visual_font_size_72pt > strong > em,
-.visual_font_size_72pt > em > strong,
-.visual_font_size_72pt em span,
-.visual_font_size_72pt span em {
-  font-size: 72pt;
-  line-height: 72pt;
-}
-.visual_font_size_84pt,
-.visual_font_size_84pt > em,
-.visual_font_size_84pt > strong,
-.visual_font_size_84pt > strong > span,
-.visual_font_size_84pt > span,
-.visual_font_size_84pt > strong > em,
-.visual_font_size_84pt > em > strong,
-.visual_font_size_84pt em span,
-.visual_font_size_84pt span em {
-  font-size: 84pt;
-  line-height: 84pt;
-}
-
-.visual_font_size_96pt,
-.visual_font_size_96pt > em,
-.visual_font_size_96pt > strong,
-.visual_font_size_96pt > strong > span,
-.visual_font_size_96pt > span,
-.visual_font_size_96pt > strong > em,
-.visual_font_size_96pt > em > strong,
-.visual_font_size_96pt em span,
-.visual_font_size_96pt span em {
-  font-size: 96pt;
-  line-height: 96pt;
-}
-
-.visual_font_size_116pt,
-.visual_font_size_116pt > em,
-.visual_font_size_116pt > strong,
-.visual_font_size_116pt > strong > span,
-.visual_font_size_116pt > span,
-.visual_font_size_116pt > strong > em,
-.visual_font_size_116pt > em > strong,
-.visual_font_size_116pt em span,
-.visual_font_size_116pt span em {
-  font-size: 116pt;
-  line-height: 116pt;
-}
-
-.visual_font_size_128pt,
-.visual_font_size_128pt > em,
-.visual_font_size_128pt > strong,
-.visual_font_size_128pt > strong > span,
-.visual_font_size_128pt > span,
-.visual_font_size_128pt > strong > em,
-.visual_font_size_128pt > em > strong,
-.visual_font_size_128pt em span,
-.visual_font_size_128pt span em {
-  font-size: 128pt;
-  line-height: 128pt;
-}
-
-.visual_font_size_140pt,
-.visual_font_size_140pt > em,
-.visual_font_size_140pt > strong,
-.visual_font_size_140pt > strong > span,
-.visual_font_size_140pt > span,
-.visual_font_size_140pt > strong > em,
-.visual_font_size_140pt > em > strong,
-.visual_font_size_140pt em span,
-.visual_font_size_140pt span em {
-  font-size: 140pt;
-  line-height: 140pt;
-}
-
-.visual_font_size_154pt,
-.visual_font_size_154pt > em,
-.visual_font_size_154pt > strong,
-.visual_font_size_154pt > strong > span,
-.visual_font_size_154pt > span,
-.visual_font_size_154pt > strong > em,
-.visual_font_size_154pt > em > strong,
-.visual_font_size_154pt em span,
-.visual_font_size_154pt span em {
-  font-size: 154pt;
-  line-height: 154pt;
-}
-
-.visual_font_size_196pt,
-.visual_font_size_196pt > em,
-.visual_font_size_196pt > strong,
-.visual_font_size_196pt > strong > span,
-.visual_font_size_196pt > span,
-.visual_font_size_196pt > strong > em,
-.visual_font_size_196pt > em > strong,
-.visual_font_size_196pt em span,
-.visual_font_size_196pt span em {
-  font-size: 196pt;
-  line-height: 196pt;
-}
-
-.resize_visual_font_size_8pt,
-.resize_visual_font_size_8pt > em,
-.resize_visual_font_size_8pt > strong,
-.resize_visual_font_size_8pt > strong > span,
-.resize_visual_font_size_8pt > span,
-.resize_visual_font_size_8pt > strong > em,
-.resize_visual_font_size_8pt > em > strong,
-.visual_font_size_8pt em span,
-.visual_font_size_8pt span em {
-  font-size: 4pt;
-  line-height: 4pt;
-}
-.resize_visual_font_size_14pt,
-.resize_visual_font_size_14pt > em,
-.resize_visual_font_size_14pt > strong,
-.resize_visual_font_size_14pt > strong > span,
-.resize_visual_font_size_14pt > span,
-.resize_visual_font_size_14pt > strong > em,
-.resize_visual_font_size_14pt > em > strong,
-.visual_font_size_14pt em span,
-.visual_font_size_14pt span em {
-  font-size: 7pt;
-  line-height: 7pt;
-}
-.resize_visual_font_size_24pt,
-.resize_visual_font_size_24pt > em,
-.resize_visual_font_size_24pt > strong,
-.resize_visual_font_size_24pt > strong > span,
-.resize_visual_font_size_24pt > span,
-.resize_visual_font_size_24pt > strong > em,
-.resize_visual_font_size_24pt > em > strong,
-.visual_font_size_14pt em span,
-.visual_font_size_14pt span em {
-  font-size: 12pt;
-  line-height: 12pt;
-}
-.resize_visual_font_size_36pt,
-.resize_visual_font_size_36pt > em,
-.resize_visual_font_size_36pt > strong,
-.resize_visual_font_size_36pt > strong > span,
-.resize_visual_font_size_36pt > span,
-.resize_visual_font_size_36pt > strong > em,
-.resize_visual_font_size_36pt > em > strong,
-.visual_font_size_36pt em span,
-.visual_font_size_36pt span em {
-  font-size: 18pt;
-  line-height: 18pt;
-}
-.resize_visual_font_size_72pt,
-.resize_visual_font_size_72pt > em,
-.resize_visual_font_size_72pt > strong,
-.resize_visual_font_size_72pt > strong > span,
-.resize_visual_font_size_72pt > span,
-.resize_visual_font_size_72pt > strong > em,
-.resize_visual_font_size_72pt > em > strong,
-.visual_font_size_72pt em span,
-.visual_font_size_72pt span em {
-  font-size: 36pt;
-  line-height: 36pt;
-}
-
-/*SIDEBAR*/
-.menu_sidebar {
-  color: #111;
-  background: #3f3f3f;
-
-  margin-left: 10px;
-  padding-left: 0px;
-  padding-right: 0px;
-  padding-top: 10px;
-  text-align: left;
-  font-family: arial, sans-serif, verdana;
-  font-size: 10px;
-  border: 1px solid #000;
-  position: absolute;
-  margin: 0;
-  width: 400px;
-  height: 260px;
-
-  -moz-box-shadow: 0px 4px 4px #010e1b;
-  -webkit-box-shadow: 0px 4px 4px #010e1b;
-  box-shadow: 0px 4px 4px #010e1b;
-
-  filter: alpha(opacity=97);
-  -moz-opacity: 0.97;
-  opacity: 0.97;
-}
-
-.menu_sidebar_radius_left {
-  -moz-border-top-left-radius: 8px;
-  -webkit-border-top-left-radius: 8px;
-  border-top-left-radius: 8px;
-
-  -moz-border-bottom-left-radius: 8px;
-  -webkit-border-bottom-left-radius: 8px;
-  border-bottom-left-radius: 8px;
-
-  border-right: 0px solid #000;
-}
-
-.menu_sidebar_radius_right {
-  -moz-border-top-right-radius: 8px;
-  -webkit-border-top-right-radius: 8px;
-  border-top-right-radius: 8px;
-  -moz-border-bottom-right-radius: 8px;
-  -webkit-border-bottom-right-radius: 8px;
-  border-bottom-right-radius: 8px;
-}
-
-.menu_sidebar_outer {
-  margin-left: 3px;
-  background: #ececec;
-  width: 100%;
-  text-align: center;
-  -moz-border-radius: 6px;
-  -webkit-border-radius: 6px;
-  border-radius: 6px;
-  padding: 8px;
-}
-
-/*Groupsview*/
-
-.groupsview {
-  border-spacing: 0px 4px;
-}
-
-.groupsview tr {
-  background-color: #666;
-}
-
-.groupsview th {
-  font-size: 12px;
-  padding: 5px;
-}
-
-.groupsview td.first,
-.groupsview th.first {
-  -moz-border-top-left-radius: 10px;
-  -webkit-border-top-left-radius: 10px;
-  border-top-left-radius: 10px;
-
-  -moz-border-bottom-left-radius: 10px;
-  -webkit-border-bottom-left-radius: 10px;
-  border-bottom-left-radius: 10px;
-}
-
-.groupsview td.last,
-.groupsview th.last {
-  -moz-border-top-right-radius: 10px;
-  -webkit-border-top-right-radius: 10px;
-  border-top-right-radius: 10px;
-  -moz-border-bottom-right-radius: 10px;
-  -webkit-border-bottom-right-radius: 10px;
-  border-bottom-right-radius: 10px;
-}
-
-a.tip {
-  display: inline;
-  cursor: help;
-}
-
-a.tip > img {
-  margin-left: 2px;
-  margin-right: 2px;
-}
-
-input.search_input {
-  background: white url("../../images/input_zoom.png") no-repeat right;
-  padding: 0px;
-  padding-left: 5px;
-  margin: 0;
-  width: 80%;
-  height: 19px;
-  margin-bottom: 5px;
-  margin-left: 2px;
-  padding-right: 25px;
-  color: #999;
-}
-
-.vertical_fields td input,
-.vertical_fields td select {
-  margin-top: 8px;
-}
-
-a[id^="tgl_ctrl_"] > img,
-a[id^="tgl_ctrl_"] > b > img {
-  vertical-align: middle;
-}
-
-.noshadow {
-  -moz-box-shadow: 0px;
-  -webkit-box-shadow: 0px;
-  box-shadow: 0px;
-}
-
-/* Images forced title */
-
-div.forced_title_layer {
-  display: block;
-  text-decoration: none;
-  position: absolute;
-  z-index: 100000;
-  border: 1px solid #708090;
-  background-color: #666;
+select,
+.edit_user_comments #textarea_comments,
+.discovery_textarea_input {
+  background-color: #111;
   color: #fff;
-  padding: 4px 5px;
-  font-weight: bold;
-  font-size: small;
-  font-size: 11px;
-  /* IE 8 */
-  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=9)";
-  /* Netscape */
-  -moz-opacity: 0.9;
-  opacity: 0.9;
-  -moz-border-radius: 3px;
-  -webkit-border-radius: 3px;
-  border-radius: 3px;
-}
-
-/* Graphs styles */
-
-div.legend > div {
-  pointer-events: none; /* Allow to click the graphs below */
-  opacity: 0.65;
-}
-
-div.nodata_text {
-  padding: 5px 12px 0px 68px;
-  font-weight: bold;
-  color: #c1c1c1;
-  text-transform: uppercase;
-  display: table-cell;
-  vertical-align: middle;
-  text-align: left;
-}
-
-div.nodata_container {
-  width: 150px;
-  height: 100px;
-  background-repeat: no-repeat;
-  background-position: center;
-  margin: auto auto;
-  display: table;
-}
-
-#snmp_data {
-  width: 40%;
-  position: absolute;
-  top: 0;
-  right: 20px;
-
-  #background-color: #5b5b5b;
-  #padding: 10px;
-}
-
-#rmf_data {
-  width: 40%;
-  height: 80%;
-  position: absolute;
-  top: 0;
-  right: 20px;
-  overflow: auto;
-
-  #background-color: #5b5b5b;
-  #padding: 10px;
-}
-
-/* Subtab styles */
-
-ul.subsubmenu {
-  border-bottom-right-radius: 5px;
-  border-bottom-left-radius: 5px;
-  -moz-border-bottom-right-radius: 5px;
-  -moz-border-bottom-left-radius: 5px;
-  -webkit-border-bottom-right-radius: 5px;
-  -webkit-border-bottom-left-radius: 5px;
-
-  background: #ececec;
-}
-
-ul.subsubmenu li {
-  background-color: #ececec;
-  font-weight: bold;
-  text-decoration: none;
-  font-size: 14px;
-  border-color: #e2e2e2;
-  border-style: solid;
-  border-width: 1px;
-}
-
-ul.subsubmenu li a {
-  padding: 0px 10px 5px;
-}
-
-div#agent_wizard_subtabs {
-  position: absolute;
-  margin-left: 0px;
-  display: none;
-  padding-bottom: 3px;
-  z-index: 1000;
-}
-
-.agent_wizard_tab:hover {
-  cursor: default;
-}
-
-#container_servicemap_legend {
-  position: absolute;
-  width: 200px;
-  background: #5b5b5b;
-  margin-top: 10px;
-  right: 2px;
-  border: 1px solid #e2e2e2;
-  border-radius: 5px;
-  padding: 10px;
-  opacity: 0.9;
-}
-
-#container_servicemap_legend table {
-  text-align: left;
-}
-
-.legend_square {
-  width: 20px;
-  padding-left: 20px;
-  padding-right: 10px;
-}
-
-.legend_square_simple {
-  padding-left: 0px;
-  padding-right: 10px;
-  padding-bottom: 3px;
-}
-.legend_square div,
-.legend_square_simple div {
-  width: 20px;
-  height: 20px;
-  border-radius: 3px;
-}
-
-.legend_basic {
-  background: #f4f4f4;
-  margin-top: 10px;
-  border-radius: 5px;
-  padding: 10px;
-}
-
-.agents_modules_table th {
-  background: #3f3f3f;
-}
-
-.agents_modules_table th * {
-  color: #ffffff;
-}
-
-/*
- * LOAD_ENTERPRISE.PHP
- */
-#code_license_dialog {
-  padding: 50px;
-  padding-top: 10px;
-}
-#code_license_dialog #logo {
-  margin-bottom: 20px;
-  text-align: center;
-}
-#code_license_dialog,
-#code_license_dialog * {
-  font-size: 14px;
-}
-#code_license_dialog ul {
-  padding-left: 30px;
-  list-style-image: url("../../images/input_tick.png");
-}
-#code_license_dialog li {
-  margin-bottom: 12px;
-}
-
-#code_license_dialog #code {
-  font-weight: bolder;
-  font-size: 20px;
-  border: 1px solid #dddddd;
-  padding: 5px;
-  text-align: center;
-  -moz-border-radius: 8px;
-  -webkit-border-radius: 8px;
-  border-radius: 8px;
-}
-
-#code_license_dialog a {
-  text-decoration: underline;
-}
-
-/* GRAPHS CSS */
-
-.parent_graph {
-  position: relative;
-}
-
-.menu_graph,
-.timestamp_graph {
-  position: absolute;
-}
-
-.menu_graph {
-  -moz-border-top-right-radius: 6px;
-  -webkit-border-top-right-radius: 6px;
-  border-top-right-radius: 6px;
-  -moz-border-top-left-radius: 6px;
-  -webkit-border-top-left-radius: 6px;
-  border-top-left-radius: 6px;
-}
-
-.legend_graph {
-  margin: 0px;
-  padding: 0px;
-  text-align: left;
-}
-
-.legendColorBox * {
-  font-size: 0px;
-  padding: 0px 4px;
-  overflow: visible;
-}
-
-/* GIS CSS */
-
-.olLayerDiv {
-  z-index: 102;
-}
-
-/* Alert view */
-
-table.alert_days th,
-table.alert_time th {
-  height: 30px;
-  vertical-align: middle;
-}
-
-table.alert_escalation th img {
-  width: 18px;
-}
-
-td.used_field {
-  #border: solid #6eb432;
-  background: #6eb432;
-  color: #ffffff;
-  font-weight: bold;
-}
-
-td.overrided_field {
-  color: #666;
-}
-
-td.unused_field {
-  color: #888;
-}
-
-td.empty_field {
-  background: url("../../images/long_arrow.png") no-repeat 100% center;
-}
-
-#table_macros textarea {
-  width: 96%;
-}
-
-/* Policies styles */
-
-table#policy_modules td * {
-  display: inline;
-}
-
-.context_help_title {
-  font-weight: bolder;
-  text-align: left;
-}
-.context_help_body {
-  text-align: left;
-}
-
-#left_column_logon_ok {
-  width: 750px;
-  float: left;
-}
-
-#news_board {
-  min-width: 530px;
-}
-
-#right_column_logon_ok {
-  width: 350px;
-  float: right;
-  margin-right: 20px;
-}
-
-#clippy_head_title {
-  font-weight: bold;
-  background: #82b92e;
-  color: #ffffff;
-  margin-top: -15px;
-  margin-left: -15px;
-  margin-right: -15px;
-  padding: 5px;
-  margin-bottom: 10px;
-  border-top-left-radius: 2px;
-  border-top-right-radius: 2px;
-}
-
-.clippy_body {
-  color: black;
-}
-
-#dialog-double_auth-container {
-  width: 100%;
-  text-align: center;
-  vertical-align: middle;
-}
-
-.center_align {
-  text-align: center;
-}
-
-.left_align {
-  text-align: left;
-}
-
-.status_tactical {
-  width: 100%;
-  margin-left: auto;
-  margin-right: auto;
-  background-color: #5b5b5b;
-  padding: 10px;
-  border: 1px solid #e2e2e2;
-  margin-top: 5%;
-  text-align: left;
-}
-
-.status_tactical img {
-  border: 3px solid #000;
-  border-radius: 100px;
-}
-
-#sumary {
-  color: #fff;
-  margin: 15px;
-  padding: 10px 30px;
-  font-size: 20px;
-  font-weight: bold;
-  height: 66px;
-  width: 191px;
-  border-radius: 2px;
-}
-
-.databox.data td {
-  border-bottom: 1px solid #e2e2e2;
-}
-
-.databox .search {
-  margin-top: 0px;
-}
-
-.databox.data td.progress_bar img {
-  border: 3px solid #000;
-  border-radius: 100px;
-}
-
-.databox td {
-  padding-left: 9px;
-  padding-right: 9px;
-  padding-top: 7px;
-  padding-bottom: 7px;
-}
-.databox.pies fieldset.tactical_set {
-  width: 70%;
-  height: 285px;
-}
-
-.difference {
-  border-left-width: 2px;
-  border-left-style: solid;
-  border-right-width: 2px;
-  border-right-style: solid;
-  border-color: #e2e2e2;
-}
-
-#title_menu {
-  color: #fff;
-  float: right;
-  width: 70%;
-  letter-spacing: 0pt;
-  font-size: 8pt;
-  white-space: pre-wrap;
-}
-
-.no_hidden_menu {
-  background-position: 11% 50%;
-}
-
-#menu_tab li.nomn,
-#menu_tab li.nomn_high {
-  background-color: #ececec;
-  padding-right: 3px;
-  padding-left: 3px;
-  font-weight: bold;
-  text-decoration: none;
-  font-size: 14px;
-  border-color: #e2e2e2;
-  border-style: solid;
-  border-width: 1px;
-  margin-top: -10px;
 }
 
+div#head,
 #menu_tab li.nomn_high,
-#menu_tab li.nomn_high span {
+#menu_tab li.nomn_high span,
+.info_box,
+.white_table_graph_header,
+.white-box-content,
+fieldset,
+.databox.filters,
+table.databox,
+.legend_basic,
+.databox_color,
+.white_box {
+  background-color: #222 !important;
   color: #fff;
-  background-color: #5b5b5b;
 }
 
+/* Tabs icons change color */
 #menu_tab li.nomn img,
 #menu_tab li img {
-  margin-top: 3px;
-  margin-left: 3px;
+  filter: invert(100%);
 }
 
-#menu_tab li.tab_operation a,
-#menu_tab a.tab_operation {
-  background: none;
+/* White text */
+a,
+#menu_tab_left li a,
+#menu_tab_left li span,
+fieldset legend,
+.tactical_set legend,
+#user-notifications-wrappe,
+#user_form *,
+h1,
+h2,
+h3,
+h4,
+.info_table > tbody > tr > th,
+.info_table > thead > tr > th,
+.info_table > thead > tr > th a,
+.info_table > thead > tr > th > span,
+form.discovery label,
+.edit_user_labels,
+.input_label {
+  color: #fff;
 }
 
-.subsubmenu {
-  position: absolute;
-  float: right;
-  z-index: 9999;
-  display: none;
-  margin-top: 6px;
-  left: 0px;
-}
-.subsubmenu li {
-  margin-top: 0px;
+/* Overwrite inline styles */
+.textodialogo td {
+  color: #fff !important;
 }
 
-.agents_modules_table {
-  border: 1px solid #e2e2e2;
-  border-spacing: 0px;
-}
-.agents_modules_table td {
-  border: 1px solid #e2e2e2;
-}
-.agents_modules_table th {
-  border: 1px solid #e2e2e2;
+.box-shadow {
+  box-shadow: none;
 }
 
-.databox.filters,
-.databox.data,
-.databox.profile_list {
-  margin-bottom: 20px;
+select:disabled,
+textarea:disabled {
+  background-color: #666;
 }
 
-.databox.filters td {
-  padding: 10px;
-  padding-left: 20px;
-}
-.databox.profile_list td {
-  padding: 4px 1px;
-  padding-left: 5px;
-  border-bottom: 1px solid #e2e2e2;
-}
-.databox.profile_list a.tip > img {
-  margin: 0px;
+.status_tactical,
+.tactical_set,
+.td-bg-white td {
+  background-color: transparent;
 }
 
-.databox.filters td > img,
-.databox.filters td > div > a > img,
-.databox.filters td > span > img,
-.databox.filters td > span > a > img,
-.databox.filters td > a > img {
-  vertical-align: middle;
-  margin-left: 5px;
-}
-.databox.data td > img,
-.databox.data th > img,
-.databox.data td > div > a > img,
-.databox.data td > span > img,
-.databox.data td > span > a > img,
-.databox.data td > a > img,
-.databox.data td > form > a > img {
-  vertical-align: middle;
+/* tables */
+.info_table {
+  background-color: #222;
 }
 
-.databox.filters td > a > img {
-  vertical-align: middle;
+.info_table > tbody > tr:nth-child(even) {
+  background-color: #111;
 }
 
-.databox.data td > input[type="checkbox"] {
-  margin: 0px;
+.info_table tr:first-child > th,
+.info_table th {
+  background-color: #222;
+  color: #fff;
 }
 
-.databox_color td {
-  padding-left: 10px;
+.info_table > tbody > tr:hover,
+.databox.data > tbody > tr:hover,
+.rowPair:hover,
+.rowOdd:hover {
+  background-color: #555 !important; /* porque tables.css se carga depues.... */
 }
 
-.databox.agente td > div > canvas {
-  width: 100%;
-  text-align: left;
+.info_table .datos3,
+.datos3,
+.info_table .datos4,
+.datos4 {
+  background-color: #666;
+  color: #fff;
 }
-.databox.agente td > div.graph {
-  width: 100%;
-  text-align: left;
+.agent_details_col,
+.white_table,
+.white_table tr:first-child > th,
+.white_table_graph_content {
+  background-color: #222;
+  color: #fff;
+}
+
+/* action buttons in tables */
+.action_buttons a[href] img,
+.action_buttons input[type="image"],
+.action_button_img {
+  filter: brightness(2.5) contrast(50%);
+}
+
+/* fix cosas generales */
+.notify,
+.notify h3 {
+  color: #000;
+}
+
+/* firts_task.css */
+.new_task,
+div.new_task_cluster,
+div.new_task_cluster > div {
+  background-color: #222;
+}
+
+/* webchat */
+#chat_box,
+#userlist_box {
+  background: #222 !important;
+}
+
+/* tree.css */
+.node-content:hover {
+  background-color: #222;
+}
+
+ul.tree-group
+  li.tree-node
+  div.node-content
+  img:not(.module-status):not(.agent-status):not(.agent-alerts-fired) {
+  filter: brightness(2);
+}
+
+/* login.css */
+div.login_nick input,
+div.login_pass input {
+  background-color: #fff !important;
+}
+
+/* user edit */
+.edit_user_info_right input {
+  border-bottom: 1px solid #5f5f5f;
+}
+
+/* datatables */
+table.dataTable tbody tr {
+  background-color: #222;
+}
+
+table.dataTable span {
+  color: #fff;
+}
+
+/* diagnostic info */
+table#diagnostic_info {
+  background-color: #111 !important;
+}
+
+table#diagnostic_info tbody td div {
+  background-color: #222 !important;
+}
+
+/* agent view */
+.agent_details_graph div#status_pie {
+  background: #fff;
+  border-radius: 5px;
+}
+
+/* menu.css */
+.operation {
+  background-color: #252525;
 }
 
 .godmode,
-.menu_icon ul li {
-  background-color: #222;
-}
-.operation .menu_icon ul li {
-  background-color: #333;
-}
-
-.godmode {
-  border-top: 4px solid;
-  padding-bottom: 4px;
-  border-bottom-right-radius: 5px;
-  border-right-style: solid;
-  border-right-width: 0px;
-}
-
-.green_title {
-  background-color: #82b92e;
-  font-weight: normal;
-  text-align: center;
-}
-
-.dashboard {
-  top: 23px;
-}
-
-.dashboard li a {
-  width: 158px;
-}
-
-.text_subDashboard {
-  float: left;
-  margin-top: 5%;
-  margin-left: 3%;
-}
-
-/* The items with the class 'spinner' will rotate */
-/* Not supported on IE9 and below */
-.spinner {
-  -webkit-animation: spinner 2s infinite linear;
-  animation: spinner 2s infinite linear;
-}
-
-@-webkit-keyframes spinner {
-  0% {
-    -ms-transform: rotate(0deg); /* IE */
-    -moz-transform: rotate(0deg); /* FF */
-    -o-transform: rotate(0deg); /* Opera */
-    -webkit-transform: rotate(0deg); /* Safari and Chrome */
-    transform: rotate(0deg);
-  }
-  100% {
-    -ms-transform: rotate(359deg); /* IE */
-    -moz-transform: rotate(359deg); /* FF */
-    -o-transform: rotate(359deg); /* Opera */
-    -webkit-transform: rotate(359deg); /* Safari and Chrome */
-    transform: rotate(359deg);
-  }
-}
-
-@keyframes spinner {
-  0% {
-    -ms-transform: rotate(0deg); /* IE */
-    -moz-transform: rotate(0deg); /* FF */
-    -o-transform: rotate(0deg); /* Opera */
-    -webkit-transform: rotate(0deg); /* Safari and Chrome */
-    transform: rotate(0deg);
-  }
-  100% {
-    -ms-transform: rotate(359deg); /* IE */
-    -moz-transform: rotate(359deg); /* FF */
-    -o-transform: rotate(359deg); /* Opera */
-    -webkit-transform: rotate(359deg); /* Safari and Chrome */
-    transform: rotate(359deg);
-  }
-}
-
-#alert_messages {
-  -moz-border-bottom-right-radius: 5px;
-  -webkit-border-bottom-left-radius: 5px;
-  border-bottom-right-radius: 5px;
-  border-bottom-left-radius: 5px;
-  z-index: 3;
-  position: fixed;
-  width: 750px;
-  max-width: 750px;
-  min-width: 750px;
-  top: 20%;
-  background: white;
-}
-.modalheader {
-  text-align: center;
-  width: 100%;
-  height: 37px;
-  left: 0px;
-  background-color: #82b92e;
-}
-.modalheadertext {
-  color: white;
-  position: relative;
-  font-family: Nunito;
-  font-size: 13pt;
-  top: 8px;
-}
-.modalclosex {
-  cursor: pointer;
-  display: inline;
-  float: right;
-  margin-right: 10px;
-  margin-top: 10px;
-}
-.modalcontent {
-  color: black;
-  background: white;
-}
-.modalcontentimg {
-  float: left;
-  margin-left: 30px;
-  margin-top: 30px;
-  margin-bottom: 30px;
-}
-.modalcontenttext {
-  float: left;
-  text-align: justify;
-  color: #666;
-  font-size: 9.5pt;
-  line-height: 13pt;
-  margin-top: 30px;
-  width: 430px;
-  margin-left: 30px;
-}
-
-.modalcontenttext > p {
-  color: black;
-}
-.modalcontenttext > p > a {
-  color: black;
-}
-
-.modalokbutton {
-  transition-property: background-color, color;
-  transition-duration: 1s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color, color;
-  -webkit-transition-duration: 1s;
-  -o-transition-property: background-color, color;
-  -o-transition-duration: 1s;
-  cursor: pointer;
-  text-align: center;
-  margin-right: 45px;
-  float: right;
-  -moz-border-radius: 3px;
-  -webkit-border-radius: 3px;
-  margin-bottom: 30px;
-  border-radius: 3px;
-  width: 90px;
-  height: 30px;
-  background-color: white;
-  border: 1px solid #82b92e;
-}
-.modalokbuttontext {
-  transition-property: background-color, color;
-  transition-duration: 1s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color, color;
-  -webkit-transition-duration: 1s;
-  -o-transition-property: background-color, color;
-  -o-transition-duration: 1s;
-  color: #82b92e;
-  font-family: Nunito;
-  font-size: 10pt;
-  position: relative;
-  top: 6px;
-}
-
-.modalokbutton:hover {
-  transition-property: background-color, color;
-  transition-duration: 1s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color, color;
-  -webkit-transition-duration: 1s;
-  -o-transition-property: background-color, color;
-  -o-transition-duration: 1s;
-  background-color: #82b92e;
-}
-
-.modalokbutton:hover .modalokbuttontext {
-  transition-property: background-color, color;
-  transition-duration: 1s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color, color;
-  -webkit-transition-duration: 1s;
-  -o-transition-property: background-color, color;
-  -o-transition-duration: 1s;
-  color: white;
-}
-.modalgobutton {
-  transition-property: background-color, color;
-  transition-duration: 1s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color, color;
-  -webkit-transition-duration: 1s;
-  -o-transition-property: background-color, color;
-  -o-transition-duration: 1s;
-  cursor: pointer;
-  text-align: center;
-  margin-right: 15px;
-  margin-bottom: 30px;
-  float: right;
-  -moz-border-radius: 3px;
-  -webkit-border-radius: 3px;
-  border-radius: 3px;
-  width: 240px;
-  height: 30px;
-  background-color: white;
-  border: 1px solid #82b92e;
-}
-.modalgobuttontext {
-  transition-property: background-color, color;
-  transition-duration: 1s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color, color;
-  -webkit-transition-duration: 1s;
-  -o-transition-property: background-color, color;
-  -o-transition-duration: 1s;
-  color: #82b92e;
-  font-family: Nunito;
-  font-size: 10pt;
-  position: relative;
-  top: 6px;
-}
-
-.modalgobutton:hover {
-  transition-property: background-color, color;
-  transition-duration: 1s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color, color;
-  -webkit-transition-duration: 1s;
-  -o-transition-property: background-color, color;
-  -o-transition-duration: 1s;
-  background-color: #82b92e;
-}
-
-.modalgobutton:hover .modalgobuttontext {
-  transition-property: background-color, color;
-  transition-duration: 1s;
-  transition-timing-function: ease-out;
-  -webkit-transition-property: background-color, color;
-  -webkit-transition-duration: 1s;
-  -o-transition-property: background-color, color;
-  -o-transition-duration: 1s;
-  color: white;
-}
-
-#opacidad {
-  opacity: 0.5;
-  z-index: 1;
-  width: 100%;
-  height: 100%;
-  position: absolute;
-  left: 0px;
-  top: 0px;
-}
-
-.textodialogo {
-  margin-left: 0px;
-  color: black;
-  font-size: 9pt;
-}
-
-.cargatextodialogo {
-  max-width: 58.5%;
-  width: 58.5%;
-  min-width: 58.5%;
-  float: left;
-  margin-left: 0px;
-  font-size: 18pt;
-  padding: 20px;
-  text-align: center;
-}
-
-.cargatextodialogo b {
-  color: black;
-}
-.cargatextodialogo p {
-  color: black;
-}
-
-.cargatextodialogo b {
-  color: black;
-}
-.cargatextodialogo a {
-  color: black;
-}
-
-.cargatextodialogo > div {
-  color: black;
-}
-
-.cargatextodialogo p,
-.cargatextodialogo b,
-.cargatextodialogo a {
-  font-size: 18pt;
-}
-
-#toolbox > input {
-  border-width: 0px 1px 0px 0px;
-  border-color: lightgray;
-}
-
-#toolbox > input.service_min {
-  border-width: 0px 0px 0px 0px;
-}
-
-#toolbox > input.grid_min {
-  border-width: 0px 0px 0px 0px;
-}
-#tinymce {
-  padding-top: 20px;
-}
-
-.rowPair:hover,
-.rowOdd:hover {
-  background-color: #6e6e6e;
-}
-.databox.data > tbody > tr:hover {
-  background-color: #6e6e6e;
-}
-.checkselected {
-  background-color: #eee;
-}
-
-#login_help_dialog * {
-  color: #222222;
-}
-
-.introjs-tooltip * {
-  color: #222222;
-}
-
-.dd_widget_content * {
-  color: #222222;
-}
-
-#dialog_add_new_widget * {
-  color: #222222;
-}
-
-.widget_configuration_form table tbody tr td:first-child {
-  color: #222222;
-}
-
-.widget_configuration_form .container * {
-  color: #222222;
-}
-.widget_configuration_form b {
-  color: #222222;
-}
-
-form[action="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list"]
-  * {
-  color: #222222;
-}
-
-form[action="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list"]
-  input {
-  color: white;
-}
-
-form[action="index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list"]
-  select {
-  color: white;
-}
-.notify {
-  color: black;
-}
-.notify * {
-  color: black;
-}
-#login_logout * {
-  color: #222222;
-}
-
-/*modal windows login*/
-div.content_alert {
-  width: 98%;
-  margin-top: 20px;
+#menu_full {
+  background-color: #1a1a1a;
 }
 
-div.icon_message_alert {
-  float: left;
-  width: 25%;
-  text-align: center;
-}
-
-div.icon_message_alert img {
-  width: 85px;
-}
-
-div.content_message_alert {
-  width: 75%;
-  float: right;
-}
-
-div.content_message_alert * {
-  color: black;
-}
-
-div.text_message_alert {
-  width: 100%;
-  margin-top: 10px;
-}
-
-div.text_message_alert h1 {
-  margin: 0px;
-}
-
-div.text_message_alert p {
-  margin: 0px;
-  font-size: 10.3pt;
-  line-height: 14pt;
-}
-
-div.button_message_alert {
-  width: 100%;
-}
-
-div.button_message_alert input {
-  float: right;
-  width: 87px;
-  height: 33px;
-  color: #82b92e;
-  border: 1px solid #82b92e;
-  font-weight: bold;
-  margin-right: 20px;
-  margin-top: 20px;
-  font-size: 10pt;
-}
-
-div.form_message_alert {
-  width: 90%;
-  clear: both;
-  padding-top: 20px;
-  padding-left: 40px;
-}
-
-div.form_message_alert ul li {
-  display: inline-block;
-  padding: 10px;
-}
-
-div.form_message_alert ul li input {
-  border: none;
-  background-color: #dadada;
-  border-radius: 0px;
-  height: 17px;
-  width: 145px;
-  padding-left: 5px;
-}
-
-div.form_message_alert ul li label {
-  font-size: 10pt;
-  padding-right: 20px;
-}
-
-div.form_message_alert h4 {
-  margin: 0px;
-  margin-bottom: 10px;
-}
-
-div.button_message_alert_form input {
-  float: right;
-  width: 87px;
-  height: 33px;
-  color: #82b92e;
-  border: 1px solid #82b92e;
-  font-weight: bold;
-  font-size: 10pt;
-  margin-right: 25px;
-}
-
-.ui-dialog .ui-dialog-titlebar {
-  background-color: #82b92e;
-}
-
-/*
-	styles header login
-*/
-div#header_login {
-  width: 100%;
-  height: 65px;
-  background-color: rgba(255, 255, 255, 0.06);
-}
-
-div#icon_custom_pandora {
-  float: left;
-  margin-top: 5px;
-  margin-left: 4%;
-}
-
-div#list_icon_docs_support {
-  float: right;
-  margin-top: 8px;
-  margin-right: 4%;
-}
-
-div#list_icon_docs_support ul {
-  margin-top: 5px;
-}
-
-div#list_icon_docs_support ul li {
-  display: inline-block;
-  color: white;
-  vertical-align: middle;
-  margin-right: 5px;
-  font-size: 10pt;
-}
-
-li#li_margin_left {
-  margin-left: 30px;
-}
-
-/*
-	styles login form
-*/
-
-div.container_login {
-  margin-top: 10%;
-  margin-left: 5%;
-  margin-right: 5%;
-}
-
-div.login_page {
-  width: 35%;
-  min-height: 600px;
-  float: left;
-}
-
-div.login_page form {
-  border-right: 1px solid #868686;
-  padding-top: 30px;
-  padding-bottom: 50px;
-  min-width: 400px;
-  max-height: 600px;
-}
-
-div.login_logo_icon {
-  margin-bottom: 40px;
-  text-align: center;
-}
-
-div.login_logo_icon img {
-  margin: 0 auto;
-  width: 150px;
-}
-div.login_double_auth_code,
-div.login_nick,
-div.login_pass {
-  margin: 0 auto;
-  width: 70%;
-  height: 40px;
-  background-color: rgba(255, 255, 255, 0.2);
-  margin-bottom: 25px;
-  min-width: 260px;
-}
-
-div.login_nick img,
-div.login_pass img {
-  vertical-align: middle;
-  margin: 3px;
-}
-
-div.login_nick input,
-div.login_pass input {
-  background-color: rgba(255, 255, 255, 0);
-  border: 0px;
-  color: white;
-  border-radius: 0px;
-  width: 89%;
-  height: 40px;
-  font-size: 9pt;
-  padding: 0px;
-}
-
-div.login_nick input:focus,
-div.login_pass input:focus {
-  outline: none;
-}
-
-div.login_nick input:-webkit-autofill,
-div.login_nick input:-webkit-autofill:hover,
-div.login_nick input:-webkit-autofill:focus,
-div.login_nick input:-webkit-autofill:active,
-div.login_pass input:-webkit-autofill,
-div.login_pass input:-webkit-autofill:hover,
-div.login_pass input:-webkit-autofill:focus,
-div.login_pass input:-webkit-autofill:active {
-  transition: background-color 10000s ease-in-out 0s;
-  -webkit-box-shadow: 0 0 0px 0px transparent inset;
-  -webkit-text-fill-color: white;
-  border: 0px;
-  width: 89%;
-}
-
-div.login_nick input::-webkit-input-placeholder,
-div.login_pass input::-webkit-input-placeholder {
-  color: white;
-}
-
-div.login_pass img,
-div.login_nick img {
-  width: 30px;
-}
-
-div.login_pass div,
-div.login_nick div {
-  float: left;
-  width: 11%;
-}
-
-div.login_button {
-  margin: 0 auto;
-  width: 70%;
-  height: 40px;
-  background-color: rgb(25, 25, 25);
-  border: 1px solid white;
-  min-width: 260px;
-}
-
-div.login_button input {
-  width: 100%;
-  background-color: rgb(25, 25, 25);
-  text-align: center;
-  border: 0px;
-  border-radius: 0px;
-  height: 40px;
-  padding: 0px;
-  font-size: 9pt;
-  color: white;
-}
-
-div.login_data {
-  width: 65%;
-  min-height: 600px;
-  float: left;
-}
-
-div.text_banner_login {
-  width: 100%;
-  margin-bottom: 60px;
-  color: white;
-  text-align: center;
-}
-
-div.text_banner_login span {
-  width: 100%;
-}
-
-span.span1 {
-  font-size: 3vw;
-  font-family: "lato-thin";
-  color: white;
-}
-
-span.span2 {
-  font-size: 3vw;
-  font-family: "lato-bolder";
-  color: white;
-}
-
-div.img_banner_login {
-  width: 100%;
-  text-align: center;
-}
-
-div.img_banner_login img {
-  max-width: 70%;
-  min-width: 70%;
-  max-height: 50%;
-  min-height: 50%;
-}
-
-@media all and (max-width: 1200px) {
-  span.span1 {
-    font-size: 30pt;
-  }
-  span.span2 {
-    font-size: 30pt;
-  }
-}
-
-.new_task p,
-.new_task h3,
-.new_task h2,
-.new_task a,
-.new_task strong {
-  color: #222222;
-}
-.item p {
-  color: #222222;
+.button_collapse {
+  background-color: #444;
 }
 
-.item span {
-  color: #222222;
+.operation .selected,
+.godmode .selected,
+.menu_icon:hover {
+  background-color: #080808;
 }
 
-.widget_config_advice,
-.widget_config_advice * {
-  color: black;
+/* footer */
+div#foot {
+  background: #222;
 }
diff --git a/pandora_console/index.php b/pandora_console/index.php
index 3c95074171..58c5998b87 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -1214,14 +1214,17 @@ echo "\n<!-- Page generated in $run_time seconds -->\n";
 // Values from PHP to be recovered from JAVASCRIPT
 require 'include/php_to_js_values.php';
 
-
+// if ($config['style'] !== 'pandora') {
 ?>
 
 <script type="text/javascript" language="javascript">
 
     // When there are less than 5 rows, all rows must be white
-    if($('table.info_table tr').length < 5){
-        $('table.info_table tbody > tr').css('background-color', '#fff');
+   var theme = "<?php echo $config['style']; ?>";
+   if(theme === 'pandora'){
+        if($('table.info_table tr').length < 5){
+            $('table.info_table tbody > tr').css('background-color', '#fff');
+        }
     }
 
     // When the user scrolls down 400px from the top of the document, show the button.

From 0064bc0cba71e67791bcc884c1bd1c6b721bc750 Mon Sep 17 00:00:00 2001
From: Daniel Barbero Martin <daniel.barbero@artica.es>
Date: Mon, 1 Jul 2019 17:07:39 +0200
Subject: [PATCH 25/83] fixed errors

---
 pandora_console/extras/mr/30.sql              |   0
 .../pandoradb_migrate_6.0_to_7.0.mysql.sql    |   9 +-
 .../reporting_builder.item_editor.php         | 185 ++++-
 .../include/ajax/reporting.ajax.php           |  14 +-
 .../include/ajax/update_manager.ajax.php      |   2 +
 .../include/functions_reporting.php           | 719 +++++++++++-------
 .../include/functions_reporting_html.php      |  86 ++-
 pandora_console/pandoradb.sql                 |   1 +
 pandora_console/pandoradb_data.sql            |   4 +-
 9 files changed, 697 insertions(+), 323 deletions(-)
 create mode 100644 pandora_console/extras/mr/30.sql

diff --git a/pandora_console/extras/mr/30.sql b/pandora_console/extras/mr/30.sql
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
index 4bad7b3652..b9e48da3f8 100644
--- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
+++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
@@ -1239,13 +1239,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 29);
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 30);
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
 UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
 DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
-INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '736');
+INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '737');
 INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
 
 -- ---------------------------------------------------------------------
@@ -2209,3 +2209,8 @@ CREATE TABLE IF NOT EXISTS `tcredential_store` (
 	`extra_2` text,
 	PRIMARY KEY (`identifier`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+-- ---------------------------------------------------------------------
+-- Table `treport_content_sla_combined`
+-- ---------------------------------------------------------------------
+ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_secondary` int(10) unsigned NOT NULL;
diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
index 8c4c21fb8f..d943fbf0fc 100755
--- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php
+++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
@@ -566,7 +566,6 @@ switch ($action) {
                     $include_extended_events = $item['show_extended_events'];
 
                     $filter_search = $style['event_filter_search'];
-
                 break;
 
                 case 'event_report_group':
@@ -2784,8 +2783,21 @@ function print_SLA_list($width, $action, $idItem=null)
                 <th class="header sla_list_module_col" scope="col">
                 <?php
                 echo __('Module');
-                ?>
+                if ($report_item_type == 'availability_graph') {
+                    ?>
+                <th class="header sla_list_agent_secondary" scope="col">
+                    <?php
+                    echo __('Agent Secondary');
+                    ?>
                 </th>
+                <th class="header sla_list_module_secondary" scope="col">
+                    <?php
+                    echo __('Module Secondary');
+                    ?>
+                </th>
+                    <?php
+                }
+                ?>
                 <th class="header sla_list_service_col" scope="col">
                 <?php
                 echo __('Service');
@@ -2831,6 +2843,7 @@ function print_SLA_list($width, $action, $idItem=null)
                 case 'update':
                 case 'edit':
                     echo '<tbody id="list_sla">';
+
                     $itemsSLA = db_get_all_rows_filter(
                         'treport_content_sla_combined',
                         ['id_report_content' => $idItem]
@@ -2865,6 +2878,25 @@ function print_SLA_list($width, $action, $idItem=null)
                             ['id_agente_modulo' => $item['id_agent_module']]
                         );
 
+                        if (isset($item['id_agent_module_secondary']) === true
+                            && $item['id_agent_module_secondary'] !== 0
+                        ) {
+                            $idAgentSecondary = db_get_value_filter(
+                                'id_agente',
+                                'tagente_modulo',
+                                ['id_agente_modulo' => $item['id_agent_module_secondary']]
+                            );
+                            $nameAgentSecondary = agents_get_alias(
+                                $idAgentSecondary
+                            );
+
+                            $nameModuleSecondary = db_get_value_filter(
+                                'nombre',
+                                'tagente_modulo',
+                                ['id_agente_modulo' => $item['id_agent_module_secondary']]
+                            );
+                        }
+
                         $server_name_element = '';
                         if ($meta && $server_name != '') {
                             $server_name_element .= ' ('.$server_name.')';
@@ -2878,6 +2910,15 @@ function print_SLA_list($width, $action, $idItem=null)
                         echo printSmallFont($nameModule);
                         echo '</td>';
 
+                        if ($report_item_type == 'availability_graph') {
+                            echo '<td class="sla_list_agent_secondary">';
+                            echo printSmallFont($nameAgentSecondary).$server_name_element;
+                            echo '</td>';
+                            echo '<td class="sla_list_module_secondary">';
+                            echo printSmallFont($nameModuleSecondary);
+                            echo '</td>';
+                        }
+
                         if (enterprise_installed()
                             && $report_item_type == 'SLA_services'
                         ) {
@@ -2926,6 +2967,13 @@ function print_SLA_list($width, $action, $idItem=null)
                             <td class="sla_list_agent_col agent_name"></td>
                             <td class="sla_list_module_col module_name"></td>
                             <?php
+                            if ($report_item_type == 'availability_graph') {
+                                ?>
+                            <td class="sla_list_agent_secondary agent_name_secondary"></td>
+                            <td class="sla_list_module_secondary module_name_secondary"></td>
+                                <?php
+                            }
+
                             if (enterprise_installed()
                                 && $report_item_type == 'SLA_services'
                             ) {
@@ -2982,6 +3030,42 @@ function print_SLA_list($width, $action, $idItem=null)
                                 </select>
                             </td>
                             <?php
+                            if ($report_item_type == 'availability_graph') {
+                                ?>
+                                <td class="sla_list_agent_secondary_col">
+                                    <input id="hidden-id_agent_secondary" name="id_agent_secondary" value="" type="hidden">
+                                    <input id="hidden-server_name_secondary" name="server_name_secondary" value="" type="hidden">
+                                    <?php
+                                    $params = [];
+                                    $params['show_helptip'] = true;
+                                    $params['input_name'] = 'agent_secondary';
+                                    $params['value'] = '';
+                                    $params['use_hidden_input_idagent'] = true;
+                                    $params['hidden_input_idagent_id'] = 'hidden-id_agent_secondary';
+                                    $params['javascript_is_function_select'] = true;
+                                    $params['selectbox_id'] = 'id_agent_module_secondary';
+                                    $params['add_none_module'] = false;
+                                    if ($meta) {
+                                        $params['use_input_id_server'] = true;
+                                        $params['input_id_server_id'] = 'hidden-id_server';
+                                        $params['disabled_javascript_on_blur_function'] = true;
+                                    }
+
+                                    ui_print_agent_autocomplete_input($params);
+                                    ?>
+                                </td>
+                                <td class="sla_list_module_secondary_col">
+                                    <select id="id_agent_module_secondary" name="id_agent_module_secondary" disabled="disabled" style="max-width: 180px">
+                                        <option value="0">
+                                            <?php
+                                            echo __('Select an Agent first');
+                                            ?>
+                                        </option>
+                                    </select>
+                                </td>
+                                <?php
+                            }
+
                             if (enterprise_installed()
                                 && $report_item_type == 'SLA_services'
                             ) {
@@ -3002,23 +3086,23 @@ function print_SLA_list($width, $action, $idItem=null)
                                         ],
                                     ]
                                 );
-                                if (!empty($services_tmp)
-                                    && $services_tmp != ENTERPRISE_NOT_HOOK
+                        if (!empty($services_tmp)
+                            && $services_tmp != ENTERPRISE_NOT_HOOK
+                        ) {
+                            foreach ($services_tmp as $service) {
+                                $check_module_sla = modules_check_agentmodule_exists(
+                                    $service['sla_id_module']
+                                );
+                                $check_module_sla_value = modules_check_agentmodule_exists(
+                                    $service['sla_value_id_module']
+                                );
+                                if ($check_module_sla
+                                    && $check_module_sla_value
                                 ) {
-                                    foreach ($services_tmp as $service) {
-                                        $check_module_sla = modules_check_agentmodule_exists(
-                                            $service['sla_id_module']
-                                        );
-                                        $check_module_sla_value = modules_check_agentmodule_exists(
-                                            $service['sla_value_id_module']
-                                        );
-                                        if ($check_module_sla
-                                            && $check_module_sla_value
-                                        ) {
-                                            $services[$service['id']] = $service['name'];
-                                        }
-                                    }
+                                    $services[$service['id']] = $service['name'];
                                 }
+                            }
+                        }
 
                                 echo '<td class="sla_list_service_col">';
                                 echo html_print_select(
@@ -3915,10 +3999,13 @@ function deleteGeneralRow(id_row) {
 
 function addSLARow() {
     var nameAgent = $("input[name=agent_sla]").val();
+    var nameAgentSecondary = $("input[name=agent_secondary]").val();
     var idAgent = $("input[name=id_agent_sla]").val();
     var serverId = $("input[name=id_server]").val();
     var idModule = $("#id_agent_module_sla").val();
+    var idModuleSecondary = $("#id_agent_module_secondary").val();
     var nameModule = $("#id_agent_module_sla :selected").text();
+    var nameModuleSecondary = $("#id_agent_module_secondary :selected").text();
     var slaMin = $("input[name=sla_min]").val();
     var slaMax = $("input[name=sla_max]").val();
     var slaLimit = $("input[name=sla_limit]").val();
@@ -3979,10 +4066,63 @@ function addSLARow() {
                 });
             }
 
+            if (nameAgentSecondary != '') {
+                //Truncate nameAgentSecondary
+                var params = [];
+                params.push("truncate_text=1");
+                params.push("text=" + nameAgentSecondary);
+                params.push("page=include/ajax/reporting.ajax");
+                jQuery.ajax ({
+                    data: params.join ("&"),
+                    type: 'POST',
+                    url: action=
+                    <?php
+                    echo '"'.ui_get_full_url(
+                        false,
+                        false,
+                        false,
+                        false
+                    ).'"';
+                    ?>
+                    + "/ajax.php",
+                    async: false,
+                    timeout: 10000,
+                    success: function (data) {
+                        nameAgentSecondary = data;
+                    }
+                });
+
+                //Truncate nameModuleSecondary
+                var params = [];
+                params.push("truncate_text=1");
+                params.push("text=" + nameModuleSecondary);
+                params.push("page=include/ajax/reporting.ajax");
+                jQuery.ajax ({
+                    data: params.join ("&"),
+                    type: 'POST',
+                    url: action=
+                    <?php
+                    echo '"'.ui_get_full_url(
+                        false,
+                        false,
+                        false,
+                        false
+                    ).'"';
+                    ?>
+                    + "/ajax.php",
+                    async: false,
+                    timeout: 10000,
+                    success: function (data) {
+                        nameModuleSecondary = data;
+                    }
+                });
+            }
+
             var params = [];
             params.push("add_sla=1");
             params.push("id=" + $("input[name=id_item]").val());
             params.push("id_module=" + idModule);
+            params.push("id_module_secondary=" + idModuleSecondary);
             params.push("sla_min=" + slaMin);
             params.push("sla_max=" + slaMax);
             params.push("sla_limit=" + slaLimit);
@@ -4015,6 +4155,8 @@ function addSLARow() {
                         $("#row", row).attr('id', 'sla_' + data['id']);
                         $(".agent_name", row).html(nameAgent);
                         $(".module_name", row).html(nameModule);
+                        $(".agent_name_secondary", row).html(nameAgentSecondary);
+                        $(".module_name_secondary", row).html(nameModuleSecondary);
                         $(".service_name", row).html(serviceName);
                         $(".sla_min", row).html(slaMin);
                         $(".sla_max", row).html(slaMax);
@@ -4025,14 +4167,22 @@ function addSLARow() {
                         );
                         $("#list_sla").append($(row).html());
                         $("input[name=id_agent_sla]").val('');
+                        $("input[name=id_agent_secondary]").val('');
                         $("input[name=id_server]").val('');
                         $("input[name=agent_sla]").val('');
+                        $("input[name=agent_secondary]").val('');
                         $("#id_agent_module_sla").empty();
                         $("#id_agent_module_sla").attr('disabled', 'true');
                         $("#id_agent_module_sla").append(
                             $("<option></option>")
                             .attr ("value", 0)
                             .html ($("#module_sla_text").html()));
+                        $("#id_agent_module_secondary").empty();
+                        $("#id_agent_module_secondary").attr('disabled', 'true');
+                        $("#id_agent_module_secondary").append(
+                            $("<option></option>")
+                            .attr ("value", 0)
+                            .html ($("#module_sla_text").html()));
                         $("input[name=sla_min]").val('');
                         $("input[name=sla_max]").val('');
                         $("input[name=sla_limit]").val('');
@@ -4161,7 +4311,6 @@ function addGeneralRow() {
             success: function (data) {
                 if (data['correct']) {
                     row = $("#general_template").clone();
-
                     $("#row", row).show();
                     $("#row", row).attr('id', 'general_' + data['id']);
                     $(".agent_name", row).html(nameAgent);
diff --git a/pandora_console/include/ajax/reporting.ajax.php b/pandora_console/include/ajax/reporting.ajax.php
index 55ed7dd216..16bdff9527 100755
--- a/pandora_console/include/ajax/reporting.ajax.php
+++ b/pandora_console/include/ajax/reporting.ajax.php
@@ -65,6 +65,7 @@ if ($add_sla) {
     $sla_max = get_parameter('sla_max', 0);
     $sla_min = get_parameter('sla_min', 0);
     $server_id = (int) get_parameter('server_id', 0);
+    $id_module_secondary = (int) get_parameter('id_module_secondary', 0);
 
     $id_service = (int) get_parameter('id_service');
     if (empty($id_module) && !empty($id_service)) {
@@ -85,12 +86,13 @@ if ($add_sla) {
     $result = db_process_sql_insert(
         'treport_content_sla_combined',
         [
-            'id_report_content' => $id,
-            'id_agent_module'   => $id_module,
-            'sla_max'           => $sla_max,
-            'sla_min'           => $sla_min,
-            'sla_limit'         => $sla_limit,
-            'server_name'       => $connection['server_name'],
+            'id_report_content'         => $id,
+            'id_agent_module'           => $id_module,
+            'id_agent_module_secondary' => $id_module_secondary,
+            'sla_max'                   => $sla_max,
+            'sla_min'                   => $sla_min,
+            'sla_limit'                 => $sla_limit,
+            'server_name'               => $connection['server_name'],
         ]
     );
 
diff --git a/pandora_console/include/ajax/update_manager.ajax.php b/pandora_console/include/ajax/update_manager.ajax.php
index 7a7cefc82b..13ea1f560b 100644
--- a/pandora_console/include/ajax/update_manager.ajax.php
+++ b/pandora_console/include/ajax/update_manager.ajax.php
@@ -134,6 +134,7 @@ if ($install_package) {
 
     $accept = (bool) get_parameter('accept', false);
     if ($accept) {
+        hd($accept, true);
         $package = (string) get_parameter('package');
         $package = trim($package);
 
@@ -163,6 +164,7 @@ if ($install_package) {
             unlink($files_copied);
         }
 
+
         if (file_exists($package)) {
             if ($files_h = fopen($files_total, 'r')) {
                 while ($line = stream_get_line($files_h, 65535, "\n")) {
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 4261518b68..ce6d901740 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -1,20 +1,30 @@
 <?php
-
-// Pandora FMS - http://pandorafms.com
-// ==================================================
-// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
-// Please see http://pandorafms.org for full contribution list
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License
-// as published by the Free Software Foundation; version 2
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
 /**
- * @package    Include
- * @subpackage Reporting
+ * Extension to manage a list of gateways and the node address where they should
+ * point to.
+ *
+ * @category   Reporting
+ * @package    Pandora FMS
+ * @subpackage Community
+ * @version    1.0.0
+ * @license    See below
+ *
+ *    ______                 ___                    _______ _______ ________
+ *   |   __ \.-----.--.--.--|  |.-----.----.-----. |    ___|   |   |     __|
+ *  |    __/|  _  |     |  _  ||  _  |   _|  _  | |    ___|       |__     |
+ * |___|   |___._|__|__|_____||_____|__| |___._| |___|   |__|_|__|_______|
+ *
+ * ============================================================================
+ * Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
+ * Please see http://pandorafms.org for full contribution list
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation for version 2.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * ============================================================================
  */
 
 /**
@@ -38,9 +48,7 @@ require_once $config['homedir'].'/include/functions_netflow.php';
 require_once $config['homedir'].'/include/functions_os.php';
 require_once $config['homedir'].'/include/functions_network.php';
 
-//
-// CONSTANTS DEFINITIONS                //
-//
+// CONSTANTS DEFINITIONS.
 // Priority modes.
 define('REPORT_PRIORITY_MODE_OK', 1);
 define('REPORT_PRIORITY_MODE_UNKNOWN', 2);
@@ -6370,11 +6378,15 @@ function reporting_availability($report, $content, $date=false, $time=false)
 }
 
 
-/**
- * reporting_availability_graph
- *
- *  Generates a structure the report.
- */
+ /**
+  * Reporting_availability_graph.
+  *
+  * @param array   $report  Info report.
+  * @param array   $content Content data.
+  * @param boolean $pdf     Output type PDF.
+  *
+  * @return array Generates a structure the report.
+  */
 function reporting_availability_graph($report, $content, $pdf=false)
 {
     global $config;
@@ -6393,7 +6405,7 @@ function reporting_availability_graph($report, $content, $pdf=false)
     $return['description'] = $content['description'];
     $return['date'] = reporting_get_date_text($report, $content);
 
-    // Get chart
+    // Get chart.
     reporting_set_conf_charts(
         $width,
         $height,
@@ -6437,83 +6449,8 @@ function reporting_availability_graph($report, $content, $pdf=false)
 
         foreach ($slas as $sla) {
             $server_name = $sla['server_name'];
-            // Metaconsole connection
-            if ($metaconsole_on && $server_name != '') {
-                $connection = metaconsole_get_connection($server_name);
-                if (!metaconsole_load_external_db($connection)) {
-                    // ui_print_error_message ("Error connecting to ".$server_name);
-                    continue;
-                }
-            }
 
-            if (modules_is_disable_agent($sla['id_agent_module'])
-                || modules_is_not_init($sla['id_agent_module'])
-            ) {
-                if ($metaconsole_on) {
-                    // Restore db connection
-                    metaconsole_restore_db();
-                }
-
-                continue;
-            }
-
-            // controller min and max == 0 then dinamic min and max critical
-            $dinamic_text = 0;
-            if ($sla['sla_min'] == 0 && $sla['sla_max'] == 0) {
-                $sla['sla_min'] = null;
-                $sla['sla_max'] = null;
-                $dinamic_text = __('Dynamic');
-            }
-
-            // controller inverse interval
-            $inverse_interval = 0;
-            if ((isset($sla['sla_max'])) && (isset($sla['sla_min']))) {
-                if ($sla['sla_max'] < $sla['sla_min']) {
-                    $content_sla_max  = $sla['sla_max'];
-                    $sla['sla_max']   = $sla['sla_min'];
-                    $sla['sla_min']   = $content_sla_max;
-                    $inverse_interval = 1;
-                    $dinamic_text = __('Inverse');
-                }
-            }
-
-            // for graph slice for module-interval, if not slice=0;
-            $module_interval = modules_get_interval($sla['id_agent_module']);
-            $slice = ($content['period'] / $module_interval);
-
-            // call functions sla
-            $sla_array = [];
-            $sla_array = reporting_advanced_sla(
-                $sla['id_agent_module'],
-                ($report['datetime'] - $content['period']),
-                $report['datetime'],
-                $sla['sla_min'],
-                // min_value -> dynamic
-                $sla['sla_max'],
-                // max_value -> dynamic
-                $inverse_interval,
-                // inverse_interval -> dynamic
-                [
-                    '1' => $content['sunday'],
-                    '2' => $content['monday'],
-                    '3' => $content['tuesday'],
-                    '4' => $content['wednesday'],
-                    '5' => $content['thursday'],
-                    '6' => $content['friday'],
-                    '7' => $content['saturday'],
-                ],
-                $content['time_from'],
-                $content['time_to'],
-                $slice
-            );
-
-            if ($metaconsole_on) {
-                // Restore db connection
-                metaconsole_restore_db();
-            }
-
-            $server_name = $sla['server_name'];
-            // Metaconsole connection
+            // Metaconsole connection.
             if ($metaconsole_on && $server_name != '') {
                 $connection = metaconsole_get_connection($server_name);
                 if (metaconsole_connect($connection) != NOERR) {
@@ -6521,199 +6458,118 @@ function reporting_availability_graph($report, $content, $pdf=false)
                 }
             }
 
-            $planned_downtimes = reporting_get_planned_downtimes_intervals($sla['id_agent_module'], ($report['datetime'] - $content['period']), $report['datetime']);
+            if (isset($sla['id_agent_module_secondary']) === true
+                && $sla['id_agent_module_secondary'] != 0
+            ) {
+                $sla_secondary['primary'] = $sla;
+                $sla_secondary['failover'] = $sla;
+                $sla_secondary['failover']['id_agent_module'] = $sla['id_agent_module_secondary'];
 
-            if ((is_array($planned_downtimes)) && (count($planned_downtimes) > 0)) {
-                // Sort retrieved planned downtimes
-                usort(
-                    $planned_downtimes,
-                    function ($a, $b) {
-                        $a = intval($a['date_from']);
-                        $b = intval($b['date_from']);
-                        if ($a == $b) {
-                            return 0;
-                        }
+                // For graph slice for module-interval, if not slice=0.
+                $module_interval = modules_get_interval($sla['id_agent_module']);
+                $slice = ($content['period'] / $module_interval);
 
-                        return ($a < $b) ? -1 : 1;
-                    }
+                foreach ($sla_secondary as $k_sla => $v_sla) {
+                    $sla_array = data_db_uncompress_module(
+                        $v_sla,
+                        $content,
+                        $report['datetime'],
+                        $slice
+                    );
+
+                    $return = prepare_data_for_paint(
+                        $v_sla,
+                        $sla_array,
+                        $content,
+                        $report['datetime'],
+                        $return,
+                        $k_sla
+                    );
+
+                    $data_combined[] = $sla_array;
+                }
+
+                if (isset($data_combined) === true
+                    && is_array($data_combined) === true
+                    && count($data_combined) > 0
+                ) {
+                    $data_a = array_map(
+                        function ($primary, $failover) {
+                            if ($primary['date_from'] === $failover['date_from']
+                                && $primary['date_to'] === $failover['date_to']
+                            ) {
+                                if ($primary['sla_fixed'] !== 100
+                                    && $primary['sla_fixed'] < $failover['sla_fixed']
+                                ) {
+                                    $primary['time_total'] = $failover['time_total'];
+                                    $primary['time_ok'] = $failover['time_ok'];
+                                    $primary['time_error'] = $failover['time_error'];
+                                    $primary['time_unknown'] = $failover['time_unknown'];
+                                    $primary['time_not_init'] = $failover['time_not_init'];
+                                    $primary['time_downtime'] = $failover['time_downtime'];
+                                    $primary['time_out'] = $failover['time_out'];
+                                    $primary['checks_total'] = $failover['checks_total'];
+                                    $primary['checks_ok'] = $failover['checks_ok'];
+                                    $primary['checks_error'] = $failover['checks_error'];
+                                    $primary['checks_unknown'] = $failover['checks_unknown'];
+                                    $primary['checks_not_init'] = $failover['checks_not_init'];
+                                    $primary['SLA'] = $failover['SLA'];
+                                    $primary['sla_fixed'] = $failover['sla_fixed'];
+                                }
+
+                                $return = $primary;
+                            }
+
+                            return $return;
+                        },
+                        $data_combined[0],
+                        $data_combined[1]
+                    );
+
+                    $return = prepare_data_for_paint(
+                        $sla,
+                        $data_a,
+                        $content,
+                        $report['datetime'],
+                        $return,
+                        'result'
+                    );
+                }
+            } else {
+                $sla_array = data_db_uncompress_module(
+                    $sla,
+                    $content,
+                    $report['datetime']
                 );
 
-                // Compress (overlapped) planned downtimes
-                $npd = count($planned_downtimes);
-                for ($i = 0; $i < $npd; $i++) {
-                    if (isset($planned_downtimes[($i + 1)])) {
-                        if ($planned_downtimes[$i]['date_to'] >= $planned_downtimes[($i + 1)]['date_from']) {
-                            // merge
-                            $planned_downtimes[$i]['date_to'] = $planned_downtimes[($i + 1)]['date_to'];
-                            array_splice($planned_downtimes, ($i + 1), 1);
-                            $npd--;
-                        }
-                    }
-                }
-            } else {
-                $planned_downtimes = null;
+                $return = prepare_data_for_paint(
+                    $sla,
+                    $sla_array,
+                    $content,
+                    $report['datetime'],
+                    $return
+                );
             }
 
-            $data = [];
-            $data['agent']        = modules_get_agentmodule_agent_alias($sla['id_agent_module']);
-            $data['module']       = modules_get_agentmodule_name($sla['id_agent_module']);
-            $data['max']          = $sla['sla_max'];
-            $data['min']          = $sla['sla_min'];
-            $data['sla_limit']    = $sla['sla_limit'];
-            $data['dinamic_text'] = $dinamic_text;
-
-            if (isset($sla_array[0])) {
-                $data['time_total']      = 0;
-                $data['time_ok']         = 0;
-                $data['time_error']      = 0;
-                $data['time_unknown']    = 0;
-                $data['time_not_init']   = 0;
-                $data['time_downtime']   = 0;
-                $data['checks_total']    = 0;
-                $data['checks_ok']       = 0;
-                $data['checks_error']    = 0;
-                $data['checks_unknown']  = 0;
-                $data['checks_not_init'] = 0;
-
-                $raw_graph = [];
-                $i = 0;
-                foreach ($sla_array as $value_sla) {
-                    $data['time_total']      += $value_sla['time_total'];
-                    $data['time_ok']         += $value_sla['time_ok'];
-                    $data['time_error']      += $value_sla['time_error'];
-                    $data['time_unknown']    += $value_sla['time_unknown'];
-                    $data['time_downtime']   += $value_sla['time_downtime'];
-                    $data['time_not_init']   += $value_sla['time_not_init'];
-                    $data['checks_total']    += $value_sla['checks_total'];
-                    $data['checks_ok']       += $value_sla['checks_ok'];
-                    $data['checks_error']    += $value_sla['checks_error'];
-                    $data['checks_unknown']  += $value_sla['checks_unknown'];
-                    $data['checks_not_init'] += $value_sla['checks_not_init'];
-
-                    // generate raw data for graph
-                    $period = reporting_sla_get_status_period($value_sla, $priority_mode);
-                    $raw_graph[$i]['data'] = reporting_translate_sla_status_for_graph($period);
-                    $raw_graph[$i]['utimestamp'] = ($value_sla['date_to'] - $value_sla['date_from']);
-                    $i++;
-                }
-
-                $data['sla_value'] = reporting_sla_get_compliance_from_array($data);
-                $data['sla_fixed'] = sla_truncate($data['sla_value'], $config['graph_precision']);
-            } else {
-                // Show only table not divider in slice for defect slice=1
-                $data['time_total']      = $sla_array['time_total'];
-                $data['time_ok']         = $sla_array['time_ok'];
-                $data['time_error']      = $sla_array['time_error'];
-                $data['time_unknown']    = $sla_array['time_unknown'];
-                $data['time_downtime']   = $sla_array['time_downtime'];
-                $data['time_not_init']   = $sla_array['time_not_init'];
-                $data['checks_total']    = $sla_array['checks_total'];
-                $data['checks_ok']       = $sla_array['checks_ok'];
-                $data['checks_error']    = $sla_array['checks_error'];
-                $data['checks_unknown']  = $sla_array['checks_unknown'];
-                $data['checks_not_init'] = $sla_array['checks_not_init'];
-                $data['sla_value']       = $sla_array['SLA'];
-            }
-
-            // checks whether or not it meets the SLA
-            if ($data['sla_value'] >= $sla['sla_limit']) {
-                $data['sla_status'] = 1;
-                $sla_failed = false;
-            } else {
-                $sla_failed = true;
-                $data['sla_status'] = 0;
-            }
-
-            // Do not show right modules if 'only_display_wrong' is active
-            if ($content['only_display_wrong'] && $sla_failed == false) {
-                continue;
-            }
-
-            // find order
-            $data['order'] = $data['sla_value'];
-            $return['data'][] = $data;
-
-            $data_init = -1;
-            $acum = 0;
-            $sum = 0;
-            $array_result = [];
-            $i = 0;
-            foreach ($raw_graph as $key => $value) {
-                if ($data_init == -1) {
-                    $data_init = $value['data'];
-                    $acum      = $value['utimestamp'];
-                    $sum       = $value['data'];
-                } else {
-                    if ($data_init == $value['data']) {
-                        $acum = ($acum + $value['utimestamp']);
-                        $sum  = ($sum + $value['real_data']);
-                    } else {
-                        $array_result[$i]['data'] = $data_init;
-                        $array_result[$i]['utimestamp'] = $acum;
-                        $array_result[$i]['real_data'] = $sum;
-                        $i++;
-                        $data_init = $value['data'];
-                        $acum = $value['utimestamp'];
-                        $sum = $value['real_data'];
-                    }
-                }
-            }
-
-            $array_result[$i]['data'] = $data_init;
-            $array_result[$i]['utimestamp'] = $acum;
-            $array_result[$i]['real_data'] = $sum;
-
-            // Slice graphs calculation
-            $dataslice = [];
-            $dataslice['agent']        = modules_get_agentmodule_agent_alias($sla['id_agent_module']);
-            $dataslice['module']       = modules_get_agentmodule_name($sla['id_agent_module']);
-            $dataslice['order']        = $data['sla_value'];
-            $dataslice['checks_total'] = $data['checks_total'];
-            $dataslice['checks_ok']    = $data['checks_ok'];
-            $dataslice['time_total']   = $data['time_total'];
-            $dataslice['time_not_init'] = $data['time_not_init'];
-            $dataslice['sla_status']   = $data['sla_status'];
-            $dataslice['sla_value']    = $data['sla_value'];
-
-            $dataslice['chart'] = graph_sla_slicebar(
-                $sla['id_agent_module'],
-                $content['period'],
-                $sla['sla_min'],
-                $sla['sla_max'],
-                $report['datetime'],
-                $content,
-                $content['time_from'],
-                $content['time_to'],
-                100,
-                70,
-                $urlImage,
-                $ttl,
-                $array_result,
-                false
-            );
-
-            $return['charts'][] = $dataslice;
-
             if ($metaconsole_on) {
-                // Restore db connection
+                // Restore db connection.
                 metaconsole_restore_db();
             }
         }
 
-        // SLA items sorted descending ()
+        // SLA items sorted descending.
         if ($content['top_n'] == 2) {
             arsort($return['data']['']);
-        }
-        // SLA items sorted ascending
-        else if ($content['top_n'] == 1) {
+        } else if ($content['top_n'] == 1) {
+            // SLA items sorted ascending.
             asort($sla_showed_values);
         }
 
-        // order data for ascending or descending
+        // Order data for ascending or descending.
         if ($content['top_n'] != 0) {
             switch ($content['top_n']) {
                 case 1:
-                    // order tables
+                    // Order tables.
                     $temp = [];
                     foreach ($return['data'] as $row) {
                         $i = 0;
@@ -6730,7 +6586,7 @@ function reporting_availability_graph($report, $content, $pdf=false)
 
                     $return['data'] = $temp;
 
-                    // order graphs
+                    // Order graphs.
                     $temp = [];
                     foreach ($return['charts'] as $row) {
                         $i = 0;
@@ -6746,11 +6602,10 @@ function reporting_availability_graph($report, $content, $pdf=false)
                     }
 
                     $return['charts'] = $temp;
-
                 break;
 
                 case 2:
-                    // order tables
+                    // Order tables.
                     $temp = [];
                     foreach ($return['data'] as $row) {
                         $i = 0;
@@ -6767,7 +6622,7 @@ function reporting_availability_graph($report, $content, $pdf=false)
 
                     $return['data'] = $temp;
 
-                    // order graph
+                    // Order graph.
                     $temp = [];
                     foreach ($return['charts'] as $row) {
                         $i = 0;
@@ -6783,7 +6638,10 @@ function reporting_availability_graph($report, $content, $pdf=false)
                     }
 
                     $return['charts'] = $temp;
+                break;
 
+                default:
+                    // If not posible.
                 break;
             }
         }
@@ -6793,6 +6651,311 @@ function reporting_availability_graph($report, $content, $pdf=false)
 }
 
 
+/**
+ * Return data db uncompress for module.
+ *
+ * @param array   $sla      Data neccesary for db_uncompress.
+ * @param array   $content  Conetent report.
+ * @param array   $datetime Date.
+ * @param integer $slice    Defined slice.
+ *
+ * @return array
+ */
+function data_db_uncompress_module($sla, $content, $datetime, $slice=0)
+{
+    // Controller min and max == 0 then dinamic min and max critical.
+    $dinamic_text = 0;
+    if ($sla['sla_min'] == 0 && $sla['sla_max'] == 0) {
+        $sla['sla_min'] = null;
+        $sla['sla_max'] = null;
+        $dinamic_text = __('Dynamic');
+    }
+
+    // Controller inverse interval.
+    $inverse_interval = 0;
+    if ((isset($sla['sla_max'])) && (isset($sla['sla_min']))) {
+        if ($sla['sla_max'] < $sla['sla_min']) {
+            $content_sla_max  = $sla['sla_max'];
+            $sla['sla_max']   = $sla['sla_min'];
+            $sla['sla_min']   = $content_sla_max;
+            $inverse_interval = 1;
+            $dinamic_text = __('Inverse');
+        }
+    }
+
+    if ($slice === 0) {
+        // For graph slice for module-interval, if not slice=0.
+        $module_interval = modules_get_interval($sla['id_agent_module']);
+        $slice = ($content['period'] / $module_interval);
+    }
+
+    // Call functions sla.
+    $sla_array = [];
+    $sla_array = reporting_advanced_sla(
+        $sla['id_agent_module'],
+        ($datetime - $content['period']),
+        $datetime,
+        $sla['sla_min'],
+        $sla['sla_max'],
+        $inverse_interval,
+        [
+            '1' => $content['sunday'],
+            '2' => $content['monday'],
+            '3' => $content['tuesday'],
+            '4' => $content['wednesday'],
+            '5' => $content['thursday'],
+            '6' => $content['friday'],
+            '7' => $content['saturday'],
+        ],
+        $content['time_from'],
+        $content['time_to'],
+        $slice
+    );
+
+    return $sla_array;
+}
+
+
+/**
+ * Return array planned downtimes.
+ *
+ * @param integer $id_agent_module Id module.
+ * @param integer $datetime        Date utimestamp.
+ * @param integer $period          Period utimestamp.
+ *
+ * @return array
+ */
+function reporting_get_planned_downtimes_sla($id_agent_module, $datetime, $period)
+{
+    $planned_downtimes = reporting_get_planned_downtimes_intervals(
+        $id_agent_module,
+        ($datetime - $period),
+        $datetime
+    );
+
+    if ((is_array($planned_downtimes))
+        && (count($planned_downtimes) > 0)
+    ) {
+        // Sort retrieved planned downtimes.
+        usort(
+            $planned_downtimes,
+            function ($a, $b) {
+                $a = intval($a['date_from']);
+                $b = intval($b['date_from']);
+                if ($a == $b) {
+                    return 0;
+                }
+
+                return ($a < $b) ? (-1) : 1;
+            }
+        );
+
+        // Compress (overlapped) planned downtimes.
+        $npd = count($planned_downtimes);
+        for ($i = 0; $i < $npd; $i++) {
+            if (isset($planned_downtimes[($i + 1)])) {
+                if ($planned_downtimes[$i]['date_to'] >= $planned_downtimes[($i + 1)]['date_from']) {
+                    // Merge.
+                    $planned_downtimes[$i]['date_to'] = $planned_downtimes[($i + 1)]['date_to'];
+                    array_splice($planned_downtimes, ($i + 1), 1);
+                    $npd--;
+                }
+            }
+        }
+    } else {
+        $planned_downtimes = [];
+    }
+
+    return $planned_downtimes;
+}
+
+
+/**
+ * Prepare data for Paint in report.
+ *
+ * @param array   $sla       Data Module to sla.
+ * @param array   $sla_array Data uncompressed.
+ * @param array   $content   Content report data.
+ * @param integer $datetime  Date.
+ * @param array   $return    Array return.
+ * @param string  $secondary Type secondaary primary, failover, Result.
+ *
+ * @return array Return modify.
+ */
+function prepare_data_for_paint(
+    $sla,
+    $sla_array,
+    $content,
+    $datetime,
+    $return,
+    $secondary=''
+) {
+    $data = [];
+    $alias_agent = modules_get_agentmodule_agent_alias(
+        $sla['id_agent_module']
+    );
+    $name_module = modules_get_agentmodule_name(
+        $sla['id_agent_module']
+    );
+
+    $data['agent'] = $alias_agent;
+    $data['module'] = $name_module;
+    $data['max'] = $sla['sla_max'];
+    $data['min'] = $sla['sla_min'];
+    $data['sla_limit'] = $sla['sla_limit'];
+    $data['dinamic_text'] = $dinamic_text;
+    $data['secondary'] = $secondary;
+    if (isset($sla_array[0])) {
+        $data['time_total']      = 0;
+        $data['time_ok']         = 0;
+        $data['time_error']      = 0;
+        $data['time_unknown']    = 0;
+        $data['time_not_init']   = 0;
+        $data['time_downtime']   = 0;
+        $data['checks_total']    = 0;
+        $data['checks_ok']       = 0;
+        $data['checks_error']    = 0;
+        $data['checks_unknown']  = 0;
+        $data['checks_not_init'] = 0;
+
+        $raw_graph = [];
+        $i = 0;
+        foreach ($sla_array as $value_sla) {
+            $data['time_total']      += $value_sla['time_total'];
+            $data['time_ok']         += $value_sla['time_ok'];
+            $data['time_error']      += $value_sla['time_error'];
+            $data['time_unknown']    += $value_sla['time_unknown'];
+            $data['time_downtime']   += $value_sla['time_downtime'];
+            $data['time_not_init']   += $value_sla['time_not_init'];
+            $data['checks_total']    += $value_sla['checks_total'];
+            $data['checks_ok']       += $value_sla['checks_ok'];
+            $data['checks_error']    += $value_sla['checks_error'];
+            $data['checks_unknown']  += $value_sla['checks_unknown'];
+            $data['checks_not_init'] += $value_sla['checks_not_init'];
+
+            // Generate raw data for graph.
+            $period = reporting_sla_get_status_period(
+                $value_sla,
+                $priority_mode
+            );
+            $raw_graph[$i]['data'] = reporting_translate_sla_status_for_graph(
+                $period
+            );
+            $raw_graph[$i]['utimestamp'] = ($value_sla['date_to'] - $value_sla['date_from']);
+            $i++;
+        }
+
+        $data['sla_value'] = reporting_sla_get_compliance_from_array(
+            $data
+        );
+        $data['sla_fixed'] = sla_truncate(
+            $data['sla_value'],
+            $config['graph_precision']
+        );
+    } else {
+        // Show only table not divider in slice for defect slice=1.
+        $data['time_total']      = $sla_array['time_total'];
+        $data['time_ok']         = $sla_array['time_ok'];
+        $data['time_error']      = $sla_array['time_error'];
+        $data['time_unknown']    = $sla_array['time_unknown'];
+        $data['time_downtime']   = $sla_array['time_downtime'];
+        $data['time_not_init']   = $sla_array['time_not_init'];
+        $data['checks_total']    = $sla_array['checks_total'];
+        $data['checks_ok']       = $sla_array['checks_ok'];
+        $data['checks_error']    = $sla_array['checks_error'];
+        $data['checks_unknown']  = $sla_array['checks_unknown'];
+        $data['checks_not_init'] = $sla_array['checks_not_init'];
+        $data['sla_value']       = $sla_array['SLA'];
+    }
+
+    // Checks whether or not it meets the SLA.
+    if ($data['sla_value'] >= $sla['sla_limit']) {
+        $data['sla_status'] = 1;
+        $sla_failed = false;
+    } else {
+        $sla_failed = true;
+        $data['sla_status'] = 0;
+    }
+
+    // Do not show right modules if 'only_display_wrong' is active.
+    if ($content['only_display_wrong'] && $sla_failed == false) {
+        return $return;
+    }
+
+    // Find order.
+    $data['order'] = $data['sla_value'];
+    $return['data'][] = $data;
+
+    $data_init = -1;
+    $acum = 0;
+    $sum = 0;
+    $array_result = [];
+    $i = 0;
+    foreach ($raw_graph as $key => $value) {
+        if ($data_init == -1) {
+            $data_init = $value['data'];
+            $acum      = $value['utimestamp'];
+            $sum       = $value['data'];
+        } else {
+            if ($data_init == $value['data']) {
+                $acum = ($acum + $value['utimestamp']);
+                $sum  = ($sum + $value['real_data']);
+            } else {
+                $array_result[$i]['data'] = $data_init;
+                $array_result[$i]['utimestamp'] = $acum;
+                $array_result[$i]['real_data'] = $sum;
+                $i++;
+                $data_init = $value['data'];
+                $acum = $value['utimestamp'];
+                $sum = $value['real_data'];
+            }
+        }
+    }
+
+    $array_result[$i]['data'] = $data_init;
+    $array_result[$i]['utimestamp'] = $acum;
+    $array_result[$i]['real_data'] = $sum;
+
+    // Slice graphs calculation.
+    $dataslice = [];
+    $dataslice['agent'] = $alias_agent;
+    $dataslice['module'] = $name_module;
+    $dataslice['order'] = $data['sla_value'];
+    $dataslice['checks_total'] = $data['checks_total'];
+    $dataslice['checks_ok'] = $data['checks_ok'];
+    $dataslice['time_total'] = $data['time_total'];
+    $dataslice['time_not_init'] = $data['time_not_init'];
+    $dataslice['sla_status'] = $data['sla_status'];
+    $dataslice['sla_value'] = $data['sla_value'];
+
+    $height = 80;
+    if ($secondary !== '' && $secondary !== 'result') {
+        $height = 50;
+    }
+
+    $dataslice['chart'] = graph_sla_slicebar(
+        $sla['id_agent_module'],
+        $content['period'],
+        $sla['sla_min'],
+        $sla['sla_max'],
+        $datetime,
+        $content,
+        $content['time_from'],
+        $content['time_to'],
+        100,
+        $height,
+        $urlImage,
+        $ttl,
+        $array_result,
+        false
+    );
+
+    $return['charts'][] = $dataslice;
+
+    return $return;
+}
+
+
 /**
  * reporting_increment
  *
diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index c8d5b3e29e..ecad568d1d 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -3252,15 +3252,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
 
     $tables_chart = '';
 
-    $table1 = new stdClass();
-    $table1->width = '99%';
-    $table1->data = [];
-    $table1->size = [];
-    $table1->size[0] = '10%';
-    $table1->size[1] = '80%';
-    $table1->size[2] = '5%';
-    $table1->size[3] = '5%';
-    foreach ($item['charts'] as $chart) {
+    foreach ($item['charts'] as $k_chart => $chart) {
         $checks_resume = '';
         $sla_value = '';
         if (reporting_sla_is_not_init_from_array($chart)) {
@@ -3291,14 +3283,74 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
             $checks_resume = '('.$chart['checks_ok'].'/'.$chart['checks_total'].')';
         }
 
-        $table1->data[0][0] = $chart['agent'].'<br />'.$chart['module'];
-        $table1->data[0][1] = $chart['chart'];
-        $table1->data[0][2] = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
-        $table1->data[0][3] = $checks_resume;
-        $tables_chart .= html_print_table(
-            $table1,
-            true
-        );
+        // Check failover availability report.
+        if ($item['data'][$k_chart]['secondary'] === '') {
+            $table1 = new stdClass();
+            $table1->width = '99%';
+            $table1->data = [];
+            $table1->size = [];
+            $table1->size[0] = '10%';
+            $table1->size[1] = '80%';
+            $table1->size[2] = '5%';
+            $table1->size[3] = '5%';
+            $table1->data[0][0] = $chart['agent'].'<br />'.$chart['module'];
+            $table1->data[0][1] = $chart['chart'];
+            $table1->data[0][2] = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
+            $table1->data[0][3] = $checks_resume;
+            $tables_chart .= html_print_table(
+                $table1,
+                true
+            );
+        } else {
+            if ($item['data'][$k_chart]['secondary'] === 'primary') {
+                $table1 = new stdClass();
+                $table1->width = '99%';
+                $table1->data = [];
+                $table1->size = [];
+                $table1->size[0] = '10%';
+                $table1->size[1] = '80%';
+                $table1->size[2] = '5%';
+                $table1->size[3] = '5%';
+            }
+
+            $title = '';
+            $checks_resume_text = $checks_resume;
+            $sla_value_text = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
+            switch ($item['data'][$k_chart]['secondary']) {
+                case 'primary':
+                    $title = '<b>'.__('Primary').'</b>';
+                    $title .= '<br />'.$chart['agent'];
+                    $title .= '<br />'.$chart['module'];
+                break;
+
+                case 'failover':
+                    $title = '<b>'.__('Failover').'</b>';
+                    $title .= '<br />'.$chart['agent'];
+                    $title .= '<br />'.$chart['module'];
+                break;
+
+                case 'result':
+                default:
+                    $title = '<b>'.__('Result').'</b>';
+                    $sla_value_text = "<span style = 'font: bold 3em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
+                    $checks_resume_text = '<span style = "font-size: 12pt;">';
+                    $checks_resume_text .= $checks_resume;
+                    $checks_resume_text .= '</span>';
+                break;
+            }
+
+            $table1->data[$item['data'][$k_chart]['secondary']][0] = $title;
+            $table1->data[$item['data'][$k_chart]['secondary']][1] = $chart['chart'];
+            $table1->data[$item['data'][$k_chart]['secondary']][2] = $sla_value_text;
+            $table1->data[$item['data'][$k_chart]['secondary']][3] = $checks_resume_text;
+
+            if ($item['data'][$k_chart]['secondary'] === 'result') {
+                $tables_chart .= html_print_table(
+                    $table1,
+                    true
+                );
+            }
+        }
     }
 
     if ($item['type'] == 'availability_graph') {
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index 6784ecb309..e73d31209b 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -1464,6 +1464,7 @@ CREATE TABLE IF NOT EXISTS `treport_content_sla_combined` (
 	`id` INTEGER UNSIGNED NOT NULL auto_increment,
 	`id_report_content` INTEGER UNSIGNED NOT NULL,
 	`id_agent_module` int(10) unsigned NOT NULL,
+	`id_agent_module_secondary` int(10) unsigned NOT NULL,
 	`sla_max` double(18,2) NOT NULL default 0,
 	`sla_min` double(18,2) NOT NULL default 0,
 	`sla_limit` double(18,2) NOT NULL default 0,
diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql
index c69e37e545..6c8811bf22 100644
--- a/pandora_console/pandoradb_data.sql
+++ b/pandora_console/pandoradb_data.sql
@@ -114,10 +114,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
 ('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
 ('custom_report_front_header', ''),
 ('custom_report_front_footer', ''),
-('MR', 29),
+('MR', 30),
 ('identification_reminder', 1),
 ('identification_reminder_timestamp', 0),
-('current_package_enterprise', '736'),
+('current_package_enterprise', '737'),
 ('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'),
 ('custom_docs_logo', 'default_docs.png'),
 ('custom_support_logo', 'default_support.png'),

From 209681e4c2e5c1affd76586f3b5fd2e8a00d3b1d Mon Sep 17 00:00:00 2001
From: Daniel Barbero <daniel.barbero@artica.es>
Date: Tue, 2 Jul 2019 11:50:58 +0200
Subject: [PATCH 26/83] ADD failover option availability_graph

---
 pandora_console/extras/mr/30.sql              |  12 ++
 .../pandoradb_migrate_6.0_to_7.0.mysql.sql    |   7 +-
 .../reporting_builder.item_editor.php         | 187 +++++++++++++-----
 .../godmode/reporting/reporting_builder.php   |  18 ++
 .../include/ajax/reporting.ajax.php           |  18 +-
 .../include/ajax/update_manager.ajax.php      |   1 -
 .../include/functions_reporting.php           |  51 +++--
 .../include/functions_reporting_html.php      |  18 +-
 pandora_console/pandoradb.sql                 |   7 +-
 9 files changed, 230 insertions(+), 89 deletions(-)

diff --git a/pandora_console/extras/mr/30.sql b/pandora_console/extras/mr/30.sql
index e69de29bb2..0e37d30c35 100644
--- a/pandora_console/extras/mr/30.sql
+++ b/pandora_console/extras/mr/30.sql
@@ -0,0 +1,12 @@
+START TRANSACTION;
+
+ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL;
+ALTER TABLE `treport_content_sla_combined` ADD `id_server_failover` int(10) unsigned NOT NULL;
+
+ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
+ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
+
+ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
+
+COMMIT;
\ No newline at end of file
diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
index b9e48da3f8..4404ee826d 100644
--- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
+++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
@@ -796,6 +796,8 @@ ALTER TABLE `treport_content_template` ADD COLUMN `unknown_checks` TINYINT(1) DE
 ALTER TABLE `treport_content_template` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
 ALTER TABLE `treport_content_template` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
 ALTER TABLE `treport_content_template` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
+ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
 
 -- -----------------------------------------------------
 -- Table `treport_content_sla_com_temp` (treport_content_sla_combined_template)
@@ -1442,6 +1444,8 @@ ALTER TABLE `treport_content` ADD COLUMN `unknown_checks` TINYINT(1) DEFAULT '1'
 ALTER TABLE `treport_content` ADD COLUMN `agent_max_value` TINYINT(1) DEFAULT '1';
 ALTER TABLE `treport_content` ADD COLUMN `agent_min_value` TINYINT(1) DEFAULT '1';
 ALTER TABLE `treport_content` ADD COLUMN `current_month` TINYINT(1) DEFAULT '1';
+ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
+ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
 
 -- ---------------------------------------------------------------------
 -- Table `tmodule_relationship`
@@ -2213,4 +2217,5 @@ CREATE TABLE IF NOT EXISTS `tcredential_store` (
 -- ---------------------------------------------------------------------
 -- Table `treport_content_sla_combined`
 -- ---------------------------------------------------------------------
-ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_secondary` int(10) unsigned NOT NULL;
+ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL;
+ALTER TABLE `treport_content_sla_combined` ADD `id_server_failover` int(10) unsigned NOT NULL;
diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
index d943fbf0fc..b269b153d5 100755
--- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php
+++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
@@ -165,6 +165,8 @@ switch ($action) {
         $show_in_landscape = 0;
         $hide_notinit_agents = 0;
         $priority_mode = REPORT_PRIORITY_MODE_OK;
+        $failover_mode = 0;
+        $failover_type = REPORT_FAILOVER_TYPE_NORMAL;
         $server_name = '';
         $server_id = 0;
         $dyn_height = 230;
@@ -314,6 +316,8 @@ switch ($action) {
                     $sla_sorted_by = $item['top_n'];
                     $period = $item['period'];
                     $current_month = $item['current_month'];
+                    $failover_mode = $item['failover_mode'];
+                    $failover_type = $item['failover_type'];
                 break;
 
                 case 'module_histogram_graph':
@@ -2237,6 +2241,7 @@ $class = 'databox filters';
                 ?>
             </td>
         </tr>
+
         <tr id="row_select_fields2" style="" class="datos">
         <td style="font-weight:bold;margin-right:150px;">
             <?php
@@ -2608,6 +2613,59 @@ $class = 'databox filters';
             </td>
         </tr>
 
+        <tr id="row_failover_mode" style="" class="datos">
+            <td style="font-weight:bold;">
+            <?php
+            echo __('Failover mode').ui_print_help_tip(
+                __('XXX.'),
+                true
+            );
+            ?>
+            </td>
+            <td>
+                <?php
+                html_print_checkbox_switch(
+                    'failover_mode',
+                    1,
+                    $failover_mode
+                );
+                ?>
+            </td>
+        </tr>
+
+        <tr id="row_failover_type" style="" class="datos">
+            <td style="font-weight:bold;">
+            <?php
+            echo __('Failover type');
+            ?>
+            </td>
+            <td>
+                <?php
+                echo __('Failover normal');
+                echo '<span style="margin-left:5px;"></span>';
+                html_print_radio_button(
+                    'failover_type',
+                    REPORT_FAILOVER_TYPE_NORMAL,
+                    '',
+                    $failover_type == REPORT_FAILOVER_TYPE_NORMAL,
+                    ''
+                );
+
+                echo '<span style="margin:30px;"></span>';
+
+                echo __('Failover simple');
+                echo '<span style="margin-left:5px;"></span>';
+                html_print_radio_button(
+                    'failover_type',
+                    REPORT_FAILOVER_TYPE_SIMPLE,
+                    '',
+                    $failover_type == REPORT_FAILOVER_TYPE_SIMPLE,
+                    ''
+                );
+                ?>
+            </td>
+        </tr>
+
         <tr id="row_filter_search" style="" class="datos">
             <td style="font-weight:bold;"><?php echo __('Free search'); ?></td>
             <td>
@@ -2771,6 +2829,13 @@ function print_SLA_list($width, $action, $idItem=null)
         'id_rc',
         $idItem
     );
+
+    $failover_mode = db_get_value(
+        'failover_mode',
+        'treport_content',
+        'id_rc',
+        $idItem
+    );
     ?>
     <table class="databox data" id="sla_list" border="0" cellpadding="4" cellspacing="4" width="100%">
         <thead>
@@ -2783,16 +2848,18 @@ function print_SLA_list($width, $action, $idItem=null)
                 <th class="header sla_list_module_col" scope="col">
                 <?php
                 echo __('Module');
-                if ($report_item_type == 'availability_graph') {
+                if ($report_item_type == 'availability_graph'
+                    && $failover_mode
+                ) {
                     ?>
-                <th class="header sla_list_agent_secondary" scope="col">
+                <th class="header sla_list_agent_failover" scope="col">
                     <?php
-                    echo __('Agent Secondary');
+                    echo __('Agent Failover');
                     ?>
                 </th>
-                <th class="header sla_list_module_secondary" scope="col">
+                <th class="header sla_list_module_failover" scope="col">
                     <?php
-                    echo __('Module Secondary');
+                    echo __('Module Failover');
                     ?>
                 </th>
                     <?php
@@ -2878,22 +2945,22 @@ function print_SLA_list($width, $action, $idItem=null)
                             ['id_agente_modulo' => $item['id_agent_module']]
                         );
 
-                        if (isset($item['id_agent_module_secondary']) === true
-                            && $item['id_agent_module_secondary'] !== 0
+                        if (isset($item['id_agent_module_failover']) === true
+                            && $item['id_agent_module_failover'] !== 0
                         ) {
-                            $idAgentSecondary = db_get_value_filter(
+                            $idAgentFailover = db_get_value_filter(
                                 'id_agente',
                                 'tagente_modulo',
-                                ['id_agente_modulo' => $item['id_agent_module_secondary']]
+                                ['id_agente_modulo' => $item['id_agent_module_failover']]
                             );
-                            $nameAgentSecondary = agents_get_alias(
-                                $idAgentSecondary
+                            $nameAgentFailover = agents_get_alias(
+                                $idAgentFailover
                             );
 
-                            $nameModuleSecondary = db_get_value_filter(
+                            $nameModuleFailover = db_get_value_filter(
                                 'nombre',
                                 'tagente_modulo',
-                                ['id_agente_modulo' => $item['id_agent_module_secondary']]
+                                ['id_agente_modulo' => $item['id_agent_module_failover']]
                             );
                         }
 
@@ -2910,12 +2977,14 @@ function print_SLA_list($width, $action, $idItem=null)
                         echo printSmallFont($nameModule);
                         echo '</td>';
 
-                        if ($report_item_type == 'availability_graph') {
-                            echo '<td class="sla_list_agent_secondary">';
-                            echo printSmallFont($nameAgentSecondary).$server_name_element;
+                        if ($report_item_type == 'availability_graph'
+                            && $failover_mode
+                        ) {
+                            echo '<td class="sla_list_agent_failover">';
+                            echo printSmallFont($nameAgentFailover).$server_name_element;
                             echo '</td>';
-                            echo '<td class="sla_list_module_secondary">';
-                            echo printSmallFont($nameModuleSecondary);
+                            echo '<td class="sla_list_module_failover">';
+                            echo printSmallFont($nameModuleFailover);
                             echo '</td>';
                         }
 
@@ -2967,10 +3036,12 @@ function print_SLA_list($width, $action, $idItem=null)
                             <td class="sla_list_agent_col agent_name"></td>
                             <td class="sla_list_module_col module_name"></td>
                             <?php
-                            if ($report_item_type == 'availability_graph') {
+                            if ($report_item_type == 'availability_graph'
+                                && $failover_mode
+                            ) {
                                 ?>
-                            <td class="sla_list_agent_secondary agent_name_secondary"></td>
-                            <td class="sla_list_module_secondary module_name_secondary"></td>
+                            <td class="sla_list_agent_failover agent_name_failover"></td>
+                            <td class="sla_list_module_failover module_name_failover"></td>
                                 <?php
                             }
 
@@ -3030,20 +3101,22 @@ function print_SLA_list($width, $action, $idItem=null)
                                 </select>
                             </td>
                             <?php
-                            if ($report_item_type == 'availability_graph') {
+                            if ($report_item_type == 'availability_graph'
+                                && $failover_mode
+                            ) {
                                 ?>
-                                <td class="sla_list_agent_secondary_col">
-                                    <input id="hidden-id_agent_secondary" name="id_agent_secondary" value="" type="hidden">
-                                    <input id="hidden-server_name_secondary" name="server_name_secondary" value="" type="hidden">
+                                <td class="sla_list_agent_failover_col">
+                                    <input id="hidden-id_agent_failover" name="id_agent_failover" value="" type="hidden">
+                                    <input id="hidden-server_name_failover" name="server_name_failover" value="" type="hidden">
                                     <?php
                                     $params = [];
                                     $params['show_helptip'] = true;
-                                    $params['input_name'] = 'agent_secondary';
+                                    $params['input_name'] = 'agent_failover';
                                     $params['value'] = '';
                                     $params['use_hidden_input_idagent'] = true;
-                                    $params['hidden_input_idagent_id'] = 'hidden-id_agent_secondary';
+                                    $params['hidden_input_idagent_id'] = 'hidden-id_agent_failover';
                                     $params['javascript_is_function_select'] = true;
-                                    $params['selectbox_id'] = 'id_agent_module_secondary';
+                                    $params['selectbox_id'] = 'id_agent_module_failover';
                                     $params['add_none_module'] = false;
                                     if ($meta) {
                                         $params['use_input_id_server'] = true;
@@ -3054,8 +3127,8 @@ function print_SLA_list($width, $action, $idItem=null)
                                     ui_print_agent_autocomplete_input($params);
                                     ?>
                                 </td>
-                                <td class="sla_list_module_secondary_col">
-                                    <select id="id_agent_module_secondary" name="id_agent_module_secondary" disabled="disabled" style="max-width: 180px">
+                                <td class="sla_list_module_failover_col">
+                                    <select id="id_agent_module_failover" name="id_agent_module_failover" disabled="disabled" style="max-width: 180px">
                                         <option value="0">
                                             <?php
                                             echo __('Select an Agent first');
@@ -3701,11 +3774,18 @@ $(document).ready (function () {
     $("#checkbox-checkbox_show_resume").change(function(){
         if($(this).is(":checked")){
             $("#row_select_fields2").show();
-            $("#row_select_fields3").show();
         }
         else{
             $("#row_select_fields2").hide();
-            $("#row_select_fields3").hide();
+        }
+    });
+
+    $("#checkbox-failover_mode").change(function(){
+        if($(this).is(":checked")){
+            $("#row_failover_type").show();
+        }
+        else{
+            $("#row_failover_type").hide();
         }
     });
 });
@@ -3999,13 +4079,13 @@ function deleteGeneralRow(id_row) {
 
 function addSLARow() {
     var nameAgent = $("input[name=agent_sla]").val();
-    var nameAgentSecondary = $("input[name=agent_secondary]").val();
+    var nameAgentFailover = $("input[name=agent_failover]").val();
     var idAgent = $("input[name=id_agent_sla]").val();
     var serverId = $("input[name=id_server]").val();
     var idModule = $("#id_agent_module_sla").val();
-    var idModuleSecondary = $("#id_agent_module_secondary").val();
+    var idModuleFailover = $("#id_agent_module_failover").val();
     var nameModule = $("#id_agent_module_sla :selected").text();
-    var nameModuleSecondary = $("#id_agent_module_secondary :selected").text();
+    var nameModuleFailover = $("#id_agent_module_failover :selected").text();
     var slaMin = $("input[name=sla_min]").val();
     var slaMax = $("input[name=sla_max]").val();
     var slaLimit = $("input[name=sla_limit]").val();
@@ -4066,11 +4146,11 @@ function addSLARow() {
                 });
             }
 
-            if (nameAgentSecondary != '') {
-                //Truncate nameAgentSecondary
+            if (nameAgentFailover != '') {
+                //Truncate nameAgentFailover
                 var params = [];
                 params.push("truncate_text=1");
-                params.push("text=" + nameAgentSecondary);
+                params.push("text=" + nameAgentFailover);
                 params.push("page=include/ajax/reporting.ajax");
                 jQuery.ajax ({
                     data: params.join ("&"),
@@ -4088,14 +4168,14 @@ function addSLARow() {
                     async: false,
                     timeout: 10000,
                     success: function (data) {
-                        nameAgentSecondary = data;
+                        nameAgentFailover = data;
                     }
                 });
 
-                //Truncate nameModuleSecondary
+                //Truncate nameModuleFailover
                 var params = [];
                 params.push("truncate_text=1");
-                params.push("text=" + nameModuleSecondary);
+                params.push("text=" + nameModuleFailover);
                 params.push("page=include/ajax/reporting.ajax");
                 jQuery.ajax ({
                     data: params.join ("&"),
@@ -4113,7 +4193,7 @@ function addSLARow() {
                     async: false,
                     timeout: 10000,
                     success: function (data) {
-                        nameModuleSecondary = data;
+                        nameModuleFailover = data;
                     }
                 });
             }
@@ -4122,7 +4202,7 @@ function addSLARow() {
             params.push("add_sla=1");
             params.push("id=" + $("input[name=id_item]").val());
             params.push("id_module=" + idModule);
-            params.push("id_module_secondary=" + idModuleSecondary);
+            params.push("id_module_failover=" + idModuleFailover);
             params.push("sla_min=" + slaMin);
             params.push("sla_max=" + slaMax);
             params.push("sla_limit=" + slaLimit);
@@ -4155,8 +4235,8 @@ function addSLARow() {
                         $("#row", row).attr('id', 'sla_' + data['id']);
                         $(".agent_name", row).html(nameAgent);
                         $(".module_name", row).html(nameModule);
-                        $(".agent_name_secondary", row).html(nameAgentSecondary);
-                        $(".module_name_secondary", row).html(nameModuleSecondary);
+                        $(".agent_name_failover", row).html(nameAgentFailover);
+                        $(".module_name_failover", row).html(nameModuleFailover);
                         $(".service_name", row).html(serviceName);
                         $(".sla_min", row).html(slaMin);
                         $(".sla_max", row).html(slaMax);
@@ -4167,19 +4247,19 @@ function addSLARow() {
                         );
                         $("#list_sla").append($(row).html());
                         $("input[name=id_agent_sla]").val('');
-                        $("input[name=id_agent_secondary]").val('');
+                        $("input[name=id_agent_failover]").val('');
                         $("input[name=id_server]").val('');
                         $("input[name=agent_sla]").val('');
-                        $("input[name=agent_secondary]").val('');
+                        $("input[name=agent_failover]").val('');
                         $("#id_agent_module_sla").empty();
                         $("#id_agent_module_sla").attr('disabled', 'true');
                         $("#id_agent_module_sla").append(
                             $("<option></option>")
                             .attr ("value", 0)
                             .html ($("#module_sla_text").html()));
-                        $("#id_agent_module_secondary").empty();
-                        $("#id_agent_module_secondary").attr('disabled', 'true');
-                        $("#id_agent_module_secondary").append(
+                        $("#id_agent_module_failover").empty();
+                        $("#id_agent_module_failover").attr('disabled', 'true');
+                        $("#id_agent_module_failover").append(
                             $("<option></option>")
                             .attr ("value", 0)
                             .html ($("#module_sla_text").html()));
@@ -4360,6 +4440,8 @@ function chooseType() {
     $("#row_custom_example").hide();
     $("#row_group").hide();
     $("#row_current_month").hide();
+    $("#row_failover_mode").hide();
+    $("#row_failover_type").hide();
     $("#row_working_time").hide();
     $("#row_only_display_wrong").hide();
     $("#row_combo_module").hide();
@@ -4533,6 +4615,11 @@ function chooseType() {
             $("#row_working_time").show();
             $("#row_historical_db_check").hide();
             $("#row_priority_mode").show();
+            $("#row_failover_mode").show();
+            var failover_checked = $("input[name='failover_mode']").prop("checked");
+            if(failover_checked){
+                $("#row_failover_type").show();
+            }
             break;
 
         case 'module_histogram_graph':
diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php
index d87a8f0e0a..1e552b112a 100755
--- a/pandora_console/godmode/reporting/reporting_builder.php
+++ b/pandora_console/godmode/reporting/reporting_builder.php
@@ -1441,6 +1441,14 @@ switch ($action) {
                                 $values['show_graph'] = get_parameter(
                                     'combo_graph_options'
                                 );
+                                $values['failover_mode'] = get_parameter(
+                                    'failover_mode',
+                                    0
+                                );
+                                $values['failover_type'] = get_parameter(
+                                    'failover_type',
+                                    REPORT_FAILOVER_TYPE_NORMAL
+                                );
 
                                 $good_format = true;
                             break;
@@ -2398,6 +2406,16 @@ switch ($action) {
 
                         $values['current_month'] = get_parameter('current_month');
 
+                        $values['failover_mode'] = get_parameter(
+                            'failover_mode',
+                            0
+                        );
+
+                        $values['failover_type'] = get_parameter(
+                            'failover_type',
+                            REPORT_FAILOVER_TYPE_NORMAL
+                        );
+
                         $style = [];
                         $style['show_in_same_row'] = get_parameter(
                             'show_in_same_row',
diff --git a/pandora_console/include/ajax/reporting.ajax.php b/pandora_console/include/ajax/reporting.ajax.php
index 16bdff9527..fa87ad72e0 100755
--- a/pandora_console/include/ajax/reporting.ajax.php
+++ b/pandora_console/include/ajax/reporting.ajax.php
@@ -65,7 +65,8 @@ if ($add_sla) {
     $sla_max = get_parameter('sla_max', 0);
     $sla_min = get_parameter('sla_min', 0);
     $server_id = (int) get_parameter('server_id', 0);
-    $id_module_secondary = (int) get_parameter('id_module_secondary', 0);
+    $id_module_failover = (int) get_parameter('id_module_failover', 0);
+    $id_server_failover = (int) get_parameter('id_server_failover', 0);
 
     $id_service = (int) get_parameter('id_service');
     if (empty($id_module) && !empty($id_service)) {
@@ -86,13 +87,14 @@ if ($add_sla) {
     $result = db_process_sql_insert(
         'treport_content_sla_combined',
         [
-            'id_report_content'         => $id,
-            'id_agent_module'           => $id_module,
-            'id_agent_module_secondary' => $id_module_secondary,
-            'sla_max'                   => $sla_max,
-            'sla_min'                   => $sla_min,
-            'sla_limit'                 => $sla_limit,
-            'server_name'               => $connection['server_name'],
+            'id_report_content'        => $id,
+            'id_agent_module'          => $id_module,
+            'id_agent_module_failover' => $id_module_failover,
+            'sla_max'                  => $sla_max,
+            'sla_min'                  => $sla_min,
+            'sla_limit'                => $sla_limit,
+            'server_name'              => $connection['server_name'],
+            'id_server_failover'       => $id_server_failover,
         ]
     );
 
diff --git a/pandora_console/include/ajax/update_manager.ajax.php b/pandora_console/include/ajax/update_manager.ajax.php
index 13ea1f560b..9c964536b1 100644
--- a/pandora_console/include/ajax/update_manager.ajax.php
+++ b/pandora_console/include/ajax/update_manager.ajax.php
@@ -134,7 +134,6 @@ if ($install_package) {
 
     $accept = (bool) get_parameter('accept', false);
     if ($accept) {
-        hd($accept, true);
         $package = (string) get_parameter('package');
         $package = trim($package);
 
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index ce6d901740..62da376a69 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -53,6 +53,10 @@ require_once $config['homedir'].'/include/functions_network.php';
 define('REPORT_PRIORITY_MODE_OK', 1);
 define('REPORT_PRIORITY_MODE_UNKNOWN', 2);
 
+// Failover type.
+define('REPORT_FAILOVER_TYPE_NORMAL', 1);
+define('REPORT_FAILOVER_TYPE_SIMPLE', 2);
+
 // Status.
 define('REPORT_STATUS_ERR', 0);
 define('REPORT_STATUS_OK', 1);
@@ -6403,6 +6407,7 @@ function reporting_availability_graph($report, $content, $pdf=false)
 
     $return['title'] = $content['name'];
     $return['description'] = $content['description'];
+    $return['failover_type'] = $content['failover_type'];
     $return['date'] = reporting_get_date_text($report, $content);
 
     // Get chart.
@@ -6458,18 +6463,20 @@ function reporting_availability_graph($report, $content, $pdf=false)
                 }
             }
 
-            if (isset($sla['id_agent_module_secondary']) === true
-                && $sla['id_agent_module_secondary'] != 0
+            if (isset($sla['id_agent_module_failover']) === true
+                && $sla['id_agent_module_failover'] != 0
             ) {
-                $sla_secondary['primary'] = $sla;
-                $sla_secondary['failover'] = $sla;
-                $sla_secondary['failover']['id_agent_module'] = $sla['id_agent_module_secondary'];
+                $sla_failover = [];
+                $sla_failover['primary'] = $sla;
+                $sla_failover['failover'] = $sla;
+                $sla_failover['failover']['id_agent_module'] = $sla['id_agent_module_failover'];
 
                 // For graph slice for module-interval, if not slice=0.
                 $module_interval = modules_get_interval($sla['id_agent_module']);
                 $slice = ($content['period'] / $module_interval);
+                $data_combined = [];
 
-                foreach ($sla_secondary as $k_sla => $v_sla) {
+                foreach ($sla_failover as $k_sla => $v_sla) {
                     $sla_array = data_db_uncompress_module(
                         $v_sla,
                         $content,
@@ -6477,14 +6484,16 @@ function reporting_availability_graph($report, $content, $pdf=false)
                         $slice
                     );
 
-                    $return = prepare_data_for_paint(
-                        $v_sla,
-                        $sla_array,
-                        $content,
-                        $report['datetime'],
-                        $return,
-                        $k_sla
-                    );
+                    if ($content['failover_type'] == REPORT_FAILOVER_TYPE_NORMAL) {
+                        $return = prepare_data_for_paint(
+                            $v_sla,
+                            $sla_array,
+                            $content,
+                            $report['datetime'],
+                            $return,
+                            $k_sla
+                        );
+                    }
 
                     $data_combined[] = $sla_array;
                 }
@@ -6493,8 +6502,10 @@ function reporting_availability_graph($report, $content, $pdf=false)
                     && is_array($data_combined) === true
                     && count($data_combined) > 0
                 ) {
+                    $data_a = [];
                     $data_a = array_map(
                         function ($primary, $failover) {
+                            $return_map = [];
                             if ($primary['date_from'] === $failover['date_from']
                                 && $primary['date_to'] === $failover['date_to']
                             ) {
@@ -6517,10 +6528,10 @@ function reporting_availability_graph($report, $content, $pdf=false)
                                     $primary['sla_fixed'] = $failover['sla_fixed'];
                                 }
 
-                                $return = $primary;
+                                $return_map = $primary;
                             }
 
-                            return $return;
+                            return $return_map;
                         },
                         $data_combined[0],
                         $data_combined[1]
@@ -6778,7 +6789,7 @@ function reporting_get_planned_downtimes_sla($id_agent_module, $datetime, $perio
  * @param array   $content   Content report data.
  * @param integer $datetime  Date.
  * @param array   $return    Array return.
- * @param string  $secondary Type secondaary primary, failover, Result.
+ * @param string  $failover  Type primary, failover, Result.
  *
  * @return array Return modify.
  */
@@ -6788,7 +6799,7 @@ function prepare_data_for_paint(
     $content,
     $datetime,
     $return,
-    $secondary=''
+    $failover=''
 ) {
     $data = [];
     $alias_agent = modules_get_agentmodule_agent_alias(
@@ -6804,7 +6815,7 @@ function prepare_data_for_paint(
     $data['min'] = $sla['sla_min'];
     $data['sla_limit'] = $sla['sla_limit'];
     $data['dinamic_text'] = $dinamic_text;
-    $data['secondary'] = $secondary;
+    $data['failover'] = $failover;
     if (isset($sla_array[0])) {
         $data['time_total']      = 0;
         $data['time_ok']         = 0;
@@ -6929,7 +6940,7 @@ function prepare_data_for_paint(
     $dataslice['sla_value'] = $data['sla_value'];
 
     $height = 80;
-    if ($secondary !== '' && $secondary !== 'result') {
+    if ($failover !== '' && $failover !== 'result') {
         $height = 50;
     }
 
diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index ecad568d1d..e0cc6ff5ad 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -3284,7 +3284,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
         }
 
         // Check failover availability report.
-        if ($item['data'][$k_chart]['secondary'] === '') {
+        if ($item['data'][$k_chart]['failover'] === '') {
             $table1 = new stdClass();
             $table1->width = '99%';
             $table1->data = [];
@@ -3302,7 +3302,9 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
                 true
             );
         } else {
-            if ($item['data'][$k_chart]['secondary'] === 'primary') {
+            if ($item['data'][$k_chart]['failover'] === 'primary'
+                || $item['failover_type'] == REPORT_FAILOVER_TYPE_SIMPLE
+            ) {
                 $table1 = new stdClass();
                 $table1->width = '99%';
                 $table1->data = [];
@@ -3316,7 +3318,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
             $title = '';
             $checks_resume_text = $checks_resume;
             $sla_value_text = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
-            switch ($item['data'][$k_chart]['secondary']) {
+            switch ($item['data'][$k_chart]['failover']) {
                 case 'primary':
                     $title = '<b>'.__('Primary').'</b>';
                     $title .= '<br />'.$chart['agent'];
@@ -3339,12 +3341,12 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
                 break;
             }
 
-            $table1->data[$item['data'][$k_chart]['secondary']][0] = $title;
-            $table1->data[$item['data'][$k_chart]['secondary']][1] = $chart['chart'];
-            $table1->data[$item['data'][$k_chart]['secondary']][2] = $sla_value_text;
-            $table1->data[$item['data'][$k_chart]['secondary']][3] = $checks_resume_text;
+            $table1->data[$item['data'][$k_chart]['failover']][0] = $title;
+            $table1->data[$item['data'][$k_chart]['failover']][1] = $chart['chart'];
+            $table1->data[$item['data'][$k_chart]['failover']][2] = $sla_value_text;
+            $table1->data[$item['data'][$k_chart]['failover']][3] = $checks_resume_text;
 
-            if ($item['data'][$k_chart]['secondary'] === 'result') {
+            if ($item['data'][$k_chart]['failover'] === 'result') {
                 $tables_chart .= html_print_table(
                     $table1,
                     true
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index e73d31209b..2776a42978 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -1452,6 +1452,8 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
 	`agent_max_value` TINYINT(1) DEFAULT '1',
 	`agent_min_value` TINYINT(1) DEFAULT '1',
 	`current_month` TINYINT(1) DEFAULT '1',
+	`failover_mode` tinyint(1) DEFAULT '1',
+	`failover_type` tinyint(1) DEFAULT '1',
 	PRIMARY KEY(`id_rc`),
 	FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
 		ON UPDATE CASCADE ON DELETE CASCADE
@@ -1464,7 +1466,8 @@ CREATE TABLE IF NOT EXISTS `treport_content_sla_combined` (
 	`id` INTEGER UNSIGNED NOT NULL auto_increment,
 	`id_report_content` INTEGER UNSIGNED NOT NULL,
 	`id_agent_module` int(10) unsigned NOT NULL,
-	`id_agent_module_secondary` int(10) unsigned NOT NULL,
+	`id_agent_module_failover` int(10) unsigned NOT NULL,
+	`id_server_failover` int(10) unsigned NOT NULL default 0,
 	`sla_max` double(18,2) NOT NULL default 0,
 	`sla_min` double(18,2) NOT NULL default 0,
 	`sla_limit` double(18,2) NOT NULL default 0,
@@ -2993,6 +2996,8 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
 	`agent_max_value` TINYINT(1) DEFAULT '1',
 	`agent_min_value` TINYINT(1) DEFAULT '1',
 	`current_month` TINYINT(1) DEFAULT '1',
+	`failover_mode` tinyint(1) DEFAULT '1',
+	`failover_type` tinyint(1) DEFAULT '1',
 	PRIMARY KEY(`id_rc`)
 ) ENGINE = InnoDB DEFAULT CHARSET=utf8;
 

From beace34567c88c54ff487ca137778d81e233a07f Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Tue, 2 Jul 2019 13:12:05 +0200
Subject: [PATCH 27/83] Created black theme - #4194

---
 .../include/graphs/functions_d3.php           | 25 +++++-
 pandora_console/include/graphs/pandora.d3.js  | 14 ++-
 .../include/styles/pandora_black.css          | 88 ++++++++++++++-----
 3 files changed, 102 insertions(+), 25 deletions(-)

diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php
index b9f2212b16..e3962bf729 100644
--- a/pandora_console/include/graphs/functions_d3.php
+++ b/pandora_console/include/graphs/functions_d3.php
@@ -740,6 +740,8 @@ function print_donut_narrow_graph(
     array $data,
     $data_total
 ) {
+    global $config;
+
     if (empty($data)) {
         return graph_nodata_image($width, $height, 'pie');
     }
@@ -754,10 +756,31 @@ function print_donut_narrow_graph(
 
     $graph_id = uniqid('graph_');
 
+    // This is for "Style template" in visual styles.
+    switch ($config['style']) {
+        case 'pandora':
+            $textColor = '#000';
+            $strokeColor = '#fff';
+        break;
+
+        case 'pandora_black':
+            $textColor = '#fff';
+            $strokeColor = '#222';
+        break;
+
+        default:
+            $textColor = '#000';
+            $strokeColor = 'transparent';
+        break;
+    }
+
+    $textColor = json_encode($textColor);
+    $strokeColor = json_encode($strokeColor);
+
     $out = "<div id='$graph_id'></div>";
     $out .= include_javascript_d3(true);
     $out .= "<script type='text/javascript'>
-						donutNarrowGraph($colors, $width, $height, $data_total)
+						donutNarrowGraph($colors, $width, $height, $data_total, $textColor, $strokeColor)
 						.donutbody(d3.select($graph_id))
 						.data($data)
 						.render();	
diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js
index 49d026ed0f..a334a85357 100644
--- a/pandora_console/include/graphs/pandora.d3.js
+++ b/pandora_console/include/graphs/pandora.d3.js
@@ -2762,7 +2762,14 @@ function valueToBytes(value) {
   return value.toFixed(2) + shorts[pos] + "B";
 }
 
-function donutNarrowGraph(colores, width, height, total) {
+function donutNarrowGraph(
+  colores,
+  width,
+  height,
+  total,
+  textColor,
+  strokeColor
+) {
   // Default settings
   var donutbody = d3.select("body");
   var data = {};
@@ -2848,7 +2855,7 @@ function donutNarrowGraph(colores, width, height, total) {
           this._current = d;
         })
         .attr("d", arc)
-        .attr("stroke", "white")
+        .attr("stroke", strokeColor)
         .style("fill", function(d) {
           return color(d.data.key);
         });
@@ -2872,7 +2879,7 @@ function donutNarrowGraph(colores, width, height, total) {
         .attr("y", 0 + radius / 10)
         .attr("class", "text-tooltip")
         .style("text-anchor", "middle")
-        //.attr("fill", "#82b92e")
+        .attr("fill", textColor)
         .style("font-size", function(d) {
           if (normal_status) {
             percentage_normal = (normal_status * 100) / total;
@@ -2902,6 +2909,7 @@ function donutNarrowGraph(colores, width, height, total) {
           /* .attr("fill", function(d) {
             return color(obj.data.key);
           })*/
+          .attr("fill", textColor)
           .style("font-size", function(d) {
             percentage = (d[obj.data.key] * 100) / total;
             if (Number.isInteger(percentage)) {
diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css
index e2a4f41602..ad24a9012b 100644
--- a/pandora_console/include/styles/pandora_black.css
+++ b/pandora_console/include/styles/pandora_black.css
@@ -21,12 +21,14 @@ Description: The default Pandora FMS theme layout
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
+body,
 div#page,
 #menu_tab_frame,
 #menu_tab_frame_view,
 #menu_tab_frame_view_bc,
 input.search_input,
 .filters input,
+input:-internal-autofill-selected,
 input#text-id_parent.ac_input,
 input,
 textarea,
@@ -77,7 +79,10 @@ h4,
 .info_table > thead > tr > th > span,
 form.discovery label,
 .edit_user_labels,
-.input_label {
+.input_label,
+.pagination,
+tr.group_view_data,
+.group_view_data {
   color: #fff;
 }
 
@@ -86,6 +91,12 @@ form.discovery label,
   color: #fff !important;
 }
 
+/* snmp */
+#snmp_browser {
+  background-color: #222 !important;
+}
+
+/* General styles */
 .box-shadow {
   box-shadow: none;
 }
@@ -97,11 +108,29 @@ textarea:disabled {
 
 .status_tactical,
 .tactical_set,
-.td-bg-white td {
+.td-bg-white td,
+#top_btn:hover {
   background-color: transparent;
 }
 
-/* tables */
+.agent_details_col,
+.white_table,
+.white_table tr:first-child > th,
+.white_table_graph_content {
+  background-color: #222;
+  color: #fff;
+}
+
+.notify,
+.notify h3 {
+  color: #000;
+}
+
+.sort_arrow img {
+  filter: brightness(2.5) contrast(3.5);
+}
+
+/* tables.css */
 .info_table {
   background-color: #222;
 }
@@ -118,9 +147,10 @@ textarea:disabled {
 
 .info_table > tbody > tr:hover,
 .databox.data > tbody > tr:hover,
+.checkselected,
 .rowPair:hover,
 .rowOdd:hover {
-  background-color: #555 !important; /* porque tables.css se carga depues.... */
+  background-color: #555 !important;
 }
 
 .info_table .datos3,
@@ -130,27 +160,13 @@ textarea:disabled {
   background-color: #666;
   color: #fff;
 }
-.agent_details_col,
-.white_table,
-.white_table tr:first-child > th,
-.white_table_graph_content {
-  background-color: #222;
-  color: #fff;
-}
 
-/* action buttons in tables */
 .action_buttons a[href] img,
 .action_buttons input[type="image"],
 .action_button_img {
   filter: brightness(2.5) contrast(50%);
 }
 
-/* fix cosas generales */
-.notify,
-.notify h3 {
-  color: #000;
-}
-
 /* firts_task.css */
 .new_task,
 div.new_task_cluster,
@@ -158,12 +174,21 @@ div.new_task_cluster > div {
   background-color: #222;
 }
 
+/* events.css */
+.filter_summary div {
+  background: transparent;
+}
+
 /* webchat */
 #chat_box,
 #userlist_box {
   background: #222 !important;
 }
 
+#chat_box > div span {
+  color: #fff !important;
+}
+
 /* tree.css */
 .node-content:hover {
   background-color: #222;
@@ -187,6 +212,10 @@ div.login_pass input {
   border-bottom: 1px solid #5f5f5f;
 }
 
+#user-notifications-wrapper {
+  color: #fff;
+}
+
 /* datatables */
 table.dataTable tbody tr {
   background-color: #222;
@@ -201,14 +230,17 @@ table#diagnostic_info {
   background-color: #111 !important;
 }
 
+table#diagnostic_info th {
+  background-color: #444 !important;
+}
+
 table#diagnostic_info tbody td div {
   background-color: #222 !important;
 }
 
 /* agent view */
-.agent_details_graph div#status_pie {
-  background: #fff;
-  border-radius: 5px;
+.buttons_agent_view {
+  filter: brightness(2.5);
 }
 
 /* menu.css */
@@ -231,7 +263,21 @@ table#diagnostic_info tbody td div {
   background-color: #080808;
 }
 
+.sub_subMenu {
+  background-color: #343434;
+}
+
 /* footer */
 div#foot {
   background: #222;
 }
+
+/* jquery custom */
+.ui-dialog,
+.ui-widget-content {
+  background-color: #111;
+}
+.ui-widget-content,
+.ui-widget-content a {
+  color: #fff;
+}

From dd8fc659ee050493c758e6f8a248a97f9db1656e Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Tue, 2 Jul 2019 15:15:19 +0200
Subject: [PATCH 28/83] Created green theme - #4194

---
 .../include/styles/pandora_black.css          |    2 +-
 .../include/styles/pandora_green_old.css      | 3761 +----------------
 pandora_console/index.php                     |    1 -
 3 files changed, 31 insertions(+), 3733 deletions(-)

diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css
index ad24a9012b..2fcee7b2ae 100644
--- a/pandora_console/include/styles/pandora_black.css
+++ b/pandora_console/include/styles/pandora_black.css
@@ -6,7 +6,7 @@ Description: The default Pandora FMS theme layout
 
 // Pandora FMS - http://pandorafms.com
 // ==========================================================
-// Copyright (c) 2004-2011 Artica Soluciones Tecnológicas S.L
+// Copyright (c) 2004-2019 Artica Soluciones Tecnológicas S.L
 
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
diff --git a/pandora_console/include/styles/pandora_green_old.css b/pandora_console/include/styles/pandora_green_old.css
index 7f03695a57..cb04b54d57 100644
--- a/pandora_console/include/styles/pandora_green_old.css
+++ b/pandora_console/include/styles/pandora_green_old.css
@@ -1,12 +1,12 @@
 /*
 
 Author: The Pandora FMS team
-Name: Green old theme
+Name: GreenOld theme
 Description: The default Pandora FMS theme layout
 
 // Pandora FMS - http://pandorafms.com
 // ==========================================================
-// Copyright (c) 2004-2011 Artica Soluciones Tecnológicas S.L
+// Copyright (c) 2004-2019 Artica Soluciones Tecnológicas S.L
 
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License
@@ -21,3771 +21,70 @@ Description: The default Pandora FMS theme layout
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
-/* Tree view styles */
-@import url(tree.css);
-
-* {
-  font-family: verdana, sans-serif;
-  letter-spacing: 0.03pt;
-  font-size: 8pt;
-  color: #3f3f3f;
-}
-svg * {
-  font-size: 11pt;
-}
-body {
-  background-color: #fff;
-  margin: 0 auto;
-}
-
-div#page {
-  background: #fff;
-  background-image: none;
-}
-
-body.pure {
-  background-color: #fff;
-}
-input,
-textarea {
-  border: 1px solid #ddd;
-}
-
-textarea {
-  padding: 5px;
-  min-height: 100px;
-  width: 99%;
-}
-textarea.conf_editor {
-  padding: 5px;
-  width: 650px;
-  height: 350px;
-}
-textarea.conf_error {
-  background-image: url(../../images/err.png);
-  background-repeat: no-repeat;
-  background-position: top right;
-}
-input {
-  padding: 2px 3px 4px 3px;
-  vertical-align: middle;
-}
-
-input[type="checkbox"] {
-  display: inline;
-}
-
-select {
-  padding: 2px 3px 3px 3px;
-  vertical-align: middle;
-}
-input.button {
-  font-family: Arial, Sans-serif;
-  border: 4px solid #ccc;
-  background: #fff;
-  padding: 2px 3px;
-  margin: 10px 15px;
-}
-
-input[type="submit"],
-input[type="button"] {
-  cursor: pointer;
-}
-
-select {
-  border: 1px solid #ddd;
-}
-checkbox {
-  padding: 4px;
-  border: 1px solid #eee;
-}
-h1,
-h2,
-h3,
-h4 {
-  font-weight: bold;
-  font-size: 1em;
-  font-family: Arial, Sans-serif;
-  text-transform: uppercase;
-  color: #3f3f3f;
-  padding-bottom: 4px;
-  padding-top: 7px;
-}
-h1 {
-  font-size: 16px;
-}
-h2 {
-  font-size: 15px;
-}
-h3 {
-  font-size: 14px;
-}
-h4 {
-  margin-bottom: 10px;
-  font-size: 13px;
-  color: #3f3f3f;
-  text-transform: none;
-}
-a {
-  color: #3f3f3f;
-  text-decoration: none;
-}
-a:hover {
-  color: #373737;
-  text-decoration: underline;
-}
-a.white_bold {
-  color: #eee;
-  text-decoration: none;
-  font-weight: bold;
-}
-a.white {
-  color: #eee;
-  text-decoration: none;
-}
-p.center {
-  text-align: center;
-}
-h1#log_title {
-  font-size: 18px;
-  margin-bottom: 0px;
-  color: #fff;
-  width: 300px;
-}
-div#log_msg {
-  display: none;
-}
-div#error_buttons {
-  margin-top: 20px;
-}
-div#error_buttons a {
-  margin: 14px;
-}
-
-#noaccess {
-  position: relative;
-  margin-top: 25px;
-  left: 15px;
-  padding-top: 5px;
-  background-color: #ffffff;
-  border-top-left-radius: 2px;
-  border-top-right-radius: 2px;
-  border-bottom-left-radius: 2px;
-  border-bottom-right-radius: 2px;
-}
-
-#noaccess-title {
-  color: #fff;
-  font-weight: bold;
-  padding-top: 5px;
-  margin-left: 5px;
-  background: none repeat scroll 0% 0% #80ab51;
-  border-top-left-radius: 2px;
-  border-top-right-radius: 2px;
-  border-bottom-left-radius: 2px;
-  border-bottom-right-radius: 2px;
-  text-align: center;
-}
-
-#noaccess-text {
-  font-size: 12px;
-  text-align: justify;
-  padding-top: 25px;
-  padding-right: 50px;
-  float: right;
-}
-
-#noaccess-image {
-  position: relative;
-  left: 10px;
-  top: 10px;
-  float: left;
-}
-
-div#activity {
-  padding-top: 0px;
-  padding-bottom: 18px;
-}
-div#noa {
-  float: right;
-  padding-right: 50px;
-  margin-top: 25px;
-}
-div#db_f {
-  text-align: justify;
-  margin: auto;
-  padding: 0.5em;
-  width: 55em;
-  margin-top: 3em;
-}
-div#db_ftxt {
-  float: right;
-  padding-top: 10px;
-}
-div#container {
-  margin: 0 auto;
-  min-width: 960px;
-  text-align: left;
-  #border-left: solid 2px #000;
-  #border-right: solid 2px #000;
-  #border-top: solid 2px #000;
-  #margin-top: 5px;
-  height: 100%;
-  background: #fff;
-}
-div#page {
-  width: 960px;
-  clear: both;
-}
-div#main {
-  width: auto;
-  margin: 0px 2% 0px 0%;
-  float: right;
-  position: relative;
-  min-height: 850px;
-}
-div#main_help {
-  width: 100%;
-  padding-left: 0px;
-  padding-top: 0px;
-  background-color: #ffffff;
-  margin-top: 0px;
-  margin-left: 0px;
-  margin-right: 0px;
-  border-radius: 10px;
-}
-div#main_help div.databox,
-.license_databox {
-  background: F3F3F3;
-  -moz-border-radius: 8px;
-  -webkit-border-radius: 8px;
-  border-radius: 8px;
-  border: 0px;
-  padding-left: 25px;
-  padding-right: 25px;
-  margin-top: 10px;
-  -moz-box-shadow: -1px 1px 6px #aaa;
-  -webkit-box-shadow: -1px 1px 6px #aaa;
-  box-shadow: -1px 1px 6px #aaa;
-}
-
-div#main_help div.databox h1 {
-  padding-bottom: 0px;
-  margin-bottom: 0px;
-  font-weight: bold;
-  font-family: sans-serif, verdana;
-}
-
-div#main_help div.databox h3,
-div#main_help div.databox h2 {
-  color: #6eb432;
-  font-family: sans-serif, verdana;
-}
-
-div#main_help div.databox h3 {
-  font-size: 12px;
-}
-
-div#main_help a.footer,
-div#main_help span {
-  color: #999;
-}
-
-a.footer,
-a.footer span {
-  font-size: 9px;
-  color: white;
-}
-
-div#main_help div.databox hr {
-  width: 100%;
-  border: 0px;
-  height: 1px;
-  background-color: #222;
-  margin: 0px;
-}
-
-div#main_help div.databox p {
-  line-height: 15px;
-  text-align: justify;
-}
-
-div#menu_container {
-  -moz-border-top-right-radius: 6px;
-  -webkit-border-top-right-radius: 6px;
-  border-top-right-radius: 6px;
-  z-index: 1010;
-  width: 40px;
-  height: 100%;
-}
-
-div#menu {
-  width: 45px;
-  float: left;
-  z-index: 2000;
-  position: absolute;
-}
-
+/* header */
 div#head {
-  font-size: 8pt;
-  width: 100%;
-  height: 60px;
-  padding-top: 0px;
-  margin-bottom: 20px;
-  border-bottom-style: solid;
-  border-bottom-width: 3px;
-  border-color: #80ab51;
-  min-width: 882px;
-  background-color: #333;
-  color: white;
-  background-image: url("../../images/header.jpg");
-}
-
-.fixed_header {
-  z-index: 9999;
-  position: fixed;
-  left: 0;
-  top: 0;
-  width: 100%;
-}
-
-div#foot {
-  font-size: 6pt;
-  border-top: solid 2px #222;
-  padding-top: 8px;
-  padding-bottom: 5px;
-  text-align: center;
-  background: #333333;
-  height: 30px;
-  clear: both;
-  width: auto;
-}
-#ver {
-  margin-bottom: 25px;
-}
-
-/****************/
-/* LOGIN STYLES */
-/****************/
-
-@font-face {
-  font-family: "Nunito";
-  font-style: normal;
-  font-weight: 400;
-  src: local("Nunito-Regular"), url(../../fonts/nunito.woff) format("woff");
-}
-
-@font-face {
-  font-family: "roboto";
-  src: url("../../fonts/roboto.woff2") format("woff2");
-}
-
-@font-face {
-  font-family: "opensans";
-  src: url("../../fonts/opensans.woff2") format("woff2");
-}
-
-@font-face {
-  font-family: "lato";
-  src: url("../../fonts/lato.woff2") format("woff2");
-}
-
-@font-face {
-  font-family: "leaguegothic";
-  src: url("../../fonts/leaguegothic.woff") format("woff");
-}
-
-#login_body {
-  /* Set rules to fill background */
-  min-height: 100%;
-  min-width: 1024px;
-  width: 100%;
-  z-index: -9999;
-  position: absolute;
-}
-
-@media screen and (max-width: 1024px) {
-  /* Specific to this particular image */
-  #login_body {
-    left: 50%;
-    margin-left: -512px; /* 50% */
-  }
-}
-@media screen and (max-width: 1100px) {
-  /* Specific to this particular image */
-  #login_body {
-    background-image: url("../../images/backgrounds/fondo_madera_bn_1100.jpg");
-    background-repeat: repeat;
-    background-position: center center;
-  }
-}
-@media screen and (max-width: 1400px) {
-  /* Specific to this particular image */
-  #login_body {
-    background-image: url("../../images/backgrounds/fondo_madera_bn_1400.jpg");
-    background-repeat: repeat;
-    background-position: center center;
-  }
-}
-@media screen and (max-width: 2000px) {
-  /* Specific to this particular image */
-  #login_body {
-    background-image: url("../../images/backgrounds/fondo_madera_bn_2000.jpg");
-    background-repeat: repeat;
-    background-position: center center;
-  }
-}
-@media screen and (min-width: 2000px) {
-  /* Specific to this particular image */
-  #login_body {
-    background-image: url("../../images/backgrounds/fondo_madera_bn_2500.jpg");
-    background-repeat: repeat;
-    background-position: center center;
-  }
-}
-
-p.log_in {
-  color: #fff;
-  padding: 0px 10px;
-  width: 300px;
-}
-h1#log_f {
-  color: #c00;
-  border-bottom: 1px solid #c00;
-  padding-bottom: 3px;
-}
-div#login {
-  border-width: 2px 2px 2px 2px;
-  border-style: solid;
-  border-color: #000;
-  font-size: 12px;
-}
-div#login_in,
-#login_f {
-  /*margin: 0 auto 0 140px;
-	width: 400px;*/
-}
-
-.databox_login,
-.databox_logout {
-  border-radius: 5px;
-  height: 200px;
-}
-
-#login_inner {
-  width: 100%;
-  height: 100%;
-  border-radius: 5px;
-  /* Browser without multibackground support */
-  background-color: #373737;
-}
-#login_outer {
-  border-radius: 11px;
-  background-color: #000;
-  width: 500px;
-  color: #fff;
-  margin: 0px auto;
-}
-
-.version_login {
-  transform: rotate(36deg);
-  /* Old browser support */
-  -ms-transform: rotate(36deg); /* IE */
-  -moz-transform: rotate(36deg); /* FF */
-  -o-transform: rotate(36deg); /* Opera */
-  -webkit-transform: rotate(36deg); /* Safari and Chrome */
-
-  float: right;
-  margin-top: 18px;
-  width: 80px;
-  height: 0px;
-  border-right: 13px solid transparent;
-  border-left: 25px solid transparent;
-  border-bottom: 18px solid #80ab51;
-  left: 16px;
-  position: relative;
-}
-
-#login_outer * {
-  font-family: Nunito, "Arial Rounded MT", Arial, Helvetica, sans-serif;
-  font-weight: bold;
-}
-.login_border {
-  border-right: 1px solid #fff;
-  text-align: center;
-}
-table#login_layout {
-  width: 100%;
-  height: 160px;
-  position: absolute;
-}
-
-div#error_login {
-  text-align: center;
-  margin-top: 5px;
-  margin-left: 5px;
-  width: 75%;
-  float: right;
-  text-align: left;
-  top: 100px;
-}
-
-div#error_login_icon {
-  #margin: 0 auto;
-  margin-top: 10px;
-  margin-right: 7px;
-  text-align: center;
-  #margin-left: 20px;
-  width: 20%;
-  float: right;
-}
-
-div#login_f {
-  margin-top: 10px;
-  margin-bottom: 25px;
-}
-
-a:focus,
-input:focus,
-button:focus {
-  utline-width: 0;
-  outline: 0;
-}
-
-div.login_links {
-  margin: 10px 0px 0px;
-  color: #fff;
-  text-align: center;
-}
-
-div.login_links > a {
-  color: #fff;
-}
-
-div.login_button {
-  text-align: right;
-  width: 100%;
-  margin-top: 15px;
-}
-
-div.login_button > input {
-  background-color: #373737;
-  border: 0px none;
-  background-image: url("../../images/input_go.png");
-  padding-right: 25px;
-}
-
-.login_page {
-  height: 200px;
-  padding-top: 10%;
-  text-align: center;
-  width: 100%;
-  position: absolute;
-}
-
-input.next_login {
-  padding-right: 12px;
-  padding-left: 12px;
-  height: 23px;
-  text-align: center;
-  font-weight: 600;
-  letter-spacing: 0.5pt;
-  font-size: 12px;
-  border-radius: 3px;
-}
-
-div.login_nick,
-div.login_pass {
-  text-align: left;
-  padding-left: 15px;
-  margin-top: 10px;
-}
-
-div.login_nick > input,
-div.login_pass > input {
-  height: 20px;
-  border-radius: 0px;
-  margin-left: 10px;
-}
-
-div.login_nick > input:focus,
-div.login_pass > input:focus {
-  outline-width: 0px;
-  border-color: #80ab51;
   background-color: #80ab51;
-  font-size: 12px;
-  height: 20px;
-  box-shadow: 0px 0px 3px 3px #80ab51;
-}
-
-div.login_nick > img,
-div.login_pass > img {
-  vertical-align: middle;
-}
-
-div.login_links a {
-  letter-spacing: 0.8pt;
-}
-
-div.login_links a:first-child {
-  margin-right: 5px;
-}
-
-div.login_links a:last-child {
-  margin-left: 5px;
-}
-
-div.login_nick_text {
-  text-align: left;
-  margin-bottom: 3px;
-  width: 191px;
-  margin: 5px 0px;
-  font-size: 12px;
-  letter-spacing: 0.4pt;
-}
-
-div.login_pass_text {
-  text-align: left;
-  width: 191px;
-  margin: 13px 0px 5px 0px;
-  font-size: 12px;
-  letter-spacing: 0.4pt;
-}
-
-div.login_pass {
-}
-
-input.login {
-  border: 0px none;
-  margin: 0px 0px;
-  width: 135px;
-  height: 18px;
-  font-weight: 100;
-
-  letter-spacing: 0.3pt;
-}
-
-input.login_user {
-  /* Browser without multibackground support */
-  color: #373737;
-  padding-left: 8px;
-  width: 179px;
-  color: #222;
-  height: 18px;
-}
-
-input.login_password {
-  /* Browser without multibackground support */
-  padding-left: 8px;
-  width: 179px;
-  color: #222;
-  height: 20px;
-}
-.databox_error {
-  width: 657px;
-  height: 400px;
-  border: none;
-  background-color: #fafafa;
-  background: url(../../images/splash_error.png) no-repeat;
-}
-
-#ver_num {
-  margin: 0px auto;
-  width: 100%;
-  position: absolute;
-  bottom: 10px;
-  color: #fff;
-  text-align: center;
-}
-
-input:-webkit-autofill {
-  #-webkit-box-shadow: 0 0 0px 1000px #ddd inset;
-}
-/***********************/
-/* END OF LOGIN STYLES */
-/***********************/
-
-th > label {
-  padding-top: 7px;
-}
-input.chk {
-  margin-right: 0px;
-  border: 0px none;
-  height: 14px;
-}
-input.datos {
-  background-color: #f5f5f5;
-}
-input.datos_readonly {
-  background-color: #050505;
-}
-
-input.sub {
-  font-weight: normal;
-
-  -moz-border-radius: 2px;
-  -webkit-border-radius: 2px;
-  border-radius: 2px;
-
-  font-size: 8pt;
-
-  background-color: #333;
-  background-repeat: no-repeat;
-  background-position: 92% 3px;
-
   color: white;
-  padding: 3px 3px 5px 12px;
-
-  border-color: #333;
-}
-
-input.sub[disabled] {
-  color: #b4b4b4;
-  background-color: #f3f3f3;
-  border-color: #b6b6b6;
-  cursor: default;
-}
-
-input.next,
-input.upd,
-input.ok,
-input.wand,
-input.delete,
-input.cog,
-input.target,
-input.search,
-input.copy,
-input.add,
-input.graph,
-input.percentile,
-input.binary,
-input.camera,
-input.config,
-input.cancel,
-input.default,
-input.filter,
-input.pdf {
-  padding-right: 30px;
-  height: 23px;
-}
-
-input.next {
-  background-image: url(../../images/input_go.png);
-}
-input.upd {
-  background-image: url(../../images/input_update.png);
-}
-input.wand {
-  background-image: url(../../images/input_wand.png);
-}
-input.wand:disabled {
-  background-image: url(../../images/input_wand.disabled.png);
-}
-input.search {
-  background-image: url(../../images/input_zoom.png);
-}
-input.search:disabled {
-  background-image: url(../../images/input_zoom.disabled.png);
-}
-input.ok {
-  background-image: url(../../images/input_tick.png);
-}
-input.ok:disabled {
-  background-image: url(../../images/input_tick.disabled.png);
-}
-input.add {
-  background-image: url(../../images/input_add.png);
-}
-input.add:disabled {
-  background-image: url(../../images/input_add.disabled.png);
-}
-input.cancel {
-  background-image: url(../../images/input_cross.png);
-}
-input.cancel:disabled {
-  background-image: url(../../images/input_cross.disabled.png);
-}
-input.delete {
-  background-image: url(../../images/input_delete.png);
-}
-input.delete:disabled {
-  background-image: url(../../images/input_delete.disabled.png);
-}
-input.cog {
-  background-image: url(../../images/input_cog.png);
-}
-input.cog:disabled {
-  background-image: url(../../images/input_cog.disabled.png);
-}
-input.config {
-  background-image: url(../../images/input_config.png);
-}
-input.config:disabled {
-  background-image: url(../../images/input_config.disabled.png);
-}
-input.filter {
-  background-image: url(../../images/input_filter.png);
-}
-input.filter:disabled {
-  background-image: url(../../images/input_filter.disabled.png);
-}
-input.pdf {
-  background-image: url(../../images/input_pdf.png);
-}
-input.pdf:disabled {
-  background-image: url(../../images/input_pdf.disabled.png);
-}
-input.camera {
-  background-image: url(../../images/input_camera.png);
-}
-
-#toolbox #auto_save {
-  padding-top: 5px;
-}
-
-#toolbox {
-  margin-top: 13px;
-}
-input.visual_editor_button_toolbox {
-  padding-right: 15px;
-  padding-top: 10px;
-  margin-top: 5px;
-}
-input.delete_min {
-  background: #fefefe url(../../images/cross.png) no-repeat center;
-}
-input.delete_min[disabled] {
-  background: #fefefe url(../../images/cross.disabled.png) no-repeat center;
-}
-input.graph_min {
-  background: #fefefe url(../../images/chart_curve.png) no-repeat center;
-}
-input.graph_min[disabled] {
-  background: #fefefe url(../../images/chart_curve.disabled.png) no-repeat
-    center;
-}
-input.percentile_min {
-  background: #fefefe url(../../images/chart_bar.png) no-repeat center;
-}
-input.percentile_min[disabled] {
-  background: #fefefe url(../../images/chart_bar.disabled.png) no-repeat center;
-}
-input.percentile_item_min {
-  background: #fefefe url(../../images/percentile_item.png) no-repeat center;
-}
-input.percentile_item_min[disabled] {
-  background: #fefefe url(../../images/percentile_item.disabled.png) no-repeat
-    center;
-}
-input.binary_min {
-  background: #fefefe url(../../images/binary.png) no-repeat center;
-}
-input.binary_min[disabled] {
-  background: #fefefe url(../../images/binary.disabled.png) no-repeat center;
-}
-input.camera_min {
-  background: #fefefe url(../../images/camera.png) no-repeat center;
-}
-input.camera_min[disabled] {
-  background: #fefefe url(../../images/camera.disabled.png) no-repeat center;
-}
-input.config_min {
-  background: #fefefe url(../../images/config.png) no-repeat center;
-}
-input.config_min[disabled] {
-  background: #fefefe url(../../images/config.disabled.png) no-repeat center;
-}
-input.label_min {
-  background: #fefefe url(../../images/tag_red.png) no-repeat center;
-}
-input.label_min[disabled] {
-  background: #fefefe url(../../images/tag_red.disabled.png) no-repeat center;
-}
-input.icon_min {
-  background: #fefefe url(../../images/photo.png) no-repeat center;
-}
-input.icon_min[disabled] {
-  background: #fefefe url(../../images/photo.disabled.png) no-repeat center;
-}
-input.box_item {
-  background: #fefefe url(../../images/box_item.png) no-repeat center;
-}
-input.box_item[disabled] {
-  background: #fefefe url(../../images/box_item.disabled.png) no-repeat center;
-}
-input.line_item {
-  background: #fefefe url(../../images/line_item.png) no-repeat center;
-}
-input.line_item[disabled] {
-  background: #fefefe url(../../images/line_item.disabled.png) no-repeat center;
-}
-input.copy_item {
-  background: #fefefe url(../../images/copy_visualmap.png) no-repeat center;
-}
-input.copy_item[disabled] {
-  background: #fefefe url(../../images/copy_visualmap.disabled.png) no-repeat
-    center;
-}
-input.grid_min {
-  background: #fefefe url(../../images/grid.png) no-repeat center;
-}
-input.grid_min[disabled] {
-  background: #fefefe url(../../images/grid.disabled.png) no-repeat center;
-}
-input.save_min {
-  background: #fefefe url(../../images/file.png) no-repeat center;
-}
-input.save_min[disabled] {
-  background: #fefefe url(../../images/file.disabled.png) no-repeat center;
-}
-input.service_min {
-  background: #fefefe url(../../images/box.png) no-repeat center;
-}
-input.service_min[disabled] {
-  background: #fefefe url(../../images/box.disabled.png) no-repeat center;
-}
-
-input.group_item_min {
-  background: #fefefe url(../../images/group_green.png) no-repeat center;
-}
-input.group_item_min[disabled] {
-  background: #fefefe url(../../images/group_green.disabled.png) no-repeat
-    center;
-}
-
-div#cont {
-  position: fixed;
-  max-height: 320px;
-  overflow-y: auto;
-  overflow-x: hidden;
-}
-
-.termframe {
-  background-color: #82b92e;
-}
-
-table,
-img {
-  border: 0px;
-}
-
-tr:first-child > th {
-  background-color: #373737;
-}
-
-th {
-  color: #fff;
-  background-color: #666;
-  font-size: 7.5pt;
-  letter-spacing: 0.3pt;
-}
-tr.datos,
-tr.datost,
-tr.datosb,
-tr.datos_id,
-tr.datosf9 {
-  #background-color: #eaeaea;
-}
-
-tr.datos2,
-tr.datos2t,
-tr.datos2b,
-tr.datos2_id,
-tr.datos2f9 {
-  #background-color: #f2f2f2;
-}
-
-tr.datos:hover,
-tr.datost:hover,
-tr.datosb:hover,
-tr.datos_id:hover,
-tr.datosf9:hover,
-tr.datos2:hover,
-tr.datos2t:hover,
-tr.datos2b:hover,
-tr.datos2_id:hover,
-tr.datos2f9:hover {
-  #background-color: #efefef;
-}
-
-/* Checkbox styles */
-td input[type="checkbox"] {
-  /* Double-sized Checkboxes */
-  -ms-transform: scale(1.3); /* IE */
-  -moz-transform: scale(1.3); /* FF */
-  -o-transform: scale(1.3); /* Opera */
-  -webkit-transform: scale(1.3); /* Safari and Chrome */
-  padding: 10px;
-  margin-top: 2px;
-  display: table-cell;
-}
-
-td.datos3,
-td.datos3 * {
-  background-color: #666;
-  color: white;
-}
-
-td.datos4,
-td.datos4 * {
-  /*Add because in php the function html_print_table write style in cell and this is style head.*/
-  text-align: center;
-  background-color: #666;
-  color: white;
-}
-
-td.datos_id {
-  color: #1a313a;
-}
-
-tr.disabled_row_user * {
-  color: grey;
-}
-
-.bg {
-  /* op menu */
-  background: #80ab51;
-}
-
-.bg2 {
-  /* main page */
-  background-color: #0a160c;
-}
-.bg3 {
-  /* godmode */
-  background: #666666;
-}
-.bg4 {
-  /* links */
-  background-color: #989898;
-}
-.bg,
-.bg2,
-.bg3,
-.bg4 {
-  position: relative;
-  width: 100%;
-}
-.bg {
-  height: 20px;
-}
-.bg2,
-.bg3,
-.bg4 {
-  height: 18px;
-}
-.f10,
-#ip {
-  font-size: 7pt;
-  text-align: center;
-}
-.f9,
-.f9i,
-.f9b,
-.datos_greyf9,
-.datos_bluef9,
-.datos_greenf9,
-.datos_redf9,
-.datos_yellowf9,
-td.f9,
-td.f9i,
-td.datosf9,
-td.datos2f9 {
-  font-size: 6.5pt;
-}
-.f9i,
-.redi {
-  font-style: italic;
-}
-.tit {
-  padding: 6px 0px;
-  height: 14px;
-}
-.tit,
-.titb {
-  font-weight: bold;
-  color: #fff;
-  text-align: center;
-}
-
-.suc * {
-  color: #5a8629;
-}
-
-.info * {
-  color: #006f9d;
-}
-
-.error * {
-  color: #f85858;
-}
-
-.warning * {
-  color: #f3b200;
-}
-
-.help {
-  background: url(../../images/help.png) no-repeat;
-}
-.red,
-.redb,
-.redi,
-.error {
-  color: #c00;
-}
-
-.sep {
-  margin-left: 30px;
-  border-bottom: 1px solid #708090;
-  width: 100%;
-}
-.orange {
-  color: #fd7304;
-}
-.green {
-  color: #5a8629;
-}
-.yellow {
-  color: #f3c500;
-}
-.greenb {
-  color: #00aa00;
-}
-.grey {
-  color: #808080;
-  font-weight: bold;
-}
-.blue {
-  color: #5ab7e5;
-  font-weight: bold;
-}
-.redb,
-.greenb,
-td.datos_id,
-td.datos2_id,
-f9b {
-  font-weight: bold;
-}
-.p10 {
-  padding-top: 1px;
-  padding-bottom: 0px;
-}
-.p21 {
-  padding-top: 2px;
-  padding-bottom: 1px;
-}
-.w120 {
-  width: 120px;
-}
-.w130,
-#table-agent-configuration select {
-  width: 130px;
-}
-.w135 {
-  width: 135px;
-}
-.w155,
-#table_layout_data select {
-  width: 155px;
-}
-.top,
-.top_red,
-.bgt,
-td.datost,
-td.datos2t {
-  vertical-align: top;
-}
-.top_red {
-  background: #ff0000;
-}
-.bot,
-.titb,
-td.datosb {
-  vertical-align: bottom;
-}
-.msg {
-  margin-top: 15px;
-  text-align: justify;
-}
-ul.mn {
-  list-style: none;
-  padding: 0px 0px 0px 0px;
-  margin: 0px 0px 0px 0px;
-  line-height: 15px;
-}
-.gr {
-  font-size: 10pt;
-  font-weight: bold;
-}
-a.mn,
-.gr {
-  font-family: Arial, Verdana, sans-serif, Helvetica;
-}
-div.nf {
-  background: url(../../images/info.png) no-repeat scroll 0 50% transparent;
-  margin-left: 7px;
-  padding: 8px 1px 6px 25px;
-}
-div.title_line {
-  background-color: #4e682c;
-  height: 5px;
-  width: 762px;
-}
-
-.alpha50 {
-  filter: alpha(opacity=50);
-  -moz-opacity: 0.5;
-  opacity: 0.5;
-  -khtml-opacity: 0.5;
-}
-
-#menu_tab_frame,
-#menu_tab_frame_view {
-  display: block;
-  border-bottom: 1px solid #82b92e;
-  /*	float:left; */
-  margin-left: 0px;
-  max-height: 42px;
-  min-height: 42px;
-  padding-right: 28px;
-  width: 100%;
-}
-
-#menu_tab {
-  margin: 0px 0px 0px 0px;
-  position: absolute;
-  right: 0px;
-  top: 10px;
-}
-
-#menu_tab .mn,
-#menu_tab ul,
-#menu_tab .mn ul {
-  padding: 0px;
-  list-style: none;
-  margin: 0px 0px 0px 0px;
-}
-#menu_tab .mn li {
-  float: right;
-  position: relative;
-  margin: 0px 0px 0px 0px;
-}
-/*
-#menu_tab li a, #menu_tab a {
-	padding: 2px 0px;
-	font-weight: bold;
-	line-height: 18px;
-	margin-left: 3px;
-	margin-right: 0px;
-
-	-moz-border-top-right-radius: 5px;
-	-webkit-border-top-right-radius: 5px;
-	border-top-right-radius: 5px;
-
-	-moz-border-top-left-radius: 5px;
-	-webkit-border-top-left-radius: 5px;
-	border-top-left-radius: 5px;
-}
-
-#menu_tab li>form {
-	padding-left: 7px;
-	padding-top: 4px;
-}
-*/
-
-#menu_tab li.separator_view {
-  padding: 4px;
-}
-
-#menu_tab li.separator {
-  padding: 4px;
-}
-
-#menu_tab li.nomn_high a {
-  /*background: #80ab51;*/
-  color: #fff;
-}
-#menu_tab .mn li a {
-  display: block;
-  text-decoration: none;
-  padding: 0px;
-  margin: 0px;
-  height: 21px;
-  width: 21px;
-}
-#menu_tab li.nomn:hover a,
-#menu_tab li:hover ul a:hover {
-  /*background: #80ab51;*/
-  color: #fff;
-}
-#menu_tab li:hover a {
-  /*background: #b2b08a url("../../images/arrow.png") no-repeat right 3px;*/
-}
-
-#menu_tab li.nomn {
-  min-width: 30px;
-  height: 28px;
-}
-#menu_tab li.nomn_high {
-  min-width: 30px;
-  height: 28px;
-}
-/* TAB TITLE */
-#menu_tab_left {
-  margin-left: 0px;
-}
-
-#menu_tab_left .mn,
-#menu_tab_left ul,
-#menu_tab_left .mn ul {
-  background-color: #000;
-  color: #fff;
-  font-weight: bold;
-  padding: 0px 0px 0px 0px;
-  list-style: none;
-  margin: 0px 0px 0px 0px;
-}
-#menu_tab_left .mn li {
-  float: left;
-  position: relative;
-  height: 26px;
-  max-height: 26px;
-}
-#menu_tab_left li a,
-#menu_tab_left li span {
-  /*	text-transform: uppercase; */
-  padding: 0px 0px 0px 0px;
-  color: #fff;
-  font-size: 8.5pt;
-  font-weight: bold;
-  line-height: 20px;
-}
-#menu_tab_left .mn li a {
-  display: block;
-  text-decoration: none;
-}
-#menu_tab_left li.view a {
-  padding: 2px 10px 2px 10px;
-  color: #fff;
-  font-weight: bold;
-  line-height: 18px;
-  display: none;
-}
-
-#menu_tab_left li.view {
-  background: #80ab51;
-  max-width: 100%;
-  min-width: 100%;
-  padding: 5px 5px 0px;
-  text-align: left;
-  -moz-border-top-right-radius: 3px;
-  -webkit-border-top-right-radius: 3px;
-  border-top-right-radius: 3px;
-
-  -moz-border-top-left-radius: 3px;
-  -webkit-border-top-left-radius: 3px;
-  border-top-left-radius: 3px;
-  margin-left: 0px;
-  overflow-y: hidden;
-}
-
-#menu_tab_left li.view img.bottom {
-  width: 24px;
-  height: 24px;
-}
-
-#menu_tab_frame *,
-#menu_tab_frame_view * {
-  #margin: 0px 0px 0px 0px;
-}
-
-span.users {
-  background: url(../../images/group.png) no-repeat;
-}
-span.agents {
-  background: url(../../images/bricks.png) no-repeat;
-}
-span.data {
-  background: url(../../images/data.png) no-repeat;
-}
-span.alerts {
-  background: url(../../images/bell.png) no-repeat;
-}
-span.time {
-  background: url(../../images/hourglass.png) no-repeat;
-}
-span.net {
-  background: url(../../images/network.png) no-repeat;
+  background-image: url(../../images/header.jpg);
 }
-span.master {
-  background: url(../../images/master.png) no-repeat;
-}
-span.wmi {
-  background: url(../../images/wmi.png) no-repeat;
-}
-span.prediction {
-  background: url(../../images/chart_bar.png) no-repeat;
-}
-span.plugin {
-  background: url(../../images/plugin.png) no-repeat;
-}
-span.export {
-  background: url(../../images/database_refresh.png) no-repeat;
-}
-span.snmp {
-  background: url(../../images/snmp.png) no-repeat;
-}
-span.binary {
-  background: url(../../images/binary.png) no-repeat;
-}
-span.recon {
-  background: url(../../images/recon.png) no-repeat;
-}
-span.rmess {
-  background: url(../../images/email_open.png) no-repeat;
-}
-span.nrmess {
-  background: url(../../images/email.png) no-repeat;
-}
-span.recon_server {
-  background: url(../../images/recon.png) no-repeat;
-}
-span.wmi_server {
-  background: url(../../images/wmi.png) no-repeat;
-}
-span.export_server {
-  background: url(../../images/server_export.png) no-repeat;
-}
-span.inventory_server {
-  background: url(../../images/page_white_text.png) no-repeat;
-}
-span.web_server {
-  background: url(../../images/world.png) no-repeat;
-}
-/* This kind of span do not have any sense, should be replaced on PHP code
-by a real img in code. They are not useful because insert too much margin around
-(for example, not valid to use in the table of server view */
-span.users,
-span.agents,
-span.data,
-span.alerts,
-span.time,
-span.net,
-span.master,
-span.snmp,
-span.binary,
-span.recon,
-span.wmi,
-span.prediction,
-span.plugin,
-span.plugin,
-span.export,
-span.recon_server,
-span.wmi_server,
-span.export_server,
-span.inventory_server,
-span.web_server {
-  margin-left: 4px;
-  margin-top: 10px;
-  padding: 4px 8px 12px 30px;
-  display: block;
-}
-span.rmess,
-span.nrmess {
-  margin-left: 14px;
-  padding: 1px 0px 10px 30px;
-  display: block;
-}
-/* New styles for data box */
-.databox,
-.databox_color,
-.databox_frame {
-  margin-bottom: 5px;
-  margin-top: 0px;
-  margin-left: 0px;
-  border: 1px solid #e2e2e2;
-  -moz-border-radius: 4px;
-  -webkit-border-radius: 4px;
-  border-radius: 4px;
-}
-.databox_color {
-  padding-top: 5px;
-}
-
-table.databox {
-  background-color: #f9faf9;
-  border-spacing: 0px;
-  -moz-box-shadow: 0px 0px 0px #ddd;
-  -webkit-box-shadow: 0px 0px 0px #ddd;
-  box-shadow: 0px 0px 0px #ddd;
-}
-
-.databox td {
-  -moz-border-radius: 0px;
-  -webkit-border-radius: 0px;
-  border-radius: 0px;
-  border: 0px none #e2e2e2;
-}
-
-.databox th {
-  padding: 9px 7px;
-  font-weight: normal;
-  color: #fff;
-}
-.databox td {
-  #border-bottom: 1px solid #e2e2e2;
-}
-
-.databox th * {
-  color: #fff;
-}
-
-.databox th input,
-.databox th textarea,
-.databox th select,
-.databox th select option {
-  color: #222;
-}
-
-.tabletitle {
-  color: #333;
-}
-
-.tactical_set legend {
-  text-align: left;
-  color: #3f3f3f;
-}
-
-.tactical_set {
-  background: #fff;
-  border: 1px solid #e2e2e2;
-  margin-left: auto;
-  margin-right: auto;
-  width: auto;
-}
-
-/* For use in Netflow */
-
-table.databox_grid {
-  margin: 25px;
-}
-
-table.databox_grid th {
-  font-size: 12px;
-}
-
-table.databox_grid td {
-  padding: 6px;
-  margin: 4px;
-  border-bottom: 1px solid #acacac;
-  border-right: 1px solid #acacac;
-}
-
-table.alternate tr:nth-child(odd) td {
-  background-color: #ffffff;
-}
-table.alternate tr:nth-child(even) td {
-  background-color: #e4e5e4;
-}
-
-table.rounded_cells td {
-  padding: 4px 4px 4px 10px;
-  -moz-border-radius: 6px;
-  -webkit-border-radius: 6px;
-  border-radius: 6px;
-}
-
-.databox_color {
-  background-color: #fafafa;
-}
-#head_l {
-  float: left;
-  margin: 0;
-  padding: 0;
-}
-#head_r {
-  float: right;
-  text-align: right;
-  margin-right: 10px;
-  padding-top: 0px;
-}
-#head_m {
-  position: absolute;
-  padding-top: 6px;
-  padding-left: 12em;
-}
-span#logo_text1 {
-  font: bolder 3em Arial, Sans-serif;
-  letter-spacing: -2px;
-  color: #eee;
-}
-span#logo_text2 {
-  font: 3em Arial, Sans-serif;
-  letter-spacing: -2px;
-  color: #aaa;
-}
-
-div#logo_text3 {
-  text-align: right;
-  font: 2em Arial, Sans-serif;
-  letter-spacing: 6px;
-  color: #aaa;
-  font-weight: bold;
-  margin-top: 0px;
-  margin-left: 4px;
-  padding-top: 0px;
-}
-
-.bb0 {
-  border-bottom: 0px;
-}
-.bt0 {
-  border-top: 0px;
-}
-.action-buttons {
-  text-align: right;
-}
-#table-add-item select,
-#table-add-sla select {
-  width: 180px;
-}
-
-/* end of classes for event priorities */
-div#main_pure {
-  background-color: #fefefe;
-  text-align: left;
-  margin-bottom: 25px;
-  margin-top: 30px;
-  margin-left: 10px;
-  margin-right: 10px;
-  height: 1000px;
-  width: 98%;
-  position: static;
-}
-#table-agent-configuration radio {
-  margin-right: 40px;
-}
-.ui-draggable {
-  cursor: move;
-}
-#layout_trash_drop {
-  float: right;
-  width: 300px;
-  height: 180px;
-  background: #fff url("../../images/trash.png") no-repeat bottom left;
-}
-#layout_trash_drop div {
-  display: block;
-}
-#layout_editor_drop {
-  float: left;
-  width: 300px;
-}
-.agent_reporting {
-  margin: 5px;
-  padding: 5px;
-}
-.report_table,
-.agent_reporting {
-  border: #ccc outset 3px;
-}
-.img_help {
-  cursor: help;
-}
-#loading {
-  position: fixed;
-  width: 200px;
-  margin-left: 30%;
-  text-align: center;
-  top: 50%;
-  background-color: #999999;
-  padding: 20px;
-}
-/* IE 7 Hack */
-#editor {
-  *margin-top: 10px;
-}
-/* big_data is used in tactical and logon_ok */
-.big_data {
-  text-decoration: none;
-  font: bold 2em Arial, Sans-serif;
-}
-
-.med_data {
-  text-decoration: none;
-  font: bold 1.5em Arial, Sans-serif;
-}
-
-.notify {
-  background-color: #f7ffa5;
-  text-align: center;
-  font-weight: bold;
-  padding: 8px;
-  margin: 0px 0px 0px 0px;
-  z-index: -1;
-}
-
-.notify a {
-  color: #003a3a;
-  text-decoration: underline;
-}
-
-.listing {
-  border-collapse: collapse;
-}
-.listing td {
-  border-bottom: 1px solid #cccccc;
-  border-top: 1px solid #cccccc;
-}
-ul {
-  list-style-type: none;
-  padding-left: 0;
-  margin-left: 0;
-}
-span.actions {
-  margin-left: 30px;
-}
-.actions {
-  min-width: 200px;
-}
-code,
-pre {
-  font-family: courier, serif;
-}
-select#template,
-select#action {
-  width: 250px;
-}
-#label-checkbox-matches_value,
-#label-checkbox-copy_modules,
-#label-checkbox-copy_alerts {
-  display: inline;
-  font-weight: normal;
-}
-input[type="image"] {
-  border: 0px;
-  background-color: transparent;
-}
-table#simple select#id_module_type,
-table#alert_search select#id_agent,
-table#alert_search select#id_group,
-table#network_component select#type {
-  width: 200px;
-}
-table#simple select#select_snmp_oid,
-table#simple select#id_plugin,
-table#network_component select#id_plugin {
-  width: 270px;
-}
-table#simple select#prediction_id_group,
-table#simple select#prediction_id_agent,
-table#simple select#prediction_module {
-  width: 50%;
-  display: block;
-}
-table#simple input#text-plugin_parameter,
-table#simple input#text-snmp_oid,
-table#source_table select,
-table#destiny_table select,
-table#target_table select,
-table#filter_compound_table select,
-table#filter_compound_table #text-search,
-table#delete_table select {
-  width: 100%;
-}
-table#simple select#network_component_group,
-table#simple select#network_component {
-  width: 90%;
-}
-table#simple span#component_group,
-table#simple span#component {
-  width: 45%;
-  font-style: italic;
-}
-table#simple label {
-  display: inline;
-  font-weight: normal;
-  font-style: italic;
-}
-.clickable {
-  cursor: pointer;
-}
-table#agent_list tr,
-table.alert_list tr {
-  vertical-align: top;
-}
-.toggle {
-  border-collapse: collapse;
-}
-.toggle td {
-  border-left: 1px solid #d3d3d3;
-}
-
-ul.actions_list {
-  list-style-image: url(../../images/arrow.png);
-  list-style-position: inside;
-  margin-top: 0;
-}
-div.loading {
-  background-color: #fff1a8;
-  margin-left: auto;
-  margin-right: auto;
-  padding: 5px;
-  text-align: center;
-  font-style: italic;
-  width: 95%;
-}
-div.loading img {
-  float: right;
-}
-/* Tablesorter jQuery pager */
-div.pager {
-  margin-left: 10px;
-  margin-top: 5px;
-}
-div.pager img {
-  position: relative;
-  top: 4px;
-  padding-left: 5px;
-}
-div.pager input {
-  padding-left: 5px;
-}
-.pagedisplay {
-  border: 0;
-  width: 35px;
-}
-/* Steps style */
-ol.steps {
-  margin-bottom: 15px;
-  padding: 0;
-  list-style-type: none;
-  list-style-position: outside;
-}
-ol.steps li {
-  float: left;
-  background-color: #efefef;
-  padding: 5px;
-  margin-left: 5px;
-  width: 150px;
-}
-ol.steps li a {
-  color: #111;
-}
-ol.steps li.visited a {
-  color: #999;
-}
-ol.steps li span {
-  font-weight: normal;
-  display: block;
-}
-ol.steps li span {
-  color: #777;
-}
-ol.steps li.visited span {
-  color: #999;
-}
-ol.steps li.current {
-  border-left: 5px solid #778866;
-  margin-left: 0;
-  font-weight: bold;
-  background-color: #e9f3d2;
-}
-ol.steps li.visited {
-  color: #999;
-}
-
-fieldset {
-  background-color: #f9faf9;
-  border: 1px solid #e2e2e2;
-  padding: 0.5em;
-  margin-bottom: 20px;
-  position: relative;
-}
-fieldset legend {
-  font-size: 1.1em;
-  font-weight: bold;
-  #color: #3f4e2f;
-  line-height: 20px;
-  color: #3f3f3f;
-  #top: -2em;
-}
-
-fieldset .databox {
-  border: 0px solid;
-}
-
-fieldset.databox {
-  padding: 14px;
-}
-
-fieldset legend span,
-span#latest_value {
-  font-style: italic;
-}
-span#latest_value span#value {
-  font-style: normal;
-}
-form#filter_form {
-  margin-bottom: 15px;
-}
-ul.action_list {
-  margin: 0;
-  list-style: none inside circle;
-}
-ul.action_list li div {
-  margin-left: 15px;
-}
-span.action_name {
-  float: none;
-}
-div.actions_container {
-  overflow: auto;
-  width: 100%;
-  max-height: 200px;
-}
-div.actions_container label {
-  display: inline;
-  font-weight: normal;
-  font-style: italic;
-}
-a.add_action {
-  clear: both;
-  display: block;
-}
-
-/* timeEntry styles */
-.timeEntry_control {
-  vertical-align: middle;
-  margin-left: 2px;
-}
-div#steps_clean {
-  clear: both;
-}
-div#event_control {
-  clear: right;
-}
-
-/* Autocomplete styles */
-.ac_results {
-  padding: 0px;
-  border: 1px solid black;
-  background-color: white;
-  overflow: hidden;
-  z-index: 99999;
-}
-
-.ac_results ul {
-  width: 100%;
-  list-style-position: outside;
-  list-style: none;
-  padding: 0;
-  margin: 0;
-  text-align: left;
-}
-
-.ac_results li {
-  margin: 0px;
-  padding: 2px 5px;
-  cursor: default;
-  display: block;
-  /*
-	if width will be 100% horizontal scrollbar will apear
-	when scroll mode will be used
-	*/
-  /*width: 100%;*/
-  font: menu;
-  font-size: 12px;
-  /*
-	it is very important, if line-height not setted or setted
-	in relative units scroll will be broken in firefox
-	*/
-  line-height: 16px;
-}
-
-.ac_loading {
-  background: white url("../images/loading.gif") right center no-repeat;
-}
-
-.ac_over {
-  background-color: #efefef;
-}
-span.ac_extra_field,
-span.ac_extra_field strong {
-  font-style: italic;
-  font-size: 9px;
-}
-
-div#pandora_logo_header {
-  /*	Put here your company logo (139x60 pixels) like this: */
-  /*	background: url(../../images/MiniLogoArtica.jpg); */
-  background: url(../../images/pandora_logo_head.png);
-  background-position: 0% 0%;
-  width: 139px;
-  height: 60px;
-  float: left;
-}
-
-#header_table img {
-  margin-top: 0px;
-}
-
-.autorefresh_disabled {
-  cursor: not-allowed;
-}
-
-a.autorefresh {
-  padding-right: 8px;
-}
-
-#refrcounter {
-  color: white;
-}
-
-#combo_refr select {
-  margin-right: 8px;
-}
-
-.disabled_module {
-  color: #aaa;
-}
-div.warn {
-  background: url(../../images/info.png) no-repeat;
-  margin-top: 7px;
-  padding: 2px 1px 6px 25px;
-}
-
-.submenu_not_selected {
-  font-weight: normal;
-}
-
-/* Submenus havent borders */
-.submenu_not_selected,
-.submenu_selected,
-.submenu2 {
-  border: 0px;
-  min-height: 35px;
-}
-
-/* Pandora width style theme */
-
-div#container {
-  width: 100%;
-}
-div#page {
-  width: auto;
-}
-div#main {
-  max-width: 93%;
-  min-width: 93%;
-}
-
-ol.steps {
-  margin-bottom: 70px;
-}
-div#steps_clean {
-  display: none;
-}
-
-#menu_tab_frame,
-#menu_tab_frame_view {
-  width: 100%;
-  padding-right: 0px;
-  margin-left: 0px;
-  margin-bottom: 20px;
-  height: 31px;
-}
-div#events_list {
-  float: left;
-  width: 100%;
-}
-span#logo_text1 {
-  font: bolder 3em Arial, Sans-serif;
-  letter-spacing: -2px;
-  color: #eee;
-}
-span#logo_text2 {
-  font: 3em Arial, Sans-serif;
-  letter-spacing: -2px;
-  color: #aaa;
-}
-div#logo_text3 {
-  text-align: right;
-  font: 2em Arial, Sans-serif;
-  letter-spacing: 6px;
-  color: #aaa;
-  font-weight: bold;
-  margin-top: 0px;
-  margin-left: 4px;
-  padding-top: 0px;
-}
-.pagination {
-  margin-top: 15px;
-  margin-bottom: 5px;
-}
-.pagination * {
-  margin-left: 0px;
-  margin-right: 0px;
-  vertical-align: middle;
-}
-
-/*CALENDAR TOOLTIP STYLE*/
 
-/* Calendar background */
-table.scw {
+/* menu.css */
+.operation,
+#menu_full {
   background-color: #80ab51;
-  border: 0;
-  border-radius: 4px;
 }
 
-/* Week number heading */
-td.scwWeekNumberHead {
-  color: #111;
+.operation .selected {
+  background-color: #d9fb86;
 }
 
-td.scwWeek {
-  color: #111;
+.operation li.selected {
+  box-shadow: inset 4px 0 #80ab51;
 }
-
-Today selector td.scwFoot {
-  background-color: #daedae;
-  color: #111;
-}
-
-td.scwFootDisabled {
-  background-color: #000;
-  color: #ffffff;
-}
-
-tfoot.scwFoot {
-  color: #111;
-}
-
-.scwFoot :hover {
-  color: #3f3f3f;
-}
-
-table.scwCells {
-  background-color: #fff;
-  color: #3c3c3c;
-}
-
-table.scwCells:hover {
-  background-color: #fff;
-}
-
-td.scwCellsExMonth {
-  background-color: #eee;
-  color: #3c3c3c;
-}
-
-td.scwCellsWeekend {
-  background-color: #3c3c3c;
-  color: #fff;
-  border: 0;
-}
-
-td.scwInputDate {
-  background-color: #777;
-  color: #ffffff;
-  border: 0;
-}
-
-td.scwFoot {
-  background-color: #fff;
-  color: #3c3c3c;
-  border: 0;
-}
-
-/* Cells divs to set individual styles with the table objects */
-div.cellBold {
-  width: 100%;
-  height: 100%;
-  font-weight: bold;
-}
-
-div.cellRight {
-  width: 100%;
-  height: 100%;
-  text-align: right;
-}
-
-div.cellCenter {
-  width: 100%;
-  height: 100%;
-  text-align: center;
-}
-
-div.cellWhite {
-  width: 100%;
-  height: 100%;
-  background: #fff;
-  color: #111;
-}
-
-div.cellNormal {
-  width: 100%;
-  height: 100%;
-  background: #6eb432;
-  color: #fff;
-}
-
-div.cellCritical {
-  width: 100%;
-  height: 100%;
-  background: #f85858;
-  color: #fff;
-}
-
-div.cellWarning {
-  width: 100%;
-  height: 100%;
-  background: #ffea59;
-  color: #111;
-}
-
-div.cellUnknown {
-  width: 100%;
-  height: 100%;
-  background: #aaaaaa;
-  color: #ffffff;
-}
-
-div.cellNotInit {
-  width: 100%;
-  height: 100%;
-  background: #4a83f3;
-  color: #ffffff;
-}
-
-div.cellAlert {
-  width: 100%;
-  height: 100%;
-  background: #ff8800;
-  color: #111;
-}
-
-div.cellBorder1 {
-  width: 100%;
-  height: 100%;
-  border: 1px solid #666;
-}
-
-div.cellBig {
-  width: 100%;
-  height: 100%;
-  font-size: 18px;
-}
-
-.info_box {
-  background: #f9faf9;
-  margin-top: 10px;
-  margin-bottom: 10px;
-  padding: 0px 5px 5px 10px;
-  border-color: #e2e2e2;
-  border-style: solid;
-  border-width: 1px;
-  width: 100%;
-  -moz-border-radius: 4px;
-  -webkit-border-radius: 4px;
-  border-radius: 4px;
-}
-
-.info_box .title * {
-  font-size: 10pt;
-  font-weight: bolder;
-}
-
-.info_box .icon {
-  width: 30px;
-  text-align: center;
-}
-
-/* Standard styles for status colos (groups, events, backgrounds...) */
-
-.opacity_cell {
-  filter: alpha(opacity=80);
-  -moz-opacity: 0.8;
-  opacity: 0.8;
-  -khtml-opacity: 0.8;
-}
-
-tr.group_view_data,
-.group_view_data {
-  color: #3f3f3f;
-}
-
-tr.group_view_crit,
-.group_view_crit {
-  background-color: #e63c52;
-  color: #fff;
-}
-
-tr.group_view_norm,
-.group_view_norm,
-tr.group_view_normal,
-.group_view_normal {
-  #background-color: #ffffff;
-}
-tr.group_view_ok,
-.group_view_ok {
-  background-color: #82b92e;
-  color: #fff;
-}
-
-tr.group_view_not_init,
-.group_view_not_init,
-tr.group_view_not_init,
-.group_view_not_init {
-  background-color: #5bb6e5;
-  color: #fff;
-}
-
-tr.group_view_warn,
-.group_view_warn,
-tr.group_view_warn.a,
-a.group_view_warn,
-tr.a.group_view_warn {
-  background-color: #f3b200;
-  color: #3f3f3f;
-}
-
-a.group_view_warn {
-  color: #f3b200;
-}
-
-tr.group_view_alrm,
-.group_view_alrm {
-  background-color: #ffa631;
-  color: #fff;
-}
-
-tr.group_view_unk,
-.group_view_unk {
-  background-color: #b2b2b2;
-  color: #fff;
-}
-
-/* classes for event priorities. Sits now in functions.php */
-.datos_green,
-.datos_greenf9,
-.datos_green a,
-.datos_greenf9 a,
-.datos_green * {
-  background-color: #82b92e;
-  color: #fff;
-}
-.datos_red,
-.datos_redf9,
-.datos_red a,
-.datos_redf9 a,
-.datos_red * {
-  background-color: #e63c52;
-  color: #fff;
-}
-
-.datos_yellow,
-.datos_yellowf9,
-.datos_yellow * {
-  background-color: #f3b200;
-  color: #111;
-}
-
-a.datos_blue,
-.datos_bluef9,
-.datos_blue,
-.datos_blue * {
-  background-color: #4ca8e0;
-  color: #fff;
-}
-
-.datos_grey,
-.datos_greyf9,
-.datos_grey * {
-  background-color: #999999;
-  color: #fff;
-}
-
-.datos_pink,
-.datos_pinkf9,
-.datos_pink * {
-  background-color: #fdc4ca;
-  color: #111;
-}
-
-.datos_brown,
-.datos_brownf9,
-.datos_brown * {
-  background-color: #a67c52;
-  color: #fff;
-}
-
-.datos_orange,
-.datos_orangef9,
-.datos_orange * {
-  background-color: #f7931e;
-  color: #111;
-}
-
-td.datos_greyf9,
-td.datos_bluef9,
-td.datos_greenf9,
-td.datos_redf9,
-td.datos_yellowf9,
-td.datos_pinkf9,
-td.datos_brownf9,
-td.datos_orangef9 {
-  padding: 5px 5px 5px 5px;
-}
-
-.menu li.selected {
-  font-weight: bold;
-}
-
-ul.operation li a:hover {
-  #font-weight: bold;
-}
-
-.submenu_text {
-  color: #fff;
-}
-
-.submenu_not_selected {
-  color: #fff;
-}
-
 .operation .menu_icon:hover {
   background-color: #d9fb86;
 }
-.operation .submenu_text:hover {
-  color: #585858;
-}
-.operation .submenu_not_selected:hover {
-  background-color: #d9fb86;
-  color: #585858;
-}
-.operation .submenu_selected:hover {
-  background-color: #d9fb86;
-  color: #585858;
-}
+
 .operation .sub_subMenu:hover {
   background-color: #d9fb86;
   color: #585858;
 }
-.operation .selected .submenu_not_selected * {
-  color: #fff;
+
+.godmode .selected {
+  background-color: #a77853;
 }
 
-.operation .selected .submenu_not_selected *:hover {
-  color: #585858;
-}
-.operation {
-  background-color: #80ab51;
-}
-.operation .selected {
-  background-color: #d9fb86;
-}
-.operation li.selected {
-  box-shadow: inset 4px 0 #80ab51;
-}
-.operation .selected .submenu_text_middle {
-  color: #585858;
-}
-.operation .submenu_selected .selected .submenu_text {
-  color: #585858;
-}
-.operation .submenu_selected .selected {
-  color: #585858;
+.godmode li.selected {
+  box-shadow: inset 4px 0 #e79b5d;
 }
 
 .godmode .menu_icon:hover {
   background-color: #a77853;
 }
-.godmode .submenu_text:hover {
-  color: #3f3f3f;
-}
-.godmode .submenu_not_selected:hover {
-  background-color: #a77853;
-  color: #2f2f2f;
-}
+
+.godmode .submenu_not_selected:hover,
 .godmode .submenu_selected:hover {
-  background-color: #a77853;
-  color: #2f2f2f;
+  background-color: #a77853 !important;
 }
+
 .godmode .sub_subMenu:hover {
   background-color: #a77853;
   color: #2f2f2f;
 }
-.godmode .selected .submenu_not_selected * {
-  color: #fff;
-}
-
-.godmode .selected .submenu_not_selected *:hover {
-  color: #2f2f2f;
-}
-.godmode {
-  background-color: #e79b5d;
-}
-.godmode .selected {
-  background-color: #a77853;
-}
-.godmode li.selected {
-  box-shadow: inset 4px 0 #e79b5d;
-}
-.godmode .selected .submenu_text_middle {
-  color: #2f2f2f;
-}
-.godmode .submenu_selected .selected .submenu_text {
-  color: #2f2f2f;
-}
-.godmode .submenu_selected .selected {
-  color: #2f2f2f;
-}
-
-li.links a:hover {
-  #font-weight: bold;
-}
-
-.is_submenu2 li {
-  background-color: #ff0000;
-}
-
-.is_submenu2 {
-  background-color: #222222;
-}
-
-.menu li,
-.menu .li.not_selected {
-  border-radius: 0px 0px 0px 0px;
-  display: block;
-  min-height: 35px;
-  border-bottom: 0px none #424242;
-  vertical-align: middle;
-}
-
-#menu_tab li.separator {
-  /* Empty */
-}
-
-.operation {
-  border-top-right-radius: 5px;
-  border-right-style: solid;
-  border-right-width: 0px;
-}
-
-input#text-id_parent.ac_input,
-input,
-textarea,
-select {
-  background-color: #ffffff;
-  border: 1px solid #cbcbcb;
-  -moz-border-radius: 3px;
-  -webkit-border-radius: 3px;
-  border-radius: 3px;
-}
-
-span#plugin_description {
-  font-size: 9px;
-}
-
-/*FOR TINYMCE*/
-#tinymce {
-  text-align: left;
-}
-
-.visual_font_size_4pt,
-.visual_font_size_4pt > em,
-.visual_font_size_4pt > strong,
-.visual_font_size_4pt > strong > span,
-.visual_font_size_4pt > span,
-.visual_font_size_4pt > strong > em,
-.visual_font_size_4pt > em > strong,
-.visual_font_size_4pt em span,
-.visual_font_size_4pt span em {
-  font-size: 4pt;
-  line-height: 4pt;
-}
-
-.visual_font_size_6pt,
-.visual_font_size_6pt > em,
-.visual_font_size_6pt > strong,
-.visual_font_size_6pt > strong > span,
-.visual_font_size_6pt > span,
-.visual_font_size_6pt > strong > em,
-.visual_font_size_6pt > em > strong,
-.visual_font_size_6pt em span,
-.visual_font_size_6pt span em {
-  font-size: 6pt;
-  line-height: 6pt;
-}
-
-.visual_font_size_8pt,
-.visual_font_size_8pt > em,
-.visual_font_size_8pt > strong,
-.visual_font_size_8pt > strong > span,
-.visual_font_size_8pt > span,
-.visual_font_size_8pt > strong > em,
-.visual_font_size_8pt > em > strong,
-.visual_font_size_8pt em span,
-.visual_font_size_8pt span em {
-  font-size: 8pt;
-  line-height: 8pt;
-}
-
-.visual_font_size_10pt,
-.visual_font_size_10pt > em,
-.visual_font_size_10pt > strong,
-.visual_font_size_10pt > strong > em,
-.visual_font_size_10pt > em > strong,
-.visual_font_size_10pt em span,
-.visual_font_size_10pt span em {
-  font-size: 10pt;
-  line-height: 10pt;
-}
-
-.visual_font_size_12pt,
-.visual_font_size_12pt > em,
-.visual_font_size_12pt > strong,
-.visual_font_size_12pt > strong > em,
-.visual_font_size_12pt > em > strong,
-.visual_font_size_12pt em span,
-.visual_font_size_12pt span em {
-  font-size: 12pt;
-  line-height: 12pt;
-}
-
-.visual_font_size_14pt,
-.visual_font_size_14pt > em,
-.visual_font_size_14pt > strong,
-.visual_font_size_14pt > strong > span,
-.visual_font_size_14pt > span,
-.visual_font_size_14pt > strong > em,
-.visual_font_size_14pt > em > strong,
-.visual_font_size_14pt em span,
-.visual_font_size_14pt span em {
-  font-size: 14pt;
-  line-height: 14pt;
-}
-
-.visual_font_size_18pt,
-.visual_font_size_18pt > em,
-.visual_font_size_18pt > strong,
-.visual_font_size_18pt > strong > span,
-.visual_font_size_18pt > span,
-.visual_font_size_18pt > strong > em,
-.visual_font_size_18pt > em > strong,
-.visual_font_size_18pt em span,
-.visual_font_size_18pt span em {
-  font-size: 18pt;
-  line-height: 18pt;
-}
-
-.visual_font_size_24pt,
-.visual_font_size_24pt > em,
-.visual_font_size_24pt > strong,
-.visual_font_size_24pt > strong > span,
-.visual_font_size_24pt > span,
-.visual_font_size_24pt > strong > em,
-.visual_font_size_24pt > em > strong,
-.visual_font_size_24pt em span,
-.visual_font_size_24pt span em {
-  font-size: 24pt;
-  line-height: 24pt;
-}
-
-.visual_font_size_28pt,
-.visual_font_size_28pt > em,
-.visual_font_size_28pt > strong,
-.visual_font_size_28pt > strong > span,
-.visual_font_size_28pt > span,
-.visual_font_size_28pt > strong > em,
-.visual_font_size_28pt > em > strong,
-.visual_font_size_28pt em span,
-.visual_font_size_28pt span em {
-  font-size: 28pt;
-  line-height: 28pt;
-}
-
-.visual_font_size_36pt,
-.visual_font_size_36pt > em,
-.visual_font_size_36pt > strong,
-.visual_font_size_36pt > strong > span,
-.visual_font_size_36pt > span,
-.visual_font_size_36pt > strong > em,
-.visual_font_size_36pt > em > strong,
-.visual_font_size_36pt em span,
-.visual_font_size_36pt span em {
-  font-size: 36pt;
-  line-height: 36pt;
-}
-
-.visual_font_size_48pt,
-.visual_font_size_48pt > em,
-.visual_font_size_48pt > strong,
-.visual_font_size_48pt > strong > span,
-.visual_font_size_48pt > span,
-.visual_font_size_48pt > strong > em,
-.visual_font_size_48pt > em > strong,
-.visual_font_size_48pt em span,
-.visual_font_size_48pt span em {
-  font-size: 48pt;
-  line-height: 48pt;
-}
-
-.visual_font_size_60pt,
-.visual_font_size_60pt > em,
-.visual_font_size_60pt > strong,
-.visual_font_size_60pt > strong > span,
-.visual_font_size_60pt > span,
-.visual_font_size_60pt > strong > em,
-.visual_font_size_60pt > em > strong,
-.visual_font_size_60pt em span,
-.visual_font_size_60pt span em {
-  font-size: 60pt;
-  line-height: 60pt;
-}
-
-.visual_font_size_72pt,
-.visual_font_size_72pt > em,
-.visual_font_size_72pt > strong,
-.visual_font_size_72pt > strong > span,
-.visual_font_size_72pt > span,
-.visual_font_size_72pt > strong > em,
-.visual_font_size_72pt > em > strong,
-.visual_font_size_72pt em span,
-.visual_font_size_72pt span em {
-  font-size: 72pt;
-  line-height: 72pt;
-}
-
-.visual_font_size_84pt,
-.visual_font_size_84pt > em,
-.visual_font_size_84pt > strong,
-.visual_font_size_84pt > strong > span,
-.visual_font_size_84pt > span,
-.visual_font_size_84pt > strong > em,
-.visual_font_size_84pt > em > strong,
-.visual_font_size_84pt em span,
-.visual_font_size_84pt span em {
-  font-size: 84pt;
-  line-height: 84pt;
-}
-
-.visual_font_size_96pt,
-.visual_font_size_96pt > em,
-.visual_font_size_96pt > strong,
-.visual_font_size_96pt > strong > span,
-.visual_font_size_96pt > span,
-.visual_font_size_96pt > strong > em,
-.visual_font_size_96pt > em > strong,
-.visual_font_size_96pt em span,
-.visual_font_size_96pt span em {
-  font-size: 96pt;
-  line-height: 96pt;
-}
-
-.visual_font_size_116pt,
-.visual_font_size_116pt > em,
-.visual_font_size_116pt > strong,
-.visual_font_size_116pt > strong > span,
-.visual_font_size_116pt > span,
-.visual_font_size_116pt > strong > em,
-.visual_font_size_116pt > em > strong,
-.visual_font_size_116pt em span,
-.visual_font_size_116pt span em {
-  font-size: 116pt;
-  line-height: 116pt;
-}
-
-.visual_font_size_128pt,
-.visual_font_size_128pt > em,
-.visual_font_size_128pt > strong,
-.visual_font_size_128pt > strong > span,
-.visual_font_size_128pt > span,
-.visual_font_size_128pt > strong > em,
-.visual_font_size_128pt > em > strong,
-.visual_font_size_128pt em span,
-.visual_font_size_128pt span em {
-  font-size: 128pt;
-  line-height: 128pt;
-}
-
-.visual_font_size_140pt,
-.visual_font_size_140pt > em,
-.visual_font_size_140pt > strong,
-.visual_font_size_140pt > strong > span,
-.visual_font_size_140pt > span,
-.visual_font_size_140pt > strong > em,
-.visual_font_size_140pt > em > strong,
-.visual_font_size_140pt em span,
-.visual_font_size_140pt span em {
-  font-size: 140pt;
-  line-height: 140pt;
-}
-
-.visual_font_size_154pt,
-.visual_font_size_154pt > em,
-.visual_font_size_154pt > strong,
-.visual_font_size_154pt > strong > span,
-.visual_font_size_154pt > span,
-.visual_font_size_154pt > strong > em,
-.visual_font_size_154pt > em > strong,
-.visual_font_size_154pt em span,
-.visual_font_size_154pt span em {
-  font-size: 154pt;
-  line-height: 154pt;
-}
-
-.visual_font_size_196pt,
-.visual_font_size_196pt > em,
-.visual_font_size_196pt > strong,
-.visual_font_size_196pt > strong > span,
-.visual_font_size_196pt > span,
-.visual_font_size_196pt > strong > em,
-.visual_font_size_196pt > em > strong,
-.visual_font_size_196pt em span,
-.visual_font_size_196pt span em {
-  font-size: 196pt;
-  line-height: 196pt;
-}
-
-.resize_visual_font_size_8pt,
-.resize_visual_font_size_8pt > em,
-.resize_visual_font_size_8pt > strong,
-.resize_visual_font_size_8pt > strong > span,
-.resize_visual_font_size_8pt > span,
-.resize_visual_font_size_8pt > strong > em,
-.resize_visual_font_size_8pt > em > strong,
-.visual_font_size_8pt em span,
-.visual_font_size_8pt span em {
-  font-size: 4pt;
-  line-height: 4pt;
-}
-.resize_visual_font_size_14pt,
-.resize_visual_font_size_14pt > em,
-.resize_visual_font_size_14pt > strong,
-.resize_visual_font_size_14pt > strong > span,
-.resize_visual_font_size_14pt > span,
-.resize_visual_font_size_14pt > strong > em,
-.resize_visual_font_size_14pt > em > strong,
-.visual_font_size_14pt em span,
-.visual_font_size_14pt span em {
-  font-size: 7pt;
-  line-height: 7pt;
-}
-.resize_visual_font_size_24pt,
-.resize_visual_font_size_24pt > em,
-.resize_visual_font_size_24pt > strong,
-.resize_visual_font_size_24pt > strong > span,
-.resize_visual_font_size_24pt > span,
-.resize_visual_font_size_24pt > strong > em,
-.resize_visual_font_size_24pt > em > strong,
-.visual_font_size_14pt em span,
-.visual_font_size_14pt span em {
-  font-size: 12pt;
-  line-height: 12pt;
-}
-.resize_visual_font_size_36pt,
-.resize_visual_font_size_36pt > em,
-.resize_visual_font_size_36pt > strong,
-.resize_visual_font_size_36pt > strong > span,
-.resize_visual_font_size_36pt > span,
-.resize_visual_font_size_36pt > strong > em,
-.resize_visual_font_size_36pt > em > strong,
-.visual_font_size_36pt em span,
-.visual_font_size_36pt span em {
-  font-size: 18pt;
-  line-height: 18pt;
-}
-.resize_visual_font_size_72pt,
-.resize_visual_font_size_72pt > em,
-.resize_visual_font_size_72pt > strong,
-.resize_visual_font_size_72pt > strong > span,
-.resize_visual_font_size_72pt > span,
-.resize_visual_font_size_72pt > strong > em,
-.resize_visual_font_size_72pt > em > strong,
-.visual_font_size_72pt em span,
-.visual_font_size_72pt span em {
-  font-size: 36pt;
-  line-height: 36pt;
-}
-/*SIDEBAR*/
-.menu_sidebar {
-  color: #111;
-  background: #3f3f3f;
-
-  margin-left: 10px;
-  padding-left: 0px;
-  padding-right: 0px;
-  padding-top: 10px;
-  text-align: left;
-  font-family: arial, sans-serif, verdana;
-  font-size: 10px;
-  border: 1px solid #000;
-  position: absolute;
-  margin: 0;
-  width: 400px;
-  height: 260px;
-
-  -moz-box-shadow: 0px 4px 4px #010e1b;
-  -webkit-box-shadow: 0px 4px 4px #010e1b;
-  box-shadow: 0px 4px 4px #010e1b;
-
-  filter: alpha(opacity=97);
-  -moz-opacity: 0.97;
-  opacity: 0.97;
-}
-
-.menu_sidebar_radius_left {
-  -moz-border-top-left-radius: 8px;
-  -webkit-border-top-left-radius: 8px;
-  border-top-left-radius: 8px;
-
-  -moz-border-bottom-left-radius: 8px;
-  -webkit-border-bottom-left-radius: 8px;
-  border-bottom-left-radius: 8px;
-
-  border-right: 0px solid #000;
-}
-
-.menu_sidebar_radius_right {
-  -moz-border-top-right-radius: 8px;
-  -webkit-border-top-right-radius: 8px;
-  border-top-right-radius: 8px;
-  -moz-border-bottom-right-radius: 8px;
-  -webkit-border-bottom-right-radius: 8px;
-  border-bottom-right-radius: 8px;
-}
-
-.menu_sidebar_outer {
-  margin-left: 3px;
-  background: #ececec;
-  width: 100%;
-  text-align: center;
-  -moz-border-radius: 6px;
-  -webkit-border-radius: 6px;
-  border-radius: 6px;
-  padding: 8px;
-}
-
-/*Groupsview*/
-
-.groupsview {
-  border-spacing: 0px 4px;
-}
-
-.groupsview tr {
-  background-color: #666;
-}
-
-.groupsview th {
-  font-size: 12px;
-  padding: 5px;
-}
-
-.groupsview td.first,
-.groupsview th.first {
-  -moz-border-top-left-radius: 10px;
-  -webkit-border-top-left-radius: 10px;
-  border-top-left-radius: 10px;
-
-  -moz-border-bottom-left-radius: 10px;
-  -webkit-border-bottom-left-radius: 10px;
-  border-bottom-left-radius: 10px;
-}
-
-.groupsview td.last,
-.groupsview th.last {
-  -moz-border-top-right-radius: 10px;
-  -webkit-border-top-right-radius: 10px;
-  border-top-right-radius: 10px;
-  -moz-border-bottom-right-radius: 10px;
-  -webkit-border-bottom-right-radius: 10px;
-  border-bottom-right-radius: 10px;
-}
-
-a.tip {
-  display: inline;
-  cursor: help;
-}
-
-a.tip > img {
-  margin-left: 2px;
-  margin-right: 2px;
-}
-
-input.search_input {
-  background: white url("../../images/input_zoom.png") no-repeat right;
-  padding: 0px;
-  padding-left: 5px;
-  margin: 0;
-  width: 80%;
-  height: 19px;
-  margin-bottom: 5px;
-  margin-left: 2px;
-  padding-right: 25px;
-  color: #999;
-}
-
-.vertical_fields td input,
-.vertical_fields td select {
-  margin-top: 8px;
-}
-
-a[id^="tgl_ctrl_"] > img,
-a[id^="tgl_ctrl_"] > b > img {
-  vertical-align: middle;
-}
-
-.noshadow {
-  -moz-box-shadow: 0px;
-  -webkit-box-shadow: 0px;
-  box-shadow: 0px;
-}
-
-/* Images forced title */
-
-div.forced_title_layer {
-  display: block;
-  text-decoration: none;
-  position: absolute;
-  z-index: 100000;
-  border: 1px solid #708090;
-  background-color: #666;
-  color: #fff;
-  padding: 4px 5px;
-  font-weight: bold;
-  font-size: small;
-  font-size: 11px;
-  /* IE 8 */
-  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=9)";
-  /* Netscape */
-  -moz-opacity: 0.9;
-  opacity: 0.9;
-  -moz-border-radius: 3px;
-  -webkit-border-radius: 3px;
-  border-radius: 3px;
-}
-
-/* Graphs styles */
-
-div.legend > div {
-  pointer-events: none; /* Allow to click the graphs below */
-  opacity: 0.65;
-}
-
-div.nodata_text {
-  padding: 5px 12px 0px 68px;
-  font-weight: bold;
-  color: #c1c1c1;
-  text-transform: uppercase;
-  display: table-cell;
-  vertical-align: middle;
-  text-align: left;
-}
-
-div.nodata_container {
-  width: 150px;
-  height: 100px;
-  background-repeat: no-repeat;
-  background-position: center;
-  margin: auto auto;
-  display: table;
-}
-
-#snmp_data {
-  width: 40%;
-  position: absolute;
-  top: 0;
-  right: 20px;
-
-  #background-color: #fff;
-  #padding: 10px;
-}
-
-#rmf_data {
-  width: 40%;
-  height: 80%;
-  position: absolute;
-  top: 0;
-  right: 20px;
-  overflow: auto;
-
-  #background-color: #fff;
-  #padding: 10px;
-}
-
-/* Subtab styles */
-
-ul.subsubmenu {
-  border-bottom-right-radius: 5px;
-  border-bottom-left-radius: 5px;
-  -moz-border-bottom-right-radius: 5px;
-  -moz-border-bottom-left-radius: 5px;
-  -webkit-border-bottom-right-radius: 5px;
-  -webkit-border-bottom-left-radius: 5px;
-
-  background: #ececec;
-}
-
-ul.subsubmenu li {
-  background-color: #ececec;
-  font-weight: bold;
-  text-decoration: none;
-  font-size: 14px;
-  border-color: #e2e2e2;
-  border-style: solid;
-  border-width: 1px;
-}
-
-ul.subsubmenu li a {
-  padding: 0px 10px 5px;
-}
-
-div#agent_wizard_subtabs {
-  position: absolute;
-  margin-left: 0px;
-  display: none;
-  padding-bottom: 3px;
-  z-index: 1000;
-}
-
-.agent_wizard_tab:hover {
-  cursor: default;
-}
-
-#container_servicemap_legend {
-  position: absolute;
-  width: 200px;
-  background: #fff;
-  margin-top: 10px;
-  right: 2px;
-  border: 1px solid #e2e2e2;
-  border-radius: 5px;
-  padding: 10px;
-  opacity: 0.9;
-}
-
-#container_servicemap_legend table {
-  text-align: left;
-}
-
-.legend_square {
-  width: 20px;
-  padding-left: 20px;
-  padding-right: 10px;
-}
-
-.legend_square_simple {
-  padding-left: 0px;
-  padding-right: 10px;
-  padding-bottom: 3px;
-}
-.legend_square div,
-.legend_square_simple div {
-  width: 20px;
-  height: 20px;
-  border-radius: 3px;
-}
-
-.legend_basic {
-  background: #f4f4f4;
-  margin-top: 10px;
-  border-radius: 5px;
-  padding: 10px;
-}
-
-.agents_modules_table th {
-  background: #3f3f3f;
-}
-
-.agents_modules_table th * {
-  color: #ffffff;
-}
-
-/*
- * LOAD_ENTERPRISE.PHP
- */
-#code_license_dialog {
-  padding: 50px;
-  padding-top: 10px;
-}
-#code_license_dialog #logo {
-  margin-bottom: 20px;
-  text-align: center;
-}
-#code_license_dialog,
-#code_license_dialog * {
-  font-size: 14px;
-}
-#code_license_dialog ul {
-  padding-left: 30px;
-  list-style-image: url("../../images/input_tick.png");
-}
-#code_license_dialog li {
-  margin-bottom: 12px;
-}
-
-#code_license_dialog #code {
-  font-weight: bolder;
-  font-size: 20px;
-  border: 1px solid #dddddd;
-  padding: 5px;
-  text-align: center;
-  -moz-border-radius: 8px;
-  -webkit-border-radius: 8px;
-  border-radius: 8px;
-}
-
-#code_license_dialog a {
-  text-decoration: underline;
-}
-
-/* GRAPHS CSS */
-
-.parent_graph {
-  position: relative;
-}
-
-.menu_graph,
-.timestamp_graph {
-  position: absolute;
-}
-
-.menu_graph {
-  -moz-border-top-right-radius: 6px;
-  -webkit-border-top-right-radius: 6px;
-  border-top-right-radius: 6px;
-  -moz-border-top-left-radius: 6px;
-  -webkit-border-top-left-radius: 6px;
-  border-top-left-radius: 6px;
-}
-
-.legend_graph {
-  margin: 0px;
-  padding: 0px;
-  text-align: left;
-}
-
-.legendColorBox * {
-  font-size: 0px;
-  padding: 0px 4px;
-  overflow: visible;
-}
-
-/* GIS CSS */
-
-.olLayerDiv {
-  z-index: 102;
-}
-
-/* Alert view */
-
-table.alert_days th,
-table.alert_time th {
-  height: 30px;
-  vertical-align: middle;
-}
-
-table.alert_escalation th img {
-  width: 18px;
-}
-
-td.used_field {
-  #border: solid #6eb432;
-  background: #6eb432;
-  color: #ffffff;
-  font-weight: bold;
-}
-
-td.overrided_field {
-  color: #666;
-}
-
-td.unused_field {
-  color: #888;
-}
-
-td.empty_field {
-  background: url("../../images/long_arrow.png") no-repeat 100% center;
-}
-
-#table_macros textarea {
-  width: 96%;
-}
-
-/* Policies styles */
-
-table#policy_modules td * {
-  display: inline;
-}
-
-.context_help_title {
-  font-weight: bolder;
-  text-align: left;
-}
-.context_help_body {
-  text-align: left;
-}
-
-#left_column_logon_ok {
-  width: 750px;
-  float: left;
-}
-
-#news_board {
-  min-width: 530px;
-}
-
-#right_column_logon_ok {
-  width: 350px;
-  float: right;
-  margin-right: 20px;
-}
-
-#clippy_head_title {
-  font-weight: bold;
-  background: #80ab51;
-  color: #ffffff;
-  margin-top: -15px;
-  margin-left: -15px;
-  margin-right: -15px;
-  padding: 5px;
-  margin-bottom: 10px;
-  border-top-left-radius: 2px;
-  border-top-right-radius: 2px;
-}
-
-#dialog-double_auth-container {
-  width: 100%;
-  text-align: center;
-  vertical-align: middle;
-}
-
-.center_align {
-  text-align: center;
-}
-
-.left_align {
-  text-align: left;
-}
-
-.status_tactical {
-  width: 100%;
-  margin-left: auto;
-  margin-right: auto;
-  background-color: #fff;
-  padding: 10px;
-  border: 1px solid #e2e2e2;
-  margin-top: 5%;
-  text-align: left;
-}
-
-.status_tactical img {
-  border: 3px solid #000;
-  border-radius: 100px;
-}
-
-#sumary {
-  color: #fff;
-  margin: 15px;
-  padding: 10px 30px;
-  font-size: 20px;
-  font-weight: bold;
-  height: 66px;
-  width: 191px;
-  border-radius: 2px;
-}
-
-.databox.data td {
-  border-bottom: 1px solid #e2e2e2;
-}
-
-.databox .search {
-  margin-top: 0px;
-}
-
-.databox.data td.progress_bar img {
-  border: 3px solid #000;
-  border-radius: 100px;
-}
-
-.databox td {
-  padding-left: 9px;
-  padding-right: 9px;
-  padding-top: 7px;
-  padding-bottom: 7px;
-}
-.databox.pies fieldset.tactical_set {
-  width: 70%;
-  height: 285px;
-}
-
-.difference {
-  border-left-width: 2px;
-  border-left-style: solid;
-  border-right-width: 2px;
-  border-right-style: solid;
-  border-color: #e2e2e2;
-}
-
-#title_menu {
-  color: #fff;
-  float: right;
-  width: 70%;
-  letter-spacing: 0pt;
-  font-size: 8pt;
-  white-space: pre-wrap;
-}
-
-.no_hidden_menu {
-  background-position: 11% 50%;
-}
-
-#menu_tab li.nomn,
-#menu_tab li.nomn_high {
-  background-color: #ececec;
-  padding-right: 3px;
-  padding-left: 3px;
-  font-weight: bold;
-  text-decoration: none;
-  font-size: 14px;
-  border-color: #e2e2e2;
-  border-style: solid;
-  border-width: 1px;
-  margin-top: -10px;
-}
-
-#menu_tab li.nomn_high,
-#menu_tab li.nomn_high span {
-  color: #fff;
-  background-color: #fff;
-}
-
-#menu_tab li.nomn img,
-#menu_tab li img {
-  margin-top: 3px;
-  margin-left: 3px;
-}
-
-#menu_tab li.tab_operation a,
-#menu_tab a.tab_operation {
-  background: none;
-}
-
-.subsubmenu {
-  position: absolute;
-  float: right;
-  z-index: 9999;
-  display: none;
-  margin-top: 6px;
-  left: 0px;
-}
-.subsubmenu li {
-  margin-top: 0px;
-}
-
-.agents_modules_table {
-  border: 1px solid #e2e2e2;
-  border-spacing: 0px;
-}
-.agents_modules_table td {
-  border: 1px solid #e2e2e2;
-}
-.agents_modules_table th {
-  border: 1px solid #e2e2e2;
-}
-
-.databox.filters,
-.databox.data,
-.databox.profile_list {
-  margin-bottom: 20px;
-}
-
-.databox.filters td {
-  padding: 10px;
-  padding-left: 20px;
-}
-.databox.profile_list td {
-  padding: 4px 1px;
-  padding-left: 5px;
-  border-bottom: 1px solid #e2e2e2;
-}
-.databox.profile_list a.tip > img {
-  margin: 0px;
-}
-
-.databox.filters td > img,
-.databox.filters td > div > a > img,
-.databox.filters td > span > img,
-.databox.filters td > span > a > img,
-.databox.filters td > a > img {
-  vertical-align: middle;
-  margin-left: 5px;
-}
-.databox.data td > img,
-.databox.data th > img,
-.databox.data td > div > a > img,
-.databox.data td > span > img,
-.databox.data td > span > a > img,
-.databox.data td > a > img,
-.databox.data td > form > a > img {
-  vertical-align: middle;
-}
-
-.databox.filters td > a > img {
-  vertical-align: middle;
-}
-
-.databox.data td > input[type="checkbox"] {
-  margin: 0px;
-}
-
-.databox_color td {
-  padding-left: 10px;
-}
-
-.databox.agente td > div > canvas {
-  width: 100%;
-  text-align: left;
-}
-.databox.agente td > div.graph {
-  width: 100%;
-  text-align: left;
-}
-
-.godmode,
-.menu_icon ul li {
-  background-color: #222;
-}
-.operation .menu_icon ul li {
-  background-color: #333;
-}
-
-.godmode {
-  border-top: 4px solid;
-  padding-bottom: 4px;
-  border-bottom-right-radius: 5px;
-  border-right-style: solid;
-  border-right-width: 0px;
-}
 
+/* General styles */
 .green_title {
   background-color: #80ab51;
-  font-weight: normal;
-  text-align: center;
 }
 
-.dashboard {
-  top: 23px;
+/* Tabs */
+#menu_tab li.nomn_high,
+#menu_tab li.nomn_high span {
+  box-shadow: inset 0px 4px #80ab51;
 }
 
-.dashboard li a {
-  width: 158px;
-}
-
-.text_subDashboard {
-  float: left;
-  margin-top: 5%;
-  margin-left: 3%;
-}
-
-/* The items with the class 'spinner' will rotate */
-/* Not supported on IE9 and below */
-.spinner {
-  -webkit-animation: spinner 2s infinite linear;
-  animation: spinner 2s infinite linear;
-}
-
-@-webkit-keyframes spinner {
-  0% {
-    -ms-transform: rotate(0deg); /* IE */
-    -moz-transform: rotate(0deg); /* FF */
-    -o-transform: rotate(0deg); /* Opera */
-    -webkit-transform: rotate(0deg); /* Safari and Chrome */
-    transform: rotate(0deg);
-  }
-  100% {
-    -ms-transform: rotate(359deg); /* IE */
-    -moz-transform: rotate(359deg); /* FF */
-    -o-transform: rotate(359deg); /* Opera */
-    -webkit-transform: rotate(359deg); /* Safari and Chrome */
-    transform: rotate(359deg);
-  }
-}
-
-@keyframes spinner {
-  0% {
-    -ms-transform: rotate(0deg); /* IE */
-    -moz-transform: rotate(0deg); /* FF */
-    -o-transform: rotate(0deg); /* Opera */
-    -webkit-transform: rotate(0deg); /* Safari and Chrome */
-    transform: rotate(0deg);
-  }
-  100% {
-    -ms-transform: rotate(359deg); /* IE */
-    -moz-transform: rotate(359deg); /* FF */
-    -o-transform: rotate(359deg); /* Opera */
-    -webkit-transform: rotate(359deg); /* Safari and Chrome */
-    transform: rotate(359deg);
-  }
-}
-
-#alert_messages {
-  -moz-border-bottom-right-radius: 5px;
-  -webkit-border-bottom-left-radius: 5px;
-  border-bottom-right-radius: 5px;
-  border-bottom-left-radius: 5px;
-  z-index: 3;
-  position: fixed;
-  width: 750px;
-  max-width: 750px;
-  min-width: 750px;
-  top: 20%;
-  background: white;
-}
-.modalheader {
-  text-align: center;
-  width: 100%;
-  height: 37px;
-  left: 0px;
-  background-color: #82b92e;
-}
-.modalheadertext {
-  color: white;
-  position: relative;
-  font-family: Nunito;
-  font-size: 13pt;
-  top: 8px;
-}
-.modalclosex {
-  cursor: pointer;
-  display: inline;
-  float: right;
-  margin-right: 10px;
-  margin-top: 10px;
-}
-.modalcontent {
-  color: black;
-  background: white;
-}
-.modalcontentimg {
-  float: left;
-  margin-left: 30px;
-  margin-top: 30px;
-  margin-bottom: 30px;
-}
-.modalcontenttext {
-  float: left;
-  text-align: justify;
-  color: black;
-  font-size: 9.5pt;
-  line-height: 13pt;
-  margin-top: 30px;
-  width: 430px;
-  margin-left: 30px;
-}
-.modalokbutton {
-  cursor: pointer;
-  text-align: center;
-  margin-right: 45px;
-  float: right;
-  -moz-border-radius: 3px;
-  -webkit-border-radius: 3px;
-  margin-bottom: 30px;
-  border-radius: 3px;
-  width: 90px;
-  height: 30px;
-  background-color: white;
-  border: 1px solid #82b92e;
-}
-.modalokbuttontext {
-  color: #82b92e;
-  font-family: Nunito;
-  font-size: 10pt;
-  position: relative;
-  top: 6px;
-}
-.modalgobutton {
-  cursor: pointer;
-  text-align: center;
-  margin-right: 15px;
-  margin-bottom: 30px;
-  float: right;
-  -moz-border-radius: 3px;
-  -webkit-border-radius: 3px;
-  border-radius: 3px;
-  width: 240px;
-  height: 30px;
-  background-color: white;
-  border: 1px solid #82b92e;
-}
-.modalgobuttontext {
-  color: #82b92e;
-  font-family: Nunito;
-  font-size: 10pt;
-  position: relative;
-  top: 6px;
-}
-
-#opacidad {
-  opacity: 0.5;
-  z-index: 1;
-  width: 100%;
-  height: 100%;
-  position: absolute;
-  left: 0px;
-  top: 0px;
-}
-
-.textodialogo {
-  margin-left: 0px;
-  color: #333;
-  padding: 20px;
-  font-size: 9pt;
-}
-
-.cargatextodialogo {
-  max-width: 58.5%;
-  width: 58.5%;
-  min-width: 58.5%;
-  float: left;
-  margin-left: 0px;
-  font-size: 18pt;
-  padding: 20px;
-  text-align: center;
-}
-
-.cargatextodialogo p,
-.cargatextodialogo b,
-.cargatextodialogo a {
-  font-size: 18pt;
-}
-
-#toolbox > input {
-  border-width: 0px 1px 0px 0px;
-  border-color: lightgray;
-}
-
-#toolbox > input.service_min {
-  border-width: 0px 0px 0px 0px;
-}
-
-#toolbox > input.grid_min {
-  border-width: 0px 0px 0px 0px;
-}
-
-#tinymce {
-  padding-top: 20px;
-}
-
-.rowPair:hover,
-.rowOdd:hover {
-  background-color: #eee;
-}
-.databox.data > tbody > tr:hover {
-  background-color: #eee;
-}
-.checkselected {
-  background-color: #eee;
+#menu_tab_frame,
+#menu_tab_frame_view,
+#menu_tab_frame_view_bc {
+  border-bottom: 2px solid #80ab51;
 }
diff --git a/pandora_console/index.php b/pandora_console/index.php
index 58c5998b87..ab41aded18 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -1214,7 +1214,6 @@ echo "\n<!-- Page generated in $run_time seconds -->\n";
 // Values from PHP to be recovered from JAVASCRIPT
 require 'include/php_to_js_values.php';
 
-// if ($config['style'] !== 'pandora') {
 ?>
 
 <script type="text/javascript" language="javascript">

From 51d7104de79d370a462b4452b8ae7b2d15b10a2f Mon Sep 17 00:00:00 2001
From: alejandro-campos <alejandro.campos@artica.es>
Date: Tue, 2 Jul 2019 18:09:52 +0200
Subject: [PATCH 29/83] fix item name macros when using report templates

---
 pandora_console/include/functions_agents.php  |  2 +-
 .../include/functions_reporting.php           | 51 ++++++++++++++++---
 2 files changed, 44 insertions(+), 9 deletions(-)

diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php
index affa4269d4..1ed3c028bd 100644
--- a/pandora_console/include/functions_agents.php
+++ b/pandora_console/include/functions_agents.php
@@ -1531,7 +1531,7 @@ function agents_get_alias($id_agent, $case='none')
         return $cache[$case][$id_agent];
     }
 
-    if ($config['dbconnection_cache'] == null && is_metaconsole()) {
+    if (is_metaconsole()) {
         $alias = (string) db_get_value('alias', 'tmetaconsole_agent', 'id_tagente', (int) $id_agent);
     } else {
         $alias = (string) db_get_value('alias', 'tagente', 'id_agente', (int) $id_agent);
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 00860ac116..46359c1471 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -11488,17 +11488,32 @@ function reporting_label_macro($item, $label)
             }
 
             if (preg_match('/_agentdescription_/', $label)) {
-                $agent_name = agents_get_description($item['id_agent']);
+                if (!is_metaconsole()) {
+                    $agent_name = agents_get_description($item['id_agent']);
+                } else {
+                    $agent_name = $item['agent_description'];
+                }
+
                 $label = str_replace('_agentdescription_', $agent_name, $label);
             }
 
             if (preg_match('/_agentgroup_/', $label)) {
-                $agent_name = groups_get_name(agents_get_agent_group($item['id_agent']), true);
+                if (!is_metaconsole()) {
+                    $agent_name = groups_get_name(agents_get_agent_group($item['id_agent']), true);
+                } else {
+                    $agent_name = $item['agent_group'];
+                }
+
                 $label = str_replace('_agentgroup_', $agent_name, $label);
             }
 
             if (preg_match('/_address_/', $label)) {
-                $agent_name = agents_get_address($item['id_agent']);
+                if (!is_metaconsole()) {
+                    $agent_name = agents_get_address($item['id_agent']);
+                } else {
+                    $agent_name = $item['agent_address'];
+                }
+
                 $label = str_replace('_address_', $agent_name, $label);
             }
         break;
@@ -11537,7 +11552,11 @@ function reporting_label_macro($item, $label)
                 if (count($item['agents']) > 1) {
                     $agent_name = '';
                 } else {
-                    $agent_name = agents_get_description($item['id_agent']);
+                    if (!is_metaconsole()) {
+                        $agent_name = agents_get_description($item['id_agent']);
+                    } else {
+                        $agent_name = $item['agent_description'];
+                    }
                 }
 
                 $label = str_replace('_agentdescription_', $agent_name, $label);
@@ -11547,7 +11566,11 @@ function reporting_label_macro($item, $label)
                 if (count($item['agents']) > 1) {
                     $agent_name = '';
                 } else {
-                    $agent_name = groups_get_name(agents_get_agent_group($item['id_agent']), true);
+                    if (!is_metaconsole()) {
+                        $agent_name = groups_get_name(agents_get_agent_group($item['id_agent']), true);
+                    } else {
+                        $agent_name = $item['agent_group'];
+                    }
                 }
 
                 $label = str_replace('_agentgroup_', $agent_name, $label);
@@ -11557,7 +11580,11 @@ function reporting_label_macro($item, $label)
                 if (count($item['agents']) > 1) {
                     $agent_name = '';
                 } else {
-                    $agent_name = agents_get_address($item['id_agent']);
+                    if (!is_metaconsole()) {
+                        $agent_name = agents_get_address($item['id_agent']);
+                    } else {
+                        $agent_name = $item['agent_address'];
+                    }
                 }
 
                 $label = str_replace('_address_', $agent_name, $label);
@@ -11567,7 +11594,11 @@ function reporting_label_macro($item, $label)
                 if ($item['modules'] > 1) {
                     $module_name = $item['modules'].__(' modules');
                 } else {
-                    $module_name = modules_get_agentmodule_name($item['id_agent_module']);
+                    if (!is_metaconsole()) {
+                        $module_name = modules_get_agentmodule_name($item['id_agent_module']);
+                    } else {
+                        $module_name = $item['module_name'];
+                    }
                 }
 
                 $label = str_replace('_module_', $module_name, $label);
@@ -11577,7 +11608,11 @@ function reporting_label_macro($item, $label)
                 if ($item['modules'] > 1) {
                     $module_description = '';
                 } else {
-                    $module_description = modules_get_agentmodule_descripcion($item['id_agent_module']);
+                    if (!is_metaconsole()) {
+                        $module_description = modules_get_agentmodule_descripcion($item['id_agent_module']);
+                    } else {
+                        $module_description = $item['module_description'];
+                    }
                 }
 
                 $label = str_replace('_moduledescription_', $module_description, $label);

From 3b68964f27a37de0137f95358a8fa17c6f2a1b76 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Wed, 3 Jul 2019 00:01:12 +0200
Subject: [PATCH 30/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 460dd6b7f9..109bc572a4 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190702
+Version: 7.0NG.736-190703
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 90ce64b6d8..5f46072be1 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190702"
+pandora_version="7.0NG.736-190703"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 8e46849482..fd04540106 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190702';
+use constant AGENT_BUILD => '190703';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 62c86be6c3..f9c083395b 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190702
+%define release     190703
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 5c6cebed00..22d9a60423 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190702
+%define release     190703
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 30e9725bda..d1d92af45b 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190702"
+PI_BUILD="190703"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index d202a71b65..072442eca6 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190702}
+{190703}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 658a85c414..b9a8154b96 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190702)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190703)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index a572727e12..4e27f4fd19 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190702))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190703))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index a3e4c8a1ba..a1f366f752 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190702
+Version: 7.0NG.736-190703
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 110cc566c1..2e12856839 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190702"
+pandora_version="7.0NG.736-190703"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index f8ea00a12d..b738586dd4 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190702';
+$build_version = 'PC190703';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 7d57a69f04..e38e5e42e3 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190702';
+            $build = '190703';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index de7f488439..fb85742ba5 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190702
+%define release     190703
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index 176fbd8516..33e40e0760 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190702
+%define release     190703
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index bca3a6cbf9..7764799354 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190702
+%define release     190703
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 0c854c2f61..fc7cfac1aa 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190702
+Version: 7.0NG.736-190703
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index eb73b7b9b4..6fa9f19eba 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190702"
+pandora_version="7.0NG.736-190703"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index c29d7dba62..4b43f35b36 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190702";
+my $pandora_build = "190703";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 3417209015..3d613f8b6b 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190702";
+my $pandora_build = "190703";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index b0bb8af72a..f6c06186e1 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190702
+%define release     190703
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 4f438c4752..6e1d85582a 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190702
+%define release     190703
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 748bd88761..1957c78f86 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190702"
+PI_BUILD="190703"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 25dc343eb2..8e415f4a52 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190702";
+my $version = "7.0NG.736 PS190703";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 3357cf0837..07d06cc368 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190702";
+my $version = "7.0NG.736 PS190703";
 
 # save program name for logging
 my $progname = basename($0);

From c7e410b16daff3720d9fab29477c952a4d3abef6 Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Wed, 3 Jul 2019 11:08:17 +0200
Subject: [PATCH 31/83] Added discovery submenus to main menu - #4203

---
 pandora_console/godmode/menu.php           | 20 +++++++++++++++++---
 pandora_console/include/functions_menu.php |  3 +++
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php
index 14caf1b9cb..09a2aff770 100644
--- a/pandora_console/godmode/menu.php
+++ b/pandora_console/godmode/menu.php
@@ -24,9 +24,23 @@ $menu_godmode['class'] = 'godmode';
 
 if (check_acl($config['id_user'], 0, 'PM')) {
     $sub = [];
-    $sub['godmode/servers/discovery']['text'] = __('Discovery');
-    $sub['godmode/servers/discovery']['id'] = 'Discovery';
-    $sub['godmode/servers/discovery']['subsecs'] = ['godmode/servers/discovery'];
+    $sub['godmode/servers/discovery&wiz=main']['text'] = __('Discovery Main');
+    $sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery';
+
+    $sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list');
+    $sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist';
+
+    $sub['godmode/servers/discovery&wiz=app']['text'] = __('Applications');
+    $sub['godmode/servers/discovery&wiz=app']['id'] = 'app';
+
+    $sub['godmode/servers/discovery&wiz=cloud']['text'] = __('Cloud');
+    $sub['godmode/servers/discovery&wiz=cloud']['id'] = 'cloud';
+
+    $sub['godmode/servers/discovery&wiz=ctask']['text'] = __('Console task');
+    $sub['godmode/servers/discovery&wiz=ctask']['id'] = 'ctask';
+
+    $sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices');
+    $sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd';
 
     // Add to menu.
     $menu_godmode['discovery']['text'] = __('Discovery');
diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php
index 3f8a8cd33b..98191d231f 100644
--- a/pandora_console/include/functions_menu.php
+++ b/pandora_console/include/functions_menu.php
@@ -52,6 +52,9 @@ function menu_print_menu(&$menu)
     $sec2 = (string) get_parameter('sec2');
     if ($sec2 == 'operation/agentes/ver_agente') {
         $sec2 = 'godmode/agentes/configurar_agente';
+    } else if ($sec2 == 'godmode/servers/discovery') {
+        $wiz = (string) get_parameter('wiz');
+        $sec2 = 'godmode/servers/discovery&wiz='.$wiz;
     } else {
         $sec2 = (string) get_parameter('sec2');
     }

From 18d8f90f90503b8a5e672be57c4bad1a1561a139 Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Wed, 3 Jul 2019 16:04:40 +0200
Subject: [PATCH 32/83] Credential store upgrade Azure

---
 pandora_console/godmode/groups/credential_store.php    | 4 ++--
 pandora_console/include/functions_credential_store.php | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pandora_console/godmode/groups/credential_store.php b/pandora_console/godmode/groups/credential_store.php
index 9a822dc986..8c9540d581 100644
--- a/pandora_console/godmode/groups/credential_store.php
+++ b/pandora_console/godmode/groups/credential_store.php
@@ -534,8 +534,8 @@ echo '</div>';
             $('#div-extra_1').hide();
             $('#div-extra_2').hide();
         } else if ($('#product :selected').val() == "AZURE") {
-            $('#div-username label').text('<?php echo __('Account ID'); ?>');
-            $('#div-password label').text('<?php echo __('Password'); ?>');
+            $('#div-username label').text('<?php echo __('Client ID'); ?>');
+            $('#div-password label').text('<?php echo __('Application secret'); ?>');
             $('#div-extra_1 label').text('<?php echo __('Tenant or domain name'); ?>');
             $('#div-extra_2 label').text('<?php echo __('Subscription id'); ?>');
             $('#div-extra_1').show();
diff --git a/pandora_console/include/functions_credential_store.php b/pandora_console/include/functions_credential_store.php
index cf09e6d67b..0293cf9721 100644
--- a/pandora_console/include/functions_credential_store.php
+++ b/pandora_console/include/functions_credential_store.php
@@ -292,8 +292,8 @@ function print_inputs($values=null)
             'script'      => 'calculate_inputs()',
             'fields'      => [
                 // 'CUSTOM' => __('Custom'),
-                'AWS' => __('Aws'),
-                // 'AZURE'  => __('Azure'),
+                'AWS'   => __('Aws'),
+                'AZURE' => __('Azure'),
                 // 'GOOGLE' => __('Google'),
             ],
             'selected'    => $values['product'],
@@ -319,7 +319,7 @@ function print_inputs($values=null)
 
         case 'AZURE':
             $user_label = __('Account ID');
-            $pass_label = __('Password');
+            $pass_label = __('Application secret');
             $extra_1_label = __('Tenant or domain name');
             $extra_2_label = __('Subscription id');
         break;

From 07edee619a92b7178006b90ab80c9ce4a7cebdc4 Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Wed, 3 Jul 2019 16:38:26 +0200
Subject: [PATCH 33/83] CS filtering and constant

---
 pandora_console/include/constants.php                  | 1 +
 pandora_console/include/functions_credential_store.php | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php
index 69e867bb40..c5cce5d347 100644
--- a/pandora_console/include/constants.php
+++ b/pandora_console/include/constants.php
@@ -602,6 +602,7 @@ define('DISCOVERY_SCRIPT_IPAM_RECON', 3);
 define('DISCOVERY_SCRIPT_IPMI_RECON', 4);
 
 // Discovery task descriptions.
+define('CLOUDWIZARD_AZURE_DESCRIPTION', 'Discovery.Cloud.Azure.Compute');
 define('CLOUDWIZARD_AWS_DESCRIPTION', 'Discovery.Cloud.AWS.EC2');
 define('CLOUDWIZARD_VMWARE_DESCRIPTION', 'Discovery.App.VMware');
 
diff --git a/pandora_console/include/functions_credential_store.php b/pandora_console/include/functions_credential_store.php
index 0293cf9721..20b643d0b8 100644
--- a/pandora_console/include/functions_credential_store.php
+++ b/pandora_console/include/functions_credential_store.php
@@ -72,6 +72,10 @@ function credentials_get_all(
         throw new Exception('[credential_get_all] Fields must be an array or "count".');
     }
 
+    if (isset($filter['product']) && !empty($filter['product'])) {
+        $sql_filters[] = sprintf(' AND cs.product = "%s"', $filter['product']);
+    }
+
     if (isset($filter['free_search']) && !empty($filter['free_search'])) {
         $sql_filters[] = vsprintf(
             ' AND (lower(cs.username) like lower("%%%s%%")
@@ -163,7 +167,7 @@ function credentials_get_all(
          %s
          %s',
         join(',', $fields),
-        join(',', $sql_filters),
+        join(' ', $sql_filters),
         $order_by,
         $pagination
     );

From 2ad44fcf90274718c24ba956cbd2bea2ff3bee01 Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Wed, 3 Jul 2019 17:07:31 +0200
Subject: [PATCH 34/83] final merge 3360 ticket

---
 pandora_console/include/functions_agents.php         | 8 +++++++-
 pandora_console/include/functions_reporting.php      | 7 ++++---
 pandora_console/include/functions_reporting_html.php | 3 ++-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php
index affa4269d4..5ca9ae3e23 100644
--- a/pandora_console/include/functions_agents.php
+++ b/pandora_console/include/functions_agents.php
@@ -1554,7 +1554,13 @@ function agents_get_alias($id_agent, $case='none')
 
 function agents_get_alias_by_name($name, $case='none')
 {
-    $alias = (string) db_get_value('alias', 'tagente', 'nombre', $name);
+    if (is_metaconsole()) {
+        $table = 'tmetaconsole_agent';
+    } else {
+        $table = 'tagente';
+    }
+
+    $alias = (string) db_get_value('alias', $table, 'nombre', $name);
 
     switch ($case) {
         case 'upper':
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 4261518b68..3a62fab322 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -6969,6 +6969,7 @@ function reporting_general($report, $content)
 
         $mod_name = modules_get_agentmodule_name($row['id_agent_module']);
         $ag_name = modules_get_agentmodule_agent_alias($row['id_agent_module']);
+        $name_agent = modules_get_agentmodule_agent_name($row['id_agent_module']);
         $type_mod = modules_get_last_value($row['id_agent_module']);
         $is_string[$index] = modules_is_string($row['id_agent_module']);
         $unit = db_get_value(
@@ -7043,12 +7044,12 @@ function reporting_general($report, $content)
                 }
 
                 if ($data_res[$index] === false) {
-                    $return['data'][$ag_name][$mod_name] = null;
+                    $return['data'][$name_agent][$mod_name] = null;
                 } else {
                     if (!is_numeric($data_res[$index])) {
-                        $return['data'][$ag_name][$mod_name] = $data_res[$index];
+                        $return['data'][$name_agent][$mod_name] = $data_res[$index];
                     } else {
-                        $return['data'][$ag_name][$mod_name] = format_for_graph($data_res[$index], 2).' '.$unit;
+                        $return['data'][$name_agent][$mod_name] = format_for_graph($data_res[$index], 2).' '.$unit;
                     }
                 }
             break;
diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index c8d5b3e29e..9e6da3a07f 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -3496,7 +3496,8 @@ function reporting_html_general($table, $item, $pdf=0)
                 $table1->head = array_merge([__('Agent')], $list_modules);
                 foreach ($item['data'] as $agent => $modules) {
                     $row = [];
-                    $row['agent'] = $agent;
+                    $alias = agents_get_alias_by_name($agent);
+                    $row['agent'] = $alias;
                     $table1->style['agent'] = 'text-align: center;';
                     foreach ($list_modules as $name) {
                         $table1->style[$name] = 'text-align: center;';

From 22734a4ea29d4289b42403a726bec14ad2438269 Mon Sep 17 00:00:00 2001
From: Daniel Barbero Martin <daniel.barbero@artica.es>
Date: Wed, 3 Jul 2019 17:51:47 +0200
Subject: [PATCH 35/83] WIP failover

---
 pandora_console/extras/mr/30.sql              |   2 +
 .../agentes/module_manager_editor_common.php  | 146 +++++++++++-------
 pandora_console/include/ajax/module.php       |  17 +-
 pandora_console/include/functions_modules.php |   9 +-
 .../include/functions_networkmap.php          |  20 ++-
 .../include/functions_reporting.php           | 108 ++++++++-----
 .../include/functions_reporting_html.php      |   2 +-
 pandora_console/pandoradb.sql                 |   1 +
 .../lib/PandoraFMS/DiscoveryServer.pm         |   2 +-
 .../util/recon_scripts/snmp-recon.pl          |   2 +-
 10 files changed, 200 insertions(+), 109 deletions(-)

diff --git a/pandora_console/extras/mr/30.sql b/pandora_console/extras/mr/30.sql
index 0e37d30c35..2de6e9cc19 100644
--- a/pandora_console/extras/mr/30.sql
+++ b/pandora_console/extras/mr/30.sql
@@ -9,4 +9,6 @@ ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
 ALTER TABLE `treport_content_template` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '1';
 ALTER TABLE `treport_content_template` ADD COLUMN `failover_type` tinyint(1) DEFAULT '1';
 
+ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
+
 COMMIT;
\ No newline at end of file
diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php
index fbdd620f77..f34013944b 100644
--- a/pandora_console/godmode/agentes/module_manager_editor_common.php
+++ b/pandora_console/godmode/agentes/module_manager_editor_common.php
@@ -1101,9 +1101,8 @@ $macro_count++;
 
 html_print_input_hidden('module_macro_count', $macro_count);
 
-/*
-    Advanced form part */
-// Add relationships
+// Advanced form part.
+// Add relationships.
 $table_new_relations = new stdClass();
 $table_new_relations->id = 'module_new_relations';
 $table_new_relations->width = '100%';
@@ -1114,7 +1113,8 @@ $table_new_relations->style[0] = 'width: 10%; font-weight: bold;';
 $table_new_relations->style[1] = 'width: 25%; text-align: center;';
 $table_new_relations->style[2] = 'width: 10%; font-weight: bold;';
 $table_new_relations->style[3] = 'width: 25%; text-align: center;';
-$table_new_relations->style[4] = 'width: 30%; text-align: center;';
+$table_new_relations->style[4] = 'width: 10%; font-weight: bold;';
+$table_new_relations->style[5] = 'width: 25%; text-align: center;';
 
 $table_new_relations->data[0][0] = __('Agent');
 $params = [];
@@ -1128,10 +1128,35 @@ $params['javascript_function_action_after_select_js_call'] = 'change_modules_aut
 $table_new_relations->data[0][1] = ui_print_agent_autocomplete_input($params);
 $table_new_relations->data[0][2] = __('Module');
 $table_new_relations->data[0][3] = "<div id='module_autocomplete'></div>";
-$table_new_relations->data[0][4] = html_print_button(__('Add relationship'), 'add_relation', false, 'javascript: add_new_relation();', 'class="sub add"', true);
-$table_new_relations->data[0][4] .= "&nbsp;&nbsp;<div id='add_relation_status' style='display: inline;'></div>";
 
-// Relationship list
+$array_rel_type = [];
+$array_rel_type['direct'] = __('Direct');
+$array_rel_type['failover'] = __('Failover');
+$table_new_relations->data[0][4] = __('Rel. type');
+$table_new_relations->data[0][5] = html_print_select(
+    $array_rel_type,
+    'relation_type',
+    '',
+    '',
+    '',
+    0,
+    true,
+    false,
+    true,
+    ''
+);
+
+$table_new_relations->data[0][6] = html_print_button(
+    __('Add relationship'),
+    'add_relation',
+    false,
+    'javascript: add_new_relation();',
+    'class="sub add"',
+    true
+);
+$table_new_relations->data[0][6] .= "&nbsp;&nbsp;<div id='add_relation_status' style='display: inline;'></div>";
+
+// Relationship list.
 $table_relations = new stdClass();
 $table_relations->id = 'module_relations';
 $table_relations->width = '100%';
@@ -1141,19 +1166,26 @@ $table_relations->data = [];
 $table_relations->rowstyle = [];
 $table_relations->rowstyle[-1] = 'display: none;';
 $table_relations->style = [];
-$table_relations->style[2] = 'width: 10%; text-align: center;';
 $table_relations->style[3] = 'width: 10%; text-align: center;';
+$table_relations->style[4] = 'width: 10%; text-align: center;';
 
 $table_relations->head[0] = __('Agent');
 $table_relations->head[1] = __('Module');
-$table_relations->head[2] = __('Changes').ui_print_help_tip(__('Activate this to prevent the relation from being updated or deleted'), true);
-$table_relations->head[3] = __('Delete');
+$table_relations->head[2] = __('Type');
+$table_relations->head[3] = __('Changes').ui_print_help_tip(
+    __('Activate this to prevent the relation from being updated or deleted'),
+    true
+);
+$table_relations->head[4] = __('Delete');
 
-// Create an invisible row to use their html to add new rows
+// Create an invisible row to use their html to add new rows.
 $table_relations->data[-1][0] = '';
 $table_relations->data[-1][1] = '';
-$table_relations->data[-1][2] = '<a id="disable_updates_button" class="alpha50" href="">'.html_print_image('images/lock.png', true).'</a>';
-$table_relations->data[-1][3] = '<a id="delete_relation_button" href="">'.html_print_image('images/cross.png', true).'</a>';
+$table_relations->data[-1][2] = '';
+$table_relations->data[-1][3] = '<a id="disable_updates_button" class="alpha50" href="">';
+$table_relations->data[-1][3] .= html_print_image('images/lock.png', true).'</a>';
+$table_relations->data[-1][4] = '<a id="delete_relation_button" href="">';
+$table_relations->data[-1][4] .= html_print_image('images/cross.png', true).'</a>';
 
 $module_relations = modules_get_relations(['id_module' => $id_agent_module]);
 if (!$module_relations) {
@@ -1164,10 +1196,14 @@ $relations_count = 0;
 foreach ($module_relations as $key => $module_relation) {
     if ($module_relation['module_a'] == $id_agent_module) {
         $module_id = $module_relation['module_b'];
-        $agent_id = modules_give_agent_id_from_module_id($module_relation['module_b']);
+        $agent_id = modules_give_agent_id_from_module_id(
+            $module_relation['module_b']
+        );
     } else {
         $module_id = $module_relation['module_a'];
-        $agent_id = modules_give_agent_id_from_module_id($module_relation['module_a']);
+        $agent_id = modules_give_agent_id_from_module_id(
+            $module_relation['module_a']
+        );
     }
 
     $agent_name = ui_print_agent_name($agent_id, true);
@@ -1183,14 +1219,16 @@ foreach ($module_relations as $key => $module_relation) {
         $disabled_update_class = 'alpha50';
     }
 
-    // Agent name
+    // Agent name.
     $table_relations->data[$relations_count][0] = $agent_name;
-    // Module name
+    // Module name.
     $table_relations->data[$relations_count][1] = "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=".$agent_id.'&tab=module&edit_module=1&id_agent_module='.$module_id."'>".ui_print_truncate_text($module_name, 'module_medium', true, true, true, '[&hellip;]').'</a>';
-    // Lock relationship updates
-    $table_relations->data[$relations_count][2] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/lock.png', true).'</a>';
-    // Delete relationship
-    $table_relations->data[$relations_count][3] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/cross.png', true).'</a>';
+    // Type.
+    $table_relations->data[$relations_count][2] = ($module_relation['type'] === 'direct') ? __('Direct') : __('Failover');
+    // Lock relationship updates.
+    $table_relations->data[$relations_count][3] = '<a id="disable_updates_button" class="'.$disabled_update_class.'"href="javascript: change_lock_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/lock.png', true).'</a>';
+    // Delete relationship.
+    $table_relations->data[$relations_count][4] = '<a id="delete_relation_button" href="javascript: delete_relation('.$relations_count.', '.$module_relation['id'].');">'.html_print_image('images/cross.png', true).'</a>';
     $relations_count++;
 }
 
@@ -1198,7 +1236,6 @@ html_print_input_hidden('module_relations_count', $relations_count);
 
 ui_require_jquery_file('json');
 
-
 ?>
 
 <script type="text/javascript">
@@ -1343,8 +1380,6 @@ $(document).ready (function () {
                      'width=800,height=600'
                      );
                    }
-              
-                
             }
             if(type_name_selected == 'web_data' ||
              type_name_selected == 'web_proc' ||
@@ -1365,8 +1400,6 @@ $(document).ready (function () {
                      'width=800,height=600'
                      );
                    }
-              
-                
             }
         }
 
@@ -1386,7 +1419,7 @@ $(document).ready (function () {
             $('#minmax_warning').hide();
             $('#svg_dinamic').hide();
         }
-        
+
         if (type_name_selected.match(/async/) == null) {
             $('#ff_timeout').hide();
             $('#ff_timeout_disable').show();
@@ -1396,16 +1429,16 @@ $(document).ready (function () {
             $('#ff_timeout_disable').hide();
         }
     });
-    
+
     $("#id_module_type").trigger('change');
-    
+
     // Prevent the form submission when the user hits the enter button from the relationship autocomplete inputs
     $("#text-autocomplete_agent_name").keydown(function(event) {
         if(event.keyCode == 13) { // key code 13 is the enter button
             event.preventDefault();
         }
     });
-    
+
     //validate post_process. Change ',' by '.'
     $("#submit-updbutton").click (function () {
         validate_post_process();
@@ -1512,7 +1545,6 @@ function advanced_option_dynamic() {
 
     } else {
         $('.hide_dinamic').show();
-        
     }
 }
 
@@ -1524,11 +1556,9 @@ function change_modules_autocomplete_input () {
     var module_autocomplete = $("#module_autocomplete");
     var load_icon = '<?php html_print_image('images/spinner.gif', false); ?>';
     var error_icon = '<?php html_print_image('images/error_red.png', false); ?>';
-    
     if (!module_autocomplete.hasClass('working')) {
         module_autocomplete.addClass('working');
         module_autocomplete.html(load_icon);
-        
         $.ajax({
             type: "POST",
             url: "ajax.php",
@@ -1563,22 +1593,26 @@ function change_modules_autocomplete_input () {
 
 // Add a new relation
 function add_new_relation () {
-    var module_a_id = parseInt($("#hidden-id_agent_module").val());
-    var module_b_id = parseInt($("#hidden-autocomplete_module_name_hidden").val());
+    var module_a_id = parseInt(
+        $("#hidden-id_agent_module").val()
+    );
+    var module_b_id = parseInt(
+        $("#hidden-autocomplete_module_name_hidden").val()
+    );
     var module_b_name = $("#text-autocomplete_module_name").val();
     var agent_b_name = $("#text-autocomplete_agent_name").val();
+    var relation_type = $("#relation_type").val();
     var hiddenRow = $("#module_relations--1");
     var button = $("#button-add_relation");
     var iconPlaceholder = $("#add_relation_status");
     var load_icon = '<?php html_print_image('images/spinner.gif', false, ['style' => 'vertical-align:middle;']); ?>';
     var suc_icon = '<?php html_print_image('images/ok.png', false, ['style' => 'vertical-align:middle;']); ?>';
     var error_icon = '<?php html_print_image('images/error_red.png', false, ['style' => 'vertical-align:middle;']); ?>';
-    
-    
+
     if (!button.hasClass('working')) {
         button.addClass('working');
         iconPlaceholder.html(load_icon);
-        
+
         $.ajax({
             type: "POST",
             url: "ajax.php",
@@ -1588,7 +1622,8 @@ function add_new_relation () {
                 add_module_relation: true,
                 id_module_a: module_a_id,
                 id_module_b: module_b_id,
-                name_module_b: module_b_name
+                name_module_b: module_b_name,
+                relation_type: relation_type
             },
             success: function (data) {
                 button.removeClass('working');
@@ -1599,29 +1634,30 @@ function add_new_relation () {
                 else {
                     iconPlaceholder.html(suc_icon);
                     setTimeout( function() { iconPlaceholder.html(''); }, 2000);
-                    
+
                     // Add the new row
                     var relationsCount = parseInt($("#hidden-module_relations_count").val());
-                    
+
                     var rowClass = "datos";
                     if (relationsCount % 2 != 0) {
                         rowClass = "datos2";
                     }
-                    
+
                     var rowHTML = '<tr id="module_relations-' + relationsCount + '" class="' + rowClass + '">' +
-                                        '<td id="module_relations-' + relationsCount + '-0"><b>' + agent_b_name + '</b></td>' +
-                                        '<td id="module_relations-' + relationsCount + '-1">' + module_b_name + '</td>' +
-                                        '<td id="module_relations-' + relationsCount + '-2" style="width: 10%; text-align: center;">' +
-                                            '<a id="disable_updates_button" class="alpha50" href="javascript: change_lock_relation(' + relationsCount + ', ' + data + ');">' +
-                                                '<?php echo html_print_image('images/lock.png', true); ?>' +
-                                            '</a>' +
-                                        '</td>' +
-                                        '<td id="module_relations-' + relationsCount + '-3" style="width: 10%; text-align: center;">' +
-                                            '<a id="delete_relation_button" href="javascript: delete_relation(' + relationsCount + ', ' + data +  ');">' +
-                                                '<?php echo html_print_image('images/cross.png', true); ?>' +
-                                            '</a>' +
-                                        '</td>' +
-                                    '</tr>';
+                                    '<td id="module_relations-' + relationsCount + '-0"><b>' + agent_b_name + '</b></td>' +
+                                    '<td id="module_relations-' + relationsCount + '-1">' + module_b_name + '</td>' +
+                                    '<td id="module_relations-' + relationsCount + '-2">' + relation_type + '</td>' +
+                                    '<td id="module_relations-' + relationsCount + '-3" style="width: 10%; text-align: center;">' +
+                                        '<a id="disable_updates_button" class="alpha50" href="javascript: change_lock_relation(' + relationsCount + ', ' + data + ');">' +
+                                            '<?php echo html_print_image('images/lock.png', true); ?>' +
+                                        '</a>' +
+                                    '</td>' +
+                                    '<td id="module_relations-' + relationsCount + '-4" style="width: 10%; text-align: center;">' +
+                                        '<a id="delete_relation_button" href="javascript: delete_relation(' + relationsCount + ', ' + data +  ');">' +
+                                            '<?php echo html_print_image('images/cross.png', true); ?>' +
+                                        '</a>' +
+                                    '</td>' +
+                                '</tr>';
                     $("#module_relations").find("tbody").append(rowHTML);
 
                     $("#hidden-module_relations_count").val(relationsCount + 1);
diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php
index 64192fdedb..09934f7baf 100755
--- a/pandora_console/include/ajax/module.php
+++ b/pandora_console/include/ajax/module.php
@@ -472,11 +472,17 @@ if (check_login()) {
         $result = false;
         $id_module_a = (int) get_parameter('id_module_a');
         $id_module_b = (int) get_parameter('id_module_b');
+        $type = (string) get_parameter('relation_type');
 
         if ($id_module_a < 1) {
             $name_module_a = get_parameter('name_module_a', '');
             if ($name_module_a) {
-                $id_module_a = (int) db_get_value('id_agente_modulo', 'tagente_modulo', 'nombre', $name_module_a);
+                $id_module_a = (int) db_get_value(
+                    'id_agente_modulo',
+                    'tagente_modulo',
+                    'nombre',
+                    $name_module_a
+                );
             } else {
                 echo json_encode($result);
                 return;
@@ -486,7 +492,12 @@ if (check_login()) {
         if ($id_module_b < 1) {
             $name_module_b = get_parameter('name_module_b', '');
             if ($name_module_b) {
-                $id_module_b = (int) db_get_value('id_agente_modulo', 'tagente_modulo', 'nombre', $name_module_b);
+                $id_module_b = (int) db_get_value(
+                    'id_agente_modulo',
+                    'tagente_modulo',
+                    'nombre',
+                    $name_module_b
+                );
             } else {
                 echo json_encode($result);
                 return;
@@ -494,7 +505,7 @@ if (check_login()) {
         }
 
         if ($id_module_a > 0 && $id_module_b > 0) {
-            $result = modules_add_relation($id_module_a, $id_module_b);
+            $result = modules_add_relation($id_module_a, $id_module_b, $type);
         }
 
         echo json_encode($result);
diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php
index 0335e851c9..26c38149d5 100755
--- a/pandora_console/include/functions_modules.php
+++ b/pandora_console/include/functions_modules.php
@@ -2596,7 +2596,7 @@ function modules_get_relations($params=[])
     }
 
     $sql = 'SELECT DISTINCT tmr.id, tmr.module_a, tmr.module_b,
-				tmr.disable_update
+				tmr.disable_update, tmr.type
 			FROM tmodule_relationship tmr,
 				tagente_modulo tam,
 				tagente ta,
@@ -2699,11 +2699,13 @@ function modules_relation_exists($id_module, $id_module_other=false)
 /**
  * Change the 'disabled_update' value of a relation row.
  *
- * @param int Relation id.
+ * @param integer $id_module_a Id agent module a.
+ * @param integer $id_module_b Id agent module b.
+ * @param string  $type        Type direct or failover.
  *
  * @return boolean True if the 'disabled_update' changes to 1, false otherwise.
  */
-function modules_add_relation($id_module_a, $id_module_b)
+function modules_add_relation($id_module_a, $id_module_b, $type='direct')
 {
     $result = false;
 
@@ -2711,6 +2713,7 @@ function modules_add_relation($id_module_a, $id_module_b)
         $values = [
             'module_a' => $id_module_a,
             'module_b' => $id_module_b,
+            'type'     => $type,
         ];
         $result = db_process_sql_insert('tmodule_relationship', $values);
     }
diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php
index ceaabaaadf..e4fb19e814 100644
--- a/pandora_console/include/functions_networkmap.php
+++ b/pandora_console/include/functions_networkmap.php
@@ -450,14 +450,26 @@ function networkmap_generate_dot(
                         $nodes[$node_count] = $module;
                 }
             } else {
-                $have_relations_a = db_get_value('id', 'tmodule_relationship', 'module_a', $module['id_agente_modulo']);
-                $have_relations_b = db_get_value('id', 'tmodule_relationship', 'module_b', $module['id_agente_modulo']);
+                $sql_a = sprintf(
+                    'SELECT id
+                    FROM tmodule_relationship
+                    WHERE module_a = %d AND type = "direct"',
+                    $module['id_agente_modulo']
+                );
+                $sql_b = sprintf(
+                    'SELECT id
+                    FROM tmodule_relationship
+                    WHERE module_b = %d AND type = "direct"',
+                    $module['id_agente_modulo']
+                );
+                $have_relations_a = db_get_value_sql($sql_a);
+                $have_relations_b = db_get_value_sql($sql_b);
 
                 if ($have_relations_a || $have_relations_b) {
-                    // Save node parent information to define edges later
+                    // Save node parent information to define edges later.
                     $parents[$node_count] = $module['parent'] = $agent['id_node'];
 
-                    // Add node
+                    // Add node.
                     $nodes[$node_count] = $module;
                 }
             }
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 62da376a69..410925fd98 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -6463,13 +6463,32 @@ function reporting_availability_graph($report, $content, $pdf=false)
                 }
             }
 
-            if (isset($sla['id_agent_module_failover']) === true
-                && $sla['id_agent_module_failover'] != 0
-            ) {
+            if ($content['failover_mode']) {
                 $sla_failover = [];
                 $sla_failover['primary'] = $sla;
-                $sla_failover['failover'] = $sla;
-                $sla_failover['failover']['id_agent_module'] = $sla['id_agent_module_failover'];
+                if (isset($sla['id_agent_module_failover']) === true
+                    && $sla['id_agent_module_failover'] != 0
+                ) {
+                    $sla_failover['failover'] = $sla;
+                    $sla_failover['failover']['id_agent_module'] = $sla['id_agent_module_failover'];
+                } else {
+                    $sql_relations = sprintf(
+                        'SELECT module_b
+                        FROM tmodule_relationship
+                        WHERE module_a = %d
+                        AND type = "failover"',
+                        $sla['id_agent_module']
+                    );
+                    $relations = db_get_all_rows_sql($sql_relations);
+                    if (isset($relations) === true
+                        && is_array($relations) === true
+                    ) {
+                        foreach ($relations as $key => $value) {
+                            $sla_failover['failover_'.$key] = $sla;
+                            $sla_failover['failover_'.$key]['id_agent_module'] = $value['module_b'];
+                        }
+                    }
+                }
 
                 // For graph slice for module-interval, if not slice=0.
                 $module_interval = modules_get_interval($sla['id_agent_module']);
@@ -6491,7 +6510,8 @@ function reporting_availability_graph($report, $content, $pdf=false)
                             $content,
                             $report['datetime'],
                             $return,
-                            $k_sla
+                            $k_sla,
+                            $pdf
                         );
                     }
 
@@ -6502,40 +6522,42 @@ function reporting_availability_graph($report, $content, $pdf=false)
                     && is_array($data_combined) === true
                     && count($data_combined) > 0
                 ) {
-                    $data_a = [];
-                    $data_a = array_map(
-                        function ($primary, $failover) {
-                            $return_map = [];
-                            if ($primary['date_from'] === $failover['date_from']
-                                && $primary['date_to'] === $failover['date_to']
-                            ) {
-                                if ($primary['sla_fixed'] !== 100
-                                    && $primary['sla_fixed'] < $failover['sla_fixed']
+                    $count_failover = count($data_combined);
+
+                    $data_a = $data_combined[0];
+                    for ($i = 1; $count_failover > $i; $i++) {
+                        $data_a = array_map(
+                            function ($primary, $failover) {
+                                $return_map = [];
+                                if ($primary['date_from'] === $failover['date_from']
+                                    && $primary['date_to'] === $failover['date_to']
                                 ) {
-                                    $primary['time_total'] = $failover['time_total'];
-                                    $primary['time_ok'] = $failover['time_ok'];
-                                    $primary['time_error'] = $failover['time_error'];
-                                    $primary['time_unknown'] = $failover['time_unknown'];
-                                    $primary['time_not_init'] = $failover['time_not_init'];
-                                    $primary['time_downtime'] = $failover['time_downtime'];
-                                    $primary['time_out'] = $failover['time_out'];
-                                    $primary['checks_total'] = $failover['checks_total'];
-                                    $primary['checks_ok'] = $failover['checks_ok'];
-                                    $primary['checks_error'] = $failover['checks_error'];
-                                    $primary['checks_unknown'] = $failover['checks_unknown'];
-                                    $primary['checks_not_init'] = $failover['checks_not_init'];
-                                    $primary['SLA'] = $failover['SLA'];
-                                    $primary['sla_fixed'] = $failover['sla_fixed'];
+                                    if ($primary['time_ok'] < $failover['time_ok']) {
+                                        $primary['time_total'] = $failover['time_total'];
+                                        $primary['time_ok'] = $failover['time_ok'];
+                                        $primary['time_error'] = $failover['time_error'];
+                                        $primary['time_unknown'] = $failover['time_unknown'];
+                                        $primary['time_not_init'] = $failover['time_not_init'];
+                                        $primary['time_downtime'] = $failover['time_downtime'];
+                                        $primary['time_out'] = $failover['time_out'];
+                                        $primary['checks_total'] = $failover['checks_total'];
+                                        $primary['checks_ok'] = $failover['checks_ok'];
+                                        $primary['checks_error'] = $failover['checks_error'];
+                                        $primary['checks_unknown'] = $failover['checks_unknown'];
+                                        $primary['checks_not_init'] = $failover['checks_not_init'];
+                                        $primary['SLA'] = $failover['SLA'];
+                                        $primary['sla_fixed'] = $failover['sla_fixed'];
+                                    }
+
+                                    $return_map = $primary;
                                 }
 
-                                $return_map = $primary;
-                            }
-
-                            return $return_map;
-                        },
-                        $data_combined[0],
-                        $data_combined[1]
-                    );
+                                return $return_map;
+                            },
+                            $data_a,
+                            $data_combined[($i)]
+                        );
+                    }
 
                     $return = prepare_data_for_paint(
                         $sla,
@@ -6543,7 +6565,8 @@ function reporting_availability_graph($report, $content, $pdf=false)
                         $content,
                         $report['datetime'],
                         $return,
-                        'result'
+                        'result',
+                        $pdf
                     );
                 }
             } else {
@@ -6558,7 +6581,8 @@ function reporting_availability_graph($report, $content, $pdf=false)
                     $sla_array,
                     $content,
                     $report['datetime'],
-                    $return
+                    $return,
+                    $pdf
                 );
             }
 
@@ -6790,6 +6814,7 @@ function reporting_get_planned_downtimes_sla($id_agent_module, $datetime, $perio
  * @param integer $datetime  Date.
  * @param array   $return    Array return.
  * @param string  $failover  Type primary, failover, Result.
+ * @param boolean $pdf       Chart pdf mode.
  *
  * @return array Return modify.
  */
@@ -6799,7 +6824,8 @@ function prepare_data_for_paint(
     $content,
     $datetime,
     $return,
-    $failover=''
+    $failover='',
+    $pdf=false
 ) {
     $data = [];
     $alias_agent = modules_get_agentmodule_agent_alias(
@@ -6956,7 +6982,7 @@ function prepare_data_for_paint(
         100,
         $height,
         $urlImage,
-        $ttl,
+        ($pdf) ? 2 : 0,
         $array_result,
         false
     );
diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index e0cc6ff5ad..f576f6ec87 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -3325,7 +3325,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
                     $title .= '<br />'.$chart['module'];
                 break;
 
-                case 'failover':
+                case (preg_match('/failover.*/', $item['data'][$k_chart]['failover']) ? true : false):
                     $title = '<b>'.__('Failover').'</b>';
                     $title .= '<br />'.$chart['agent'];
                     $title .= '<br />'.$chart['module'];
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index 2776a42978..8b2123c66c 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -820,6 +820,7 @@ CREATE TABLE IF NOT EXISTS `tmodule_relationship` (
 	`module_a` int(10) unsigned NOT NULL,
 	`module_b` int(10) unsigned NOT NULL,
 	`disable_update` tinyint(1) unsigned NOT NULL default '0',
+	`type` ENUM('direct', 'failover') DEFAULT 'direct',
 	PRIMARY KEY (`id`),
 	FOREIGN KEY (`module_a`) REFERENCES tagente_modulo(`id_agente_modulo`)
 		ON DELETE CASCADE,
diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
index 80fcbef8d3..51761f5e27 100644
--- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
+++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
@@ -490,7 +490,7 @@ sub PandoraFMS::Recon::Base::connect_agents($$$$$) {
     }
 
     # Connect the modules if they are not already connected.
-    my $connection_id = get_db_value($self->{'dbh'}, 'SELECT id FROM tmodule_relationship WHERE (module_a = ? AND module_b = ?) OR (module_b = ? AND module_a = ?)', $module_id_1, $module_id_2, $module_id_1, $module_id_2);
+    my $connection_id = get_db_value($self->{'dbh'}, 'SELECT id FROM tmodule_relationship WHERE (module_a = ? AND module_b = ? AND `type` = "direct") OR (module_b = ? AND module_a = ? AND `type` = "direct")', $module_id_1, $module_id_2, $module_id_1, $module_id_2);
     if (! defined($connection_id)) {
         db_do($self->{'dbh'}, 'INSERT INTO tmodule_relationship (`module_a`, `module_b`, `id_rt`) VALUES(?, ?, ?)', $module_id_1, $module_id_2, $self->{'task_id'});
     }
diff --git a/pandora_server/util/recon_scripts/snmp-recon.pl b/pandora_server/util/recon_scripts/snmp-recon.pl
index 6bf2d6b709..c7009fd75a 100755
--- a/pandora_server/util/recon_scripts/snmp-recon.pl
+++ b/pandora_server/util/recon_scripts/snmp-recon.pl
@@ -1005,7 +1005,7 @@ sub connect_pandora_agents($$$$) {
 	}
 
 	# Connect the modules if they are not already connected.
-	my $connection_id = get_db_value($DBH, 'SELECT id FROM tmodule_relationship WHERE (module_a = ? AND module_b = ?) OR (module_b = ? AND module_a = ?)', $module_id_1, $module_id_2, $module_id_1, $module_id_2);
+	my $connection_id = get_db_value($DBH, 'SELECT id FROM tmodule_relationship WHERE (module_a = ? AND module_b = ? AND `type` = "direct") OR (module_b = ? AND module_a = ? AND `type` = "direct")', $module_id_1, $module_id_2, $module_id_1, $module_id_2);
 	if (! defined($connection_id)) {
 		db_do($DBH, 'INSERT INTO tmodule_relationship (`module_a`, `module_b`, `id_rt`) VALUES(?, ?, ?)', $module_id_1, $module_id_2, $TASK_ID);
 	}

From f4b8b39704dc85744197773f3e963704b23a4912 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Thu, 4 Jul 2019 00:01:09 +0200
Subject: [PATCH 36/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 109bc572a4..4ca43080d4 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190703
+Version: 7.0NG.736-190704
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 5f46072be1..4d2eb2ad36 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190703"
+pandora_version="7.0NG.736-190704"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index fd04540106..c4b8c9a482 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190703';
+use constant AGENT_BUILD => '190704';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index f9c083395b..9ee7dfac59 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190703
+%define release     190704
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 22d9a60423..0adace638a 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190703
+%define release     190704
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index d1d92af45b..1650743680 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190703"
+PI_BUILD="190704"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 072442eca6..6e9c24fdbf 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190703}
+{190704}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index b9a8154b96..61557bc15a 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190703)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190704)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 4e27f4fd19..6a19940b9b 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190703))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190704))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index a1f366f752..2f4cba40c0 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190703
+Version: 7.0NG.736-190704
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 2e12856839..9e607576dc 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190703"
+pandora_version="7.0NG.736-190704"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index b738586dd4..4868483266 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190703';
+$build_version = 'PC190704';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index e38e5e42e3..56db55110d 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190703';
+            $build = '190704';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index fb85742ba5..ff81470ae0 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190703
+%define release     190704
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index 33e40e0760..c09eda58ab 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190703
+%define release     190704
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 7764799354..28a95eacbd 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190703
+%define release     190704
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index fc7cfac1aa..2a05b4dae3 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190703
+Version: 7.0NG.736-190704
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 6fa9f19eba..a9a826bd85 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190703"
+pandora_version="7.0NG.736-190704"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 4b43f35b36..c8f661a379 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190703";
+my $pandora_build = "190704";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 3d613f8b6b..f3c5fab2e4 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190703";
+my $pandora_build = "190704";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index f6c06186e1..bd2c15d77d 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190703
+%define release     190704
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 6e1d85582a..ce2fc59451 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190703
+%define release     190704
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 1957c78f86..1de14abf9f 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190703"
+PI_BUILD="190704"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 8e415f4a52..9fa9ef2dfc 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190703";
+my $version = "7.0NG.736 PS190704";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 07d06cc368..5eae88d3e8 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190703";
+my $version = "7.0NG.736 PS190704";
 
 # save program name for logging
 my $progname = basename($0);

From c25b7155faffceb9819304d2879ae36e2d9958ff Mon Sep 17 00:00:00 2001
From: Daniel Barbero Martin <daniel.barbero@artica.es>
Date: Thu, 4 Jul 2019 11:17:12 +0200
Subject: [PATCH 37/83] WIP failover

---
 .../include/functions_reporting_html.php      | 170 +++++++++---------
 1 file changed, 87 insertions(+), 83 deletions(-)

diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index f576f6ec87..ecb57d97e4 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -3252,59 +3252,42 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
 
     $tables_chart = '';
 
-    foreach ($item['charts'] as $k_chart => $chart) {
-        $checks_resume = '';
-        $sla_value = '';
-        if (reporting_sla_is_not_init_from_array($chart)) {
-            $color = COL_NOTINIT;
-            $sla_value = __('Not init');
-        } else if (reporting_sla_is_ignored_from_array($chart)) {
-            $color = COL_IGNORED;
-            $sla_value = __('No data');
-        } else {
-            switch ($chart['sla_status']) {
-                case REPORT_STATUS_ERR:
-                    $color = COL_CRITICAL;
-                break;
+    if (isset($item['failed']) === true && empty($item['failed']) === false) {
+        $tables_chart .= $item['failed'];
+    } else {
+        foreach ($item['charts'] as $k_chart => $chart) {
+            $checks_resume = '';
+            $sla_value = '';
+            if (reporting_sla_is_not_init_from_array($chart)) {
+                $color = COL_NOTINIT;
+                $sla_value = __('Not init');
+            } else if (reporting_sla_is_ignored_from_array($chart)) {
+                $color = COL_IGNORED;
+                $sla_value = __('No data');
+            } else {
+                switch ($chart['sla_status']) {
+                    case REPORT_STATUS_ERR:
+                        $color = COL_CRITICAL;
+                    break;
 
-                case REPORT_STATUS_OK:
-                    $color = COL_NORMAL;
-                break;
+                    case REPORT_STATUS_OK:
+                        $color = COL_NORMAL;
+                    break;
 
-                default:
-                    $color = COL_UNKNOWN;
-                break;
+                    default:
+                        $color = COL_UNKNOWN;
+                    break;
+                }
+
+                $sla_value = sla_truncate(
+                    $chart['sla_value'],
+                    $config['graph_precision']
+                ).'%';
+                $checks_resume = '('.$chart['checks_ok'].'/'.$chart['checks_total'].')';
             }
 
-            $sla_value = sla_truncate(
-                $chart['sla_value'],
-                $config['graph_precision']
-            ).'%';
-            $checks_resume = '('.$chart['checks_ok'].'/'.$chart['checks_total'].')';
-        }
-
-        // Check failover availability report.
-        if ($item['data'][$k_chart]['failover'] === '') {
-            $table1 = new stdClass();
-            $table1->width = '99%';
-            $table1->data = [];
-            $table1->size = [];
-            $table1->size[0] = '10%';
-            $table1->size[1] = '80%';
-            $table1->size[2] = '5%';
-            $table1->size[3] = '5%';
-            $table1->data[0][0] = $chart['agent'].'<br />'.$chart['module'];
-            $table1->data[0][1] = $chart['chart'];
-            $table1->data[0][2] = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
-            $table1->data[0][3] = $checks_resume;
-            $tables_chart .= html_print_table(
-                $table1,
-                true
-            );
-        } else {
-            if ($item['data'][$k_chart]['failover'] === 'primary'
-                || $item['failover_type'] == REPORT_FAILOVER_TYPE_SIMPLE
-            ) {
+            // Check failover availability report.
+            if ($item['data'][$k_chart]['failover'] === '') {
                 $table1 = new stdClass();
                 $table1->width = '99%';
                 $table1->data = [];
@@ -3313,44 +3296,65 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
                 $table1->size[1] = '80%';
                 $table1->size[2] = '5%';
                 $table1->size[3] = '5%';
-            }
-
-            $title = '';
-            $checks_resume_text = $checks_resume;
-            $sla_value_text = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
-            switch ($item['data'][$k_chart]['failover']) {
-                case 'primary':
-                    $title = '<b>'.__('Primary').'</b>';
-                    $title .= '<br />'.$chart['agent'];
-                    $title .= '<br />'.$chart['module'];
-                break;
-
-                case (preg_match('/failover.*/', $item['data'][$k_chart]['failover']) ? true : false):
-                    $title = '<b>'.__('Failover').'</b>';
-                    $title .= '<br />'.$chart['agent'];
-                    $title .= '<br />'.$chart['module'];
-                break;
-
-                case 'result':
-                default:
-                    $title = '<b>'.__('Result').'</b>';
-                    $sla_value_text = "<span style = 'font: bold 3em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
-                    $checks_resume_text = '<span style = "font-size: 12pt;">';
-                    $checks_resume_text .= $checks_resume;
-                    $checks_resume_text .= '</span>';
-                break;
-            }
-
-            $table1->data[$item['data'][$k_chart]['failover']][0] = $title;
-            $table1->data[$item['data'][$k_chart]['failover']][1] = $chart['chart'];
-            $table1->data[$item['data'][$k_chart]['failover']][2] = $sla_value_text;
-            $table1->data[$item['data'][$k_chart]['failover']][3] = $checks_resume_text;
-
-            if ($item['data'][$k_chart]['failover'] === 'result') {
+                $table1->data[0][0] = $chart['agent'].'<br />'.$chart['module'];
+                $table1->data[0][1] = $chart['chart'];
+                $table1->data[0][2] = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
+                $table1->data[0][3] = $checks_resume;
                 $tables_chart .= html_print_table(
                     $table1,
                     true
                 );
+            } else {
+                if ($item['data'][$k_chart]['failover'] === 'primary'
+                    || $item['failover_type'] == REPORT_FAILOVER_TYPE_SIMPLE
+                ) {
+                    $table1 = new stdClass();
+                    $table1->width = '99%';
+                    $table1->data = [];
+                    $table1->size = [];
+                    $table1->size[0] = '10%';
+                    $table1->size[1] = '80%';
+                    $table1->size[2] = '5%';
+                    $table1->size[3] = '5%';
+                }
+
+                $title = '';
+                $checks_resume_text = $checks_resume;
+                $sla_value_text = "<span style = 'font: bold 2em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
+                switch ($item['data'][$k_chart]['failover']) {
+                    case 'primary':
+                        $title = '<b>'.__('Primary').'</b>';
+                        $title .= '<br />'.$chart['agent'];
+                        $title .= '<br />'.$chart['module'];
+                    break;
+
+                    case (preg_match('/failover.*/', $item['data'][$k_chart]['failover']) ? true : false):
+                        $title = '<b>'.__('Failover').'</b>';
+                        $title .= '<br />'.$chart['agent'];
+                        $title .= '<br />'.$chart['module'];
+                    break;
+
+                    case 'result':
+                    default:
+                        $title = '<b>'.__('Result').'</b>';
+                        $sla_value_text = "<span style = 'font: bold 3em Arial, Sans-serif; color: ".$color."'>".$sla_value.'</span>';
+                        $checks_resume_text = '<span style = "font-size: 12pt;">';
+                        $checks_resume_text .= $checks_resume;
+                        $checks_resume_text .= '</span>';
+                    break;
+                }
+
+                $table1->data[$item['data'][$k_chart]['failover']][0] = $title;
+                $table1->data[$item['data'][$k_chart]['failover']][1] = $chart['chart'];
+                $table1->data[$item['data'][$k_chart]['failover']][2] = $sla_value_text;
+                $table1->data[$item['data'][$k_chart]['failover']][3] = $checks_resume_text;
+
+                if ($item['data'][$k_chart]['failover'] === 'result') {
+                    $tables_chart .= html_print_table(
+                        $table1,
+                        true
+                    );
+                }
             }
         }
     }

From 000cdfdcfd5c382cba5c58cc71a25d61eb4cf549 Mon Sep 17 00:00:00 2001
From: Daniel Barbero Martin <daniel.barbero@artica.es>
Date: Thu, 4 Jul 2019 12:09:08 +0200
Subject: [PATCH 38/83] WIP failover

---
 pandora_console/extras/mr/30.sql                              | 1 -
 pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 +-
 pandora_console/include/ajax/reporting.ajax.php               | 2 --
 pandora_console/pandoradb.sql                                 | 1 -
 4 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/pandora_console/extras/mr/30.sql b/pandora_console/extras/mr/30.sql
index 2de6e9cc19..eeb3b8d797 100644
--- a/pandora_console/extras/mr/30.sql
+++ b/pandora_console/extras/mr/30.sql
@@ -1,7 +1,6 @@
 START TRANSACTION;
 
 ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL;
-ALTER TABLE `treport_content_sla_combined` ADD `id_server_failover` int(10) unsigned NOT NULL;
 
 ALTER TABLE `treport_content` ADD COLUMN `failover_mode` tinyint(1) DEFAULT '0';
 ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
index 4404ee826d..60e19998e8 100644
--- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
+++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql
@@ -1451,6 +1451,7 @@ ALTER TABLE `treport_content` ADD COLUMN `failover_type` tinyint(1) DEFAULT '0';
 -- Table `tmodule_relationship`
 -- ---------------------------------------------------------------------
 ALTER TABLE tmodule_relationship ADD COLUMN `id_server` varchar(100) NOT NULL DEFAULT '';
+ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') DEFAULT 'direct';
 
 -- ---------------------------------------------------------------------
 -- Table `tpolicy_module`
@@ -2218,4 +2219,3 @@ CREATE TABLE IF NOT EXISTS `tcredential_store` (
 -- Table `treport_content_sla_combined`
 -- ---------------------------------------------------------------------
 ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL;
-ALTER TABLE `treport_content_sla_combined` ADD `id_server_failover` int(10) unsigned NOT NULL;
diff --git a/pandora_console/include/ajax/reporting.ajax.php b/pandora_console/include/ajax/reporting.ajax.php
index fa87ad72e0..dec331b6ef 100755
--- a/pandora_console/include/ajax/reporting.ajax.php
+++ b/pandora_console/include/ajax/reporting.ajax.php
@@ -66,7 +66,6 @@ if ($add_sla) {
     $sla_min = get_parameter('sla_min', 0);
     $server_id = (int) get_parameter('server_id', 0);
     $id_module_failover = (int) get_parameter('id_module_failover', 0);
-    $id_server_failover = (int) get_parameter('id_server_failover', 0);
 
     $id_service = (int) get_parameter('id_service');
     if (empty($id_module) && !empty($id_service)) {
@@ -94,7 +93,6 @@ if ($add_sla) {
             'sla_min'                  => $sla_min,
             'sla_limit'                => $sla_limit,
             'server_name'              => $connection['server_name'],
-            'id_server_failover'       => $id_server_failover,
         ]
     );
 
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index 8b2123c66c..95d6caadfd 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -1468,7 +1468,6 @@ CREATE TABLE IF NOT EXISTS `treport_content_sla_combined` (
 	`id_report_content` INTEGER UNSIGNED NOT NULL,
 	`id_agent_module` int(10) unsigned NOT NULL,
 	`id_agent_module_failover` int(10) unsigned NOT NULL,
-	`id_server_failover` int(10) unsigned NOT NULL default 0,
 	`sla_max` double(18,2) NOT NULL default 0,
 	`sla_min` double(18,2) NOT NULL default 0,
 	`sla_limit` double(18,2) NOT NULL default 0,

From a10945d2096489a560ae78487753809e6653026f Mon Sep 17 00:00:00 2001
From: alejandro-campos <alejandro.campos@artica.es>
Date: Thu, 4 Jul 2019 18:33:12 +0200
Subject: [PATCH 39/83] fix bug in api function that removes an agent from a
 policy

---
 pandora_console/include/functions_api.php | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php
index 0569319a29..899add9ec0 100644
--- a/pandora_console/include/functions_api.php
+++ b/pandora_console/include/functions_api.php
@@ -15059,17 +15059,18 @@ function remove_agent_from_policy($id_policy, $use_agent_name, $params)
     if (is_metaconsole()) {
         if ($use_agent_name === false) {
             $id_node = $params[1];
-            $id_agent = db_get_value_filter('id_agente', 'tmetaconsole_agent', ['id_tagente' => $params[0], 'id_tmetaconsole_setup' => $id_node]);
+            $id_agent = $params[0];
         } else {
-            $id_agent = db_get_value_filter('id_agente', 'tmetaconsole_agent', ['nombre' => $params[0]]);
+            $id_node = db_get_value_filter('id_tmetaconsole_setup', 'tmetaconsole_agent', ['nombre' => $params[0]]);
+            $id_agent = db_get_value_filter('id_tagente', 'tmetaconsole_agent', ['nombre' => $params[0]]);
         }
 
-        $agent = db_get_row_filter('tmetaconsole_agent', ['id_agente' => $id_agent]);
+        $agent = db_get_row_filter('tmetaconsole_agent', ['id_tagente' => $id_agent, 'id_tmetaconsole_setup' => $id_node]);
     }
 
     $policy = policies_get_policy($id_policy, false, false);
 
-    $policy_agent = db_get_row_filter('tpolicy_agents', ['id_policy' => $id_policy, 'id_agent' => $id_agent]);
+    $policy_agent = (is_metaconsole()) ? db_get_row_filter('tpolicy_agents', ['id_policy' => $id_policy, 'id_agent' => $id_agent, 'id_node' => $id_node]) : db_get_row_filter('tpolicy_agents', ['id_policy' => $id_policy, 'id_agent' => $id_agent]);
 
     if (empty($policy)) {
         returnError('error_policy', __('This policy does not exist.'));

From 0e3fd848f7e1e5a66ba670058c278ef4d1bcea85 Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Thu, 4 Jul 2019 19:34:03 +0200
Subject: [PATCH 40/83] minor fixes and visual change in azure credentials

---
 pandora_console/include/constants.php                  | 1 +
 pandora_console/include/functions_credential_store.php | 4 ++--
 pandora_console/operation/agentes/ver_agente.php       | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php
index c5cce5d347..7e44f1c080 100644
--- a/pandora_console/include/constants.php
+++ b/pandora_console/include/constants.php
@@ -590,6 +590,7 @@ define('DISCOVERY_APP_MYSQL', 4);
 define('DISCOVERY_APP_ORACLE', 5);
 define('DISCOVERY_CLOUD_AWS_EC2', 6);
 define('DISCOVERY_CLOUD_AWS_RDS', 7);
+define('DISCOVERY_CLOUD_AZURE_COMPUTE', 8);
 
 
 // Discovery types matching definition.
diff --git a/pandora_console/include/functions_credential_store.php b/pandora_console/include/functions_credential_store.php
index 20b643d0b8..eaf756f7b1 100644
--- a/pandora_console/include/functions_credential_store.php
+++ b/pandora_console/include/functions_credential_store.php
@@ -362,7 +362,7 @@ function print_inputs($values=null)
                 'label'       => $extra_1_label,
                 'name'        => 'extra_1',
                 'input_class' => 'flex-row',
-                'type'        => 'password',
+                'type'        => 'text',
                 'value'       => $values['extra_1'],
                 'return'      => true,
             ]
@@ -375,7 +375,7 @@ function print_inputs($values=null)
                 'label'       => $extra_2_label,
                 'name'        => 'extra_2',
                 'input_class' => 'flex-row',
-                'type'        => 'password',
+                'type'        => 'text',
                 'value'       => $values['extra_2'],
                 'return'      => true,
                 'display'     => $extra2,
diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php
index b9b2a2128d..b625595930 100644
--- a/pandora_console/operation/agentes/ver_agente.php
+++ b/pandora_console/operation/agentes/ver_agente.php
@@ -70,7 +70,7 @@ if (is_ajax()) {
         if ($id_agente > 0) {
             $last_contact = db_get_value_sql(
                 sprintf(
-                    'SELECT intervalo - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto > ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto)))
+                    'SELECT format(intervalo,2) - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto > ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto))) as "val"
                      FROM `tagente`
                      WHERE id_agente = %d ',
                     $id_agente

From 8229f634e0e85e5a7b00218cf119236050faf7a4 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Fri, 5 Jul 2019 00:01:09 +0200
Subject: [PATCH 41/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 4ca43080d4..531a41e5b3 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190704
+Version: 7.0NG.736-190705
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 4d2eb2ad36..98fdaa992f 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190704"
+pandora_version="7.0NG.736-190705"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index c4b8c9a482..1e03cfa248 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190704';
+use constant AGENT_BUILD => '190705';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 9ee7dfac59..1e03c24394 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190704
+%define release     190705
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 0adace638a..ac8a594450 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190704
+%define release     190705
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 1650743680..1fc0ed921c 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190704"
+PI_BUILD="190705"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 6e9c24fdbf..32836deca7 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190704}
+{190705}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 61557bc15a..02d9a63209 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190704)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190705)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 6a19940b9b..8ecffd52ee 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190704))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190705))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 2f4cba40c0..5e6512722a 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190704
+Version: 7.0NG.736-190705
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 9e607576dc..d6f3b6da50 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190704"
+pandora_version="7.0NG.736-190705"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 4868483266..62812d314c 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190704';
+$build_version = 'PC190705';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 56db55110d..00e176f42c 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190704';
+            $build = '190705';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index ff81470ae0..d3011eb849 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190704
+%define release     190705
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index c09eda58ab..e841ce2f51 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190704
+%define release     190705
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 28a95eacbd..1ee39cb54d 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190704
+%define release     190705
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 2a05b4dae3..8f86f67614 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190704
+Version: 7.0NG.736-190705
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index a9a826bd85..8a1a1c87fd 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190704"
+pandora_version="7.0NG.736-190705"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index c8f661a379..c46b9e894f 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190704";
+my $pandora_build = "190705";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index f3c5fab2e4..2291610e57 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190704";
+my $pandora_build = "190705";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index bd2c15d77d..b2e81b4c72 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190704
+%define release     190705
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index ce2fc59451..a31db9b0c4 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190704
+%define release     190705
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 1de14abf9f..39391e9339 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190704"
+PI_BUILD="190705"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 9fa9ef2dfc..fa0822b985 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190704";
+my $version = "7.0NG.736 PS190705";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 5eae88d3e8..be30e449dc 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190704";
+my $version = "7.0NG.736 PS190705";
 
 # save program name for logging
 my $progname = basename($0);

From 7175d716f032dde6da6178afa70c317025244c7c Mon Sep 17 00:00:00 2001
From: Daniel Barbero <daniel.barbero@artica.es>
Date: Fri, 5 Jul 2019 10:32:10 +0200
Subject: [PATCH 42/83] fixed translate

---
 .../godmode/reporting/reporting_builder.item_editor.php         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
index b269b153d5..ff8ca88e40 100755
--- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php
+++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php
@@ -2617,7 +2617,7 @@ $class = 'databox filters';
             <td style="font-weight:bold;">
             <?php
             echo __('Failover mode').ui_print_help_tip(
-                __('XXX.'),
+                __('SLA calculation must be performed taking into account the failover modules assigned to the primary module'),
                 true
             );
             ?>

From 6e7dfb38fd0482db0314b0cd230ee0f4173f0fc3 Mon Sep 17 00:00:00 2001
From: Daniel Barbero <daniel.barbero@artica.es>
Date: Fri, 5 Jul 2019 13:46:48 +0200
Subject: [PATCH 43/83] fixed error network component plugin

---
 .../manage_network_components_form_plugin.php | 63 +++++++++++-----
 .../include/javascript/pandora_modules.js     | 74 ++++++++++++++-----
 2 files changed, 100 insertions(+), 37 deletions(-)

diff --git a/pandora_console/godmode/modules/manage_network_components_form_plugin.php b/pandora_console/godmode/modules/manage_network_components_form_plugin.php
index 19d3c45e8f..94ce00892e 100755
--- a/pandora_console/godmode/modules/manage_network_components_form_plugin.php
+++ b/pandora_console/godmode/modules/manage_network_components_form_plugin.php
@@ -1,17 +1,32 @@
 <?php
+/**
+ * Extension to manage a list of gateways and the node address where they should
+ * point to.
+ *
+ * @category   Network components Plugins
+ * @package    Pandora FMS
+ * @subpackage Community
+ * @version    1.0.0
+ * @license    See below
+ *
+ *    ______                 ___                    _______ _______ ________
+ *   |   __ \.-----.--.--.--|  |.-----.----.-----. |    ___|   |   |     __|
+ *  |    __/|  _  |     |  _  ||  _  |   _|  _  | |    ___|       |__     |
+ * |___|   |___._|__|__|_____||_____|__| |___._| |___|   |__|_|__|_______|
+ *
+ * ============================================================================
+ * Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
+ * Please see http://pandorafms.org for full contribution list
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation for version 2.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * ============================================================================
+ */
 
-// Pandora FMS - http://pandorafms.com
-// ==================================================
-// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
-// Please see http://pandorafms.org for full contribution list
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation for version 2.
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// Load global variables
 global $config;
 
 check_login();
@@ -29,7 +44,7 @@ $data[1] = html_print_select_from_sql(
     false,
     false
 );
-// Store the macros in base64 into a hidden control to move between pages
+// Store the macros in base64 into a hidden control to move between pages.
 $data[1] .= html_print_input_hidden('macros', base64_encode($macros), true);
 $data[2] = __('Post process');
 $data[3] = html_print_extended_select_for_post_process(
@@ -46,7 +61,7 @@ $data[3] = html_print_extended_select_for_post_process(
 
 push_table_row($data, 'plugin_1');
 
-// A hidden "model row" to clone it from javascript to add fields dynamicly
+// A hidden "model row" to clone it from javascript to add fields dynamicly.
 $data = [];
 $data[0] = 'macro_desc';
 $data[0] .= ui_print_help_tip('macro_help', true);
@@ -56,7 +71,7 @@ $table->rowstyle['macro_field'] = 'display:none';
 
 push_table_row($data, 'macro_field');
 
-// If there are $macros, we create the form fields
+// If there are $macros, we create the form fields.
 if (!empty($macros)) {
     $macros = json_decode($macros, true);
 
@@ -68,9 +83,23 @@ if (!empty($macros)) {
         }
 
         if ($m['hide'] == 1) {
-            $data[1] = html_print_input_text($m['macro'], $m['value'], '', 100, 1024, true);
+            $data[1] = html_print_input_text(
+                $m['macro'],
+                io_output_password($m['value']),
+                '',
+                100,
+                1024,
+                true
+            );
         } else {
-            $data[1] = html_print_input_text($m['macro'], io_output_password($m['value']), '', 100, 1024, true);
+            $data[1] = html_print_input_text(
+                $m['macro'],
+                $m['value'],
+                '',
+                100,
+                1024,
+                true
+            );
         }
 
         $table->colspan['macro'.$m['macro']][1] = 3;
diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js
index 049bb9e96b..1d5c804289 100644
--- a/pandora_console/include/javascript/pandora_modules.js
+++ b/pandora_console/include/javascript/pandora_modules.js
@@ -791,7 +791,7 @@ function new_macro(prefix, callback) {
   }
 }
 
-function add_macro_field(macro, row_model_id) {
+function add_macro_field(macro, row_model_id, type_copy) {
   var macro_desc = macro["desc"];
   // Change the carriage returns by html returns <br> in help
   var macro_help = macro["help"].replace(/&#x0d;/g, "<br>");
@@ -850,16 +850,31 @@ function add_macro_field(macro, row_model_id) {
   }
 
   // Change the text box id and value
-  $("#" + row_id)
-    .children()
-    .eq(1)
-    .attr("id", "text-" + macro_macro);
-  $("#" + row_id)
-    .children()
-    .eq(1)
-    .attr("name", macro_macro);
+  if (type_copy == "td") {
+    $("#" + row_id)
+      .children()
+      .eq(1)
+      .children()
+      .eq(0)
+      .attr("id", "text-" + macro_macro);
+    $("#" + row_id)
+      .children()
+      .eq(1)
+      .children()
+      .eq(0)
+      .attr("name", macro_macro);
+  } else {
+    $("#" + row_id)
+      .children()
+      .eq(1)
+      .attr("id", "text-" + macro_macro);
+    $("#" + row_id)
+      .children()
+      .eq(1)
+      .attr("name", macro_macro);
+  }
 
-  macro_field_hide = false;
+  var macro_field_hide = false;
   if (typeof macro["hide"] == "string") {
     if (macro["hide"].length == 0) {
       macro_field_hide = false;
@@ -872,16 +887,35 @@ function add_macro_field(macro, row_model_id) {
     }
   }
 
-  if (macro_field_hide) {
-    $("#" + row_id)
-      .children()
-      .eq(1)
-      .attr("type", "password");
+  if (type_copy == "td") {
+    if (macro_field_hide) {
+      $("#" + row_id)
+        .children()
+        .eq(1)
+        .children()
+        .eq(0)
+        .attr("type", "password");
+    } else {
+      $("#" + row_id)
+        .children()
+        .eq(1)
+        .children()
+        .eq(0)
+        .val(macro_value);
+    }
+  } else {
+    if (macro_field_hide) {
+      $("#" + row_id)
+        .children()
+        .eq(1)
+        .attr("type", "password");
+    } else {
+      $("#" + row_id)
+        .children()
+        .eq(1)
+        .val(macro_value);
+    }
   }
-  $("#" + row_id)
-    .children()
-    .eq(1)
-    .val(macro_value);
 
   $("#" + row_id).show();
 }
@@ -908,7 +942,7 @@ function load_plugin_macros_fields(row_model_id) {
         $("#hidden-macros").val(data["base64"]);
         jQuery.each(data["array"], function(i, macro) {
           if (macro["desc"] != "") {
-            add_macro_field(macro, row_model_id);
+            add_macro_field(macro, row_model_id, "td");
           }
         });
         //Plugin text can be larger

From d1bc6cc2ffd83b98fe40b71032a056f92464b20d Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Fri, 5 Jul 2019 13:59:48 +0200
Subject: [PATCH 44/83] Created green theme - #4194

---
 .../include/graphs/functions_d3.php           |   2 +-
 .../include/styles/pandora_black.css          |  38 ++++
 .../include/styles/pandora_green_old.css      | 185 +++++++++++++-----
 3 files changed, 173 insertions(+), 52 deletions(-)

diff --git a/pandora_console/include/graphs/functions_d3.php b/pandora_console/include/graphs/functions_d3.php
index e3962bf729..fea1273015 100644
--- a/pandora_console/include/graphs/functions_d3.php
+++ b/pandora_console/include/graphs/functions_d3.php
@@ -770,7 +770,7 @@ function print_donut_narrow_graph(
 
         default:
             $textColor = '#000';
-            $strokeColor = 'transparent';
+            $strokeColor = '#fff';
         break;
     }
 
diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css
index 2fcee7b2ae..a94dcf468c 100644
--- a/pandora_console/include/styles/pandora_black.css
+++ b/pandora_console/include/styles/pandora_black.css
@@ -130,6 +130,15 @@ textarea:disabled {
   filter: brightness(2.5) contrast(3.5);
 }
 
+/* events.css */
+table.table_modal_alternate tr:nth-child(odd) td {
+  background-color: #222;
+}
+
+table.table_modal_alternate tr:nth-child(even) td {
+  background-color: #111;
+}
+
 /* tables.css */
 .info_table {
   background-color: #222;
@@ -281,3 +290,32 @@ div#foot {
 .ui-widget-content a {
   color: #fff;
 }
+
+.ui-state-default,
+.ui-widget-content .ui-state-default,
+.ui-widget-header .ui-state-default {
+  background-color: #222;
+  color: #fff;
+}
+
+.ui-state-active,
+.ui-widget-content .ui-state-active,
+.ui-widget-header .ui-state-active {
+  background-color: #111;
+  color: #fff;
+}
+
+.ui-state-default a,
+.ui-state-default a:link,
+.ui-state-default a:visited,
+a.ui-button,
+a:link.ui-button,
+a:visited.ui-button,
+.ui-button {
+  color: #fff;
+}
+
+ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
+  img {
+  filter: brightness(2);
+}
diff --git a/pandora_console/include/styles/pandora_green_old.css b/pandora_console/include/styles/pandora_green_old.css
index cb04b54d57..239ecee786 100644
--- a/pandora_console/include/styles/pandora_green_old.css
+++ b/pandora_console/include/styles/pandora_green_old.css
@@ -21,70 +21,153 @@ Description: The default Pandora FMS theme layout
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
-/* header */
-div#head {
-  background-color: #80ab51;
-  color: white;
-  background-image: url(../../images/header.jpg);
-}
-
 /* menu.css */
 .operation,
-#menu_full {
-  background-color: #80ab51;
-}
-
-.operation .selected {
-  background-color: #d9fb86;
-}
-
-.operation li.selected {
-  box-shadow: inset 4px 0 #80ab51;
-}
-.operation .menu_icon:hover {
-  background-color: #d9fb86;
-}
-
-.operation .sub_subMenu:hover {
-  background-color: #d9fb86;
-  color: #585858;
-}
-
-.godmode .selected {
-  background-color: #a77853;
-}
-
-.godmode li.selected {
-  box-shadow: inset 4px 0 #e79b5d;
-}
-
-.godmode .menu_icon:hover {
-  background-color: #a77853;
+#menu_full,
+.godmode,
+.operation .menu_icon ul.submenu > li,
+.godmode .menu_icon ul.submenu > li,
+.sub_subMenu {
+  background-color: #fff;
 }
 
+.operation .selected,
+.operation .menu_icon:hover,
+.godmode .selected,
+.godmode .menu_icon:hover,
 .godmode .submenu_not_selected:hover,
-.godmode .submenu_selected:hover {
-  background-color: #a77853 !important;
+.godmode .submenu_selected:hover,
+.operation .sub_subMenu:hover,
+.operation .menu_icon ul.submenu > li:hover,
+.godmode .menu_icon ul.submenu > li:hover {
+  background-color: #343434 !important;
+  color: #fff;
 }
 
-.godmode .sub_subMenu:hover {
-  background-color: #a77853;
-  color: #2f2f2f;
+ul.subsubmenu li {
+  background-color: #82b92e;
 }
 
-/* General styles */
-.green_title {
-  background-color: #80ab51;
+.godmode {
+  border-top: 1px solid #f1f1f1;
+}
+
+.menu li ul {
+  border: 1px solid #f1f1f1;
+}
+
+#title_menu,
+.submenu_text {
+  color: #9c9c9c;
+}
+
+.button_collapse,
+div#foot {
+  background-color: #82b92e;
+}
+
+/* footer */
+div#foot a,
+div#foot span {
+  color: #fff;
 }
 
 /* Tabs */
-#menu_tab li.nomn_high,
-#menu_tab li.nomn_high span {
-  box-shadow: inset 0px 4px #80ab51;
-}
-
 #menu_tab_frame,
 #menu_tab_frame_view,
 #menu_tab_frame_view_bc {
-  border-bottom: 2px solid #80ab51;
+  background-color: #82b92e;
+}
+
+#menu_tab li.nomn_high,
+#menu_tab li.nomn_high span {
+  box-shadow: inset 0px 4px #fff;
+  background-color: transparent;
+}
+#menu_tab li:hover {
+  box-shadow: inset 0px 4px #fff;
+  background-color: #ffffff38;
+}
+
+#menu_tab_left li a,
+#menu_tab_left li span {
+  color: #fff;
+}
+
+#menu_tab li.nomn img,
+#menu_tab li img {
+  filter: brightness(4.5);
+}
+
+/* General styles */
+div#page {
+  background: #ecfad6;
+}
+
+#top_btn {
+  background-color: #343434;
+}
+
+#top_btn:hover {
+  background-color: transparent;
+}
+
+.breadcrumb_link.selected,
+.breadcrumb_active {
+  color: #ecfad6;
+}
+
+.sort_arrow img {
+  filter: brightness(2.5) contrast(3.5);
+}
+
+/* tables.css */
+.info_table tr:first-child > th {
+  background-color: #343434;
+  color: #fff;
+}
+
+.info_table > tbody > tr > th,
+.info_table > thead > tr > th,
+.info_table > thead > tr > th a,
+.info_table > thead > tr > th > span {
+  color: #fff;
+}
+
+/* agent view*/
+.agent_details_header,
+.white_table tr:first-child > th,
+.white_table_graph_header {
+  background-color: #343434;
+  color: #fff;
+  border-top-left-radius: 5px;
+  border-top-right-radius: 5px;
+}
+
+.white_table thead tr:first-child > th {
+  border-radius: 0;
+}
+
+.white_table thead tr:first-child > th:first-child {
+  border-top-left-radius: 4px;
+}
+
+.white_table thead tr:first-child > th:last-child {
+  border-top-right-radius: 4px;
+}
+
+.buttons_agent_view a img {
+  background-color: #fff;
+}
+
+.breadcrumbs_container,
+.breadcrumb_link,
+div.agent_details_agent_alias * {
+  color: #fff;
+}
+
+/* jquery custom */
+.ui-dialog,
+.ui-widget-content {
+  background-color: #ecfad6;
 }

From 745ab711de469133d45b32ef9f1cdc8b92be4016 Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Fri, 5 Jul 2019 14:02:59 +0200
Subject: [PATCH 45/83] Created green theme - #4194

---
 pandora_console/include/styles/pandora_green_old.css | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pandora_console/include/styles/pandora_green_old.css b/pandora_console/include/styles/pandora_green_old.css
index 239ecee786..a9fbdf7f80 100644
--- a/pandora_console/include/styles/pandora_green_old.css
+++ b/pandora_console/include/styles/pandora_green_old.css
@@ -1,7 +1,7 @@
 /*
 
 Author: The Pandora FMS team
-Name: GreenOld theme
+Name: Green old theme
 Description: The default Pandora FMS theme layout
 
 // Pandora FMS - http://pandorafms.com
@@ -100,6 +100,8 @@ div#foot span {
 }
 
 /* General styles */
+
+body,
 div#page {
   background: #ecfad6;
 }

From 8242bf34b813c07dd179be5685d01ee2d6289863 Mon Sep 17 00:00:00 2001
From: Alejandro Fraguas <alejandro.fraguas@artica.es>
Date: Fri, 5 Jul 2019 14:55:22 +0200
Subject: [PATCH 46/83] Revert "Merge branch
 'ent-3693-pete-php-pantalla-en-blanco-con-auth-saml' into 'develop'"

This reverts merge request !2562
---
 pandora_console/general/noaccesssaml.php | 164 ----------------------
 pandora_console/include/auth/saml.php    | 166 -----------------------
 pandora_console/index.php                |  11 +-
 3 files changed, 3 insertions(+), 338 deletions(-)
 delete mode 100644 pandora_console/general/noaccesssaml.php
 delete mode 100755 pandora_console/include/auth/saml.php

diff --git a/pandora_console/general/noaccesssaml.php b/pandora_console/general/noaccesssaml.php
deleted file mode 100644
index e357e040dc..0000000000
--- a/pandora_console/general/noaccesssaml.php
+++ /dev/null
@@ -1,164 +0,0 @@
-<html>
-<head>
-    
-<style>
-
-#alert_messages_na{
-    z-index:2;
-    position: absolute;
-    left: 50%;
-    top: 50%;
-    transform: translate(-50%, -50%);
-    -webkit-transform: translate(-50%, -50%);   
-    width:650px;
-    height: 400px;
-    background:white;
-    background-image:url('images/imagen-no-acceso.jpg');
-    background-repeat:no-repeat;
-    justify-content: center;
-    display: flex;
-    flex-direction: column;
-    box-shadow:4px 5px 10px 3px rgba(0, 0, 0, 0.4);
-}
-
-.modalheade{
-    text-align:center;
-    width:100%;
-    position:absolute;
-    top:0;
-}
-.modalheadertex{
-    color:#000;
-    font-family:Nunito;
-    line-height: 40px;
-    font-size: 23pt;
-    margin-bottom:30px;
-}
-.modalclose{
-    cursor:pointer;
-    display:inline;
-    float:right;
-    margin-right:10px;
-    margin-top:10px;
-}
-.modalconten{
-    color:black;
-    width:300px;
-    margin-left: 30px;
-}
-.modalcontenttex{
-    text-align:left;
-    color:black;
-    font-size: 11pt;
-    line-height:13pt;
-    margin-bottom:30px;
-}
-.modalokbutto{
-    cursor:pointer;
-    text-align:center;
-    display: inline-block;
-    padding: 6px 45px;
-    -moz-border-radius: 3px;
-    -webkit-border-radius: 3px;
-    border-radius: 3px;
-    background-color:white;
-    border: 1px solid #82b92e;
-}
-.modalokbuttontex{
-    color:#82b92e;
-    font-family:Nunito;
-    font-size:13pt;
-}
-.modalgobutto{
-    cursor:pointer;
-    text-align:center;
-    -moz-border-radius: 3px;
-    -webkit-border-radius: 3px;
-    border-radius: 3px;
-    background-color:white;
-    border: 1px solid #82b92e;
-}
-.modalgobuttontex{
-color:#82b92e;
-font-family:Nunito;
-font-size:10pt;
-}
-
-
-#opacidad{
-    position:fixed;
-    background:black;
-    opacity:0.6;
-    z-index:-1;
-    left:0px;
-    top:0px;
-    width:100%;
-    height:100%;
-}
-/*
-.textodialog{
-    margin-left: 0px;
-    color:#333;
-    padding:20px;
-    font-size:9pt;
-}
-
-.cargatextodialog{
-    max-width:58.5%;
-    width:58.5%;
-    min-width:58.5%;
-    float:left;
-    margin-left: 0px;
-    font-size:18pt;
-    padding:20px;
-    text-align:center;
-}
-
-.cargatextodialog p, .cargatextodialog b, .cargatextodialog a{
-    font-size:18pt; 
-}
-*/
-</style>
-</head>
-<body>
-    
-    <div id="alert_messages_na">
-        
-        <div class='modalheade'>
-            <img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>  
-        </div>
-
-        <div class='modalconten'>
-            <div class='modalheadertex'>
-                <?php echo __("You don't have access to this page"); ?>
-            </div>
-
-            <div class='modalcontenttex'>
-                <?php
-                echo __('Access to this page is restricted to authorized users SAML only, please contact system administrator if you need assistance.');
-                    echo '<br/> <br/>';
-                    echo __('Please make sure you have SAML authentication properly configured. For more information the error to access this page are recorded in security logs of %s System Database', get_product_name());
-                ?>
-                      
-            </div>
-
-            <div class='modalokbutto cerrar'>
-                <span class='modalokbuttontex'>OK</span>
-            </div>
-        </div>
-    </div>
-        
-    <div id="opacidad"></div>
-    
-</body>
-</html>
-
-<script>
-
-    $(".cerrar").click(function(){
-    window.location=".";
-    });
-
-    $('div#page').css('background-color','#d3d3d3');
-
-</script>
diff --git a/pandora_console/include/auth/saml.php b/pandora_console/include/auth/saml.php
deleted file mode 100755
index 6ffbc8cf4b..0000000000
--- a/pandora_console/include/auth/saml.php
+++ /dev/null
@@ -1,166 +0,0 @@
-<?php
-// ______                 __                     _______ _______ _______
-// |   __ \.---.-.-----.--|  |.-----.----.---.-. |    ___|   |   |     __|
-// |    __/|  _  |     |  _  ||  _  |   _|  _  | |    ___|       |__     |
-// |___|   |___._|__|__|_____||_____|__| |___._| |___|   |__|_|__|_______|
-//
-// ============================================================================
-// Copyright (c) 2007-2010 Artica Soluciones Tecnologicas, http://www.artica.es
-// This code is NOT free software. This code is NOT licenced under GPL2 licence
-// You cannnot redistribute it without written permission of copyright holder.
-// ============================================================================
-global $config;
-
-if (!file_exists($config['saml_path'].'simplesamlphp/lib/_autoload.php')) {
-    return false;
-}
-
-
-/**
- * Authenticate in saml system (red.es)
- *
- * @param string Login
- * @param string Password
- *
- * @return boolean True if the login succeeds, false otherwise
- */
-function saml_process_user_login()
-{
-    global $config;
-
-    // SAML authentication attributes
-    $as = new SimpleSAML_Auth_Simple('PandoraFMS');
-    $as->requireAuth();
-    $session = SimpleSAML_Session::getSessionFromRequest();
-    $session->cleanup();
-    $attributes = $as->getAttributes();
-
-    if (empty($attributes)) {
-        return false;
-    }
-
-    $id_user = $attributes[SAML_MAIL_IN_PANDORA][0];
-    $email = $attributes[SAML_MAIL_IN_PANDORA][0];
-    $group_name = $attributes[SAML_GROUP_IN_PANDORA][0];
-    $profiles_and_tags = $attributes[SAML_ROLE_AND_TAG];
-
-    $profile_names = [];
-    $tag_names = [];
-    // Manages array with tags and roles to separate them
-    foreach ($profiles_and_tags as $profile_or_tag) {
-        $is_profile_or_tag = explode(SAML_DEFAULT_PROFILES_AND_TAGS_FORM, $profile_or_tag);
-        $is_profile_or_tag2 = explode(':', $is_profile_or_tag[1]);
-        if ($is_profile_or_tag2[0] == 'role') {
-            $profile_names[] = $is_profile_or_tag2[1];
-        } else if ($is_profile_or_tag2[0] == 'tag') {
-            $tag_names[] = $is_profile_or_tag2[1];
-        }
-    }
-
-    // Connect to Pandora db
-    $connection = mysql_connect_db(
-        $config['pandora_server'],
-        $config['pandora_dbname'],
-        $config['pandora_user'],
-        $config['pandora_pass']
-    );
-
-    if ($connection === false) {
-        return false;
-    }
-
-    // Get the red.es user id
-    $rows = db_get_all_rows_sql(
-        "SELECT * FROM tusuario
-		WHERE id_user = '".$id_user."'",
-        false,
-        false,
-        $connection
-    );
-
-    // Checks group id, profiles id and tags id
-    $group_id = '';
-    $profile_id = [];
-    $tag_id = '';
-    $tags_to_profile = '';
-    if ($group_name != '') {
-        $group_id = db_get_all_rows_sql("SELECT id_grupo FROM tgrupo WHERE nombre = '".$group_name."'");
-        $group_id = $group_id[0]['id_grupo'];
-        if (empty($group_id)) {
-            $config['auth_error'] = 'Group not found in database';
-            db_pandora_audit('Logon Failed', 'Group '.$group_name.' not found in database', $_SERVER['REMOTE_ADDR']);
-            return false;
-        }
-    }
-
-    if (!empty($profile_names)) {
-        foreach ($profile_names as $profile_name) {
-            $profile_id[] = db_get_row_sql("SELECT id_perfil FROM tperfil WHERE name = '".io_safe_input($profile_name)."'");
-        }
-    }
-
-    if (!empty($tag_names)) {
-        $i = 0;
-        foreach ($tag_names as $tag_name) {
-            $tag_id = db_get_row_sql("SELECT id_tag FROM ttag WHERE name = '".io_safe_input($tag_name)."'");
-            if ($i == 0) {
-                $tags_to_profile = (String) $tag_id['id_tag'];
-            } else {
-                $tags_to_profile .= ','.(String) $tag_id['id_tag'];
-            }
-
-            $i++;
-        }
-    }
-
-    // If user does not exist in Pandora
-    if (empty($rows)) {
-        if ($id_user != '') {
-            $values_user = [];
-            $values_user['id_user'] = $id_user;
-            $values_user['email'] = $email;
-            $result_insert_user = db_process_sql_insert('tusuario', $values_user);
-
-            // Separates user insert of profile insert
-            $values_user_profile = [];
-            $values_user_profile['id_usuario'] = $id_user;
-            $values_user_profile['id_grupo'] = $group_id;
-            $values_user_profile['tags'] = $tags_to_profile;
-            foreach ($profile_id as $id) {
-                $values_user_profile['id_perfil'] = $id['id_perfil'];
-                $result_insert_user_profile = db_process_sql_insert('tusuario_perfil', $values_user_profile);
-            }
-
-            if (!$result_insert_user_profile) {
-                $config['auth_error'] = 'Login error';
-                return false;
-            }
-
-            return $id_user;
-        } else {
-            return false;
-        }
-    } else {
-        $user = $rows[0];
-        // To update the profiles, delete the old and insert the new
-        $have_profiles = db_get_all_rows_sql("SELECT id_up FROM tusuario_perfil WHERE id_usuario = '".$user['id_user']."'");
-        if ($have_profiles) {
-            $delete_old_profiles = db_process_sql("DELETE FROM tusuario_perfil WHERE id_usuario = '".$user['id_user']."'");
-        }
-
-        $values_user_profile = [];
-        $values_user_profile['id_usuario'] = $user['id_user'];
-        $values_user_profile['id_grupo'] = $group_id;
-        $values_user_profile['tags'] = $tags_to_profile;
-        foreach ($profile_id as $id) {
-            $values_user_profile['id_perfil'] = $id['id_perfil'];
-            $result_insert_user_profile = db_process_sql_insert('tusuario_perfil', $values_user_profile);
-        }
-
-        return $user['id_user'];
-    }
-
-    $config['auth_error'] = 'User not found in database or incorrect password';
-
-    return false;
-}
diff --git a/pandora_console/index.php b/pandora_console/index.php
index a543829bb7..3c95074171 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -359,17 +359,12 @@ if (! isset($config['id_user'])) {
             $nick_in_db = $_SESSION['prepared_login_da']['id_user'];
             $expired_pass = false;
         } else if (($config['auth'] == 'saml') && ($login_button_saml)) {
-            if (!include_once 'include/auth/saml.php') {
-                include_once 'general/noaccesssaml.php';
-            } else {
-                $saml_user_id = saml_process_user_login();
-            }
+            include_once ENTERPRISE_DIR.'/include/auth/saml.php';
+
+            $saml_user_id = saml_process_user_login();
 
             $nick_in_db = $saml_user_id;
-
             if (!$nick_in_db) {
-                include_once 'general/noaccesssaml.php';
-
                 include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
                 $as = new SimpleSAML_Auth_Simple('PandoraFMS');
                 $as->logout();

From d0f3a6bc0b9418c16efe8567392a81906a488b56 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Sat, 6 Jul 2019 00:01:19 +0200
Subject: [PATCH 47/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 531a41e5b3..9fb3888b56 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190705
+Version: 7.0NG.736-190706
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 98fdaa992f..0db060be9d 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190705"
+pandora_version="7.0NG.736-190706"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 1e03cfa248..b995494f84 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190705';
+use constant AGENT_BUILD => '190706';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 1e03c24394..341958f85b 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190705
+%define release     190706
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index ac8a594450..b16873ba8e 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190705
+%define release     190706
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 1fc0ed921c..a460425043 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190705"
+PI_BUILD="190706"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 32836deca7..4fd63586fb 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190705}
+{190706}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 02d9a63209..49771beaf4 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190705)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190706)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 8ecffd52ee..756617327c 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190705))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190706))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 5e6512722a..6a48453fd6 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190705
+Version: 7.0NG.736-190706
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index d6f3b6da50..1d03b25f1e 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190705"
+pandora_version="7.0NG.736-190706"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 62812d314c..a6c55e0755 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190705';
+$build_version = 'PC190706';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 00e176f42c..f485cb3000 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190705';
+            $build = '190706';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index d3011eb849..28a96e4524 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190705
+%define release     190706
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index e841ce2f51..d44dc538ca 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190705
+%define release     190706
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 1ee39cb54d..8fb2815e92 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190705
+%define release     190706
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 8f86f67614..7ecc116949 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190705
+Version: 7.0NG.736-190706
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 8a1a1c87fd..3663215aa1 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190705"
+pandora_version="7.0NG.736-190706"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index c46b9e894f..a0152cc83e 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190705";
+my $pandora_build = "190706";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 2291610e57..6a09b7f52d 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190705";
+my $pandora_build = "190706";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index b2e81b4c72..850f36ace4 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190705
+%define release     190706
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index a31db9b0c4..930f8a681c 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190705
+%define release     190706
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 39391e9339..e30946b9ac 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190705"
+PI_BUILD="190706"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index fa0822b985..48f2961049 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190705";
+my $version = "7.0NG.736 PS190706";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index be30e449dc..3142d7a0d9 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190705";
+my $version = "7.0NG.736 PS190706";
 
 # save program name for logging
 my $progname = basename($0);

From 90497410c75182d01021607f7f9fa426c25f2bfb Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Sun, 7 Jul 2019 00:01:07 +0200
Subject: [PATCH 48/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 9fb3888b56..c701f2c1d8 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190706
+Version: 7.0NG.736-190707
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 0db060be9d..9a728d043f 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190706"
+pandora_version="7.0NG.736-190707"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index b995494f84..e0b5740813 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190706';
+use constant AGENT_BUILD => '190707';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 341958f85b..4551d4f7ad 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190706
+%define release     190707
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index b16873ba8e..d32371885f 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190706
+%define release     190707
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index a460425043..85834b9b10 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190706"
+PI_BUILD="190707"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 4fd63586fb..a4faf508be 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190706}
+{190707}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 49771beaf4..ae897511c6 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190706)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190707)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 756617327c..41ccc44a4d 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190706))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190707))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 6a48453fd6..d3d25c2b86 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190706
+Version: 7.0NG.736-190707
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 1d03b25f1e..352bd78c5b 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190706"
+pandora_version="7.0NG.736-190707"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index a6c55e0755..ea494ea2cf 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190706';
+$build_version = 'PC190707';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index f485cb3000..ec9f8406d9 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190706';
+            $build = '190707';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 28a96e4524..958156159b 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190706
+%define release     190707
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index d44dc538ca..d8b66e3648 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190706
+%define release     190707
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 8fb2815e92..cb42983702 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190706
+%define release     190707
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 7ecc116949..3b5d219e67 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190706
+Version: 7.0NG.736-190707
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 3663215aa1..6e1912c27c 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190706"
+pandora_version="7.0NG.736-190707"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index a0152cc83e..357ab0c1a4 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190706";
+my $pandora_build = "190707";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 6a09b7f52d..6270239337 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190706";
+my $pandora_build = "190707";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 850f36ace4..22fe1af31e 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190706
+%define release     190707
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 930f8a681c..5cbc0ddc69 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190706
+%define release     190707
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index e30946b9ac..e61d88feae 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190706"
+PI_BUILD="190707"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 48f2961049..e1b88ef2aa 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190706";
+my $version = "7.0NG.736 PS190707";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 3142d7a0d9..11a293b4eb 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190706";
+my $version = "7.0NG.736 PS190707";
 
 # save program name for logging
 my $progname = basename($0);

From 034181037dff514a7de7c97bbf84237aeda52ba1 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Mon, 8 Jul 2019 00:01:17 +0200
Subject: [PATCH 49/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index c701f2c1d8..02a7bdab5f 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190707
+Version: 7.0NG.736-190708
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 9a728d043f..cc8929763d 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190707"
+pandora_version="7.0NG.736-190708"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index e0b5740813..399559f00b 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190707';
+use constant AGENT_BUILD => '190708';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 4551d4f7ad..977af1104f 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190707
+%define release     190708
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index d32371885f..84eac835d9 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190707
+%define release     190708
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 85834b9b10..02c3728350 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190707"
+PI_BUILD="190708"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index a4faf508be..ce66038ef5 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190707}
+{190708}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index ae897511c6..41ae8eb267 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190707)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190708)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 41ccc44a4d..696d6c34e3 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190707))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190708))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index d3d25c2b86..062c14afdc 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190707
+Version: 7.0NG.736-190708
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 352bd78c5b..56d98823ac 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190707"
+pandora_version="7.0NG.736-190708"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index ea494ea2cf..3adcf1f113 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190707';
+$build_version = 'PC190708';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index ec9f8406d9..e22cf98add 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190707';
+            $build = '190708';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 958156159b..4b5ba54d58 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190707
+%define release     190708
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index d8b66e3648..7b8be55c9a 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190707
+%define release     190708
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index cb42983702..cb245a98b6 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190707
+%define release     190708
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 3b5d219e67..3a2b2d11f1 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190707
+Version: 7.0NG.736-190708
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 6e1912c27c..fa5303f620 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190707"
+pandora_version="7.0NG.736-190708"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 357ab0c1a4..1d73d1ab8b 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190707";
+my $pandora_build = "190708";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 6270239337..80f94f0543 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190707";
+my $pandora_build = "190708";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 22fe1af31e..9eca22a68f 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190707
+%define release     190708
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 5cbc0ddc69..92935fbd0d 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190707
+%define release     190708
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index e61d88feae..1ddc84c2c9 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190707"
+PI_BUILD="190708"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index e1b88ef2aa..f4c3a443df 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190707";
+my $version = "7.0NG.736 PS190708";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 11a293b4eb..cf5bf608e3 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190707";
+my $version = "7.0NG.736 PS190708";
 
 # save program name for logging
 my $progname = basename($0);

From b6d551d5837be53af4a829282abe7f8ac79d9867 Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Mon, 8 Jul 2019 10:08:04 +0200
Subject: [PATCH 50/83] Changed images with white background - #4194

---
 .../images/wizard/netscan_green.png           | Bin 15485 -> 3424 bytes
 .../include/styles/pandora_black.css          | 143 +++++++++---------
 2 files changed, 71 insertions(+), 72 deletions(-)

diff --git a/pandora_console/images/wizard/netscan_green.png b/pandora_console/images/wizard/netscan_green.png
index faeae9b04208888f9b7fdb70a185494bf45cd862..c602e96ac58a079b2154a8f044b5ac1c1527361a 100644
GIT binary patch
literal 3424
zcmaJ^c|25Y8y?xWRF<hQrjbOMF=L5gMpMc<)+tM&iJ@uC(#)}ChCwL_ktL-<DN88P
zWC^8}kBV%A%$qEwm@FZsZ}e90`^VRJe&;;f@4l}4dhYu^zvr9;7bhD<x%F}&5J=I^
z*4j<fUlu*_GE$<p>4E2MQMV4*<q5dc1A#CilLW#A&<~QJc2r^z$&Ew|h&b|$WC;R^
zZzK~u0Z+Um+MiB^6PIn^;Z%kQ4FXwOg)@l$6cPYEND3m;FtEwm1{jnafPs0K;0^JN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{Cd<-|{+mPA00000NkvXXu0mjf{q1nd

diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css
index a94dcf468c..2db907831a 100644
--- a/pandora_console/include/styles/pandora_black.css
+++ b/pandora_console/include/styles/pandora_black.css
@@ -21,6 +21,7 @@ Description: The default Pandora FMS theme layout
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
 
+/* General styles */
 body,
 div#page,
 #menu_tab_frame,
@@ -28,7 +29,6 @@ div#page,
 #menu_tab_frame_view_bc,
 input.search_input,
 .filters input,
-input:-internal-autofill-selected,
 input#text-id_parent.ac_input,
 input,
 textarea,
@@ -55,48 +55,6 @@ table.databox,
   color: #fff;
 }
 
-/* Tabs icons change color */
-#menu_tab li.nomn img,
-#menu_tab li img {
-  filter: invert(100%);
-}
-
-/* White text */
-a,
-#menu_tab_left li a,
-#menu_tab_left li span,
-fieldset legend,
-.tactical_set legend,
-#user-notifications-wrappe,
-#user_form *,
-h1,
-h2,
-h3,
-h4,
-.info_table > tbody > tr > th,
-.info_table > thead > tr > th,
-.info_table > thead > tr > th a,
-.info_table > thead > tr > th > span,
-form.discovery label,
-.edit_user_labels,
-.input_label,
-.pagination,
-tr.group_view_data,
-.group_view_data {
-  color: #fff;
-}
-
-/* Overwrite inline styles */
-.textodialogo td {
-  color: #fff !important;
-}
-
-/* snmp */
-#snmp_browser {
-  background-color: #222 !important;
-}
-
-/* General styles */
 .box-shadow {
   box-shadow: none;
 }
@@ -130,6 +88,76 @@ textarea:disabled {
   filter: brightness(2.5) contrast(3.5);
 }
 
+/* White text */
+a,
+#menu_tab_left li a,
+#menu_tab_left li span,
+fieldset legend,
+.tactical_set legend,
+#user-notifications-wrappe,
+#user_form *,
+h1,
+h2,
+h3,
+h4,
+.info_table > tbody > tr > th,
+.info_table > thead > tr > th,
+.info_table > thead > tr > th a,
+.info_table > thead > tr > th > span,
+form.discovery label,
+.edit_user_labels,
+.input_label,
+.pagination,
+tr.group_view_data,
+.group_view_data {
+  color: #fff;
+}
+
+/* Tabs icons change color */
+#menu_tab li.nomn img,
+#menu_tab li img {
+  filter: invert(100%);
+}
+
+/* menu.css */
+.operation {
+  background-color: #252525;
+}
+
+.godmode,
+#menu_full {
+  background-color: #1a1a1a;
+}
+
+.button_collapse {
+  background-color: #444;
+}
+
+.operation .selected,
+.godmode .selected,
+.menu_icon:hover {
+  background-color: #080808;
+}
+
+.sub_subMenu {
+  background-color: #343434;
+}
+
+/* footer */
+div#foot {
+  background: #222;
+}
+
+/* Overwrite inline styles */
+.textodialogo td {
+  color: #fff !important;
+}
+
+/* snmp */
+#snmp_browser {
+  background-color: #222 !important;
+}
+
 /* events.css */
 table.table_modal_alternate tr:nth-child(odd) td {
   background-color: #222;
@@ -252,35 +280,6 @@ table#diagnostic_info tbody td div {
   filter: brightness(2.5);
 }
 
-/* menu.css */
-.operation {
-  background-color: #252525;
-}
-
-.godmode,
-#menu_full {
-  background-color: #1a1a1a;
-}
-
-.button_collapse {
-  background-color: #444;
-}
-
-.operation .selected,
-.godmode .selected,
-.menu_icon:hover {
-  background-color: #080808;
-}
-
-.sub_subMenu {
-  background-color: #343434;
-}
-
-/* footer */
-div#foot {
-  background: #222;
-}
-
 /* jquery custom */
 .ui-dialog,
 .ui-widget-content {

From 8ea9b673264fead2bb266fb34febd065774c36a0 Mon Sep 17 00:00:00 2001
From: Daniel Barbero <daniel.barbero@artica.es>
Date: Mon, 8 Jul 2019 10:20:43 +0200
Subject: [PATCH 51/83] fixed graph in mobile view metaconsole

---
 .../mobile/operation/module_graph.php         | 35 +++++++++++++++++--
 pandora_console/mobile/operation/modules.php  | 16 ++++++++-
 2 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/pandora_console/mobile/operation/module_graph.php b/pandora_console/mobile/operation/module_graph.php
index 3a6668b0bc..2d057fb8fb 100644
--- a/pandora_console/mobile/operation/module_graph.php
+++ b/pandora_console/mobile/operation/module_graph.php
@@ -47,6 +47,8 @@ class ModuleGraph
 
     private $module = null;
 
+    private $server_id = '';
+
 
     function __construct()
     {
@@ -68,6 +70,8 @@ class ModuleGraph
 
         $this->id = (int) $system->getRequest('id', 0);
         $this->id_agent = (int) $system->getRequest('id_agent', 0);
+        $this->server_id = $system->getRequest('server_id', '');
+
         $this->module = modules_get_agentmodule($this->id);
         $this->graph_type = return_graphtype($this->module['id_tipo_modulo']);
 
@@ -124,6 +128,16 @@ class ModuleGraph
             switch ($parameter2) {
                 case 'get_graph':
                     $this->getFilters();
+                    if ($system->getConfig('metaconsole')) {
+                        $server_data = metaconsole_get_connection_by_id(
+                            $this->server_id
+                        );
+                        // Establishes connection.
+                        if (metaconsole_load_external_db($server_data) !== NOERR) {
+                            return false;
+                        }
+                    }
+
                     $correct = 0;
                     $graph = '';
                     $correct = 1;
@@ -197,6 +211,10 @@ class ModuleGraph
                         break;
                     }
 
+                    if ($system->getConfig('metaconsole')) {
+                        metaconsole_restore_db();
+                    }
+
                     $graph = ob_get_clean().$graph;
 
                     echo json_encode(['correct' => $correct, 'graph' => $graph]);
@@ -252,7 +270,7 @@ class ModuleGraph
                             - $(".ui-collapsible").height()
                             - 55;
                     var width = $(document).width() - 25;
-                    ajax_get_graph($("#id_module").val(), heigth, width);
+                    ajax_get_graph($("#id_module").val(), heigth, width, $("#server_id").val());
                 }
 
                 load_graph();
@@ -264,7 +282,7 @@ class ModuleGraph
                 });
             });
 
-            function ajax_get_graph(id, heigth_graph, width_graph) {
+            function ajax_get_graph(id, heigth_graph, width_graph, server_id) {
                 postvars = {};
                 postvars["action"] = "ajax";
                 postvars["parameter1"] = "module_graph";
@@ -284,6 +302,8 @@ class ModuleGraph
 
                 postvars["id"] = id;
 
+                postvars["server_id"] = server_id;
+
                 $.ajax ({
                     type: "POST",
                     url: "index.php",
@@ -360,9 +380,18 @@ class ModuleGraph
                     ]
                 )
             );
+            $ui->contentAddHtml(
+                $ui->getInput(
+                    [
+                        'id'    => 'server_id',
+                        'value' => $this->server_id,
+                        'type'  => 'hidden',
+                    ]
+                )
+            );
             $title = sprintf(__('Options for %s : %s'), $agent_alias, $this->module['nombre']);
             $ui->contentBeginCollapsible($title);
-                $ui->beginForm('index.php?page=module_graph&id='.$this->id);
+                $ui->beginForm('index.php?page=module_graph&id='.$this->id.'&server_id='.$this->server_id);
                     $options = [
                         'name'    => 'draw_alerts',
                         'value'   => 1,
diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php
index 8b9bd18804..5b32c358ad 100644
--- a/pandora_console/mobile/operation/modules.php
+++ b/pandora_console/mobile/operation/modules.php
@@ -485,6 +485,8 @@ class Modules
                 $temp_modules = db_get_all_rows_sql($sql_select.$sql.$sql_limit);
 
                 foreach ($temp_modules as $result_element_key => $result_element_value) {
+                    $result_element_value['server_id'] = $server['id'];
+                    $result_element_value['server_name'] = $server['server_name'];
                     array_push($modules_db, $result_element_value);
                 }
 
@@ -684,7 +686,19 @@ class Modules
 
                     $row[7] = ui_get_snapshot_image($link, $is_snapshot).'&nbsp;&nbsp;';
                 } else {
-                    $row[7] = $row[__('Data')] = '<span style="white-space: nowrap;">'.'<span style="display: none;" class="show_collapside">'.$row[__('Status')].'&nbsp;&nbsp;</span>'.'<a data-ajax="false" class="ui-link" '.'href="index.php?page=module_graph&id='.$module['id_agente_modulo'].'&id_agent='.$this->id_agent.'">'.$output.'</a>'.'</span>';
+                    if ($system->getConfig('metaconsole')) {
+                        $row[__('Data')] = '<span style="white-space: nowrap;">';
+                        $row[__('Data')] .= '<span style="display: none;" class="show_collapside">';
+                        $row[__('Data')] .= $row[__('Status')].'&nbsp;&nbsp;</span>';
+                        $row[__('Data')] .= '<a data-ajax="false" class="ui-link" ';
+                        $row[__('Data')] .= 'href="index.php?page=module_graph&id='.$module['id_agente_modulo'];
+                        $row[__('Data')] .= '&server_id='.$module['server_id'];
+                        $row[__('Data')] .= '&id_agent='.$this->id_agent.'">';
+                        $row[__('Data')] .= $output.'</a></span>';
+                        $row[7] = $row[__('Data')];
+                    } else {
+                        $row[7] = $row[__('Data')] = '<span style="white-space: nowrap;">'.'<span style="display: none;" class="show_collapside">'.$row[__('Status')].'&nbsp;&nbsp;</span>'.'<a data-ajax="false" class="ui-link" '.'href="index.php?page=module_graph&id='.$module['id_agente_modulo'].'&id_agent='.$this->id_agent.'">'.$output.'</a>'.'</span>';
+                    }
                 }
 
                 if (!$ajax) {

From 0cccafc7bed19abcb209e0505d4266562769ff4d Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Mon, 8 Jul 2019 10:37:34 +0200
Subject: [PATCH 52/83] Heartbeat gifs with black background - #4194

---
 .../images/heartbeat_green_black.gif            | Bin 0 -> 18665 bytes
 pandora_console/images/heartbeat_red_black.gif  | Bin 0 -> 16734 bytes
 pandora_console/include/functions_agents.php    |  15 +++++++++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 pandora_console/images/heartbeat_green_black.gif
 create mode 100644 pandora_console/images/heartbeat_red_black.gif

diff --git a/pandora_console/images/heartbeat_green_black.gif b/pandora_console/images/heartbeat_green_black.gif
new file mode 100644
index 0000000000000000000000000000000000000000..b365cade3f406e3492b7cd532805da83f862cdbd
GIT binary patch
literal 18665
zcmbTdc~}!?|200@LkJ{+1j3%3gf$=_STvIj0!9fCR#5|j0wS`hsHjOuSOg_(iaQ`G
zTD72P)!IG@0)ko%ife5f6xZ5*qqQyC6y9KMpFYp~{k?zuxN==2lbL&F?#!HXKId~L
zIwmSSBJ&u)27a3c6qP<%RX&Bg{32snOO!rE`}|VZazrWK=^Hr9>wQzpIR!g>XGJoD
z=P+Xw-e5e7#bInd9k8;+m!H6zD`k}(^efomH$RKLtj4E!zh7V&LzwK%_GQEuu#-xx
z<FFR4V26vDIrY99Px{9yyc1TjC5zeNB3AkaAMR{M7@w)^3lJo-{DK(SwLXPye$g4;
zrJa8H&At_%`IjH{&uj9X6U|z*kuz@rOS0Hoq4ufh30T$U8y>|<E9Ycv=J;|Mp&*kd
zW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z?
z4&xAY@nZ}~se<G52@<M;qz5Af22&lfGJgtX3XdD;Ruuw-HXxz_V`WI(_+e3@JT9#c
zp}{Ob3Ri;Mq782nN+avK5GF*7uL+SrP=(@%wE@;3i!i`p4I&DtO2rE;TI@hT;0(zU
jq!9H)3M#;7S%0Vlp`C?8TZJN4%l4|X63eSX0s;U#D?gF_

literal 0
HcmV?d00001

diff --git a/pandora_console/images/heartbeat_red_black.gif b/pandora_console/images/heartbeat_red_black.gif
new file mode 100644
index 0000000000000000000000000000000000000000..90fed812db59640d17311708a2f774a82f643ea3
GIT binary patch
literal 16734
zcmbVz2{@Gf_xE7TW{knuX2z_RAz@@KF~(T4%%GxF)<Vcu(Z(<sqU=c$Ls6+HMLqR2
z_9aTuUQa}}mWR~yP~yFZ7XALe|9idH+tqc&bl-EI^ZA_fIp=%6-`mc?*3``R9Eb+`
zcL8Kdq$J1_)(|L8c=AKAN{tk5KZf9|OiY(m-K0XYB#;A@iNQ)l6B31`O8x_m^Hw2w
zVo673Rd*>8<K+q2Xw^tXVkTO(9g20uk<K9TMJUztNW8x?sRV`Zf?y9~2-Q;fa%uc!
z1g-;uZGhwI5V%4a)jmm;ez1xKfn0^e-+<!;()f!~_%dm{1%dJetP-G1ViL$LP;55@
zTZ~f8mr-qkV)JBFuOV=^;MiIOE>eNuf+y#pRhwYgKqVqyj&M+(kS3>kP72RdB^whd
zRs`~0No<f3X$6^LP9UE};!9Dg+m%VqIMNFVl}%WZmkOyKj*C(xZdE4gP$-$Qs_C+X
z6ggGCEFlg<I3<lwkt6WrRC^^=!W4;WRO%5~LJnG$p-S$S#P&$4R3h=Ki4=7zRg*&1
zpis3aRBZ~?SD8ekQ1!@^6%?ugiQ<7J8ImX~$rMLCS(i-NszTbKL`;?=*r}3r$P_x6
zqCus)<48s%N{ABinS_cynPRI-UPGijmr&V=C2dzCHo~y0NR$m&Qm7))6-T}=iCs&e
z>{cM^kg4mjBnLd1gCpOD;d&*p>+obD49k@##3&G>6^MHjh;BI2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mw|Fqt&Obgsa-9%S&{6y!z!oi!V;5%_M}HiJRoDD<`e|h#dqHiNvg8Q
zWodf@hI?BN@ITVJ&UF}-J-3jRx89cjtXY$kes(-=W@tCchU+^&_a1t2YWv=!-j8{e
zpUU<lv|srwOQg*JXiKl7JrGS~AEzw6*79WWKs=Bwz$-kid9=k>c*gy-dG@bOmvRHP
zJ2Ds;>R=G5um+Wmk>*q*IPk7wZ`+#+?&|U}hYqTvX8cw`tjgFR<$9XL5BJr<ZA<P$
z={GU3)VGv)Ul$-sxk;N*96}nVfs&4lrwY{4lU@t9txiTQ^SZe(k_qM52T`i0N(*Ho
r%d5{Fm~62@vdzA(i{a#saYepH?i)ywy#SpkLT@guyp93}&ujh<)2^pU

literal 0
HcmV?d00001

diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php
index affa4269d4..69759c1f5e 100644
--- a/pandora_console/include/functions_agents.php
+++ b/pandora_console/include/functions_agents.php
@@ -3385,11 +3385,22 @@ function agents_get_image_status($status)
  */
 function agents_get_status_animation($up=true)
 {
+    global $config;
+
+    // Gif with black background or white background
+    if ($config['style'] === 'pandora_black') {
+        $heartbeat_green = 'images/heartbeat_green_black.gif';
+        $heartbeat_red = 'images/heartbeat_red_black.gif';
+    } else {
+        $heartbeat_green = 'images/heartbeat_green.gif';
+        $heartbeat_red = 'images/heartbeat_red.gif';
+    }
+
     switch ($up) {
         case true:
         default:
         return html_print_image(
-            'images/heartbeat_green.gif',
+            $heartbeat_green,
             true,
             [
                 'width'  => '170',
@@ -3399,7 +3410,7 @@ function agents_get_status_animation($up=true)
 
         case false:
         return html_print_image(
-            'images/heartbeat_red.gif',
+            $heartbeat_red,
             true,
             [
                 'width'  => '170',

From f444f639bd02c118d28f71b74c97104d1d02294f Mon Sep 17 00:00:00 2001
From: Kike <enrique.martin@artica.es>
Date: Mon, 8 Jul 2019 12:17:48 +0200
Subject: [PATCH 53/83] New SMPP client

---
 pandora_server/util/pandora_smpp.pl | 152 ++++++++++++++++++++++++++++
 1 file changed, 152 insertions(+)
 create mode 100755 pandora_server/util/pandora_smpp.pl

diff --git a/pandora_server/util/pandora_smpp.pl b/pandora_server/util/pandora_smpp.pl
new file mode 100755
index 0000000000..af85d496f5
--- /dev/null
+++ b/pandora_server/util/pandora_smpp.pl
@@ -0,0 +1,152 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Net::SMPP;
+
+use lib '/usr/lib/perl5';
+use PandoraFMS::PluginTools qw(read_configuration);
+
+my $HELP =<<EO_H;
+
+
+#######################
+Pandora FMS SMPP client
+#######################
+
+Usage:
+
+$0 -server <smsc_server:port> -user <user_id> -password <user_password> -source <source_number> -destination <destination_numbers> -message <short_message> [OPTIONS]
+
+- <destination_numbers>            Comma separated list of destination numbers (+123456789,+234567891,...)
+
+OPTIONS:
+
+-service_type <value>              Default: ''
+-source_addr_ton <value>           Default: 0x00
+-source_addr_npi <value>           Default: 0x00
+-dest_addr_ton <value>             Default: 0x00
+-dest_addr_npi <value>             Default: 0x00
+-esm_class <value>                 Default: 0x00
+-protocol_id <value>               Default: 0x00
+-priority_flag <value>             Default: 0x00
+-schedule_delivery_time <value>    Default: ''
+-validity_period <value>           Default: ''
+-registered_delivery <value>       Default: 0x00
+-replace_if_present_flag <value>   Default: 0x00
+-data_coding <value>               Default: 0x00
+-sm_default_msg_id <value>         Default: 0x00
+-system_type <value>               Default: ''
+-interface_version <value>         Default: 0x34
+-addr_ton <value>                  Default: 0x00
+-addr_npi <value>                  Default: 0x00
+-address_range <value>             Default: ''
+
+Example:
+
+$0 -server 192.168.1.50:2775 -user myuser -password mypassword -source +123456789 -destination +234567891 -message "Content of SMS message"
+
+EO_H
+
+my $config;
+$config = read_configuration($config);
+
+if (!$config->{'server'}){
+        print "Parameter -server is mandatory.";
+        print $HELP;
+        exit;
+}
+if (!$config->{'user'}){
+        print "Parameter -user is mandatory.";
+        print $HELP;
+        exit;
+}
+if (!$config->{'password'}){
+        print "Parameter -password is mandatory.";
+        print $HELP;
+        exit;
+}
+if (!$config->{'source'}){
+        print "Parameter -source is mandatory.";
+        print $HELP;
+        exit;
+}
+if (!$config->{'destination'}){
+        print "Parameter -destination is mandatory.";
+        print $HELP;
+        exit;
+}
+if (!$config->{'message'}){
+        print "Parameter -message is mandatory.";
+        print $HELP;
+        exit;
+}
+
+my ($smsc_server, $smsc_port) = split /:/, $config->{'server'};
+
+my @destination_numbers = $config->{'destination'};
+
+if (!$smsc_port){
+	$smsc_port = 2775;
+}
+
+$config->{'service_type'}              = ''     if (!$config->{'service_type'});
+$config->{'source_addr_ton'}           = '0x00' if (!$config->{'source_addr_ton'});
+$config->{'source_addr_npi'}           = '0x00' if (!$config->{'source_addr_npi'});
+$config->{'dest_addr_ton'}             = '0x00' if (!$config->{'dest_addr_ton'});
+$config->{'dest_addr_npi'}             = '0x00' if (!$config->{'dest_addr_npi'});
+$config->{'esm_class'}                 = '0x00' if (!$config->{'esm_class'});
+$config->{'protocol_id'}               = '0x00' if (!$config->{'protocol_id'});
+$config->{'priority_flag'}             = '0x00' if (!$config->{'priority_flag'});
+$config->{'schedule_delivery_time'}    = ''     if (!$config->{'schedule_delivery_time'});
+$config->{'validity_period'}           = ''     if (!$config->{'validity_period'});
+$config->{'registered_delivery'}       = '0x00' if (!$config->{'registered_delivery'});
+$config->{'replace_if_present_flag'}   = '0x00' if (!$config->{'replace_if_present_flag'});
+$config->{'data_coding'}               = '0x00' if (!$config->{'data_coding'});
+$config->{'sm_default_msg_id'}         = '0x00' if (!$config->{'sm_default_msg_id'});
+$config->{'system_type'}               = ''     if (!$config->{'system_type'});
+$config->{'interface_version'}         = '0x34' if (!$config->{'interface_version'});
+$config->{'addr_ton'}                  = '0x00' if (!$config->{'addr_ton'});
+$config->{'addr_npi'}                  = '0x00' if (!$config->{'addr_npi'});
+$config->{'address_range'}             = ''     if (!$config->{'address_range'});
+
+my $smpp = Net::SMPP->new_transmitter(
+        $smsc_server,
+        port              => $smsc_port,
+        system_id         => $config->{'user'},
+        password          => $config->{'password'},
+        system_type       => $config->{'system_type'},
+        interface_version => $config->{'interface_version'},
+        addr_ton          => $config->{'addr_ton'},
+        addr_npi          => $config->{'addr_npi'},
+        address_range     => $config->{'address_range'}
+) or die "Unable to connect to [$smsc_server] on port [$smsc_port] with user [" . $config->{'user'} . "]\n";
+
+foreach my $destination_number (@destination_numbers){
+        my $resp_pdu = $smpp->submit_sm(
+                source_addr             => $config->{'source'},
+                destination_addr        => $destination_number,
+                short_message           => $config->{'message'},
+                service_type            => $config->{'service_type'},
+                source_addr_ton         => $config->{'source_addr_ton'},
+                source_addr_npi         => $config->{'source_addr_npi'},
+                dest_addr_ton           => $config->{'dest_addr_ton'},
+                dest_addr_npi           => $config->{'dest_addr_npi'},
+                esm_class               => $config->{'esm_class'},
+                protocol_id             => $config->{'protocol_id'},
+                priority_flag           => $config->{'priority_flag'},
+                schedule_delivery_time  => $config->{'schedule_delivery_time'},
+                validity_period         => $config->{'validity_period'},
+                registered_delivery     => $config->{'registered_delivery'},
+                replace_if_present_flag => $config->{'replace_if_present_flag'},
+                data_coding             => $config->{'data_coding'},
+                sm_default_msg_id       => $config->{'sm_default_msg_id'}
+        );
+
+        if ($resp_pdu->{message_id}){
+                print "SUCCESS: Message sent to [$destination_number]\n";
+        }else{
+                print "ERROR: Unable to send message to [$destination_number] - Response error: " . $resp_pdu->explain_status() . "\n";
+        }
+}
\ No newline at end of file

From b70c904ec3cb79dd31e9fa723d24099e1e04becd Mon Sep 17 00:00:00 2001
From: Daniel Barbero <daniel.barbero@artica.es>
Date: Mon, 8 Jul 2019 13:40:52 +0200
Subject: [PATCH 54/83] fixed minor error network components

---
 pandora_console/include/javascript/pandora_modules.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js
index 1d5c804289..2795df7bdb 100644
--- a/pandora_console/include/javascript/pandora_modules.js
+++ b/pandora_console/include/javascript/pandora_modules.js
@@ -536,7 +536,7 @@ function configure_modules_form() {
 
           var obj = jQuery.parseJSON(data["macros"]);
           $.each(obj, function(k, macro) {
-            add_macro_field(macro, "simple-macro");
+            add_macro_field(macro, "simple-macro", "td");
           });
         }
 

From d5362c1d5dfe04abe5a85fc95d79dd2b175c138d Mon Sep 17 00:00:00 2001
From: alejandro-campos <alejandro.campos@artica.es>
Date: Mon, 8 Jul 2019 16:07:22 +0200
Subject: [PATCH 55/83] fix bug: label macros not being replaced in view report

---
 .../include/functions_reporting.php           | 779 +++++++++---------
 1 file changed, 399 insertions(+), 380 deletions(-)

diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 46359c1471..aac7e2104d 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -190,13 +190,13 @@ function reporting_make_reporting_data(
             );
 
             $sql_tags_join = 'INNER JOIN tagente ON tagente.id_agente = t1.id_agente
-				INNER JOIN ttag_module ON ttag_module.id_agente_modulo = t1.id_agente_modulo
-				LEFT JOIN tagent_secondary_group tasg ON tagente.id_agente = tasg.id_agent';
+                INNER JOIN ttag_module ON ttag_module.id_agente_modulo = t1.id_agente_modulo
+                LEFT JOIN tagent_secondary_group tasg ON tagente.id_agente = tasg.id_agent';
 
             $sql = sprintf(
                 'SELECT count(*) FROM tagente_modulo t1
-				%s WHERE t1.delete_pending = 0 AND t1.id_agente_modulo = '.$content['id_agent_module'].'
-				AND t1.id_agente = '.$content['id_agent'].' %s',
+                %s WHERE t1.delete_pending = 0 AND t1.id_agente_modulo = '.$content['id_agent_module'].'
+                AND t1.id_agente = '.$content['id_agent'].' %s',
                 $sql_tags_join,
                 $where_tags
             );
@@ -284,6 +284,25 @@ function reporting_make_reporting_data(
                 if (!metaconsole_load_external_db($connection)) {
                     continue;
                 }
+
+                $items_label['agent_description'] = agents_get_description($content['id_agent']);
+                $items_label['agent_group'] = agents_get_agent_group($content['id_agent']);
+                $items_label['agent_address'] = agents_get_address($content['id_agent']);
+
+                $modules = agents_get_modules(
+                    $agent_value,
+                    [
+                        'id_agente_modulo',
+                        'nombre',
+                        'descripcion',
+                    ],
+                    [
+                        'id_agente_modulo' => $content['id_agent_module'],
+                    ]
+                );
+
+                $items_label['module_name'] = $modules[$content['id_agent_module']]['nombre'];
+                $items_label['module_description'] = $modules[$content['id_agent_module']]['descripcion'];
             }
 
             if (is_array($content['id_agent']) && count($content['id_agent']) != 1) {
@@ -294,12 +313,12 @@ function reporting_make_reporting_data(
                 $content['style']['name_label'] = str_replace('_module_', count($content['id_agent_module']).__(' modules'), $content['style']['name_label']);
             }
 
-            $content['name'] = reporting_label_macro($items_label, $content['style']['name_label']);
-
             if ($metaconsole_on) {
                 // Restore db connection.
                 metaconsole_restore_db();
             }
+
+            $content['name'] = reporting_label_macro($items_label, $content['style']['name_label']);
         }
 
         switch (reporting_get_type($content)) {
@@ -1359,8 +1378,8 @@ function reporting_event_top_n(
         // Get all the related data.
         $sql = sprintf(
             'SELECT id_agent_module, server_name
-			FROM treport_content_item
-			WHERE id_report_content = %d',
+            FROM treport_content_item
+            WHERE id_report_content = %d',
             $content['id_rc']
         );
 
@@ -2323,9 +2342,9 @@ function reporting_exception(
         // Get all the related data.
         $sql = sprintf(
             '
-			SELECT id_agent_module, server_name, operation
-			FROM treport_content_item
-			WHERE id_report_content = %d',
+            SELECT id_agent_module, server_name, operation
+            FROM treport_content_item
+            WHERE id_report_content = %d',
             $content['id_rc']
         );
 
@@ -3091,10 +3110,10 @@ function reporting_database_serialized($report, $content)
     // This query gets information from the default and the historic database
     $result = db_get_all_rows_sql(
         'SELECT *
-		FROM tagente_datos
-		WHERE id_agente_modulo = '.$content['id_agent_module'].'
-			AND utimestamp > '.$datelimit.'
-			AND utimestamp <= '.$report['datetime'],
+        FROM tagente_datos
+        WHERE id_agente_modulo = '.$content['id_agent_module'].'
+            AND utimestamp > '.$datelimit.'
+            AND utimestamp <= '.$report['datetime'],
         $search_in_history_db
     );
 
@@ -3103,10 +3122,10 @@ function reporting_database_serialized($report, $content)
         // This query gets information from the default and the historic database
         $result = db_get_all_rows_sql(
             'SELECT *
-			FROM tagente_datos_string
-			WHERE id_agente_modulo = '.$content['id_agent_module'].'
-				AND utimestamp > '.$datelimit.'
-				AND utimestamp <= '.$report['datetime'],
+            FROM tagente_datos_string
+            WHERE id_agente_modulo = '.$content['id_agent_module'].'
+                AND utimestamp > '.$datelimit.'
+                AND utimestamp <= '.$report['datetime'],
             $search_in_history_db
         );
     }
@@ -3211,9 +3230,9 @@ function reporting_group_configuration($report, $content)
         }
     } else {
         $sql = '
-			SELECT *
-			FROM tagente
-			WHERE id_grupo='.$content['id_group'];
+            SELECT *
+            FROM tagente
+            WHERE id_grupo='.$content['id_group'];
     }
 
     $agents_list = db_get_all_rows_sql($sql);
@@ -3472,25 +3491,25 @@ function reporting_alert_report_group($report, $content)
     if ($content['id_group'] == 0) {
         $agent_modules = db_get_all_rows_sql(
             '
-			SELECT distinct(id_agent_module)
-			FROM talert_template_modules
-			WHERE disabled = 0
-				AND id_agent_module IN (
-					SELECT id_agente_modulo
-					FROM tagente_modulo)'
+            SELECT distinct(id_agent_module)
+            FROM talert_template_modules
+            WHERE disabled = 0
+                AND id_agent_module IN (
+                    SELECT id_agente_modulo
+                    FROM tagente_modulo)'
         );
     } else {
         $agent_modules = db_get_all_rows_sql(
             '
-			SELECT distinct(id_agent_module)
-			FROM talert_template_modules
-			WHERE disabled = 0
-				AND id_agent_module IN (
-					SELECT id_agente_modulo
-					FROM tagente_modulo
-					WHERE id_agente IN (
-						SELECT id_agente
-						FROM tagente WHERE id_grupo = '.$content['id_group'].'))'
+            SELECT distinct(id_agent_module)
+            FROM talert_template_modules
+            WHERE disabled = 0
+                AND id_agent_module IN (
+                    SELECT id_agente_modulo
+                    FROM tagente_modulo
+                    WHERE id_agente IN (
+                        SELECT id_agente
+                        FROM tagente WHERE id_grupo = '.$content['id_group'].'))'
         );
     }
 
@@ -4109,8 +4128,8 @@ function reporting_netflow(
     // Get item filters.
     $filter = db_get_row_sql(
         "SELECT *
-		FROM tnetflow_filter
-		WHERE id_sg = '".(int) $content['text']."'",
+        FROM tnetflow_filter
+        WHERE id_sg = '".(int) $content['text']."'",
         false,
         true
     );
@@ -4294,9 +4313,9 @@ function reporting_agent_configuration($report, $content)
     }
 
     $sql = '
-		SELECT *
-		FROM tagente
-		WHERE id_agente='.$content['id_agent'];
+        SELECT *
+        FROM tagente
+        WHERE id_agente='.$content['id_agent'];
     $agent_data = db_get_row_sql($sql);
 
     $agent_configuration = [];
@@ -4316,9 +4335,9 @@ function reporting_agent_configuration($report, $content)
     if (!empty($modules)) {
         foreach ($modules as $id_agent_module => $module) {
             $sql = "
-				SELECT *
-				FROM tagente_modulo
-				WHERE id_agente_modulo = $id_agent_module";
+                SELECT *
+                FROM tagente_modulo
+                WHERE id_agente_modulo = $id_agent_module";
             $module_db = db_get_row_sql($sql);
 
             $data_module = [];
@@ -4364,12 +4383,12 @@ function reporting_agent_configuration($report, $content)
             $data_module['status_icon'] = ui_print_status_image($status, $title, true);
             $data_module['status'] = $title;
             $sql_tag = "
-				SELECT name
-				FROM ttag
-				WHERE id_tag IN (
-					SELECT id_tag
-					FROM ttag_module
-					WHERE id_agente_modulo = $id_agent_module)";
+                SELECT name
+                FROM ttag
+                WHERE id_tag IN (
+                    SELECT id_tag
+                    FROM ttag_module
+                    WHERE id_agente_modulo = $id_agent_module)";
             $tags = db_get_all_rows_sql($sql_tag);
             if ($tags === false) {
                 $data_module['tags'] = [];
@@ -4537,41 +4556,41 @@ function reporting_value($report, $content, $type, $pdf=false)
                 }
             } else {
                 $value = '
-				<table border="0" style="margin:0 auto;text-align:center;">
-					<tr>
-						<td width="400px;" height="20%;">';
+                <table border="0" style="margin:0 auto;text-align:center;">
+                    <tr>
+                        <td width="400px;" height="20%;">';
                 if ($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3) {
                     $value .= '
-							<table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
-								<tr>
-									<th style="padding:5px;background-color:#82b92e;">
-										'.__('Agent').'
-									</th>
-									<th style="padding:5px;background-color:#82b92e;">
-										'.__('Module').'
-									</th>
-									<th style="padding:5px;background-color:#82b92e;">
-										'.__('Maximum').'
-									</th>
-								<tr>
-									<td style="padding:5px;">
-										'.$agent_name.'
-									</td>
-									<td style="padding:5px;">
-										'.$module_name.'
-									</td>
-									<td style="padding:5px;">
-										'.format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
-									</td>
-								</tr>
-							</table>';
+                            <table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
+                                <tr>
+                                    <th style="padding:5px;background-color:#82b92e;">
+                                        '.__('Agent').'
+                                    </th>
+                                    <th style="padding:5px;background-color:#82b92e;">
+                                        '.__('Module').'
+                                    </th>
+                                    <th style="padding:5px;background-color:#82b92e;">
+                                        '.__('Maximum').'
+                                    </th>
+                                <tr>
+                                    <td style="padding:5px;">
+                                        '.$agent_name.'
+                                    </td>
+                                    <td style="padding:5px;">
+                                        '.$module_name.'
+                                    </td>
+                                    <td style="padding:5px;">
+                                        '.format_for_graph(reporting_get_agentmodule_data_max($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
+                                    </td>
+                                </tr>
+                            </table>';
                 }
 
                 $value .= '
-					</td>
-					<td rowspan="2" width="150px">
-					</td>
-					<td rowspan="2">';
+                    </td>
+                    <td rowspan="2" width="150px">
+                    </td>
+                    <td rowspan="2">';
 
                 if ($content['visual_format'] == 2 || $content['visual_format'] == 3) {
                     $params['force_interval'] = 'max_only';
@@ -4580,23 +4599,23 @@ function reporting_value($report, $content, $type, $pdf=false)
 
                 $value .= '
 
-					</td>
-				</tr>
-				<tr>
-					<td>';
+                    </td>
+                </tr>
+                <tr>
+                    <td>';
 
                 if ($content['visual_format'] == 1 || $content['visual_format'] == 3) {
                     $value .= '
-						<table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
-							<tr>
-								<th style="padding:5px;background-color:#82b92e;">
-									'.__('Lapse').'
-								</th>
-								<th style="padding:5px;background-color:#82b92e;">
-									'.__('Maximum').'
-								</th>
-							</tr>
-							<tr>';
+                        <table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
+                            <tr>
+                                <th style="padding:5px;background-color:#82b92e;">
+                                    '.__('Lapse').'
+                                </th>
+                                <th style="padding:5px;background-color:#82b92e;">
+                                    '.__('Maximum').'
+                                </th>
+                            </tr>
+                            <tr>';
                             $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module'], true);
                             $date_reference = getdate();
 
@@ -4670,16 +4689,16 @@ function reporting_value($report, $content, $type, $pdf=false)
                                 </td>
                                 <td style="padding:5px;">
                                     '.format_for_graph(reporting_get_agentmodule_data_min($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
-									</td>
-								</tr>
-							</table>';
+                                    </td>
+                                </tr>
+                            </table>';
                 }
 
                         $value .= '
-					</td>
-					<td rowspan="2" width="150px">
-					</td>
-					<td rowspan="2">';
+                    </td>
+                    <td rowspan="2" width="150px">
+                    </td>
+                    <td rowspan="2">';
 
                 if ($content['visual_format'] == 2 || $content['visual_format'] == 3) {
                     $params['force_interval'] = 'min_only';
@@ -4694,16 +4713,16 @@ function reporting_value($report, $content, $type, $pdf=false)
 
                 if ($content['visual_format'] == 1 || $content['visual_format'] == 3) {
                     $value .= '
-						<table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
-							<tr>
-								<th style="padding:5px;background-color:#82b92e;">
-									'.__('Lapse').'
-								</th>
-								<th style="padding:5px;background-color:#82b92e;">
-									'.__('Minimum').'
-								</th>
-							</tr>
-							<tr>';
+                        <table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
+                            <tr>
+                                <th style="padding:5px;background-color:#82b92e;">
+                                    '.__('Lapse').'
+                                </th>
+                                <th style="padding:5px;background-color:#82b92e;">
+                                    '.__('Minimum').'
+                                </th>
+                            </tr>
+                            <tr>';
                             $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']);
                             $date_reference = getdate();
 
@@ -4728,7 +4747,7 @@ function reporting_value($report, $content, $type, $pdf=false)
                 }
 
                 $value .= '
-						
+                        
                             </td>
                         </tr>
                     </table>';
@@ -4757,60 +4776,60 @@ function reporting_value($report, $content, $type, $pdf=false)
 
                 if ($content['visual_format'] == 1 || $content['visual_format'] == 2 || $content['visual_format'] == 3) {
                     $value .= '
-							<table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
-								<tr>
-									<th style="padding:5px;background-color:#82b92e;">
-										'.__('Agent').'
-									</th>
-									<th style="padding:5px;background-color:#82b92e;">
-										'.__('Module').'
-									</th>
-									<th style="padding:5px;background-color:#82b92e;">
-										'.__('Average').'
-									</th>
-								<tr>
-									<td style="padding:5px;">
-										'.$agent_name.'
-									</td>
-									<td style="padding:5px;">
-										'.$module_name.'
-									</td>
-									<td style="padding:5px;">
-										'.format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
-									</td>
-								</tr>
-							</table>';
+                            <table style="width:90%;margin:0 auto;background-color:#eee;border: solid lightgray 1px;">
+                                <tr>
+                                    <th style="padding:5px;background-color:#82b92e;">
+                                        '.__('Agent').'
+                                    </th>
+                                    <th style="padding:5px;background-color:#82b92e;">
+                                        '.__('Module').'
+                                    </th>
+                                    <th style="padding:5px;background-color:#82b92e;">
+                                        '.__('Average').'
+                                    </th>
+                                <tr>
+                                    <td style="padding:5px;">
+                                        '.$agent_name.'
+                                    </td>
+                                    <td style="padding:5px;">
+                                        '.$module_name.'
+                                    </td>
+                                    <td style="padding:5px;">
+                                        '.format_for_graph(reporting_get_agentmodule_data_average($content['id_agent_module'], $content['period'], $report['datetime']), $config['graph_precision']).' '.$unit.'
+                                    </td>
+                                </tr>
+                            </table>';
                 }
 
                         $value .= '
-					</td>
-					<td rowspan="2" width="150px">
-					</td>
-					<td rowspan="2">';
+                    </td>
+                    <td rowspan="2" width="150px">
+                    </td>
+                    <td rowspan="2">';
                 if ($content['visual_format'] == 2 || $content['visual_format'] == 3) {
                     $params['force_interval'] = 'avg_only';
                     $value .= grafico_modulo_sparse($params);
                 }
 
                 $value .= '
-					
-					</td>				
-				</tr>
-				<tr>
-					<td>';
+                    
+                    </td>               
+                </tr>
+                <tr>
+                    <td>';
 
                 if ($content['visual_format'] == 1 || $content['visual_format'] == 3) {
                     $value .= '
-						<table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
-							<tr>
-								<th style="padding:5px;background-color:#82b92e;">
-									'.__('Lapse').'
-								</th>
-								<th style="padding:5px;background-color:#82b92e;">
-									'.__('Average').'
-								</th>
-							</tr>
-							<tr>';
+                        <table style="width:90%;margin:0 auto;margin-top:30px;background-color:#eee;border: solid lightgray 1px;">
+                            <tr>
+                                <th style="padding:5px;background-color:#82b92e;">
+                                    '.__('Lapse').'
+                                </th>
+                                <th style="padding:5px;background-color:#82b92e;">
+                                    '.__('Average').'
+                                </th>
+                            </tr>
+                            <tr>';
                     $time_begin = db_get_row_sql('select utimestamp from tagente_datos where id_agente_modulo ='.$content['id_agent_module']);
                     $date_reference = getdate();
 
@@ -4835,7 +4854,7 @@ function reporting_value($report, $content, $type, $pdf=false)
                 }
 
                 $value .= '
-						
+                        
                             </td>
                         </tr>
                     </table>';
@@ -6146,10 +6165,10 @@ function reporting_availability($report, $content, $date=false, $time=false)
     if (empty($content['subitems'])) {
         $sql = sprintf(
             '
-			SELECT id_agent_module,
-				server_name, operation
-			FROM treport_content_item
-			WHERE id_report_content = %d',
+            SELECT id_agent_module,
+                server_name, operation
+            FROM treport_content_item
+            WHERE id_report_content = %d',
             $content['id_rc']
         );
 
@@ -6823,13 +6842,13 @@ function reporting_increment($report, $content)
 
     if (is_metaconsole()) {
         $sql1 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' 
-									 AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC';
+                                     AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC';
         $sql2 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC';
 
         $servers = db_get_all_rows_sql(
             'SELECT *
-		FROM tmetaconsole_setup
-		WHERE disabled = 0'
+        FROM tmetaconsole_setup
+        WHERE disabled = 0'
         );
 
         if ($servers === false) {
@@ -6853,7 +6872,7 @@ function reporting_increment($report, $content)
     } else {
         $old_data = db_get_value_sql(
             'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' 
-									 AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC'
+                                     AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC'
         );
 
         $last_data = db_get_value_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC');
@@ -7276,8 +7295,8 @@ function reporting_custom_graph(
         if (is_metaconsole()) {
             $module_source = db_get_all_rows_sql(
                 'SELECT id_agent_module, id_server
-			FROM tgraph_source
-			WHERE id_graph = '.$content['id_gs']
+            FROM tgraph_source
+            WHERE id_graph = '.$content['id_gs']
             );
 
             if (isset($module_source) && is_array($module_source)) {
@@ -8015,10 +8034,10 @@ function reporting_get_group_stats($id_group=0, $access='AR')
         foreach ($id_group as $group) {
             $group_stat = db_get_all_rows_sql(
                 "SELECT *
-				FROM tgroup_stat, tgrupo
-				WHERE tgrupo.id_grupo = tgroup_stat.id_group
-					AND tgroup_stat.id_group = $group
-				ORDER BY nombre"
+                FROM tgroup_stat, tgrupo
+                WHERE tgrupo.id_grupo = tgroup_stat.id_group
+                    AND tgroup_stat.id_group = $group
+                ORDER BY nombre"
             );
 
             $data['monitor_checks'] += $group_stat[0]['modules'];
@@ -8246,10 +8265,10 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR')
         foreach ($id_group as $group) {
             $group_stat = db_get_all_rows_sql(
                 "SELECT *
-				FROM tgroup_stat, tgrupo
-				WHERE tgrupo.id_grupo = tgroup_stat.id_group
-					AND tgroup_stat.id_group = $group
-				ORDER BY nombre"
+                FROM tgroup_stat, tgrupo
+                WHERE tgrupo.id_grupo = tgroup_stat.id_group
+                    AND tgroup_stat.id_group = $group
+                ORDER BY nombre"
             );
 
             $data['monitor_checks'] += $group_stat[0]['modules'];
@@ -8284,8 +8303,8 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR')
             $tags = db_get_value('tags', 'tusuario_perfil', 'id_usuario', $config['id_user']);
             if ($tags) {
                 $tags_sql = " AND tae.id_agente_modulo IN ( SELECT id_agente_modulo 
-				                                           FROM ttag_module 
-				                                           WHERE id_tag IN ($tags) ) ";
+                                                           FROM ttag_module 
+                                                           WHERE id_tag IN ($tags) ) ";
             } else {
                 $tags_sql = '';
             }
@@ -8296,27 +8315,27 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR')
 
             // for stats modules
             $sql = "SELECT tg.id_grupo as id, tg.nombre as name, 
-    				SUM(tae.estado=0) as monitor_ok,
-    				SUM(tae.estado=1) as monitor_critical,
-    				SUM(tae.estado=2) as monitor_warning,
-    				SUM(tae.estado=3) as monitor_unknown,
-    				SUM(tae.estado=4) as monitor_not_init,
-    				COUNT(tae.estado) as monitor_total
+                    SUM(tae.estado=0) as monitor_ok,
+                    SUM(tae.estado=1) as monitor_critical,
+                    SUM(tae.estado=2) as monitor_warning,
+                    SUM(tae.estado=3) as monitor_unknown,
+                    SUM(tae.estado=4) as monitor_not_init,
+                    COUNT(tae.estado) as monitor_total
 
-					FROM
-    					tagente_estado tae,
-    					tagente        ta,
-    					tagente_modulo tam,
-    					tgrupo         tg
+                    FROM
+                        tagente_estado tae,
+                        tagente        ta,
+                        tagente_modulo tam,
+                        tgrupo         tg
     
-					WHERE 1=1
-    					AND tae.id_agente = ta.id_agente
-       					AND tae.id_agente_modulo = tam.id_agente_modulo
-    					AND ta.id_grupo = tg.id_grupo
-    					AND tam.disabled = 0
-    					AND ta.disabled = 0
-    					AND ta.id_grupo IN ($id_group) $tags_sql 
-					GROUP BY tg.id_grupo;";
+                    WHERE 1=1
+                        AND tae.id_agente = ta.id_agente
+                        AND tae.id_agente_modulo = tam.id_agente_modulo
+                        AND ta.id_grupo = tg.id_grupo
+                        AND tam.disabled = 0
+                        AND ta.disabled = 0
+                        AND ta.id_grupo IN ($id_group) $tags_sql 
+                    GROUP BY tg.id_grupo;";
             $data_array = db_get_all_rows_sql($sql);
 
             $data = $data_array[0];
@@ -8329,27 +8348,27 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR')
 
             // for stats agents
             $sql = "SELECT tae.id_agente id_agente, tg.id_grupo id_grupo,
-    				SUM(tae.estado=0) as monitor_agent_ok,
-    				SUM(tae.estado=1) as monitor_agent_critical,
-    				SUM(tae.estado=2) as monitor_agent_warning,
-				    SUM(tae.estado=3) as monitor_agent_unknown,
-				    SUM(tae.estado=4) as monitor_agent_not_init,
-				    COUNT(tae.estado) as monitor_agent_total
+                    SUM(tae.estado=0) as monitor_agent_ok,
+                    SUM(tae.estado=1) as monitor_agent_critical,
+                    SUM(tae.estado=2) as monitor_agent_warning,
+                    SUM(tae.estado=3) as monitor_agent_unknown,
+                    SUM(tae.estado=4) as monitor_agent_not_init,
+                    COUNT(tae.estado) as monitor_agent_total
 
-				FROM
-				    tagente_estado tae,
-				    tagente        ta,
-				    tagente_modulo tam,
-				    tgrupo         tg
-				    
-				WHERE 1=1
-				    AND tae.id_agente = ta.id_agente
-				    AND tae.id_agente_modulo = tam.id_agente_modulo
-				    AND ta.id_grupo = tg.id_grupo
-				    AND tam.disabled = 0
-				    AND ta.disabled = 0
-				    AND ta.id_grupo IN ($id_group) $tags_sql
-				GROUP BY tae.id_agente;";
+                FROM
+                    tagente_estado tae,
+                    tagente        ta,
+                    tagente_modulo tam,
+                    tgrupo         tg
+                    
+                WHERE 1=1
+                    AND tae.id_agente = ta.id_agente
+                    AND tae.id_agente_modulo = tam.id_agente_modulo
+                    AND ta.id_grupo = tg.id_grupo
+                    AND tam.disabled = 0
+                    AND ta.disabled = 0
+                    AND ta.id_grupo IN ($id_group) $tags_sql
+                GROUP BY tae.id_agente;";
             $data_array_2 = db_get_all_rows_sql($sql);
 
             if (is_array($data_array_2) || is_object($data_array_2)) {
@@ -8460,22 +8479,22 @@ function reporting_get_stats_indicators($data, $width=280, $height=20, $html=tru
 
     if ($html) {
         $tdata[0] = '<fieldset class="databox tactical_set">
-						<legend>'.__('Server health').ui_print_help_tip(sprintf(__('%d Downed servers'), $servers['down']), true).'</legend>'.progress_bar($servers['health'], $width, $height, '', 0).'</fieldset>';
+                        <legend>'.__('Server health').ui_print_help_tip(sprintf(__('%d Downed servers'), $servers['down']), true).'</legend>'.progress_bar($servers['health'], $width, $height, '', 0).'</fieldset>';
         $table_ind->rowclass[] = '';
         $table_ind->data[] = $tdata;
 
         $tdata[0] = '<fieldset class="databox tactical_set">
-						<legend>'.__('Monitor health').ui_print_help_tip(sprintf(__('%d Not Normal monitors'), $data['monitor_not_normal']), true).'</legend>'.progress_bar($data['monitor_health'], $width, $height, $data['monitor_health'].'% '.__('of monitors up'), 0).'</fieldset>';
+                        <legend>'.__('Monitor health').ui_print_help_tip(sprintf(__('%d Not Normal monitors'), $data['monitor_not_normal']), true).'</legend>'.progress_bar($data['monitor_health'], $width, $height, $data['monitor_health'].'% '.__('of monitors up'), 0).'</fieldset>';
         $table_ind->rowclass[] = '';
         $table_ind->data[] = $tdata;
 
         $tdata[0] = '<fieldset class="databox tactical_set">
-						<legend>'.__('Module sanity').ui_print_help_tip(sprintf(__('%d Not inited monitors'), $data['monitor_not_init']), true).'</legend>'.progress_bar($data['module_sanity'], $width, $height, $data['module_sanity'].'% '.__('of total modules inited'), 0).'</fieldset>';
+                        <legend>'.__('Module sanity').ui_print_help_tip(sprintf(__('%d Not inited monitors'), $data['monitor_not_init']), true).'</legend>'.progress_bar($data['module_sanity'], $width, $height, $data['module_sanity'].'% '.__('of total modules inited'), 0).'</fieldset>';
         $table_ind->rowclass[] = '';
         $table_ind->data[] = $tdata;
 
         $tdata[0] = '<fieldset class="databox tactical_set">
-						<legend>'.__('Alert level').ui_print_help_tip(sprintf(__('%d Fired alerts'), $data['monitor_alerts_fired']), true).'</legend>'.progress_bar($data['alert_level'], $width, $height, $data['alert_level'].'% '.__('of defined alerts not fired'), 0).'</fieldset>';
+                        <legend>'.__('Alert level').ui_print_help_tip(sprintf(__('%d Fired alerts'), $data['monitor_alerts_fired']), true).'</legend>'.progress_bar($data['alert_level'], $width, $height, $data['alert_level'].'% '.__('of defined alerts not fired'), 0).'</fieldset>';
         $table_ind->rowclass[] = '';
         $table_ind->data[] = $tdata;
 
@@ -8558,7 +8577,7 @@ function reporting_get_stats_alerts($data, $links=false)
 
     if (!is_metaconsole()) {
         $output = '<fieldset class="databox tactical_set">
-					<legend>'.__('Defined and fired alerts').'</legend>'.html_print_table($table_al, true).'</fieldset>';
+                    <legend>'.__('Defined and fired alerts').'</legend>'.html_print_table($table_al, true).'</fieldset>';
     } else {
         // Remove the defined alerts cause with the new cache table is difficult to retrieve them
         unset($table_al->data[0][0], $table_al->data[0][1]);
@@ -8566,7 +8585,7 @@ function reporting_get_stats_alerts($data, $links=false)
         $table_al->class = 'tactical_view';
         $table_al->style = [];
         $output = '<fieldset class="tactical_set">
-					<legend>'.__('Fired alerts').'</legend>'.html_print_table($table_al, true).'</fieldset>';
+                    <legend>'.__('Fired alerts').'</legend>'.html_print_table($table_al, true).'</fieldset>';
     }
 
     return $output;
@@ -8642,14 +8661,14 @@ function reporting_get_stats_modules_status($data, $graph_width=250, $graph_heig
 
     if (!is_metaconsole()) {
         $output = '
-			<fieldset class="databox tactical_set">
-				<legend>'.__('Monitors by status').'</legend>'.html_print_table($table_mbs, true).'</fieldset>';
+            <fieldset class="databox tactical_set">
+                <legend>'.__('Monitors by status').'</legend>'.html_print_table($table_mbs, true).'</fieldset>';
     } else {
         $table_mbs->class = 'tactical_view';
         $table_mbs->style = [];
         $output = '
-			<fieldset class="tactical_set">
-				<legend>'.__('Monitors by status').'</legend>'.html_print_table($table_mbs, true).'</fieldset>';
+            <fieldset class="tactical_set">
+                <legend>'.__('Monitors by status').'</legend>'.html_print_table($table_mbs, true).'</fieldset>';
     }
 
     return $output;
@@ -8715,7 +8734,7 @@ function reporting_get_stats_agents_monitors($data)
     $table_am->data[] = $tdata;
 
     $output = '<fieldset class="databox tactical_set">
-				<legend>'.__('Total agents and monitors').'</legend>'.html_print_table($table_am, true).'</fieldset>';
+                <legend>'.__('Total agents and monitors').'</legend>'.html_print_table($table_am, true).'</fieldset>';
 
     return $output;
 }
@@ -8746,7 +8765,7 @@ function reporting_get_stats_users($data)
     $table_us->data[] = $tdata;
 
     $output = '<fieldset class="databox tactical_set">
-				<legend>'.__('Users').'</legend>'.html_print_table($table_us, true).'</fieldset>';
+                <legend>'.__('Users').'</legend>'.html_print_table($table_us, true).'</fieldset>';
 
     return $output;
 }
@@ -8781,8 +8800,8 @@ function reporting_get_agentmodule_data_average($id_agent_module, $period=0, $da
     // Get module data
     $interval_data = db_get_all_rows_sql(
         'SELECT *
-		FROM tagente_datos 
-		WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
+        FROM tagente_datos 
+        WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
         $search_in_history_db
     );
     if ($interval_data === false) {
@@ -8907,8 +8926,8 @@ function reporting_get_agentmodule_mttr($id_agent_module, $period=0, $date=0)
 
     $module = db_get_row_sql(
         'SELECT max_critical, min_critical, id_tipo_modulo
-		FROM tagente_modulo
-		WHERE id_agente_modulo = '.(int) $id_agent_module
+        FROM tagente_modulo
+        WHERE id_agente_modulo = '.(int) $id_agent_module
     );
     if ($module === false) {
         return false;
@@ -8929,7 +8948,7 @@ function reporting_get_agentmodule_mttr($id_agent_module, $period=0, $date=0)
     // Get module data
     $interval_data = db_get_all_rows_sql(
         'SELECT * FROM tagente_datos 
-		WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
+        WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
         $search_in_history_db
     );
     if ($interval_data === false) {
@@ -9053,8 +9072,8 @@ function reporting_get_agentmodule_mtbf($id_agent_module, $period=0, $date=0)
 
     $module = db_get_row_sql(
         'SELECT max_critical, min_critical, id_tipo_modulo
-		FROM tagente_modulo
-		WHERE id_agente_modulo = '.(int) $id_agent_module
+        FROM tagente_modulo
+        WHERE id_agente_modulo = '.(int) $id_agent_module
     );
     if ($module === false) {
         return false;
@@ -9075,7 +9094,7 @@ function reporting_get_agentmodule_mtbf($id_agent_module, $period=0, $date=0)
     // Get module data
     $interval_data = db_get_all_rows_sql(
         'SELECT * FROM tagente_datos 
-		WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
+        WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
         $search_in_history_db
     );
     if ($interval_data === false) {
@@ -9195,8 +9214,8 @@ function reporting_get_agentmodule_tto($id_agent_module, $period=0, $date=0)
 
     $module = db_get_row_sql(
         'SELECT max_critical, min_critical, id_tipo_modulo
-		FROM tagente_modulo
-		WHERE id_agente_modulo = '.(int) $id_agent_module
+        FROM tagente_modulo
+        WHERE id_agente_modulo = '.(int) $id_agent_module
     );
     if ($module === false) {
         return false;
@@ -9217,7 +9236,7 @@ function reporting_get_agentmodule_tto($id_agent_module, $period=0, $date=0)
     // Get module data
     $interval_data = db_get_all_rows_sql(
         'SELECT * FROM tagente_datos 
-		WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
+        WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
         $search_in_history_db
     );
     if ($interval_data === false) {
@@ -9304,8 +9323,8 @@ function reporting_get_agentmodule_ttr($id_agent_module, $period=0, $date=0)
 
     $module = db_get_row_sql(
         'SELECT max_critical, min_critical, id_tipo_modulo
-		FROM tagente_modulo
-		WHERE id_agente_modulo = '.(int) $id_agent_module
+        FROM tagente_modulo
+        WHERE id_agente_modulo = '.(int) $id_agent_module
     );
     if ($module === false) {
         return false;
@@ -9326,7 +9345,7 @@ function reporting_get_agentmodule_ttr($id_agent_module, $period=0, $date=0)
     // Get module data
     $interval_data = db_get_all_rows_sql(
         'SELECT * FROM tagente_datos 
-		WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
+        WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
         $search_in_history_db
     );
     if ($interval_data === false) {
@@ -9775,9 +9794,9 @@ function reporting_get_agentmodule_sla(
         // Get interval data
         $sql = sprintf(
             'SELECT *
-			FROM tagente_datos
-			WHERE id_agente_modulo = %d
-				AND utimestamp > %d AND utimestamp <= %d',
+            FROM tagente_datos
+            WHERE id_agente_modulo = %d
+                AND utimestamp > %d AND utimestamp <= %d',
             $id_agent_module,
             $datelimit,
             $date
@@ -9996,43 +10015,43 @@ function reporting_get_planned_downtimes_intervals($id_agent_module, $start_date
     }
 
     $sql_downtime = '
-		SELECT DISTINCT(tpdr.id),
-				tpdr.name,
-				'.$tpdr_description.",
-				tpdr.date_from,
-				tpdr.date_to,
-				tpdr.executed,
-				tpdr.id_group,
-				tpdr.only_alerts,
-				tpdr.monday,
-				tpdr.tuesday,
-				tpdr.wednesday,
-				tpdr.thursday,
-				tpdr.friday,
-				tpdr.saturday,
-				tpdr.sunday,
-				tpdr.periodically_time_from,
-				tpdr.periodically_time_to,
-				tpdr.periodically_day_from,
-				tpdr.periodically_day_to,
-				tpdr.type_downtime,
-				tpdr.type_execution,
-				tpdr.type_periodicity,
-				tpdr.id_user
-		FROM (
-				SELECT tpd.*
-				FROM tplanned_downtime tpd, tplanned_downtime_agents tpda, tagente_modulo tam
-				WHERE tpd.id = tpda.id_downtime
-					AND tpda.all_modules = 1
-					AND tpda.id_agent = tam.id_agente
-					AND tam.id_agente_modulo = $id_agent_module
-			UNION ALL
-				SELECT tpd.*
-				FROM tplanned_downtime tpd, tplanned_downtime_modules tpdm
-				WHERE tpd.id = tpdm.id_downtime
-					AND tpdm.id_agent_module = $id_agent_module
-		) tpdr
-		ORDER BY tpdr.id";
+        SELECT DISTINCT(tpdr.id),
+                tpdr.name,
+                '.$tpdr_description.",
+                tpdr.date_from,
+                tpdr.date_to,
+                tpdr.executed,
+                tpdr.id_group,
+                tpdr.only_alerts,
+                tpdr.monday,
+                tpdr.tuesday,
+                tpdr.wednesday,
+                tpdr.thursday,
+                tpdr.friday,
+                tpdr.saturday,
+                tpdr.sunday,
+                tpdr.periodically_time_from,
+                tpdr.periodically_time_to,
+                tpdr.periodically_day_from,
+                tpdr.periodically_day_to,
+                tpdr.type_downtime,
+                tpdr.type_execution,
+                tpdr.type_periodicity,
+                tpdr.id_user
+        FROM (
+                SELECT tpd.*
+                FROM tplanned_downtime tpd, tplanned_downtime_agents tpda, tagente_modulo tam
+                WHERE tpd.id = tpda.id_downtime
+                    AND tpda.all_modules = 1
+                    AND tpda.id_agent = tam.id_agente
+                    AND tam.id_agente_modulo = $id_agent_module
+            UNION ALL
+                SELECT tpd.*
+                FROM tplanned_downtime tpd, tplanned_downtime_modules tpdm
+                WHERE tpd.id = tpdm.id_downtime
+                    AND tpdm.id_agent_module = $id_agent_module
+        ) tpdr
+        ORDER BY tpdr.id";
 
     $downtimes = db_get_all_rows_sql($sql_downtime);
 
@@ -10241,8 +10260,8 @@ function reporting_get_agentmodule_data_max($id_agent_module, $period=0, $date=0
     // Get module data
     $interval_data = db_get_all_rows_sql(
         'SELECT *
-		FROM tagente_datos 
-		WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
+        FROM tagente_datos 
+        WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
         $search_in_history_db
     );
 
@@ -10347,8 +10366,8 @@ function reporting_get_agentmodule_data_min($id_agent_module, $period=0, $date=0
     // Get module data
     $interval_data = db_get_all_rows_sql(
         'SELECT *
-		FROM tagente_datos 
-		WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
+        FROM tagente_datos 
+        WHERE id_agente_modulo = '.(int) $id_agent_module.' AND utimestamp > '.(int) $datelimit.' AND utimestamp < '.(int) $date.' ORDER BY utimestamp ASC',
         $search_in_history_db
     );
     if ($interval_data === false) {
@@ -10473,11 +10492,11 @@ function reporting_get_agentmodule_data_sum(
         // Get module data
         $interval_data = db_get_all_rows_sql(
             '
-			SELECT * FROM tagente_datos 
-			WHERE id_agente_modulo = '.(int) $id_agent_module.'
-				AND utimestamp > '.(int) $datelimit.'
-				AND utimestamp < '.(int) $date.'
-			ORDER BY utimestamp ASC',
+            SELECT * FROM tagente_datos 
+            WHERE id_agente_modulo = '.(int) $id_agent_module.'
+                AND utimestamp > '.(int) $datelimit.'
+                AND utimestamp < '.(int) $date.'
+            ORDER BY utimestamp ASC',
             $search_in_history_db
         );
     } else {
@@ -10572,24 +10591,24 @@ function reporting_get_planned_downtimes($start_date, $end_date, $id_agent_modul
         // is inside the planned downtime execution.
         // The start and end time is very important.
         $periodically_monthly_w = "type_periodicity = 'monthly'
-									AND (((periodically_day_from > '$start_day'
-												OR (periodically_day_from = '$start_day'
-													AND periodically_time_from >= '$start_time'))
-											AND (periodically_day_to < '$end_day'
-												OR (periodically_day_to = '$end_day'
-													AND periodically_time_to <= '$end_time')))
-										OR ((periodically_day_from < '$start_day' 
-												OR (periodically_day_from = '$start_day'
-													AND periodically_time_from <= '$start_time'))
-											AND (periodically_day_to > '$start_day'
-												OR (periodically_day_to = '$start_day'
-													AND periodically_time_to >= '$start_time')))
-										OR ((periodically_day_from < '$end_day' 
-												OR (periodically_day_from = '$end_day'
-													AND periodically_time_from <= '$end_time'))
-											AND (periodically_day_to > '$end_day'
-												OR (periodically_day_to = '$end_day'
-													AND periodically_time_to >= '$end_time'))))";
+                                    AND (((periodically_day_from > '$start_day'
+                                                OR (periodically_day_from = '$start_day'
+                                                    AND periodically_time_from >= '$start_time'))
+                                            AND (periodically_day_to < '$end_day'
+                                                OR (periodically_day_to = '$end_day'
+                                                    AND periodically_time_to <= '$end_time')))
+                                        OR ((periodically_day_from < '$start_day' 
+                                                OR (periodically_day_from = '$start_day'
+                                                    AND periodically_time_from <= '$start_time'))
+                                            AND (periodically_day_to > '$start_day'
+                                                OR (periodically_day_to = '$start_day'
+                                                    AND periodically_time_to >= '$start_time')))
+                                        OR ((periodically_day_from < '$end_day' 
+                                                OR (periodically_day_from = '$end_day'
+                                                    AND periodically_time_from <= '$end_time'))
+                                            AND (periodically_day_to > '$end_day'
+                                                OR (periodically_day_to = '$end_day'
+                                                    AND periodically_time_to >= '$end_time'))))";
     }
 
     $periodically_weekly_days = [];
@@ -10609,13 +10628,13 @@ function reporting_get_planned_downtimes($start_date, $end_date, $id_agent_modul
         // the start or end time of the date range.
         $weekday_actual = strtolower(date('l', $start_date));
         $periodically_weekly_days[] = "($weekday_actual = 1
-			AND ((periodically_time_from > '$start_time' AND periodically_time_to < '$end_time')
-				OR (periodically_time_from = '$start_time'
-					OR (periodically_time_from < '$start_time'
-						AND periodically_time_to >= '$start_time'))
-				OR (periodically_time_from = '$end_time'
-					OR (periodically_time_from < '$end_time'
-						AND periodically_time_to >= '$end_time'))))";
+            AND ((periodically_time_from > '$start_time' AND periodically_time_to < '$end_time')
+                OR (periodically_time_from = '$start_time'
+                    OR (periodically_time_from < '$start_time'
+                        AND periodically_time_to >= '$start_time'))
+                OR (periodically_time_from = '$end_time'
+                    OR (periodically_time_from < '$end_time'
+                        AND periodically_time_to >= '$end_time'))))";
     } else {
         while ($date_aux <= $end_date && $i < 7) {
             $weekday_actual = strtolower(date('l', $date_aux));
@@ -10660,68 +10679,68 @@ function reporting_get_planned_downtimes($start_date, $end_date, $id_agent_modul
         }
 
         $sql_downtime = '
-			SELECT
-				DISTINCT(tpdr.id),
-				tpdr.name,
-				'.$tpdr_description.",
-				tpdr.date_from,
-				tpdr.date_to,
-				tpdr.executed,
-				tpdr.id_group,
-				tpdr.only_alerts,
-				tpdr.monday,
-				tpdr.tuesday,
-				tpdr.wednesday,
-				tpdr.thursday,
-				tpdr.friday,
-				tpdr.saturday,
-				tpdr.sunday,
-				tpdr.periodically_time_from,
-				tpdr.periodically_time_to,
-				tpdr.periodically_day_from,
-				tpdr.periodically_day_to,
-				tpdr.type_downtime,
-				tpdr.type_execution,
-				tpdr.type_periodicity,
-				tpdr.id_user
-			FROM (
-					SELECT tpd.*
-					FROM tplanned_downtime tpd, tplanned_downtime_agents tpda, tagente_modulo tam
-					WHERE (tpd.id = tpda.id_downtime
-							AND tpda.all_modules = 1
-							AND tpda.id_agent = tam.id_agente
-							AND tam.id_agente_modulo IN ($id_agent_modules_str))
-						AND ((type_execution = 'periodically'
-								AND $periodically_condition)
-							OR (type_execution = 'once'
-								AND ((date_from >= '$start_date' AND date_to <= '$end_date')
-									OR (date_from <= '$start_date' AND date_to >= '$end_date')
-									OR (date_from <= '$start_date' AND date_to >= '$start_date')
-									OR (date_from <= '$end_date' AND date_to >= '$end_date'))))
-				UNION ALL
-					SELECT tpd.*
-					FROM tplanned_downtime tpd, tplanned_downtime_modules tpdm
-					WHERE (tpd.id = tpdm.id_downtime
-							AND tpdm.id_agent_module IN ($id_agent_modules_str))
-						AND ((type_execution = 'periodically'
-								AND $periodically_condition)
-							OR (type_execution = 'once'
-								AND ((date_from >= '$start_date' AND date_to <= '$end_date')
-									OR (date_from <= '$start_date' AND date_to >= '$end_date')
-									OR (date_from <= '$start_date' AND date_to >= '$start_date')
-									OR (date_from <= '$end_date' AND date_to >= '$end_date'))))
-			) tpdr
-			ORDER BY tpdr.id";
+            SELECT
+                DISTINCT(tpdr.id),
+                tpdr.name,
+                '.$tpdr_description.",
+                tpdr.date_from,
+                tpdr.date_to,
+                tpdr.executed,
+                tpdr.id_group,
+                tpdr.only_alerts,
+                tpdr.monday,
+                tpdr.tuesday,
+                tpdr.wednesday,
+                tpdr.thursday,
+                tpdr.friday,
+                tpdr.saturday,
+                tpdr.sunday,
+                tpdr.periodically_time_from,
+                tpdr.periodically_time_to,
+                tpdr.periodically_day_from,
+                tpdr.periodically_day_to,
+                tpdr.type_downtime,
+                tpdr.type_execution,
+                tpdr.type_periodicity,
+                tpdr.id_user
+            FROM (
+                    SELECT tpd.*
+                    FROM tplanned_downtime tpd, tplanned_downtime_agents tpda, tagente_modulo tam
+                    WHERE (tpd.id = tpda.id_downtime
+                            AND tpda.all_modules = 1
+                            AND tpda.id_agent = tam.id_agente
+                            AND tam.id_agente_modulo IN ($id_agent_modules_str))
+                        AND ((type_execution = 'periodically'
+                                AND $periodically_condition)
+                            OR (type_execution = 'once'
+                                AND ((date_from >= '$start_date' AND date_to <= '$end_date')
+                                    OR (date_from <= '$start_date' AND date_to >= '$end_date')
+                                    OR (date_from <= '$start_date' AND date_to >= '$start_date')
+                                    OR (date_from <= '$end_date' AND date_to >= '$end_date'))))
+                UNION ALL
+                    SELECT tpd.*
+                    FROM tplanned_downtime tpd, tplanned_downtime_modules tpdm
+                    WHERE (tpd.id = tpdm.id_downtime
+                            AND tpdm.id_agent_module IN ($id_agent_modules_str))
+                        AND ((type_execution = 'periodically'
+                                AND $periodically_condition)
+                            OR (type_execution = 'once'
+                                AND ((date_from >= '$start_date' AND date_to <= '$end_date')
+                                    OR (date_from <= '$start_date' AND date_to >= '$end_date')
+                                    OR (date_from <= '$start_date' AND date_to >= '$start_date')
+                                    OR (date_from <= '$end_date' AND date_to >= '$end_date'))))
+            ) tpdr
+            ORDER BY tpdr.id";
     } else {
         $sql_downtime = "SELECT *
-						FROM tplanned_downtime tpd, tplanned_downtime_modules tpdm
-						WHERE (type_execution = 'periodically'
-									AND $periodically_condition)
-								OR (type_execution = 'once'
-									AND ((date_from >= '$start_date' AND date_to <= '$end_date')
-										OR (date_from <= '$start_date' AND date_to >= '$end_date')
-										OR (date_from <= '$start_date' AND date_to >= '$start_date')
-										OR (date_from <= '$end_date' AND date_to >= '$end_date')))";
+                        FROM tplanned_downtime tpd, tplanned_downtime_modules tpdm
+                        WHERE (type_execution = 'periodically'
+                                    AND $periodically_condition)
+                                OR (type_execution = 'once'
+                                    AND ((date_from >= '$start_date' AND date_to <= '$end_date')
+                                        OR (date_from <= '$start_date' AND date_to >= '$end_date')
+                                        OR (date_from <= '$start_date' AND date_to >= '$start_date')
+                                        OR (date_from <= '$end_date' AND date_to >= '$end_date')))";
     }
 
     $downtimes = db_get_all_rows_sql($sql_downtime);
@@ -10789,10 +10808,10 @@ function reporting_get_agentmodule_sla_day($id_agent_module, $period=0, $min_val
     // Get interval data
     $sql = sprintf(
         'SELECT *
-		FROM tagente_datos
-		WHERE id_agente_modulo = %d
-			AND utimestamp > %d
-			AND utimestamp <= %d',
+        FROM tagente_datos
+        WHERE id_agente_modulo = %d
+            AND utimestamp > %d
+            AND utimestamp <= %d',
         $id_agent_module,
         $datelimit,
         $date
@@ -11117,7 +11136,7 @@ function reporting_get_stats_servers()
     $table_srv->data[] = $tdata;
 
     $output = '<fieldset class="databox tactical_set">
-				<legend>'.__('Server performance').'</legend>'.html_print_table($table_srv, true).'</fieldset>';
+                <legend>'.__('Server performance').'</legend>'.html_print_table($table_srv, true).'</fieldset>';
 
     $output .= '<script type="text/javascript">';
         $output .= '$(document).ready(function () {';

From 09e5feef05591868fa7039539df4b7677576c4b7 Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Mon, 8 Jul 2019 17:02:28 +0200
Subject: [PATCH 56/83] add message no acces saml without saml.php file

---
 pandora_console/general/noaccesssaml.php | 164 +++++++++++++++++++++++
 pandora_console/index.php                |   9 +-
 2 files changed, 170 insertions(+), 3 deletions(-)
 create mode 100644 pandora_console/general/noaccesssaml.php

diff --git a/pandora_console/general/noaccesssaml.php b/pandora_console/general/noaccesssaml.php
new file mode 100644
index 0000000000..e357e040dc
--- /dev/null
+++ b/pandora_console/general/noaccesssaml.php
@@ -0,0 +1,164 @@
+<html>
+<head>
+    
+<style>
+
+#alert_messages_na{
+    z-index:2;
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    transform: translate(-50%, -50%);
+    -webkit-transform: translate(-50%, -50%);   
+    width:650px;
+    height: 400px;
+    background:white;
+    background-image:url('images/imagen-no-acceso.jpg');
+    background-repeat:no-repeat;
+    justify-content: center;
+    display: flex;
+    flex-direction: column;
+    box-shadow:4px 5px 10px 3px rgba(0, 0, 0, 0.4);
+}
+
+.modalheade{
+    text-align:center;
+    width:100%;
+    position:absolute;
+    top:0;
+}
+.modalheadertex{
+    color:#000;
+    font-family:Nunito;
+    line-height: 40px;
+    font-size: 23pt;
+    margin-bottom:30px;
+}
+.modalclose{
+    cursor:pointer;
+    display:inline;
+    float:right;
+    margin-right:10px;
+    margin-top:10px;
+}
+.modalconten{
+    color:black;
+    width:300px;
+    margin-left: 30px;
+}
+.modalcontenttex{
+    text-align:left;
+    color:black;
+    font-size: 11pt;
+    line-height:13pt;
+    margin-bottom:30px;
+}
+.modalokbutto{
+    cursor:pointer;
+    text-align:center;
+    display: inline-block;
+    padding: 6px 45px;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    background-color:white;
+    border: 1px solid #82b92e;
+}
+.modalokbuttontex{
+    color:#82b92e;
+    font-family:Nunito;
+    font-size:13pt;
+}
+.modalgobutto{
+    cursor:pointer;
+    text-align:center;
+    -moz-border-radius: 3px;
+    -webkit-border-radius: 3px;
+    border-radius: 3px;
+    background-color:white;
+    border: 1px solid #82b92e;
+}
+.modalgobuttontex{
+color:#82b92e;
+font-family:Nunito;
+font-size:10pt;
+}
+
+
+#opacidad{
+    position:fixed;
+    background:black;
+    opacity:0.6;
+    z-index:-1;
+    left:0px;
+    top:0px;
+    width:100%;
+    height:100%;
+}
+/*
+.textodialog{
+    margin-left: 0px;
+    color:#333;
+    padding:20px;
+    font-size:9pt;
+}
+
+.cargatextodialog{
+    max-width:58.5%;
+    width:58.5%;
+    min-width:58.5%;
+    float:left;
+    margin-left: 0px;
+    font-size:18pt;
+    padding:20px;
+    text-align:center;
+}
+
+.cargatextodialog p, .cargatextodialog b, .cargatextodialog a{
+    font-size:18pt; 
+}
+*/
+</style>
+</head>
+<body>
+    
+    <div id="alert_messages_na">
+        
+        <div class='modalheade'>
+            <img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>  
+        </div>
+
+        <div class='modalconten'>
+            <div class='modalheadertex'>
+                <?php echo __("You don't have access to this page"); ?>
+            </div>
+
+            <div class='modalcontenttex'>
+                <?php
+                echo __('Access to this page is restricted to authorized users SAML only, please contact system administrator if you need assistance.');
+                    echo '<br/> <br/>';
+                    echo __('Please make sure you have SAML authentication properly configured. For more information the error to access this page are recorded in security logs of %s System Database', get_product_name());
+                ?>
+                      
+            </div>
+
+            <div class='modalokbutto cerrar'>
+                <span class='modalokbuttontex'>OK</span>
+            </div>
+        </div>
+    </div>
+        
+    <div id="opacidad"></div>
+    
+</body>
+</html>
+
+<script>
+
+    $(".cerrar").click(function(){
+    window.location=".";
+    });
+
+    $('div#page').css('background-color','#d3d3d3');
+
+</script>
diff --git a/pandora_console/index.php b/pandora_console/index.php
index 3c95074171..320a33da3b 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -359,12 +359,15 @@ if (! isset($config['id_user'])) {
             $nick_in_db = $_SESSION['prepared_login_da']['id_user'];
             $expired_pass = false;
         } else if (($config['auth'] == 'saml') && ($login_button_saml)) {
-            include_once ENTERPRISE_DIR.'/include/auth/saml.php';
-
-            $saml_user_id = saml_process_user_login();
+            if (!include_once 'include/auth/saml.php') {
+                include_once 'general/noaccesssaml.php';
+            } else {
+                $saml_user_id = saml_process_user_login();
+            }
 
             $nick_in_db = $saml_user_id;
             if (!$nick_in_db) {
+                include_once 'general/noaccesssaml.php';
                 include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
                 $as = new SimpleSAML_Auth_Simple('PandoraFMS');
                 $as->logout();

From 127f67f2ac92f616fc07b5d3bacdf093d7df51ab Mon Sep 17 00:00:00 2001
From: Daniel Barbero <daniel.barbero@artica.es>
Date: Mon, 8 Jul 2019 19:33:54 +0200
Subject: [PATCH 57/83] fixed error in network component

---
 .../godmode/agentes/configurar_agente.php     | 14 +++--------
 .../include/javascript/pandora_modules.js     | 23 +++++++++++++------
 2 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php
index d5f6f1fcfd..842f6c3d46 100644
--- a/pandora_console/godmode/agentes/configurar_agente.php
+++ b/pandora_console/godmode/agentes/configurar_agente.php
@@ -1276,18 +1276,10 @@ if ($update_module || $create_module) {
                 $m_hide = $m['hide'];
             }
 
-            if ($update_module) {
-                if ($m_hide == '1') {
-                    $macros[$k]['value'] = io_input_password(get_parameter($m['macro'], ''));
-                } else {
-                    $macros[$k]['value'] = get_parameter($m['macro'], '');
-                }
+            if ($m_hide == '1') {
+                $macros[$k]['value'] = io_input_password(get_parameter($m['macro'], ''));
             } else {
-                if ($m_hide == '1') {
-                    $macros[$k]['value'] = io_input_password($macros_names[$k]);
-                } else {
-                    $macros[$k]['value'] = $macros_names[$k];
-                }
+                $macros[$k]['value'] = get_parameter($m['macro'], '');
             }
         }
 
diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js
index 2795df7bdb..d04c3d2bd6 100644
--- a/pandora_console/include/javascript/pandora_modules.js
+++ b/pandora_console/include/javascript/pandora_modules.js
@@ -536,7 +536,7 @@ function configure_modules_form() {
 
           var obj = jQuery.parseJSON(data["macros"]);
           $.each(obj, function(k, macro) {
-            add_macro_field(macro, "simple-macro", "td");
+            add_macro_field(macro, "simple-macro", "td", k);
           });
         }
 
@@ -791,7 +791,7 @@ function new_macro(prefix, callback) {
   }
 }
 
-function add_macro_field(macro, row_model_id, type_copy) {
+function add_macro_field(macro, row_model_id, type_copy, k) {
   var macro_desc = macro["desc"];
   // Change the carriage returns by html returns <br> in help
   var macro_help = macro["help"].replace(/&#x0d;/g, "<br>");
@@ -799,7 +799,6 @@ function add_macro_field(macro, row_model_id, type_copy) {
   var macro_value = $("<div />")
     .html(macro["value"])
     .text();
-  var macro_hide = macro["hide"];
 
   macro_value.type = "password";
 
@@ -809,6 +808,7 @@ function add_macro_field(macro, row_model_id, type_copy) {
 
   // Change attributes to be unique and with identificable class
   $macro_field.attr("id", row_id);
+
   $macro_field.attr("class", "macro_field");
 
   // Get the number of fields already printed
@@ -828,6 +828,19 @@ function add_macro_field(macro, row_model_id, type_copy) {
     );
   }
 
+  // Only for create module type plugin need rename
+  // td id "simple-macro_field" + k + "-1" is horrible.
+  if (k) {
+    $("#" + row_model_id + "_field" + k + "_ td:eq(0)").attr(
+      "id",
+      "simple-macro_field" + k + "-0"
+    );
+    $("#" + row_model_id + "_field" + k + "_ td:eq(1)").attr(
+      "id",
+      "simple-macro_field" + k + "-1"
+    );
+  }
+
   // Change the label
   if (macro_help == "") {
     $("#" + row_id)
@@ -855,13 +868,11 @@ function add_macro_field(macro, row_model_id, type_copy) {
       .children()
       .eq(1)
       .children()
-      .eq(0)
       .attr("id", "text-" + macro_macro);
     $("#" + row_id)
       .children()
       .eq(1)
       .children()
-      .eq(0)
       .attr("name", macro_macro);
   } else {
     $("#" + row_id)
@@ -893,14 +904,12 @@ function add_macro_field(macro, row_model_id, type_copy) {
         .children()
         .eq(1)
         .children()
-        .eq(0)
         .attr("type", "password");
     } else {
       $("#" + row_id)
         .children()
         .eq(1)
         .children()
-        .eq(0)
         .val(macro_value);
     }
   } else {

From 729fb32ffb2c19ec1b3686e7b3672d05d0856980 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Tue, 9 Jul 2019 00:01:10 +0200
Subject: [PATCH 58/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 02a7bdab5f..6f8d1f824d 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190708
+Version: 7.0NG.736-190709
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index cc8929763d..1234a20b06 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190708"
+pandora_version="7.0NG.736-190709"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 399559f00b..5be1d49311 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190708';
+use constant AGENT_BUILD => '190709';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 977af1104f..23d3afc120 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190708
+%define release     190709
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 84eac835d9..7320e5a83d 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190708
+%define release     190709
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 02c3728350..ae6028674d 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190708"
+PI_BUILD="190709"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index ce66038ef5..7f4138dd8a 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190708}
+{190709}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 41ae8eb267..dc6658a299 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190708)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190709)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 696d6c34e3..7589ae4e1f 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190708))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190709))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 062c14afdc..09c13f639d 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190708
+Version: 7.0NG.736-190709
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 56d98823ac..1e2e36c157 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190708"
+pandora_version="7.0NG.736-190709"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 3adcf1f113..57121de09a 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190708';
+$build_version = 'PC190709';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index e22cf98add..1f7283c155 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190708';
+            $build = '190709';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 4b5ba54d58..4d769141e2 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190708
+%define release     190709
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index 7b8be55c9a..e8179bd043 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190708
+%define release     190709
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index cb245a98b6..4c96b354d5 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190708
+%define release     190709
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 3a2b2d11f1..e0e43f69bf 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190708
+Version: 7.0NG.736-190709
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index fa5303f620..7d8b03492a 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190708"
+pandora_version="7.0NG.736-190709"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 1d73d1ab8b..017d5a0308 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190708";
+my $pandora_build = "190709";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 80f94f0543..60d445306a 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190708";
+my $pandora_build = "190709";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 9eca22a68f..da6d2103e1 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190708
+%define release     190709
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 92935fbd0d..222a596040 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190708
+%define release     190709
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 1ddc84c2c9..0c14c07255 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190708"
+PI_BUILD="190709"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index f4c3a443df..dd4417cb0b 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190708";
+my $version = "7.0NG.736 PS190709";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index cf5bf608e3..6b2567e178 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190708";
+my $version = "7.0NG.736 PS190709";
 
 # save program name for logging
 my $progname = basename($0);

From 0f280494a00a8e5cb6be01459d0a46a618b09a3d Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Tue, 9 Jul 2019 09:33:49 +0200
Subject: [PATCH 59/83] Changed images for divs to show preview in visual
 styles - #4195

---
 .../godmode/setup/setup_visuals.php           | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php
index 8b0b2d5486..6e73913b56 100755
--- a/pandora_console/godmode/setup/setup_visuals.php
+++ b/pandora_console/godmode/setup/setup_visuals.php
@@ -159,6 +159,16 @@ $table_styles->data[$row][1] = html_print_select(
 $table_styles->data[$row][1] .= '&nbsp;'.html_print_button(__('View'), 'status_set_preview', false, '', 'class="sub camera logo_preview"', true);
 $row++;
 
+// Divs to show icon status Colours (Default)
+$icon_unknown_ball = ui_print_status_image(STATUS_AGENT_UNKNOWN_BALL, '', true);
+$icon_unknown = ui_print_status_image(STATUS_AGENT_UNKNOWN, '', true);
+$icon_ok_ball = ui_print_status_image(STATUS_AGENT_OK_BALL, '', true);
+$icon_ok = ui_print_status_image(STATUS_AGENT_OK, '', true);
+$icon_warning_ball = ui_print_status_image(STATUS_AGENT_WARNING_BALL, '', true);
+$icon_warning = ui_print_status_image(STATUS_AGENT_WARNING, '', true);
+$icon_bad_ball = ui_print_status_image(STATUS_AGENT_CRITICAL_BALL, '', true);
+$icon_bad = ui_print_status_image(STATUS_AGENT_CRITICAL, '', true);
+// End - Divs to show icon status Colours (Default)
 $table_styles->data[$row][0] = __('Login background').ui_print_help_tip(__('You can place your custom images into the folder images/backgrounds/'), true);
 $backgrounds_list_jpg = list_files('images/backgrounds', 'jpg', 1, 0);
 $backgrounds_list_gif = list_files('images/backgrounds', 'gif', 1, 0);
@@ -1635,6 +1645,17 @@ $("#button-status_set_preview").click (function (e) {
     $icon_bad_ball = $("<img src=\"" + icon_path + "agent_critical_ball.png\">");
     $icon_bad = $("<img src=\"" + icon_path + "agent_critical.png\">");
 
+    if(icon_dir == 'default'){
+        $icon_unknown_ball = '<?php echo $icon_unknown_ball; ?>';
+        $icon_unknown = '<?php echo $icon_unknown; ?>';
+        $icon_ok_ball = '<?php echo $icon_ok_ball; ?>';
+        $icon_ok = '<?php echo $icon_ok; ?>';
+        $icon_warning_ball = '<?php echo $icon_warning_ball; ?>';
+        $icon_warning = '<?php echo $icon_warning; ?>';
+        $icon_bad_ball = '<?php echo $icon_bad_ball; ?>';
+        $icon_bad = '<?php echo $icon_bad; ?>';
+    }
+
     try {
         $dialog
             .hide()

From bd80e013f56330d91e33cdc3cd19b4425cca8582 Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Tue, 9 Jul 2019 12:02:07 +0200
Subject: [PATCH 60/83] minor fix to avoid log messages

---
 pandora_console/include/load_session.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_console/include/load_session.php b/pandora_console/include/load_session.php
index 99bae81244..8b243d808a 100644
--- a/pandora_console/include/load_session.php
+++ b/pandora_console/include/load_session.php
@@ -94,7 +94,7 @@ function pandora_session_write($session_id, $data)
     if (is_ajax()) {
         // Avoid session upadte while processing ajax responses - notifications.
         if (get_parameter('check_new_notifications', false)) {
-            return false;
+            return true;
         }
     }
 

From 0cabc4d4dac8ac6895b18208ae5cf0177ceeb287 Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Tue, 9 Jul 2019 12:02:29 +0200
Subject: [PATCH 61/83] Azure discovery task form completed

---
 .../wizards/DiscoveryTaskList.class.php       | 112 +++++++++++-------
 .../include/functions_snmp_browser.php        |   2 -
 2 files changed, 70 insertions(+), 44 deletions(-)

diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php
index e018ec3d30..586f24335b 100644
--- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php
+++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php
@@ -501,41 +501,60 @@ class DiscoveryTaskList extends Wizard
                     $data[5] = __('Pending');
                 }
 
-                if ($task['id_recon_script'] == 0) {
-                    // Internal discovery task.
-                    switch ($task['type']) {
-                        case DISCOVERY_CLOUD_AWS_RDS:
-                            // Discovery Applications MySQL.
-                            $data[6] = html_print_image(
-                                'images/network.png',
-                                true,
-                                ['title' => __('Discovery Cloud RDS')]
-                            ).'&nbsp;&nbsp;';
-                            $data[6] .= __('Discovery.Cloud.Aws.RDS');
-                        break;
+                switch ($task['type']) {
+                    case DISCOVERY_CLOUD_AZURE_COMPUTE:
+                        // Discovery Applications MySQL.
+                        $data[6] = html_print_image(
+                            'images/plugin.png',
+                            true,
+                            ['title' => __('Discovery Cloud Azure Compute')]
+                        ).'&nbsp;&nbsp;';
+                        $data[6] .= __('Cloud.Azure.Compute');
+                    break;
 
-                        case DISCOVERY_APP_MYSQL:
-                            // Discovery Applications MySQL.
-                            $data[6] = html_print_image(
-                                'images/network.png',
-                                true,
-                                ['title' => __('Discovery Applications MySQL')]
-                            ).'&nbsp;&nbsp;';
-                            $data[6] .= __('Discovery.App.MySQL');
-                        break;
+                    case DISCOVERY_CLOUD_AWS_EC2:
+                        // Discovery Applications MySQL.
+                        $data[6] = html_print_image(
+                            'images/plugin.png',
+                            true,
+                            ['title' => __('Discovery Cloud AWS EC2')]
+                        ).'&nbsp;&nbsp;';
+                        $data[6] .= __('Cloud.AWS.EC2');
+                    break;
 
-                        case DISCOVERY_APP_ORACLE:
-                            // Discovery Applications Oracle.
-                            $data[6] = html_print_image(
-                                'images/network.png',
-                                true,
-                                ['title' => __('Discovery Applications Oracle')]
-                            ).'&nbsp;&nbsp;';
-                            $data[6] .= __('Discovery.App.Oracle');
-                        break;
+                    case DISCOVERY_CLOUD_AWS_RDS:
+                        // Discovery Cloud RDS.
+                        $data[6] = html_print_image(
+                            'images/network.png',
+                            true,
+                            ['title' => __('Discovery Cloud RDS')]
+                        ).'&nbsp;&nbsp;';
+                        $data[6] .= __('Discovery.Cloud.Aws.RDS');
+                    break;
 
-                        case DISCOVERY_HOSTDEVICES:
-                        default:
+                    case DISCOVERY_APP_MYSQL:
+                        // Discovery Applications MySQL.
+                        $data[6] = html_print_image(
+                            'images/network.png',
+                            true,
+                            ['title' => __('Discovery Applications MySQL')]
+                        ).'&nbsp;&nbsp;';
+                        $data[6] .= __('Discovery.App.MySQL');
+                    break;
+
+                    case DISCOVERY_APP_ORACLE:
+                        // Discovery Applications Oracle.
+                        $data[6] = html_print_image(
+                            'images/network.png',
+                            true,
+                            ['title' => __('Discovery Applications Oracle')]
+                        ).'&nbsp;&nbsp;';
+                        $data[6] .= __('Discovery.App.Oracle');
+                    break;
+
+                    case DISCOVERY_HOSTDEVICES:
+                    default:
+                        if ($task['id_recon_script'] == 0) {
                             // Discovery NetScan.
                             $data[6] = html_print_image(
                                 'images/network.png',
@@ -550,15 +569,15 @@ class DiscoveryTaskList extends Wizard
                             } else {
                                 $data[6] .= __('Discovery.NetScan');
                             }
-                        break;
-                    }
-                } else {
-                    // APP recon task.
-                    $data[6] = html_print_image(
-                        'images/plugin.png',
-                        true
-                    ).'&nbsp;&nbsp;';
-                    $data[6] .= $recon_script_name;
+                        } else {
+                            // APP or external script recon task.
+                            $data[6] = html_print_image(
+                                'images/plugin.png',
+                                true
+                            ).'&nbsp;&nbsp;';
+                            $data[6] .= $recon_script_name;
+                        }
+                    break;
                 }
 
                 if ($task['status'] <= 0 || $task['status'] > 100) {
@@ -699,7 +718,16 @@ class DiscoveryTaskList extends Wizard
         if ($script !== false) {
             switch ($script['type']) {
                 case DISCOVERY_SCRIPT_CLOUD_AWS:
-                return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&page=1';
+                    switch ($task['type']) {
+                        case DISCOVERY_CLOUD_AWS_EC2:
+                        return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&page=1';
+
+                        case DISCOVERY_CLOUD_AZURE_COMPUTE:
+                        return 'wiz=cloud&mode=azure&ki='.$task['auth_strings'].'&sub=compute&page=0';
+
+                        default:
+                        return 'wiz=cloud';
+                    }
 
                 case DISCOVERY_SCRIPT_APP_VMWARE:
                 return 'wiz=app&mode=vmware&page=0';
diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php
index dded175af5..5b485d9e54 100644
--- a/pandora_console/include/functions_snmp_browser.php
+++ b/pandora_console/include/functions_snmp_browser.php
@@ -96,7 +96,6 @@ function snmp_browser_get_html_tree(
     foreach ($tree['__LEAVES__'] as $level => $sub_level) {
         // Id used to expand leafs.
         $sub_id = time().rand(0, getrandmax());
-
         // Display the branch.
         $output .= '<li id="li_'.$sub_id.'" style="margin: 0; padding: 0;">';
 
@@ -225,7 +224,6 @@ function snmp_browser_print_tree(
         $last_array,
         $sufix,
         $checked,
-        $return,
         $descriptive_ids,
         $previous_id
     );

From ab3cfd4cc97f3b2ef8f0552b5571f9b84a2a74ca Mon Sep 17 00:00:00 2001
From: Daniel Barbero <daniel.barbero@artica.es>
Date: Tue, 9 Jul 2019 14:08:06 +0200
Subject: [PATCH 62/83] new tocken user edit newslatter info

---
 .../godmode/users/configure_user.php          | 34 ++++++++++++++-----
 1 file changed, 26 insertions(+), 8 deletions(-)

diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php
index 47788284fe..662df7ecee 100644
--- a/pandora_console/godmode/users/configure_user.php
+++ b/pandora_console/godmode/users/configure_user.php
@@ -137,6 +137,8 @@ if ($new_user && $config['admin_can_add_user']) {
     $user_info['not_login'] = false;
     $user_info['strict_acl'] = false;
     $user_info['session_time'] = 0;
+    $user_info['middlename'] = 0;
+
     if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
         $user_info['id_skin'] = '';
     }
@@ -218,6 +220,7 @@ if ($create_user) {
     }
 
     $values['not_login'] = (bool) get_parameter('not_login', false);
+    $values['middlename'] = get_parameter('middlename', 0);
     $values['strict_acl'] = (bool) get_parameter('strict_acl', false);
     $values['session_time'] = (int) get_parameter('session_time', 0);
 
@@ -317,12 +320,13 @@ if ($update_user) {
     $values['timezone'] = (string) get_parameter('timezone');
     $values['default_event_filter'] = (int) get_parameter('default_event_filter');
     $values['default_custom_view'] = (int) get_parameter('default_custom_view');
-    // eHorus user level conf
+
+    // eHorus user level conf.
     $values['ehorus_user_level_enabled'] = (bool) get_parameter('ehorus_user_level_enabled', false);
     $values['ehorus_user_level_user'] = (string) get_parameter('ehorus_user_level_user');
     $values['ehorus_user_level_pass'] = (string) get_parameter('ehorus_user_level_pass');
 
-
+    $values['middlename'] = get_parameter('middlename', 0);
 
     $dashboard = get_parameter('dashboard', '');
     $visual_console = get_parameter('visual_console', '');
@@ -869,13 +873,27 @@ foreach ($event_filter_data as $filter) {
 $table->data[16][0] = __('Default event filter');
 $table->data[16][1] = html_print_select($event_filter, 'default_event_filter', $user_info['default_event_filter'], '', '', __('None'), true, false, false);
 
+$table->data[17][0] = __('Disabled newsletter');
+if ($user_info['middlename'] >= 0) {
+    $middlename = false;
+} else {
+    $middlename = true;
+}
+
+$table->data[17][1] = html_print_checkbox(
+    'middlename',
+    -1,
+    $middlename,
+    true
+);
+
 if ($config['ehorus_user_level_conf']) {
-    $table->data[17][0] = __('eHorus user acces enabled');
-    $table->data[17][1] = html_print_checkbox('ehorus_user_level_enabled', 1, $user_info['ehorus_user_level_enabled'], true);
-    $table->data[18][0] = __('eHorus user');
-    $table->data[19][0] = __('eHorus password');
-    $table->data[18][1] = html_print_input_text('ehorus_user_level_user', $user_info['ehorus_user_level_user'], '', 15, 45, true);
-    $table->data[19][1] = html_print_input_password('ehorus_user_level_pass', io_output_password($user_info['ehorus_user_level_pass']), '', 15, 45, true);
+    $table->data[18][0] = __('eHorus user acces enabled');
+    $table->data[18][1] = html_print_checkbox('ehorus_user_level_enabled', 1, $user_info['ehorus_user_level_enabled'], true);
+    $table->data[19][0] = __('eHorus user');
+    $table->data[20][0] = __('eHorus password');
+    $table->data[19][1] = html_print_input_text('ehorus_user_level_user', $user_info['ehorus_user_level_user'], '', 15, 45, true);
+    $table->data[20][1] = html_print_input_password('ehorus_user_level_pass', io_output_password($user_info['ehorus_user_level_pass']), '', 15, 45, true);
 }
 
 

From d05dd7ecbc801f5c15eae822a0e6b3263f61dfc8 Mon Sep 17 00:00:00 2001
From: Daniel Barbero <daniel.barbero@artica.es>
Date: Tue, 9 Jul 2019 14:56:42 +0200
Subject: [PATCH 63/83] fixed minor error

---
 pandora_console/include/functions_reporting.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 410925fd98..c56c2b85fe 100755
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -6582,6 +6582,7 @@ function reporting_availability_graph($report, $content, $pdf=false)
                     $content,
                     $report['datetime'],
                     $return,
+                    '',
                     $pdf
                 );
             }

From eaf29b798a4e8a669c7f0f38902692d37b6d363c Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Tue, 9 Jul 2019 15:03:38 +0200
Subject: [PATCH 64/83] Fixed minor visual bugs in black theme- #4194

---
 pandora_console/extensions/module_groups.php  | 10 ++-
 .../agentes/module_manager_editor_common.php  |  9 ++-
 .../include/functions_reporting_html.php      |  8 ++-
 .../include/styles/pandora_black.css          | 69 ++++++++++++++++++-
 pandora_console/operation/search_main.php     |  2 +-
 5 files changed, 92 insertions(+), 6 deletions(-)

diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php
index d9843f9860..8b5075f77c 100644
--- a/pandora_console/extensions/module_groups.php
+++ b/pandora_console/extensions/module_groups.php
@@ -270,6 +270,12 @@ function mainModuleGroups()
         $table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
         $table->width = '100%';
 
+        if ($config['style'] === 'pandora_black') {
+            $background_color = '#333';
+        } else {
+            $background_color = '#fff';
+        }
+
         $head[0] = __('Groups');
         $headstyle[0] = 'width: 20%;  font-weight: bolder;';
         foreach ($array_module_group as $key => $value) {
@@ -314,7 +320,7 @@ function mainModuleGroups()
                         $data[$i][$j] .= $array_data[$key][$k]['total_count'];
                         $data[$i][$j] .= '</a></div>';
                     } else {
-                        $data[$i][$j] = "<div style='background:white;".$cell_style."'>";
+                        $data[$i][$j] = "<div style='background:".$background_color.';'.$cell_style."'>";
                         $data[$i][$j] .= 0;
                         $data[$i][$j] .= '</div>';
                     }
@@ -323,7 +329,7 @@ function mainModuleGroups()
                 }
             } else {
                 foreach ($value['gm'] as $k => $v) {
-                    $data[$i][$j] = "<div style='background:white; min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
+                    $data[$i][$j] = "<div style='background:".$background_color."; min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
                     $data[$i][$j] .= 0;
                     $data[$i][$j] .= '</div>';
                     $j++;
diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php
index fbdd620f77..cc674f3837 100644
--- a/pandora_console/godmode/agentes/module_manager_editor_common.php
+++ b/pandora_console/godmode/agentes/module_manager_editor_common.php
@@ -78,6 +78,13 @@ function push_table_advanced($row, $id=false)
 function add_component_selection($id_network_component_type)
 {
     global $table_simple;
+    global $config;
+
+    if ($config['style'] === 'pandora_black') {
+        $background_row = 'background-color: #444';
+    } else {
+        $background_row = 'background-color: #cfcfcf';
+    }
 
     $data = [];
     $data[0] = __('Using module component').' ';
@@ -116,7 +123,7 @@ function add_component_selection($id_network_component_type)
     $data[1] .= '</span>';
 
     $table_simple->colspan['module_component'][1] = 3;
-    $table_simple->rowstyle['module_component'] = 'background-color: #cfcfcf';
+    $table_simple->rowstyle['module_component'] = $background_row;
 
     prepend_table_simple($data, 'module_component');
 }
diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php
index c8d5b3e29e..c6524b4ec3 100644
--- a/pandora_console/include/functions_reporting_html.php
+++ b/pandora_console/include/functions_reporting_html.php
@@ -107,9 +107,15 @@ function html_do_report_info($report)
 {
     global $config;
 
+    if ($config['style'] === 'pandora_black') {
+        $background_color = '#222';
+    } else {
+        $background_color = '#f5f5f5';
+    }
+
     $date_today = date($config['date_format']);
 
-    $html = '<div style="border: 1px dashed #999; padding: 10px 15px; background: #f5f5f5;margin-top:20px;margin-bottom:20px;"><table>
+    $html = '<div style="border: 1px dashed #999; padding: 10px 15px; background: '.$background_color.';margin-top:20px;margin-bottom:20px;"><table>
             <tr>
                 <td><b>'.__('Generated').': </b></td><td>'.$date_today.'</td>
             </tr>
diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css
index 2db907831a..1913f9025d 100644
--- a/pandora_console/include/styles/pandora_black.css
+++ b/pandora_console/include/styles/pandora_black.css
@@ -55,6 +55,11 @@ table.databox,
   color: #fff;
 }
 
+input[readonly] {
+  background-color: #444 !important;
+  color: #a2a2a2 !important;
+}
+
 .box-shadow {
   box-shadow: none;
 }
@@ -88,6 +93,37 @@ textarea:disabled {
   filter: brightness(2.5) contrast(3.5);
 }
 
+table.widget_list tr.datos,
+table.widget_list tr.datos2,
+table.widget_list td.datos,
+table.widget_list td.datos2 {
+  background-color: inherit;
+}
+
+/* messages */
+.container {
+  background-color: #222;
+}
+
+.p-slider {
+  background-color: #888;
+}
+
+ol.steps li.current {
+  border-left: 5px solid #82b92e;
+  background-color: #545454;
+}
+
+ol.steps li {
+  background-color: #999;
+}
+
+ol.steps li.visited,
+ol.steps li.visited span,
+ol.steps li.visited a {
+  color: #eaeaea;
+}
+
 /* White text */
 a,
 #menu_tab_left li a,
@@ -109,7 +145,9 @@ form.discovery label,
 .input_label,
 .pagination,
 tr.group_view_data,
-.group_view_data {
+.group_view_data,
+ol.steps li span,
+ol.steps li a {
   color: #fff;
 }
 
@@ -198,6 +236,13 @@ table.table_modal_alternate tr:nth-child(even) td {
   color: #fff;
 }
 
+.info_table .datos3,
+.datos3,
+.info_table .datos4,
+.datos4 {
+  background-color: #444;
+}
+
 .action_buttons a[href] img,
 .action_buttons input[type="image"],
 .action_button_img {
@@ -318,3 +363,25 @@ ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
   img {
   filter: brightness(2);
 }
+
+/* notifications */
+#notification-wrapper::before {
+  border-bottom-color: #111;
+}
+
+#notification-wrapper {
+  background: #111;
+}
+
+.notification-item {
+  background: #222;
+}
+
+.notification-subtitle {
+  color: #fff;
+}
+
+/* update_manager.css */
+div#box_online * {
+  color: #000;
+}
diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php
index ffc9d93f74..3a0880e348 100644
--- a/pandora_console/operation/search_main.php
+++ b/pandora_console/operation/search_main.php
@@ -22,7 +22,7 @@ $searchReports = check_acl($config['id_user'], 0, 'RR');
 $searchUsers = check_acl($config['id_user'], 0, 'UM');
 $searchHelps = true;
 
-echo '<br><div style="margin:auto; width:90%; padding: 10px; background: #fff">';
+echo '<br><div style="margin:auto; width:90%; padding: 10px;">';
 
 $anyfound = false;
 

From ca3b893073db33d06b250250ea6614b34e893392 Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Tue, 9 Jul 2019 16:08:29 +0200
Subject: [PATCH 65/83] Discovery Cloud Azure

---
 .../lib/PandoraFMS/DiscoveryServer.pm         | 58 ++-----------------
 pandora_server/lib/PandoraFMS/Tools.pm        | 20 +++++++
 2 files changed, 26 insertions(+), 52 deletions(-)

diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
index 80fcbef8d3..8993826931 100644
--- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
+++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
@@ -56,15 +56,7 @@ my $TaskSem :shared;
 use constant {
     OS_OTHER => 10,
     OS_ROUTER => 17,
-    OS_SWITCH => 18,
-    DISCOVERY_HOSTDEVICES => 0,
-    DISCOVERY_HOSTDEVICES_CUSTOM => 1,
-    DISCOVERY_CLOUD_AWS => 2,
-    DISCOVERY_APP_VMWARE => 3,
-    DISCOVERY_APP_MYSQL => 4,
-    DISCOVERY_APP_ORACLE => 5,
-    DISCOVERY_CLOUD_AWS_EC2 => 6,
-    DISCOVERY_CLOUD_AWS_RDS => 7
+    OS_SWITCH => 18
 };
 
 ########################################################################################
@@ -196,49 +188,11 @@ sub data_consumer ($$) {
         my $main_event = pandora_event($pa_config, "[Discovery] Execution summary",$task->{'id_group'}, 0, 0, 0, 0, 'system', 0, $dbh);
 
         my %cnf_extra;
-        if ($task->{'type'} == DISCOVERY_CLOUD_AWS_EC2
-        || $task->{'type'} == DISCOVERY_CLOUD_AWS_RDS) {
-            # auth_strings stores the crential identifier to be used.
-            my $key = pandora_get_credential($dbh, $task->{'auth_strings'});
-
-            if (ref($key) eq "HASH") {
-				$cnf_extra{'aws_access_key_id'} = $key->{'username'};
-				$cnf_extra{'aws_secret_access_key'} = $key->{'password'};
-            } else {
-                # Invalid credential.
-                return;
-            }
-
-            $cnf_extra{'cloud_util_path'} = pandora_get_config_value($dbh, 'cloud_util_path');
-
-            # Pass credentials by file due Perl limitations. We cannot update ENV here.
-            $cnf_extra{'creds_file'} = $pa_config->{'temporal'} . '/tmp_discovery.' . md5($task->{'id_rt'} . $task->{'name'} . time());
-            eval {
-                open(my $__file_cfg, '> '. $cnf_extra{'creds_file'}) or die($!);
-                print $__file_cfg $cnf_extra{'aws_access_key_id'} . "\n";
-                print $__file_cfg $cnf_extra{'aws_secret_access_key'} . "\n";
-                close($__file_cfg);
-                set_file_permissions(
-                    $pa_config,
-                    $cnf_extra{'creds_file'},
-                    "0600"
-                );
-            };
-            if ($@) {
-                logger(
-                    $pa_config,
-                    'Cannot instantiate configuration file for task: ' . safe_output($task->{'name'}),
-                    5
-                );
-                # A server restart will override ENV definition (see run)
-                logger(
-                    $pa_config,
-                    'Cannot execute Discovery task: ' . safe_output($task->{'name'}) . '. Please restart the server.',
-                    1
-                );
-                # Skip this task.
-                return;
-            }
+        
+        my $r = enterprise_hook('discovery_generate_extra_cnf',[$pa_config, $dbh, $task, \%cnf_extra]);
+        if (isset($r) && $r eq 'ERR') {
+            # Could not generate extra cnf, skip this task.
+            return;
         }
 
         my $recon = new PandoraFMS::Recon::Base(
diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm
index 6271698c03..4a96c5851d 100755
--- a/pandora_server/lib/PandoraFMS/Tools.pm
+++ b/pandora_server/lib/PandoraFMS/Tools.pm
@@ -72,6 +72,15 @@ our @EXPORT = qw(
 	MIGRATIONSERVER
 	METACONSOLE_LICENSE
 	OFFLINE_LICENSE
+	DISCOVERY_HOSTDEVICES
+	DISCOVERY_HOSTDEVICES_CUSTOM
+	DISCOVERY_CLOUD_AWS
+	DISCOVERY_APP_VMWARE
+	DISCOVERY_APP_MYSQL
+	DISCOVERY_APP_ORACLE
+	DISCOVERY_CLOUD_AWS_EC2
+	DISCOVERY_CLOUD_AWS_RDS
+	DISCOVERY_CLOUD_AZURE_COMPUTE
 	$DEVNULL
 	$OS
 	$OS_VERSION
@@ -172,6 +181,17 @@ use constant OFFLINE_LICENSE => 0x02;
 use constant RECOVERED_ALERT => 0;
 use constant FIRED_ALERT => 1;
 
+# Discovery task types
+use constant DISCOVERY_HOSTDEVICES => 0;
+use constant DISCOVERY_HOSTDEVICES_CUSTOM => 1;
+use constant DISCOVERY_CLOUD_AWS => 2;
+use constant DISCOVERY_APP_VMWARE => 3;
+use constant DISCOVERY_APP_MYSQL => 4;
+use constant DISCOVERY_APP_ORACLE => 5;
+use constant DISCOVERY_CLOUD_AWS_EC2 => 6;
+use constant DISCOVERY_CLOUD_AWS_RDS => 7;
+use constant DISCOVERY_CLOUD_AZURE_COMPUTE => 8;
+
 # Set OS, OS version and /dev/null
 our $OS = $^O;
 our $OS_VERSION = "unknown";

From 084d1a229e866ccf72cf75d9d21b51c2122c35c0 Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Tue, 9 Jul 2019 16:41:00 +0200
Subject: [PATCH 66/83] Added success and error messages when change the event
 owner - #4309

---
 pandora_console/include/functions_events.php  |  2 ++
 .../include/javascript/pandora_events.js      | 36 +++++++++++--------
 pandora_console/include/styles/events.css     |  4 +--
 3 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index 5f83669b4b..24efd1215e 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -4398,6 +4398,8 @@ function events_page_general($event)
         $data[1] = $user_owner;
     }
 
+    $table_general->cellclass[3][1] = 'general_owner';
+
     $table_general->data[] = $data;
 
     $data = [];
diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js
index 94dadb6fbb..c459ab0443 100644
--- a/pandora_console/include/javascript/pandora_events.js
+++ b/pandora_console/include/javascript/pandora_events.js
@@ -475,19 +475,18 @@ function event_change_owner() {
   var meta = $("#hidden-meta").val();
   var history = $("#hidden-history").val();
 
-  var params = [];
-  params.push("page=include/ajax/events");
-  params.push("change_owner=1");
-  params.push("event_id=" + event_id);
-  params.push("new_owner=" + new_owner);
-  params.push("meta=" + meta);
-  params.push("history=" + history);
-
   $("#button-owner_button").attr("disabled", "disabled");
   $("#response_loading").show();
 
   jQuery.ajax({
-    data: params.join("&"),
+    data: {
+      page: "include/ajax/events",
+      change_owner: 1,
+      event_id: event_id,
+      new_owner: new_owner,
+      meta: meta,
+      history: history
+    },
     type: "POST",
     url: $("#hidden-ajax_file").val(),
     async: true,
@@ -496,12 +495,19 @@ function event_change_owner() {
       $("#button-owner_button").removeAttr("disabled");
       $("#response_loading").hide();
 
-      show_event_dialog(
-        event_id,
-        $("#hidden-group_rep").val(),
-        "responses",
-        data
-      );
+      if (data == "owner_ok") {
+        dt_events.draw(false);
+        $("#notification_owner_success").show();
+        console.log(new_owner);
+        if (new_owner == -1) {
+          new_owner = "";
+        }
+        $("#extended_event_general_page table td.general_owner").text(
+          new_owner
+        );
+      } else {
+        $("#notification_owner_error").show();
+      }
     }
   });
 
diff --git a/pandora_console/include/styles/events.css b/pandora_console/include/styles/events.css
index fa1aac2e66..1ed0028dc8 100644
--- a/pandora_console/include/styles/events.css
+++ b/pandora_console/include/styles/events.css
@@ -271,6 +271,7 @@ ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
   margin: 0;
   margin-bottom: -1px;
   border: none;
+  border-bottom: 1px solid #a9a9a9;
 }
 
 ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
@@ -298,9 +299,6 @@ li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab {
 li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab.ui-tabs-active.ui-state-active {
   border-bottom: 1px solid #fff;
 }
-div.extended_event_pages.ui-tabs-panel.ui-corner-bottom.ui-widget-content {
-  border-top: 1px solid #a9a9a9;
-}
 
 tr.group {
   padding: 5px;

From 6af6aa179b1b19a1c06e0b8456a36710cf37e4a2 Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Tue, 9 Jul 2019 16:45:00 +0200
Subject: [PATCH 67/83] Changed background in update manager offline - #4194

---
 pandora_console/include/styles/pandora_black.css | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css
index 1913f9025d..4df56da344 100644
--- a/pandora_console/include/styles/pandora_black.css
+++ b/pandora_console/include/styles/pandora_black.css
@@ -109,6 +109,15 @@ table.widget_list td.datos2 {
   background-color: #888;
 }
 
+.fileupload_form {
+  background-color: #222;
+}
+
+#drop_file {
+  background-color: #444;
+  color: #fff;
+}
+
 ol.steps li.current {
   border-left: 5px solid #82b92e;
   background-color: #545454;

From 936a7e839f617e46b7b2964f45d7866d0150ce4d Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Tue, 9 Jul 2019 17:18:37 +0200
Subject: [PATCH 68/83] Added success and error messages when change the event
 owner - #4309

---
 pandora_console/include/javascript/pandora_events.js | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js
index c459ab0443..2ca786326e 100644
--- a/pandora_console/include/javascript/pandora_events.js
+++ b/pandora_console/include/javascript/pandora_events.js
@@ -498,7 +498,6 @@ function event_change_owner() {
       if (data == "owner_ok") {
         dt_events.draw(false);
         $("#notification_owner_success").show();
-        console.log(new_owner);
         if (new_owner == -1) {
           new_owner = "";
         }

From 7fd284f1059d64cfd65e3596daab28a4b7291ff9 Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Tue, 9 Jul 2019 17:36:40 +0200
Subject: [PATCH 69/83] Fixed visual bugs in green and black theme - #4194

---
 .../include/styles/pandora_black.css           |  6 +++---
 .../include/styles/pandora_green_old.css       | 18 ++++++++++++++----
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css
index 4df56da344..030eae88ca 100644
--- a/pandora_console/include/styles/pandora_black.css
+++ b/pandora_console/include/styles/pandora_black.css
@@ -110,12 +110,12 @@ table.widget_list td.datos2 {
 }
 
 .fileupload_form {
-  background-color: #222;
+  background-color: #222 !important;
 }
 
 #drop_file {
-  background-color: #444;
-  color: #fff;
+  background-color: #444 !important;
+  color: #fff !important;
 }
 
 ol.steps li.current {
diff --git a/pandora_console/include/styles/pandora_green_old.css b/pandora_console/include/styles/pandora_green_old.css
index a9fbdf7f80..4b5c875f83 100644
--- a/pandora_console/include/styles/pandora_green_old.css
+++ b/pandora_console/include/styles/pandora_green_old.css
@@ -49,16 +49,20 @@ ul.subsubmenu li {
 }
 
 .godmode {
-  border-top: 1px solid #f1f1f1;
+  border-top: 1px solid #ddd;
 }
 
 .menu li ul {
-  border: 1px solid #f1f1f1;
+  border: 1px solid #eee;
 }
 
 #title_menu,
 .submenu_text {
-  color: #9c9c9c;
+  color: #666;
+}
+#title_menu:hover,
+.submenu_text:hover {
+  color: #b9b9b9;
 }
 
 .button_collapse,
@@ -100,7 +104,6 @@ div#foot span {
 }
 
 /* General styles */
-
 body,
 div#page {
   background: #ecfad6;
@@ -123,6 +126,13 @@ div#page {
   filter: brightness(2.5) contrast(3.5);
 }
 
+table.widget_list tr.datos,
+table.widget_list tr.datos2,
+table.widget_list td.datos,
+table.widget_list td.datos2 {
+  background-color: #ecfad6;
+}
+
 /* tables.css */
 .info_table tr:first-child > th {
   background-color: #343434;

From 85e40b30dceac6bd0a41c365f3d616daaddf6377 Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Tue, 9 Jul 2019 17:54:23 +0200
Subject: [PATCH 70/83] Fix: user filter load tags

---
 pandora_console/operation/events/events.php | 85 +++++++++++----------
 1 file changed, 44 insertions(+), 41 deletions(-)

diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php
index da7123e728..9561872288 100644
--- a/pandora_console/operation/events/events.php
+++ b/pandora_console/operation/events/events.php
@@ -334,6 +334,50 @@ if (is_ajax()) {
     exit;
 }
 
+/*
+ * Load user default form.
+ */
+
+$user_filter = db_get_row_sql(
+    sprintf(
+        'SELECT f.id_filter, f.id_name
+         FROM tevent_filter f
+         INNER JOIN tusuario u
+             ON u.default_event_filter=f.id_filter
+         WHERE u.id_user = "%s" ',
+        $config['id_user']
+    )
+);
+if ($user_filter !== false) {
+    $filter = events_get_event_filter($user_filter['id_filter']);
+    if ($filter !== false) {
+        $id_group = $filter['id_group'];
+        $event_type = $filter['event_type'];
+        $severity = $filter['severity'];
+        $status = $filter['status'];
+        $search = $filter['search'];
+        $text_agent = $filter['text_agent'];
+        $id_agent = $filter['id_agent'];
+        $id_agent_module = $filter['id_agent_module'];
+        $pagination = $filter['pagination'];
+        $event_view_hr = $filter['event_view_hr'];
+        $id_user_ack = $filter['id_user_ack'];
+        $group_rep = $filter['group_rep'];
+        $tag_with = json_decode(io_safe_output($filter['tag_with']));
+        $tag_without = json_decode(io_safe_output($filter['tag_without']));
+
+        $tag_with_base64 = base64_encode(json_encode($tag_with));
+        $tag_without_base64 = base64_encode(json_encode($tag_without));
+
+        $filter_only_alert = $filter['filter_only_alert'];
+        $id_group_filter = $filter['id_group_filter'];
+        $date_from = $filter['date_from'];
+        $date_to = $filter['date_to'];
+        $source = $filter['source'];
+        $id_extra = $filter['id_extra'];
+        $user_comment = $filter['user_comment'];
+    }
+}
 
 // TAGS.
 // Get the tags where the user have permissions in Events reading tasks.
@@ -736,47 +780,6 @@ if (is_metaconsole() !== true) {
     }
 }
 
-/*
- * Load user default form.
- */
-
-$user_filter = db_get_row_sql(
-    sprintf(
-        'SELECT f.id_filter, f.id_name
-         FROM tevent_filter f
-         INNER JOIN tusuario u
-             ON u.default_event_filter=f.id_filter
-         WHERE u.id_user = "%s" ',
-        $config['id_user']
-    )
-);
-if ($user_filter !== false) {
-    $filter = events_get_event_filter($user_filter['id_filter']);
-    if ($filter !== false) {
-        $id_group = $filter['id_group'];
-        $event_type = $filter['event_type'];
-        $severity = $filter['severity'];
-        $status = $filter['status'];
-        $search = $filter['search'];
-        $text_agent = $filter['text_agent'];
-        $id_agent = $filter['id_agent'];
-        $id_agent_module = $filter['id_agent_module'];
-        $pagination = $filter['pagination'];
-        $event_view_hr = $filter['event_view_hr'];
-        $id_user_ack = $filter['id_user_ack'];
-        $group_rep = $filter['group_rep'];
-        $tag_with = $filter['tag_with'];
-        $tag_without = $filter['tag_without'];
-        $filter_only_alert = $filter['filter_only_alert'];
-        $id_group_filter = $filter['id_group_filter'];
-        $date_from = $filter['date_from'];
-        $date_to = $filter['date_to'];
-        $source = $filter['source'];
-        $id_extra = $filter['id_extra'];
-        $user_comment = $filter['user_comment'];
-    }
-}
-
 /*
  * Load filter form.
  */

From 5b6e7d13cd8f528cc7a0aaf295b96ba5a32383ea Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Tue, 9 Jul 2019 18:13:46 +0200
Subject: [PATCH 71/83] changed condition for saml no access

---
 pandora_console/index.php | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/pandora_console/index.php b/pandora_console/index.php
index 22a5f46179..5b724c52dc 100755
--- a/pandora_console/index.php
+++ b/pandora_console/index.php
@@ -359,15 +359,21 @@ if (! isset($config['id_user'])) {
             $nick_in_db = $_SESSION['prepared_login_da']['id_user'];
             $expired_pass = false;
         } else if (($config['auth'] == 'saml') && ($login_button_saml)) {
-            if (!include_once 'include/auth/saml.php') {
+            $saml_configured = include_once $config['homedir'].'/'.ENTERPRISE_DIR.'/include/auth/saml.php';
+
+            if (!$saml_configured) {
                 include_once 'general/noaccesssaml.php';
-            } else {
-                $saml_user_id = saml_process_user_login();
             }
 
+            $saml_user_id = saml_process_user_login();
+
+            if (!$saml_user_id) {
+                include_once 'general/noaccesssaml.php';
+            }
+
+
             $nick_in_db = $saml_user_id;
             if (!$nick_in_db) {
-                include_once 'general/noaccesssaml.php';
                 include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
                 $as = new SimpleSAML_Auth_Simple($config['saml_source']);
                 $as->logout();

From ca237a0fc4ab24bf0a27e4cfec2232ed87d9138e Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Wed, 10 Jul 2019 00:01:10 +0200
Subject: [PATCH 72/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 6f8d1f824d..940dfe083f 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190709
+Version: 7.0NG.736-190710
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 1234a20b06..1ff1a4514b 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190709"
+pandora_version="7.0NG.736-190710"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 5be1d49311..8a6a6c2643 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190709';
+use constant AGENT_BUILD => '190710';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 23d3afc120..0d413c7fa1 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190709
+%define release     190710
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 7320e5a83d..6ce012ae4f 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190709
+%define release     190710
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index ae6028674d..8434f711d4 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190709"
+PI_BUILD="190710"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 7f4138dd8a..f05a229bc3 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190709}
+{190710}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index dc6658a299..9790174b11 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190709)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190710)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 7589ae4e1f..4e4ab15cf8 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190709))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190710))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 09c13f639d..5e26ed9f29 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190709
+Version: 7.0NG.736-190710
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 1e2e36c157..038f128c6f 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190709"
+pandora_version="7.0NG.736-190710"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 57121de09a..d5255f5809 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190709';
+$build_version = 'PC190710';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 1f7283c155..e59483e657 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190709';
+            $build = '190710';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 4d769141e2..8781350751 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190709
+%define release     190710
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index e8179bd043..9131d862a5 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190709
+%define release     190710
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 4c96b354d5..512084db36 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190709
+%define release     190710
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index e0e43f69bf..057a3d89c8 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190709
+Version: 7.0NG.736-190710
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 7d8b03492a..4844017e22 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190709"
+pandora_version="7.0NG.736-190710"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 017d5a0308..9fa7b5769a 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190709";
+my $pandora_build = "190710";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 60d445306a..671b325a83 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190709";
+my $pandora_build = "190710";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index da6d2103e1..3687124ebb 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190709
+%define release     190710
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 222a596040..4ad259da7e 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190709
+%define release     190710
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 0c14c07255..145ec86518 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190709"
+PI_BUILD="190710"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index dd4417cb0b..ea5468bf0f 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190709";
+my $version = "7.0NG.736 PS190710";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 6b2567e178..edee1d5175 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190709";
+my $version = "7.0NG.736 PS190710";
 
 # save program name for logging
 my $progname = basename($0);

From 8c7745768c86e893d3b665d0eb8732a2441fb02b Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Wed, 10 Jul 2019 11:05:06 +0200
Subject: [PATCH 73/83] Added success and error messages when change the event
 owner - #4309

---
 .../include/javascript/pandora_events.js           | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js
index 2ca786326e..5727e200f5 100644
--- a/pandora_console/include/javascript/pandora_events.js
+++ b/pandora_console/include/javascript/pandora_events.js
@@ -495,14 +495,22 @@ function event_change_owner() {
       $("#button-owner_button").removeAttr("disabled");
       $("#response_loading").hide();
 
+      if ($("#notification_owner_success").length) {
+        $("#notification_owner_success").hide();
+      }
+
+      if ($("#notification_owner_error").length) {
+        $("#notification_owner_error").hide();
+      }
+
       if (data == "owner_ok") {
         dt_events.draw(false);
         $("#notification_owner_success").show();
         if (new_owner == -1) {
-          new_owner = "";
+          new_owner = "N/A";
         }
-        $("#extended_event_general_page table td.general_owner").text(
-          new_owner
+        $("#extended_event_general_page table td.general_owner").html(
+          "<i>" + new_owner + "</i>"
         );
       } else {
         $("#notification_owner_error").show();

From bfb78971495ef29441f491332c2e0cd9c0fdc333 Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Wed, 10 Jul 2019 12:15:41 +0200
Subject: [PATCH 74/83] Added success and error messages when change the event
 status - #4309

---
 pandora_console/include/functions_events.php  |  2 +
 .../include/javascript/pandora_events.js      | 53 ++++++++++++-------
 2 files changed, 36 insertions(+), 19 deletions(-)

diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index 24efd1215e..e368651a12 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -4467,6 +4467,8 @@ function events_page_general($event)
         $data[1] = '<i>'.__('N/A').'</i>';
     }
 
+    $table_general->cellclass[7][1] = 'general_status';
+
     $table_general->data[] = $data;
 
     $data = [];
diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js
index 5727e200f5..c50d755fc0 100644
--- a/pandora_console/include/javascript/pandora_events.js
+++ b/pandora_console/include/javascript/pandora_events.js
@@ -437,19 +437,18 @@ function event_change_status(event_ids) {
   var meta = $("#hidden-meta").val();
   var history = $("#hidden-history").val();
 
-  var params = [];
-  params.push("page=include/ajax/events");
-  params.push("change_status=1");
-  params.push("event_ids=" + event_ids);
-  params.push("new_status=" + new_status);
-  params.push("meta=" + meta);
-  params.push("history=" + history);
-
   $("#button-status_button").attr("disabled", "disabled");
   $("#response_loading").show();
 
   jQuery.ajax({
-    data: params.join("&"),
+    data: {
+      page: "include/ajax/events",
+      change_status: 1,
+      event_ids: event_ids,
+      new_status: new_status,
+      meta: meta,
+      history: history
+    },
     type: "POST",
     url: $("#hidden-ajax_file").val(),
     async: true,
@@ -457,12 +456,25 @@ function event_change_status(event_ids) {
     success: function(data) {
       $("#button-status_button").removeAttr("disabled");
       $("#response_loading").hide();
-      show_event_dialog(
-        event_id,
-        $("#hidden-group_rep").val(),
-        "responses",
-        data
-      );
+
+      if ($("#notification_status_success").length) {
+        $("#notification_status_success").hide();
+      }
+
+      if ($("#notification_status_error").length) {
+        $("#notification_status_error").hide();
+      }
+      console.log(data);
+      if (data == "status_ok") {
+        dt_events.draw(false);
+        $("#notification_status_success").show();
+
+        $("#extended_event_general_page table td.general_status").text(
+          new_status
+        );
+      } else {
+        $("#notification_status_error").show();
+      }
     }
   });
   return false;
@@ -507,11 +519,14 @@ function event_change_owner() {
         dt_events.draw(false);
         $("#notification_owner_success").show();
         if (new_owner == -1) {
-          new_owner = "N/A";
+          $("#extended_event_general_page table td.general_owner").html(
+            "<i>N/A</i>"
+          );
+        } else {
+          $("#extended_event_general_page table td.general_owner").text(
+            new_owner
+          );
         }
-        $("#extended_event_general_page table td.general_owner").html(
-          "<i>" + new_owner + "</i>"
-        );
       } else {
         $("#notification_owner_error").show();
       }

From 1f8e1439634e9f06a9dae6188d36e627110aacd2 Mon Sep 17 00:00:00 2001
From: Tatiana Llorente <tatiana.llorente@artica.es>
Date: Wed, 10 Jul 2019 13:04:06 +0200
Subject: [PATCH 75/83] Fixed bug to change the event status in modal window -
 #4309

---
 pandora_console/include/ajax/events.php              | 3 +++
 pandora_console/include/javascript/pandora_events.js | 6 +-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php
index a7d23ca015..22eb1d7836 100644
--- a/pandora_console/include/ajax/events.php
+++ b/pandora_console/include/ajax/events.php
@@ -1139,6 +1139,7 @@ if ($get_extended_event) {
 
     $dialog_page = get_parameter('dialog_page', 'general');
     $filter = get_parameter('filter', []);
+    $similar_ids = get_parameter('similar_ids', $event_id);
     $group_rep = $filter['group_rep'];
     $event_rep = $event['event_rep'];
     $timestamp_first = $event['min_timestamp'];
@@ -1146,6 +1147,8 @@ if ($get_extended_event) {
     $server_id = $event['server_id'];
     $comments = $event['comments'];
 
+    $event['similar_ids'] = $similar_ids;
+
     if (!isset($comments)) {
         $comments = $event['user_comment'];
     }
diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js
index c50d755fc0..0fb6c1a6ef 100644
--- a/pandora_console/include/javascript/pandora_events.js
+++ b/pandora_console/include/javascript/pandora_events.js
@@ -464,14 +464,10 @@ function event_change_status(event_ids) {
       if ($("#notification_status_error").length) {
         $("#notification_status_error").hide();
       }
-      console.log(data);
+
       if (data == "status_ok") {
         dt_events.draw(false);
         $("#notification_status_success").show();
-
-        $("#extended_event_general_page table td.general_status").text(
-          new_status
-        );
       } else {
         $("#notification_status_error").show();
       }

From a4518819e41b825985ff682f7c2da2e4eb6d6583 Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Wed, 10 Jul 2019 17:58:52 +0200
Subject: [PATCH 76/83] add link and change table

---
 pandora_console/operation/search_policies.php | 45 +++++++++++++++----
 1 file changed, 36 insertions(+), 9 deletions(-)

diff --git a/pandora_console/operation/search_policies.php b/pandora_console/operation/search_policies.php
index a71d76a733..6277318f66 100644
--- a/pandora_console/operation/search_policies.php
+++ b/pandora_console/operation/search_policies.php
@@ -30,26 +30,53 @@ if (!$policies || !$searchpolicies) {
     $table->align[4] = 'center';
 
     $table->head = [];
-    $table->head[0] = __('ID').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectpolicieIDUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectpolicieIDDown]).'</a>';
-    $table->head[1] = __('Name').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>';
-    $table->head[2] = __('Description').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectDescriptionUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectDescriptionDown]).'</a>';
-    $table->head[3] = __('Id_group').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectId_groupUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectId_groupDown]).'</a>';
-    $table->head[4] = __('Status').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectstatusDown]).'</a>';
+    // $table->head[0] = __('ID').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectpolicieIDUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=id_policie&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectpolicieIDDown]).'</a>';
+    $table->head[0] = __('Name').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'</a>';
+    $table->head[1] = __('Description').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectDescriptionUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=description&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectDescriptionDown]).'</a>';
+    $table->head[2] = __('Id_group').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectId_groupUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=last_contact&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectId_groupDown]).'</a>';
+    $table->head[3] = __('Status').' '.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp]).'</a>'.'<a href="index.php?search_category=policies&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=status&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectstatusDown]).'</a>';
 
     $table->data = [];
 
     foreach ($policies as $policie) {
         $policieIDCell = "<a href='?sec=gmodules&sec2=enterprise/godmode/policies/policies&id=".$policies['id']."'>".$policies['id'].'</a>';
 
+        switch ($policie['status']) {
+            case POLICY_UPDATED:
+                $status = html_print_image(
+                    'images/policies_ok.png',
+                    true,
+                    ['title' => __('Policy updated')]
+                );
+            break;
+
+            case POLICY_PENDING_DATABASE:
+                $status = html_print_image(
+                    'images/policies_error_db.png',
+                    true,
+                    ['title' => __('Pending update policy only database')]
+                );
+            break;
+
+            case POLICY_PENDING_ALL:
+                $status = html_print_image(
+                    'images/policies_error.png',
+                    true,
+                    ['title' => __('Pending update policy')]
+                );
+            break;
+        }
+
+        $url = $config['homeurl'].'/index.php?'.'sec=gmodules&'.'sec2=enterprise/godmode/policies/policies&id='.$policie['id'].'';
 
         array_push(
             $table->data,
             [
-                $policie['id'],
-                $policie['name'],
+                // $policie['id'],
+                '<a href= '.$url.'>'.$policie['name'].'',
                 $policie['description'],
-                $policie['id_group'],
-                $policie['status'],
+                ui_print_group_icon($policie['id_group'], true),
+                $status,
 
             ]
         );

From 45c9db2b69ef02919cc09746faa479f57120815e Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Thu, 11 Jul 2019 00:01:12 +0200
Subject: [PATCH 77/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 940dfe083f..9a0b872a6e 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190710
+Version: 7.0NG.736-190711
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 1ff1a4514b..4d84020703 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190710"
+pandora_version="7.0NG.736-190711"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 8a6a6c2643..8a6ac38d5f 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190710';
+use constant AGENT_BUILD => '190711';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 0d413c7fa1..c9f7f10dc0 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190710
+%define release     190711
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 6ce012ae4f..8d1ff4fc15 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190710
+%define release     190711
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 8434f711d4..52b49cca0c 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190710"
+PI_BUILD="190711"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index f05a229bc3..efa43a74ee 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190710}
+{190711}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 9790174b11..75fb3cbe98 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190710)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190711)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 4e4ab15cf8..392c639976 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190710))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190711))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 5e26ed9f29..32efed3e39 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190710
+Version: 7.0NG.736-190711
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 038f128c6f..68e0aa147f 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190710"
+pandora_version="7.0NG.736-190711"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index d5255f5809..f72acc3ef6 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190710';
+$build_version = 'PC190711';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index e59483e657..e0c24fd2c6 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190710';
+            $build = '190711';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 8781350751..8f3c01ee7a 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190710
+%define release     190711
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index 9131d862a5..0b35aa03f8 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190710
+%define release     190711
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 512084db36..f7db72f440 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190710
+%define release     190711
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 057a3d89c8..4b93d0489d 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190710
+Version: 7.0NG.736-190711
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 4844017e22..26a19695c2 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190710"
+pandora_version="7.0NG.736-190711"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 9fa7b5769a..96a641026a 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190710";
+my $pandora_build = "190711";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 671b325a83..0431e76d74 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190710";
+my $pandora_build = "190711";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 3687124ebb..230fbad5e8 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190710
+%define release     190711
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 4ad259da7e..0cee7965f4 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190710
+%define release     190711
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 145ec86518..48ace9e334 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190710"
+PI_BUILD="190711"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index ea5468bf0f..f655b5bcb0 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190710";
+my $version = "7.0NG.736 PS190711";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index edee1d5175..7172389c25 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190710";
+my $version = "7.0NG.736 PS190711";
 
 # save program name for logging
 my $progname = basename($0);

From 467ee5fb8f8760805b4ff8e122bfe49a1bc2df3d Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Thu, 11 Jul 2019 12:01:19 +0200
Subject: [PATCH 78/83] Minor errata fix

---
 pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
index 8993826931..e70d871042 100644
--- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
+++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
@@ -190,7 +190,7 @@ sub data_consumer ($$) {
         my %cnf_extra;
         
         my $r = enterprise_hook('discovery_generate_extra_cnf',[$pa_config, $dbh, $task, \%cnf_extra]);
-        if (isset($r) && $r eq 'ERR') {
+        if (defined($r) && $r eq 'ERR') {
             # Could not generate extra cnf, skip this task.
             return;
         }

From bd070b706bad475c94d758091b9785397aca37f4 Mon Sep 17 00:00:00 2001
From: Daniel Barbero Martin <daniel.barbero@artica.es>
Date: Thu, 11 Jul 2019 12:45:52 +0200
Subject: [PATCH 79/83] fixed minor error

---
 pandora_console/general/register.php          | 32 +++++++++----------
 .../include/class/ConsoleSupervisor.php       |  2 +-
 pandora_console/include/functions_config.php  |  8 +++++
 pandora_console/operation/users/user_edit.php | 31 +++++++++---------
 4 files changed, 41 insertions(+), 32 deletions(-)

diff --git a/pandora_console/general/register.php b/pandora_console/general/register.php
index e6a26bb250..b1d58aada4 100644
--- a/pandora_console/general/register.php
+++ b/pandora_console/general/register.php
@@ -122,7 +122,6 @@ if (is_ajax()) {
     exit();
 }
 
-
 ui_require_css_file('register');
 
 $initial = isset($config['initial_wizard']) !== true
@@ -150,26 +149,27 @@ if ($initial && users_is_admin()) {
     );
 }
 
-if ($registration && users_is_admin()) {
-    // Prepare registration wizard, not launch. leave control to flow.
-    registration_wiz_modal(
-        false,
-        // Launch only if not being launch from 'initial'.
-        !$initial,
-        (($show_newsletter === true) ? 'force_run_newsletter()' : null)
-    );
-} else {
-    if ($show_newsletter) {
-        // Show newsletter wizard for current user.
-        newsletter_wiz_modal(
+if (!$config['disabled_newsletter']) {
+    if ($registration && users_is_admin()) {
+        // Prepare registration wizard, not launch. leave control to flow.
+        registration_wiz_modal(
             false,
-            // Launch only if not being call from 'registration'.
-            !$registration && !$initial
+            // Launch only if not being launch from 'initial'.
+            !$initial,
+            (($show_newsletter === true) ? 'force_run_newsletter()' : null)
         );
+    } else {
+        if ($show_newsletter) {
+            // Show newsletter wizard for current user.
+            newsletter_wiz_modal(
+                false,
+                // Launch only if not being call from 'registration'.
+                !$registration && !$initial
+            );
+        }
     }
 }
 
-
 $newsletter = null;
 
 ?>
diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php
index af688fb5a0..d03b360c16 100644
--- a/pandora_console/include/class/ConsoleSupervisor.php
+++ b/pandora_console/include/class/ConsoleSupervisor.php
@@ -1976,7 +1976,7 @@ class ConsoleSupervisor
             'id_user',
             $config['id_user']
         );
-        if (license_free() === true
+        if (!$config['disabled_newsletter']
             && $newsletter != 1
             && $login === false
         ) {
diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php
index 0964cf59a3..558260f7a8 100644
--- a/pandora_console/include/functions_config.php
+++ b/pandora_console/include/functions_config.php
@@ -395,6 +395,10 @@ function config_update_config()
                             $error_update[] = __('Enable Update Manager');
                         }
 
+                        if (!config_update_value('disabled_newsletter', get_parameter('disabled_newsletter'))) {
+                            $error_update[] = __('Disabled newsletter');
+                        }
+
                         if (!config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'))) {
                             $error_update[] = __('Ipam Ocuppied Manager Critical');
                         }
@@ -1723,6 +1727,10 @@ function config_process_config()
         config_update_value('enable_update_manager', 1);
     }
 
+    if (!isset($config['disabled_newsletter'])) {
+        config_update_value('disabled_newsletter', 0);
+    }
+
     if (!isset($config['ipam_ocuppied_critical_treshold'])) {
         config_update_value('ipam_ocuppied_critical_treshold', 90);
     }
diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php
index 9e267c5c2d..b8b42ad945 100644
--- a/pandora_console/operation/users/user_edit.php
+++ b/pandora_console/operation/users/user_edit.php
@@ -426,24 +426,25 @@ if (check_acl($config['id_user'], 0, 'ER')) {
     ).'</div>';
 }
 
+if (!$config['disabled_newsletter']) {
+    $newsletter = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Subscribed').': </p>';
+    if ($user_info['middlename'] > 0) {
+        $newsletter .= '<span>'.__('Already subscribed to %s newsletter', get_product_name()).'</span>';
+    } else {
+        $newsletter .= '<span><a href="javascript: force_run_newsletter();">'.__('Subscribe to our newsletter').'</a></span></div>';
+        $newsletter_reminder = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Reminder').': </p>';
+        $newsletter_reminder .= html_print_switch(
+            [
+                'name'     => 'newsletter_reminder',
+                'value'    => $newsletter_reminder_value,
+                'disabled' => false,
+            ]
+        );
+    }
 
-$newsletter = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Subscribed').': </p>';
-if ($user_info['middlename'] > 0) {
-    $newsletter .= '<span>'.__('Already subscribed to %s newsletter', get_product_name()).'</span>';
-} else {
-    $newsletter .= '<span><a href="javascript: force_run_newsletter();">'.__('Subscribe to our newsletter').'</a></span></div>';
-    $newsletter_reminder = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Newsletter Reminder').': </p>';
-    $newsletter_reminder .= html_print_switch(
-        [
-            'name'     => 'newsletter_reminder',
-            'value'    => $newsletter_reminder_value,
-            'disabled' => false,
-        ]
-    );
+    $newsletter_reminder .= '</div>';
 }
 
-$newsletter_reminder .= '</div>';
-
 
 
 $autorefresh_list_out = [];

From 219852283d50057b9cdf183ebdcab74a1e9df570 Mon Sep 17 00:00:00 2001
From: fbsanchez <fborja.sanchez@artica.es>
Date: Thu, 11 Jul 2019 14:53:00 +0200
Subject: [PATCH 80/83] Fix in snmp browser tree

---
 pandora_console/include/functions_snmp_browser.php | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php
index 5b485d9e54..dc423481f2 100644
--- a/pandora_console/include/functions_snmp_browser.php
+++ b/pandora_console/include/functions_snmp_browser.php
@@ -173,7 +173,6 @@ function snmp_browser_get_html_tree(
             $last_array,
             $sufix,
             $checked,
-            $return,
             $descriptive_ids,
             $previous_id
         );

From 1dbf8240c4ba515fd58401f330f1c13029558aaf Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Thu, 11 Jul 2019 15:51:35 +0200
Subject: [PATCH 81/83] deelted duplicated count

---
 pandora_console/operation/search_policies.php | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pandora_console/operation/search_policies.php b/pandora_console/operation/search_policies.php
index 6277318f66..7e31db1220 100644
--- a/pandora_console/operation/search_policies.php
+++ b/pandora_console/operation/search_policies.php
@@ -84,7 +84,6 @@ if (!$policies || !$searchpolicies) {
 
     $totalPolicies = count($policies);
     echo '<br />';
-    ui_pagination($totalPolicies);
     html_print_table($table);
     unset($table);
     ui_pagination($totalPolicies);

From 055bafe4d7b68dfe64fd6295004d92bd9ee13c4e Mon Sep 17 00:00:00 2001
From: "marcos.alconada" <marcos.alconada@artica.es>
Date: Thu, 11 Jul 2019 17:28:22 +0200
Subject: [PATCH 82/83] changed UM to AW for search policies

---
 pandora_console/operation/search_main.php             | 2 +-
 pandora_console/operation/search_policies.getdata.php | 2 +-
 pandora_console/operation/search_policies.php         | 2 +-
 pandora_console/operation/search_results.php          | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php
index c269b6481c..718fd45be5 100644
--- a/pandora_console/operation/search_main.php
+++ b/pandora_console/operation/search_main.php
@@ -20,7 +20,7 @@ $searchGraphs = check_acl($config['id_user'], 0, 'RR');
 $searchMaps = check_acl($config['id_user'], 0, 'RR');
 $searchReports = check_acl($config['id_user'], 0, 'RR');
 $searchUsers = check_acl($config['id_user'], 0, 'UM');
-$searchPolicies = check_acl($config['id_user'], 0, 'UM');
+$searchPolicies = check_acl($config['id_user'], 0, 'AW');
 $searchHelps = true;
 
 echo '<br><div style="margin:auto; width:90%; padding: 10px;">';
diff --git a/pandora_console/operation/search_policies.getdata.php b/pandora_console/operation/search_policies.getdata.php
index aec8298170..a8c05ea071 100644
--- a/pandora_console/operation/search_policies.getdata.php
+++ b/pandora_console/operation/search_policies.getdata.php
@@ -16,7 +16,7 @@ global $config;
 enterprise_include_once('include/functions_policies.php');
 
 
-$searchpolicies = check_acl($config['id'], 0, 'UM');
+$searchpolicies = check_acl($config['id'], 0, 'AW');
 
 $selectpolicieIDUp = '';
 $selectpolicieIDDown = '';
diff --git a/pandora_console/operation/search_policies.php b/pandora_console/operation/search_policies.php
index 7e31db1220..26b3f7737d 100644
--- a/pandora_console/operation/search_policies.php
+++ b/pandora_console/operation/search_policies.php
@@ -16,7 +16,7 @@ global $config;
 enterprise_include_once('include/functions_policies.php');
 require_once $config['homedir'].'/enterprise/include/functions_groups.php';
 
-$searchpolicies = check_acl($config['id_user'], 0, 'UM');
+$searchpolicies = check_acl($config['id_user'], 0, 'AW');
 
 if (!$policies || !$searchpolicies) {
     echo "<br><div class='nf'>".__('Zero results found')."</div>\n";
diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php
index 11b4aedec9..803a92cdd1 100644
--- a/pandora_console/operation/search_results.php
+++ b/pandora_console/operation/search_results.php
@@ -18,7 +18,7 @@ require_once $config['homedir'].'/include/functions_reporting.php';
 enterprise_include('operation/reporting/custom_reporting.php');
 
 $searchAgents = $searchAlerts = $searchModules = check_acl($config['id_user'], 0, 'AR');
-$searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'UM');
+$searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'AW');
 $searchMaps = $searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'IR');
 $searchMain = true;
 $searchHelps = true;

From fe981897792312de35a7374200285c8a4c730b15 Mon Sep 17 00:00:00 2001
From: artica <artica.devel@gmail.com>
Date: Fri, 12 Jul 2019 00:01:08 +0200
Subject: [PATCH 83/83] Auto-updated build strings.

---
 pandora_agents/unix/DEBIAN/control             | 2 +-
 pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +-
 pandora_agents/unix/pandora_agent              | 2 +-
 pandora_agents/unix/pandora_agent.redhat.spec  | 2 +-
 pandora_agents/unix/pandora_agent.spec         | 2 +-
 pandora_agents/unix/pandora_agent_installer    | 2 +-
 pandora_agents/win32/installer/pandora.mpi     | 2 +-
 pandora_agents/win32/pandora.cc                | 2 +-
 pandora_agents/win32/versioninfo.rc            | 2 +-
 pandora_console/DEBIAN/control                 | 2 +-
 pandora_console/DEBIAN/make_deb_package.sh     | 2 +-
 pandora_console/include/config_process.php     | 2 +-
 pandora_console/install.php                    | 2 +-
 pandora_console/pandora_console.redhat.spec    | 2 +-
 pandora_console/pandora_console.rhel7.spec     | 2 +-
 pandora_console/pandora_console.spec           | 2 +-
 pandora_server/DEBIAN/control                  | 2 +-
 pandora_server/DEBIAN/make_deb_package.sh      | 2 +-
 pandora_server/lib/PandoraFMS/Config.pm        | 2 +-
 pandora_server/lib/PandoraFMS/PluginTools.pm   | 2 +-
 pandora_server/pandora_server.redhat.spec      | 2 +-
 pandora_server/pandora_server.spec             | 2 +-
 pandora_server/pandora_server_installer        | 2 +-
 pandora_server/util/pandora_db.pl              | 2 +-
 pandora_server/util/pandora_manage.pl          | 2 +-
 25 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 9a0b872a6e..b6ecacb2b4 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-agent-unix
-Version: 7.0NG.736-190711
+Version: 7.0NG.736-190712
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index 4d84020703..c7f4f3334e 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190711"
+pandora_version="7.0NG.736-190712"
 
 echo "Test if you has the tools for to make the packages."
 whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index 8a6ac38d5f..1298d9c2f9 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -42,7 +42,7 @@ my $Sem = undef;
 my $ThreadSem = undef;
 
 use constant AGENT_VERSION => '7.0NG.736';
-use constant AGENT_BUILD => '190711';
+use constant AGENT_BUILD => '190712';
 
 # Agent log default file size maximum and instances
 use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index c9f7f10dc0..5fdc516b68 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190711
+%define release     190712
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 8d1ff4fc15..891b2769f1 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_agent_unix
 %define version     7.0NG.736
-%define release     190711
+%define release     190712
 
 Summary:            Pandora FMS Linux agent, PERL version
 Name:               %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 52b49cca0c..01d573fb70 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190711"
+PI_BUILD="190712"
 OS_NAME=`uname -s`
 
 FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index efa43a74ee..d20217c6a0 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
 {}
 
 Version
-{190711}
+{190712}
 
 ViewReadme
 {Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 75fb3cbe98..51c386db55 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
 using namespace Pandora_Strutils;
 
 #define PATH_SIZE    _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.736(Build 190711)")
+#define PANDORA_VERSION ("7.0NG.736(Build 190712)")
 
 string pandora_path;
 string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 392c639976..feb8e814e1 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -11,7 +11,7 @@ BEGIN
       VALUE "LegalCopyright", "Artica ST"
       VALUE "OriginalFilename", "PandoraAgent.exe"
       VALUE "ProductName", "Pandora FMS Windows Agent"
-      VALUE "ProductVersion", "(7.0NG.736(Build 190711))"
+      VALUE "ProductVersion", "(7.0NG.736(Build 190712))"
       VALUE "FileVersion", "1.0.0.0"
     END
   END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 32efed3e39..901b426196 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-console
-Version: 7.0NG.736-190711
+Version: 7.0NG.736-190712
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 68e0aa147f..98935e7bf9 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190711"
+pandora_version="7.0NG.736-190712"
 
 package_pear=0
 package_pandora=1
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index f72acc3ef6..ab7acc743d 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
 /**
  * Pandora build version and version
  */
-$build_version = 'PC190711';
+$build_version = 'PC190712';
 $pandora_version = 'v7.0NG.736';
 
 // Do not overwrite default timezone set if defined.
diff --git a/pandora_console/install.php b/pandora_console/install.php
index e0c24fd2c6..7b1d4833a6 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -129,7 +129,7 @@
         <div style='height: 10px'>
             <?php
             $version = '7.0NG.736';
-            $build = '190711';
+            $build = '190712';
             $banner = "v$version Build $build";
 
             error_reporting(0);
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 8f3c01ee7a..e25982eca0 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190711
+%define release     190712
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index 0b35aa03f8..86190dc5dc 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190711
+%define release     190712
 
 # User and Group under which Apache is running
 %define httpd_name  httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index f7db72f440..47a76c7e05 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_console
 %define version     7.0NG.736
-%define release     190711
+%define release     190712
 %define httpd_name      httpd
 # User and Group under which Apache is running
 %define httpd_name  apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 4b93d0489d..4a356c6403 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
 package: pandorafms-server
-Version: 7.0NG.736-190711
+Version: 7.0NG.736-190712
 Architecture: all
 Priority: optional
 Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 26a19695c2..5282a8f9eb 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-pandora_version="7.0NG.736-190711"
+pandora_version="7.0NG.736-190712"
 
 package_cpan=0
 package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index 96a641026a..0f1a845400 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -45,7 +45,7 @@ our @EXPORT = qw(
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190711";
+my $pandora_build = "190712";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 # Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 0431e76d74..de1a363293 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
 
 # version: Defines actual version of Pandora Server for this module only
 my $pandora_version = "7.0NG.736";
-my $pandora_build = "190711";
+my $pandora_build = "190712";
 our $VERSION = $pandora_version." ".$pandora_build;
 
 our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index 230fbad5e8..388fabbd14 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190711
+%define release     190712
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index 0cee7965f4..20093a9ea4 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -3,7 +3,7 @@
 #
 %define name        pandorafms_server
 %define version     7.0NG.736
-%define release     190711
+%define release     190712
 
 Summary:            Pandora FMS Server
 Name:               %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 48ace9e334..48dd2eaa41 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
 # **********************************************************************
 
 PI_VERSION="7.0NG.736"
-PI_BUILD="190711"
+PI_BUILD="190712"
 
 MODE=$1
 if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index f655b5bcb0..e040b6ea7e 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -34,7 +34,7 @@ use PandoraFMS::Config;
 use PandoraFMS::DB;
 
 # version: define current version
-my $version = "7.0NG.736 PS190711";
+my $version = "7.0NG.736 PS190712";
 
 # Pandora server configuration
 my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 7172389c25..172c7ee278 100644
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
 Encode::Locale::decode_argv;
 
 # version: define current version
-my $version = "7.0NG.736 PS190711";
+my $version = "7.0NG.736 PS190712";
 
 # save program name for logging
 my $progname = basename($0);