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/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/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-extra_1').hide();
$('#div-extra_2').hide();
} else if ($('#product :selected').val() == "AZURE") {
- $('#div-username label').text('');
- $('#div-password label').text('');
+ $('#div-username label').text('');
+ $('#div-password label').text('');
$('#div-extra_1 label').text('');
$('#div-extra_2 label').text('');
$('#div-extra_1').show();
diff --git a/pandora_console/godmode/massive/massive_add_profiles.php b/pandora_console/godmode/massive/massive_add_profiles.php
index 6000dbe9a6..e337c09f81 100644
--- a/pandora_console/godmode/massive/massive_add_profiles.php
+++ b/pandora_console/godmode/massive/massive_add_profiles.php
@@ -84,7 +84,9 @@ if ($create_profiles) {
);
}
-html_print_table($table);
+if ($table !== null) {
+ html_print_table($table);
+}
unset($table);
diff --git a/pandora_console/godmode/massive/massive_delete_profiles.php b/pandora_console/godmode/massive/massive_delete_profiles.php
index 068f9ee02d..776e72616d 100644
--- a/pandora_console/godmode/massive/massive_delete_profiles.php
+++ b/pandora_console/godmode/massive/massive_delete_profiles.php
@@ -92,7 +92,9 @@ if ($delete_profiles) {
);
}
-html_print_table($table);
+if ($table !== null) {
+ html_print_table($table);
+}
unset($table);
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/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php
index 43f5c1510b..a9562ba6d2 100755
--- a/pandora_console/godmode/reporting/reporting_builder.php
+++ b/pandora_console/godmode/reporting/reporting_builder.php
@@ -774,14 +774,14 @@ switch ($action) {
$table->head[1] = __('Description');
$table->head[2] = __('HTML');
$table->head[3] = __('XML');
- $table->size[0] = '60%';
+ $table->size[0] = '50%';
$table->size[1] = '20%';
$table->size[2] = '2%';
- $table->headstyle[2] = 'min-width: 35px;text-align: center;';
+ $table->headstyle[2] = 'min-width: 35px;text-align: left;';
$table->size[3] = '2%';
- $table->headstyle[3] = 'min-width: 35px;text-align: center;';
+ $table->headstyle[3] = 'min-width: 35px;text-align: left;';
$table->size[4] = '2%';
- $table->headstyle[4] = 'min-width: 35px;text-align: center;';
+ $table->headstyle[4] = 'min-width: 35px;text-align: left;';
$next = 4;
// Calculate dinamically the number of the column.
@@ -790,15 +790,16 @@ switch ($action) {
}
$table->size[$next] = '2%';
- $table->style[$next] = 'text-align: center;';
+ $table->style[$next] = 'text-align: left;';
- $table->headstyle[($next + 2)] = 'min-width: 100px;';
- $table->style[($next + 2)] = 'text-align: center;';
+ $table->headstyle[($next + 2)] = 'min-width: 130px; text-align:right;';
+ $table->style[($next + 2)] = 'text-align: right;';
// Admin options only for RM flag.
if (check_acl($config['id_user'], 0, 'RM')) {
$table->head[$next] = __('Private');
+ $table->headstyle[$next] = 'min-width: 40px;text-align: left;';
$table->size[$next] = '2%';
if (defined('METACONSOLE')) {
$table->align[$next] = '';
@@ -808,7 +809,9 @@ switch ($action) {
$next++;
$table->head[$next] = __('Group');
- $table->size[$next] = '15%';
+ $table->headstyle[$next] = 'min-width: 40px;text-align: left;';
+ $table->size[$next] = '2%';
+ $table->align[$next] = 'left';
$next++;
$op_column = false;
@@ -826,7 +829,7 @@ switch ($action) {
// $table->size = array ();
$table->size[$next] = '10%';
- $table->align[$next] = 'left';
+ $table->align[$next] = 'right';
}
$columnview = false;
diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php
index 6e73913b56..0e7e41e7d6 100755
--- a/pandora_console/godmode/setup/setup_visuals.php
+++ b/pandora_console/godmode/setup/setup_visuals.php
@@ -1505,7 +1505,7 @@ $(document).ready (function () {
.prop('checked');
display_custom_report_front(custom_report,$(this).parent().parent().parent().parent().parent().attr('id'));
});
- $(".databox.filters").css('margin-bottom','-10px');
+ $(".databox.filters").css('margin-bottom','0px');
});
// Change the favicon preview when is changed
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);
}
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')]
- ).' ';
- $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')]
+ ).' ';
+ $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')]
- ).' ';
- $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')]
+ ).' ';
+ $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')]
- ).' ';
- $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')]
+ ).' ';
+ $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')]
+ ).' ';
+ $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')]
+ ).' ';
+ $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
- ).' ';
- $data[6] .= $recon_script_name;
+ } else {
+ // APP or external script recon task.
+ $data[6] = html_print_image(
+ 'images/plugin.png',
+ true
+ ).' ';
+ $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/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/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/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/include/constants.php b/pandora_console/include/constants.php
index 6edfdf1f70..c0a03ea34d 100644
--- a/pandora_console/include/constants.php
+++ b/pandora_console/include/constants.php
@@ -582,6 +582,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.
@@ -594,6 +595,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_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/include/functions_credential_store.php b/pandora_console/include/functions_credential_store.php
index cf09e6d67b..eaf756f7b1 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
);
@@ -292,8 +296,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 +323,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;
@@ -358,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,
]
@@ -371,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/include/functions_events.php b/pandora_console/include/functions_events.php
index f9a1271c18..7a4dc7a11b 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 = [];
@@ -4465,6 +4467,8 @@ function events_page_general($event)
$data[1] = ''.__('N/A').'';
}
+ $table_general->cellclass[7][1] = 'general_status';
+
$table_general->data[] = $data;
$data = [];
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)
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');
}
diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php
index dded175af5..dc423481f2 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 .= '
';
@@ -174,7 +173,6 @@ function snmp_browser_get_html_tree(
$last_array,
$sufix,
$checked,
- $return,
$descriptive_ids,
$previous_id
);
@@ -225,7 +223,6 @@ function snmp_browser_print_tree(
$last_array,
$sufix,
$checked,
- $return,
$descriptive_ids,
$previous_id
);
diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js
index 94dadb6fbb..0fb6c1a6ef 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,21 @@ 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();
+ }
+
+ if (data == "status_ok") {
+ dt_events.draw(false);
+ $("#notification_status_success").show();
+ } else {
+ $("#notification_status_error").show();
+ }
}
});
return false;
@@ -475,19 +483,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 +503,29 @@ function event_change_owner() {
$("#button-owner_button").removeAttr("disabled");
$("#response_loading").hide();
- show_event_dialog(
- event_id,
- $("#hidden-group_rep").val(),
- "responses",
- data
- );
+ 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) {
+ $("#extended_event_general_page table td.general_owner").html(
+ "N/A"
+ );
+ } else {
+ $("#extended_event_general_page table td.general_owner").text(
+ new_owner
+ );
+ }
+ } else {
+ $("#notification_owner_error").show();
+ }
}
});
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;
}
}
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;
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index de13b884ff..f688186567 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -235,11 +235,12 @@ pre {
font-family: courier, serif;
}
fieldset {
- background-color: #f9faf9;
+ background-color: #fff;
border: 1px solid #e2e2e2;
padding: 0.5em;
margin-bottom: 20px;
position: relative;
+ border-radius: 5px;
}
fieldset legend {
font-size: 1.1em;
@@ -5791,7 +5792,6 @@ div#status_pie {
grid-template-columns: 50px auto;
}
-
/*
* ---------------------------------------------------------------------
* - IMAGES FOR STATUS. This replaces the images of /images/status_sets/default/
@@ -5834,7 +5834,6 @@ div#status_pie {
* ---------------------------------------------------------------------
*/
-
/* Table for show more info in events and config menu in modules graphs. (This class exists in events.css too) */
.table_modal_alternate {
border-spacing: 0;
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 @@
width."; text-align: right;'>";
+ echo "
";
if ($new_networkmap) {
html_print_input_hidden('save_networkmap', 1);
html_print_submit_button(
__('Save networkmap'),
'crt',
false,
- 'class="sub"'
+ 'class="sub next"'
);
}
@@ -401,7 +401,7 @@ if ($not_found) {
__('Update networkmap'),
'crt',
false,
- 'class="sub"'
+ 'class="sub upd"'
);
}
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
diff --git a/pandora_console/operation/search_graphs.getdata.php b/pandora_console/operation/search_graphs.getdata.php
index aefd6e2073..4dc6f3ba74 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);
@@ -45,5 +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;
}
}
diff --git a/pandora_console/operation/search_main.php b/pandora_console/operation/search_main.php
index 3a0880e348..718fd45be5 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, 'AW');
$searchHelps = true;
echo '
';
@@ -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] = "
".sprintf(__('%s Found'), $totalAgents).'';
$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] = "
".sprintf(__('%s Found'), $totalReports).'';
$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Maps found')]);
$table->data[0][13] = "
".sprintf(__('%s Found'), $totalMaps).'';
-$table->data[0][14] = html_print_image('images/help.png', true, ['title' => __('Helps found')]);
-$table->data[0][15] = "
".sprintf(__('%s Found'), $totalHelps).'';
+if (enterprise_installed()) {
+ $table->data[0][14] = html_print_image('images/policies.png', true, ['title' => __('Policies')]);
+ $table->data[0][15] = "
".sprintf(__('%s Found'), $totalPolicies).'';
+}
html_print_table($table);
@@ -79,4 +86,5 @@ if ($searchAgents && $totalAgents > 0) {
).'';
}
+
echo '
';
diff --git a/pandora_console/operation/search_policies.getdata.php b/pandora_console/operation/search_policies.getdata.php
new file mode 100644
index 0000000000..a8c05ea071
--- /dev/null
+++ b/pandora_console/operation/search_policies.getdata.php
@@ -0,0 +1,200 @@
+ '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) {
+ /*
+ 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);
+
+ $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);
+
+ $policies = db_process_sql($sql);
+
+if ($policies !== false) {
+ $totalPolicies = count($policies);
+
+ if ($only_count) {
+ unset($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..26b3f7737d
--- /dev/null
+++ b/pandora_console/operation/search_policies.php
@@ -0,0 +1,90 @@
+
".__('Zero results found')."
\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').' '.'
'.html_print_image('images/sort_up.png', true, ['style' => $selectpolicieIDUp]).''.'
'.html_print_image('images/sort_down.png', true, ['style' => $selectpolicieIDDown]).'';
+ $table->head[0] = __('Name').' '.'
'.html_print_image('images/sort_up.png', true, ['style' => $selectNameUp]).''.'
'.html_print_image('images/sort_down.png', true, ['style' => $selectNameDown]).'';
+ $table->head[1] = __('Description').' '.'
'.html_print_image('images/sort_up.png', true, ['style' => $selectDescriptionUp]).''.'
'.html_print_image('images/sort_down.png', true, ['style' => $selectDescriptionDown]).'';
+ $table->head[2] = __('Id_group').' '.'
'.html_print_image('images/sort_up.png', true, ['style' => $selectId_groupUp]).''.'
'.html_print_image('images/sort_down.png', true, ['style' => $selectId_groupDown]).'';
+ $table->head[3] = __('Status').' '.'
'.html_print_image('images/sort_up.png', true, ['style' => $selectStatusUp]).''.'
'.html_print_image('images/sort_down.png', true, ['style' => $selectstatusDown]).'';
+
+ $table->data = [];
+
+ foreach ($policies as $policie) {
+ $policieIDCell = "
".$policies['id'].'';
+
+ 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['description'],
+ ui_print_group_icon($policie['id_group'], true),
+ $status,
+
+ ]
+ );
+ }
+
+ $totalPolicies = count($policies);
+ echo '
';
+ 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..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 = 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;
@@ -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' => "".html_print_image(
- 'images/help_w.png',
+if ($searchPolicies) {
+ $policies_tab = [
+ 'text' => "".html_print_image(
+ 'images/policies.png',
true,
- ['title' => __('Helps')]
+ ['title' => __('Policies')]
).'',
- '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(
@@ -212,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;
@@ -251,8 +253,9 @@ 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;
}
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')) {
).'
';
}
+if (!$config['disabled_newsletter']) {
+ $newsletter = '
'.__('Newsletter Subscribed').':
';
+ if ($user_info['middlename'] > 0) {
+ $newsletter .= '
'.__('Already subscribed to %s newsletter', get_product_name()).'';
+ } else {
+ $newsletter .= '
'.__('Subscribe to our newsletter').'';
+ $newsletter_reminder = '
'.__('Newsletter Reminder').':
';
+ $newsletter_reminder .= html_print_switch(
+ [
+ 'name' => 'newsletter_reminder',
+ 'value' => $newsletter_reminder_value,
+ 'disabled' => false,
+ ]
+ );
+ }
-$newsletter = '
'.__('Newsletter Subscribed').':
';
-if ($user_info['middlename'] > 0) {
- $newsletter .= '
'.__('Already subscribed to %s newsletter', get_product_name()).'';
-} else {
- $newsletter .= '
'.__('Subscribe to our newsletter').'';
- $newsletter_reminder = '
'.__('Newsletter Reminder').':
';
- $newsletter_reminder .= html_print_switch(
- [
- 'name' => 'newsletter_reminder',
- 'value' => $newsletter_reminder_value,
- 'disabled' => false,
- ]
- );
+ $newsletter_reminder .= '
';
}
-$newsletter_reminder .= '
';
-
$autorefresh_list_out = [];
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/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
index 51761f5e27..e91b580498 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 (defined($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/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/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";
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);