Merge branch 'develop' into 'ent-4836-menu-duplicado-en-reports-de-metaconsola'

# Conflicts:
#   pandora_console/godmode/reporting/reporting_builder.php
This commit is contained in:
Marcos Alconada 2019-10-22 13:26:15 +02:00
commit 6963ce894b
44 changed files with 163 additions and 57 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.739-191017
Version: 7.0NG.739-191022
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.739-191017"
pandora_version="7.0NG.739-191022"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.739';
use constant AGENT_BUILD => '191017';
use constant AGENT_BUILD => '191022';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.739
%define release 191017
%define release 191022
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.739
%define release 191017
%define release 191022
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.739"
PI_BUILD="191017"
PI_BUILD="191022"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{191017}
{191022}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.739(Build 191017)")
#define PANDORA_VERSION ("7.0NG.739(Build 191022)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.739(Build 191017))"
VALUE "ProductVersion", "(7.0NG.739(Build 191022))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.739-191017
Version: 7.0NG.739-191022
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.739-191017"
pandora_version="7.0NG.739-191022"
package_pear=0
package_pandora=1

View File

@ -842,7 +842,9 @@ foreach ($modules as $module) {
$module['str_warning'],
$module['max_critical'],
$module['min_critical'],
$module['str_critical']
$module['str_critical'],
$module['warning_inverse'],
$module['critical_inverse']
);
} else {
$data[7] = '';

View File

@ -16,10 +16,10 @@ global $config;
// Check user credentials
check_login();
if (! check_acl($config['id_user'], 0, 'RR')) {
if (! check_acl($config['id_user'], 0, 'RR') || enterprise_installed() === false) {
db_pandora_audit(
'ACL Violation',
'Trying to access Inventory Module Management'
'Trying to access Graph container'
);
include 'general/noaccess.php';
return;

View File

@ -71,10 +71,12 @@ switch ($activeTab) {
break;
}
$buttons['graph_container'] = [
'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image('images/graph-container.png', true, ['title' => __('Graphs containers')]).'</a>',
];
if ($enterpriseEnable) {
$buttons['graph_container'] = [
'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image('images/graph-container.png', true, ['title' => __('Graphs containers')]).'</a>',
];
}
$delete_graph = (bool) get_parameter('delete_graph');
$view_graph = (bool) get_parameter('view_graph');

View File

@ -18,7 +18,7 @@ check_login();
enterprise_hook('open_meta_frame');
if (! check_acl($config['id_user'], 0, 'PM')) {
if (! check_acl($config['id_user'], 0, 'UM')) {
db_pandora_audit(
'ACL Violation',
'Trying to access Profile Management'
@ -320,24 +320,29 @@ if ($id_profile || $new_profile) {
$table->data['IM'] = $row;
$table->data[] = '<hr>';
$disable_option = 'javascript: return false;';
if (check_acl($config['id_user'], 0, 'PM') || users_is_admin()) {
$disable_option = '';
}
// Users
$row = [];
$row['name'] = __('Manage users');
$row['input'] = html_print_checkbox('user_management', 1, $user_management, true);
$row['input'] = html_print_checkbox('user_management', 1, $user_management, true, false, $disable_option);
$table->data['UM'] = $row;
$table->data[] = '<hr>';
// DB
$row = [];
$row['name'] = __('Manage database');
$row['input'] = html_print_checkbox('db_management', 1, $db_management, true);
$row['input'] = html_print_checkbox('db_management', 1, $db_management, true, false, $disable_option);
$table->data['DM'] = $row;
$table->data[] = '<hr>';
// Pandora
$row = [];
$row['name'] = __('%s management', get_product_name());
$row['input'] = html_print_checkbox('pandora_management', 1, $pandora_management, true);
$row['input'] = html_print_checkbox('pandora_management', 1, $pandora_management, true, false, $disable_option);
$table->data['PM'] = $row;
$table->data[] = '<hr>';
@ -359,3 +364,18 @@ if ($id_profile || $new_profile) {
}
enterprise_hook('close_meta_frame');
?>
<script type="text/javascript" language="javascript">
$(document).ready (function () {
var disable_option = '<?php echo $disable_option; ?>';
if (disable_option != '') {
var ids = ['#checkbox-db_management', '#checkbox-user_management', '#checkbox-pandora_management'];
ids.forEach(id => {
$(id).css({'cursor':'not-allowed', 'opacity':'0.5'});
});
}
});
</script>

View File

@ -362,7 +362,10 @@ foreach ($profiles as $profile) {
$data['PM'] = ($profile['pandora_management'] ? $img : '');
$table->cellclass[]['operations'] = 'action_buttons';
$data['operations'] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'&pure='.$pure.'">'.html_print_image('images/config.png', true, ['title' => __('Edit')]).'</a>';
$data['operations'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile['id_perfil'].'&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>';
if (check_acl($config['id_user'], 0, 'PM') || users_is_admin()) {
$data['operations'] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile['id_perfil'].'&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true).'</a>';
}
array_push($table->data, $data);
}

View File

@ -420,7 +420,9 @@ else {
$u = get_user_info($key);
$g = users_get_groups($key, 'AR', $u['is_admin']);
$result = array_intersect($g, $own_groups);
if (!$usr['is_admin'] && !empty($result)) {
// Show users without profile too.
if (!$usr['is_admin'] && !empty($result) || (!$usr['is_admin'] && db_get_all_rows_field_filter('tusuario_perfil', 'id_usuario', $usr['id_user']) === false)) {
$info[$key] = $usr;
}

View File

@ -1113,7 +1113,7 @@ if (check_login()) {
}
if ($module['id_tipo_modulo'] != 25) {
$data[6] = ui_print_module_warn_value($module['max_warning'], $module['min_warning'], $module['str_warning'], $module['max_critical'], $module['min_critical'], $module['str_critical']);
$data[6] = ui_print_module_warn_value($module['max_warning'], $module['min_warning'], $module['str_warning'], $module['max_critical'], $module['min_critical'], $module['str_critical'], $module['warning_inverse'], $module['critical_inverse']);
} else {
$data[6] = '';
}

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC191017';
$build_version = 'PC191022';
$pandora_version = 'v7.0NG.739';
// Do not overwrite default timezone set if defined.

View File

@ -6225,9 +6225,8 @@ function api_set_planned_downtimes_created($id, $thrash1, $other, $thrash3)
return;
}
$date_from = strtotime(html_entity_decode($other['data'][1]));
$date_to = strtotime(html_entity_decode($other['data'][2]));
$date_from = strtotime(html_entity_decode($other['data'][1].' '.$other['data'][11]));
$date_to = strtotime(html_entity_decode($other['data'][2].' '.$other['data'][12]));
$values = [];
$values['name'] = $id;
$values = [

View File

@ -3609,7 +3609,7 @@ function graph_custom_sql_graph(
$sql = io_safe_output($sql['sql']);
}
if (($config['metaconsole'] == 1) && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && defined('METACONSOLE') && $report_content['server_name'] != '' && $report_content['server_name'] != '0') {
$metaconsole_connection = enterprise_hook('metaconsole_get_connection', [$report_content['server_name']]);
if ($metaconsole_connection === false) {
@ -3624,7 +3624,7 @@ function graph_custom_sql_graph(
$data_result = db_get_all_rows_sql($sql, $historical_db);
if (($config['metaconsole'] == 1) && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && defined('METACONSOLE') && $report_content['server_name'] != '' && $report_content['server_name'] != '0') {
enterprise_hook('metaconsole_restore_db');
}

View File

@ -2527,9 +2527,22 @@ function ui_print_module_warn_value(
$str_warning,
$max_critical,
$min_critical,
$str_critical
$str_critical,
$warning_inverse=0,
$critical_inverse=0
) {
$data = "<span title='".__('Warning').': '.__('Max').$max_warning.'/'.__('Min').$min_warning.' - '.__('Critical').': '.__('Max').$max_critical.'/'.__('Min').$min_critical."'>";
$war_inv = '';
$crit_inv = '';
if ($warning_inverse == 1) {
$war_inv = ' (inv)';
}
if ($critical_inverse == 1) {
$crit_inv = ' (inv)';
}
$data = "<span title='".__('Warning').': '.__('Max').$max_warning.'/'.__('Min').$min_warning.$war_inv.' - '.__('Critical').': '.__('Max').$max_critical.'/'.__('Min').$min_critical.$crit_inv."'>";
if ($max_warning != $min_warning) {
$data .= format_for_graph($max_warning).'/'.format_for_graph($min_warning);
@ -5696,8 +5709,7 @@ function ui_print_comments($comments)
// Only show the last comment. If commment its too long,the comment will short with ...
// If $config['prominent_time'] is timestamp the date show Month, day, hour and minutes.
// Else show comments hours ago
if ($last_comment[0][0]['action'] != 'Added comment'){
if ($last_comment[0][0]['action'] != 'Added comment') {
$last_comment[0][0]['comment'] = $last_comment[0][0]['action'];
}

View File

@ -261,6 +261,7 @@ div.login_button_saml input:hover {
.login_back input {
background-image: url("../../images/back_login.png");
background-position: left 5% center;
background-repeat: no-repeat;
}
.login_back input:hover {

View File

@ -0,0 +1,10 @@
/*
* Wux style
*/
.wux_execution_result_transaction {
width: auto;
height: auto;
float: right;
margin-right: 200px;
}

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.739';
$build = '191017';
$build = '191022';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -166,6 +166,19 @@ class ModuleGraph
$time_compare = 'overlapped';
}
// Graph TIP view.
if (!isset($config['full_scale_option']) || $config['full_scale_option'] == 0) {
$fullscale = 0;
} else if ($config['full_scale_option'] == 1) {
$fullscale = 1;
} else if ($config['full_scale_option'] == 2) {
if ($this->graph_type == 'boolean') {
$fullscale = 1;
} else {
$fullscale = 0;
}
}
ob_start();
switch ($this->graph_type) {
case 'boolean':
@ -188,6 +201,7 @@ class ModuleGraph
'menu' => false,
'type_graph' => $config['type_module_charts'],
'vconsole' => true,
'fullscale' => $fullscale,
];
$graph = grafico_modulo_sparse($params);

View File

@ -1541,7 +1541,9 @@ if (!empty($result)) {
$row['str_warning'],
$row['max_critical'],
$row['min_critical'],
$row['str_critical']
$row['str_critical'],
$row['warning_inverse'],
$row['critical_inverse']
);
if (is_numeric($row['datos']) && !modules_is_string_type($row['module_type'])) {

View File

@ -280,6 +280,14 @@ if (is_ajax()) {
$events,
function ($carry, $item) {
$tmp = (object) $item;
$tmp->meta = is_metaconsole();
if (is_metaconsole()) {
if ($tmp->server_name !== null) {
$tmp->data_server = metaconsole_get_servers($tmp->server_id);
$tmp->server_url_hash = metaconsole_get_servers_url_hash($tmp->data_server);
}
}
$tmp->evento = str_replace('"', '', io_safe_output($tmp->evento));
if (strlen($tmp->evento) >= 255) {
$tmp->evento = ui_print_truncate_text($tmp->evento, 255, $tmp->evento, true, false);
@ -1598,6 +1606,17 @@ function process_datatables_callback(table, settings) {
function process_datatables_item(item) {
// Url to go to node from meta.
var server_url = '';
var hashdata = '';
if(item.meta === true){
if(typeof item.data_server !== 'undefined' && typeof item.server_url_hash !== 'undefined'){
server_url = item.data_server.server_url;
hashdata = item.server_url_hash;
}
}
// Show comments events.
item.user_comment = item.comments
@ -1843,9 +1862,19 @@ function process_datatables_item(item) {
/* Update column content now to avoid json poisoning. */
// Url to agent view.
var url_link = '<?php echo ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='); ?>';
var url_link_hash = '';
if(item.meta === true){
url_link = server_url+'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=';
url_link_hash = hashdata;
}
/* Agent name link */
if (item.id_agente > 0) {
item.agent_name = '<a href="<?php echo ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='); ?>' +item.id_agente+'">' + item.agent_name + '</a>';
item.agent_name = '<a href="'+url_link+item.id_agente+url_link_hash+'">' + item.agent_name + '</a>';
} else {
item.agent_name = '';
}
@ -1855,11 +1884,11 @@ function process_datatables_item(item) {
<?php
if (in_array('agent_name', $fields)) {
?>
item.id_agente = '<a href="<?php echo ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='); ?>'+item.id_agente+'">' + item.id_agente + '</a>';
item.id_agente = '<a href="'+url_link+item.id_agente+url_link_hash+'">' + item.id_agente + '</a>';
<?php
} else {
?>
item.id_agente = '<a href="<?php echo ui_get_full_url('index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='); ?>'+item.id_agente+'">' + item.agent_name + '</a>';
item.id_agente = '<a href="'+url_link+item.id_agente+url_link_hash+'">' + item.agent_name + '</a>';
<?php
}
?>

View File

@ -18,6 +18,11 @@ enterprise_include_once('include/functions_policies.php');
$searchpolicies = check_acl($config['id_user'], 0, 'AW');
if (!$searchpolicies) {
$totalPolicies = 0;
return;
}
$selectpolicieIDUp = '';
$selectpolicieIDDown = '';
$selectNameUp = '';
@ -169,7 +174,7 @@ switch ($sortField) {
break;
}
if ($searchpolicies == 0) {
if ($searchpolicies) {
/*
We take the user groups to get policies that meet the requirements of the search
and which the user have permission on this groups
@ -189,6 +194,7 @@ if ($searchpolicies == 0) {
$policies = db_process_sql($sql);
if ($policies !== false) {
$totalPolicies = count($policies);

View File

@ -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, 'AW');
$searchUsers = $searchPolicies = check_acl($config['id_user'], 0, 'AR');
$searchMaps = $searchReports = $searchGraphs = check_acl($config['id_user'], 0, 'IR');
$searchMain = true;
$searchHelps = true;

View File

@ -18,6 +18,10 @@ require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/functions_groups.php';
$searchUsers = check_acl($config['id_user'], 0, 'UM');
if (!$searchUsers) {
$totalUsers = 0;
return;
}
$selectUserIDUp = '';
$selectUserIDDown = '';

View File

@ -91,7 +91,7 @@ if (!$users || !$searchUsers) {
}
echo '<br />';
ui_pagination($totalUsers);
// ui_pagination($totalUsers);
html_print_table($table);
unset($table);
ui_pagination($totalUsers);

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.739
%define release 191017
%define release 191022
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.739
%define release 191017
%define release 191022
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.739
%define release 191017
%define release 191022
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.739-191017
Version: 7.0NG.739-191022
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.739-191017"
pandora_version="7.0NG.739-191022"
package_cpan=0
package_pandora=1

View File

@ -45,7 +45,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.739";
my $pandora_build = "191017";
my $pandora_build = "191022";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.739";
my $pandora_build = "191017";
my $pandora_build = "191022";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
@ -762,7 +762,7 @@ sub transfer_xml {
my $file_path;
if (! (empty ($name))) {
$file_name = $name . "." . sprintf("%d",time()) . ".data";
$file_name = $name . "." . sprintf("%d",getCurrentUTimeMilis(). (rand()*10000)) . ".data";
}
else {
# Inherit file name

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.739
%define release 191017
%define release 191022
Summary: Pandora FMS Server
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_server
%define version 7.0NG.739
%define release 191017
%define release 191022
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.739"
PI_BUILD="191017"
PI_BUILD="191022"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.739 PS191017";
my $version = "7.0NG.739 PS191022";
# Pandora server configuration
my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.739 PS191017";
my $version = "7.0NG.739 PS191022";
# save program name for logging
my $progname = basename($0);