Merge remote-tracking branch 'origin/develop' into 3170-Cambios_custom_fields_view

This commit is contained in:
daniel 2018-12-04 09:39:08 +01:00
commit 67bd22fed3
30 changed files with 210 additions and 50 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.729-181130 Version: 7.0NG.729-181204
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.729" PI_VERSION="7.0NG.729"
PI_BUILD="181130" PI_BUILD="181204"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{181130} {181204}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.729-181130 Version: 7.0NG.729-181204
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -14,9 +14,6 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
require_once ('../include/functions_update_manager.php');
if (isset($_SERVER['REQUEST_TIME'])) { if (isset($_SERVER['REQUEST_TIME'])) {
$time = $_SERVER['REQUEST_TIME']; $time = $_SERVER['REQUEST_TIME'];
} }

View File

@ -229,15 +229,31 @@ $(document).ready (function () {
}); });
$("#left").click (function () { $("#left").click (function () {
var current_fields_size = ($('#fields_selected option').size());
var selected_fields = [];
var selected_fields_total = '';
jQuery.each($("select[name='fields_selected[]'] option:selected"), function (key, value) { jQuery.each($("select[name='fields_selected[]'] option:selected"), function (key, value) {
field_name = $(value).html(); field_name = $(value).html();
if (field_name != <?php echo "'".__('None')."'"; ?>) { selected_fields.push(field_name);
id_field = $(value).attr('value'); selected_fields_total = selected_fields.length;
$("select[name='fields_available[]']").append($("<option></option>").val(id_field).html('<i>' + field_name + '</i>'));
$("#fields_selected").find("option[value='" + id_field + "']").remove();
$("#fields_available").find("option[value='0']").remove();
}
}); });
if(selected_fields_total === current_fields_size){
display_confirm_dialog(
"<?php echo '<span style=text-transform:none;font-size:9.5pt;>'.__('There must be at least one custom field. Timestamp will be set by default').'</span>'; ?>",
"<?php echo __('Confirm'); ?>",
"<?php echo __('Cancel'); ?>",
function () {
move_left();
$("#fields_available").find("option[value='timestamp']").remove();
$("select[name='fields_selected[]']").append($("<option></option>").val('timestamp').html('<i>' + 'Timestamp' + '</i>'));
}
);
}
else{
move_left();
}
}); });
$("#submit-upd_button").click(function () { $("#submit-upd_button").click(function () {
@ -247,4 +263,16 @@ $(document).ready (function () {
}); });
}); });
}); });
function move_left(){
jQuery.each($("select[name='fields_selected[]'] option:selected"), function (key, value) {
field_name = $(value).html();
if (field_name != <?php echo "'".__('None')."'"; ?>) {
id_field = $(value).attr('value');
$("select[name='fields_available[]']").append($("<option></option>").val(id_field).html('<i>' + field_name + '</i>'));
$("#fields_selected").find("option[value='" + id_field + "']").remove();
$("#fields_available").find("option[value='0']").remove();
}
});
}
</script> </script>

View File

@ -175,7 +175,7 @@ if ($id_profile || $new_profile) {
$vconsole_management = (bool) $profile["vconsole_management"]; $vconsole_management = (bool) $profile["vconsole_management"];
$id_audit = db_pandora_audit("User management", $id_audit = db_pandora_audit("User management",
"Edit profile ". $name); "Edit profile ". io_safe_output($name));
enterprise_include_once('include/functions_audit.php'); enterprise_include_once('include/functions_audit.php');
$info = 'Name: ' . $name . $info = 'Name: ' . $name .

View File

@ -74,7 +74,7 @@ if ($delete_profile) {
} }
else { else {
db_pandora_audit("Profile management", db_pandora_audit("Profile management",
"Delete profile ". $profile['name']); "Delete profile ". io_safe_output($profile['name']));
ui_print_success_message(__('Successfully deleted')); ui_print_success_message(__('Successfully deleted'));
} }
@ -187,7 +187,7 @@ if ($update_profile) {
"'.get_product_name().' Management":"'.$pandora_management.'"}'; "'.get_product_name().' Management":"'.$pandora_management.'"}';
db_pandora_audit("User management", db_pandora_audit("User management",
"Update profile ". $name, false, false, $info); "Update profile ".io_safe_output($name), false, false, $info);
ui_print_success_message(__('Successfully updated')); ui_print_success_message(__('Successfully updated'));
} }
@ -234,7 +234,7 @@ if ($create_profile) {
"'.get_product_name().' Management":"'.$pandora_management.'"}'; "'.get_product_name().' Management":"'.$pandora_management.'"}';
db_pandora_audit("User management", db_pandora_audit("User management",
"Created profile ". $name, false, false, $info); "Created profile ". io_safe_output($name), false, false, $info);
} }
else { else {
ui_print_error_message(__('There was a problem creating this profile')); ui_print_error_message(__('There was a problem creating this profile'));

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC181130'; $build_version = 'PC181204';
$pandora_version = 'v7.0NG.729'; $pandora_version = 'v7.0NG.729';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -11871,8 +11871,142 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access =
return false; return false;
} }
function api_set_validate_traps ($id, $thrash2, $other, $thrash3) {
if (defined ('METACONSOLE')) {
return;
}
if($id == 'all'){
$result = db_process_sql_update('ttrap',array('status' => 1));
}
else{
$result = db_process_sql_update('ttrap',
array('status' => 1), array('id_trap' => $id));
}
if (is_error($result)) {
// TODO: Improve the error returning more info
returnError('error_update_trap', __('Error in trap update.'));
}
else {
returnData('string',
array('type' => 'string',
'data' => __('Validated traps.')));
}
}
function api_set_delete_traps ($id, $thrash2, $other, $thrash3) {
if (defined ('METACONSOLE')) {
return;
}
if($id == 'all'){
$result = db_process_sql ('delete from ttrap');
}
else{
$result = db_process_sql_delete('ttrap',array('id_trap' => $id));
}
if (is_error($result)) {
// TODO: Improve the error returning more info
returnError('error_delete_trap', __('Error in trap delete.'));
}
else {
returnData('string',
array('type' => 'string',
'data' => __('Deleted traps.')));
}
}
function api_get_group_id_by_name($thrash1, $thrash2, $other, $thrash3) {
if (defined ('METACONSOLE')) {
return;
}
$sql = sprintf('SELECT id_grupo
FROM tgrupo WHERE nombre = "'.$other['data'].'"');
$group_id = db_get_all_rows_sql($sql);
if (count($group_id) > 0 and $group_id !== false) {
$data = array('type' => 'array', 'data' => $group_id);
returnData('csv', $data, ';');
}
else {
returnError('error_group_name', 'No groups retrieved.');
}
}
function api_get_timezone($thrash1, $thrash2, $other, $thrash3) {
if (defined ('METACONSOLE')) {
return;
}
$sql = sprintf('SELECT value
FROM tconfig WHERE token = "timezone"');
$timezone = db_get_all_rows_sql($sql);
if (count($timezone) > 0 and $timezone !== false) {
$data = array('type' => 'string', 'data' => $timezone);
returnData('string',array('type' => 'string','data' => $data['data'][0]['value']));
}
else {
returnError('error_timezone', 'No timezone retrieved.');
}
}
function api_get_language($thrash1, $thrash2, $other, $thrash3) {
if (defined ('METACONSOLE')) {
return;
}
$sql = sprintf('SELECT value
FROM tconfig WHERE token = "language"');
$language = db_get_all_rows_sql($sql);
if (count($language) > 0 and $language !== false) {
$data = array('type' => 'string', 'data' => $language);
returnData('string',array('type' => 'string','data' => $data['data'][0]['value']));
}
else {
returnError('error_language', 'No language retrieved.');
}
}
function api_get_session_timeout($thrash1, $thrash2, $other, $thrash3) {
if (defined ('METACONSOLE')) {
return;
}
$sql = sprintf('SELECT value
FROM tconfig WHERE token = "session_timeout"');
$language = db_get_all_rows_sql($sql);
if (count($language) > 0 and $language !== false) {
$data = array('type' => 'string', 'data' => $language);
returnData('string',array('type' => 'string','data' => $data['data'][0]['value']));
}
else {
returnError('error_session_timeout', 'No session timeout retrieved.');
}
}
?> ?>

View File

@ -7543,8 +7543,8 @@ function reporting_get_stats_alerts($data, $links = false) {
$urls['monitor_alerts'] = "index.php?sec=estado&sec2=operation/agentes/alerts_status&pure=" . $config['pure']; $urls['monitor_alerts'] = "index.php?sec=estado&sec2=operation/agentes/alerts_status&pure=" . $config['pure'];
$urls['monitor_alerts_fired'] = "index.php?sec=estado&sec2=operation/agentes/alerts_status&filter=fired&pure=" . $config['pure']; $urls['monitor_alerts_fired'] = "index.php?sec=estado&sec2=operation/agentes/alerts_status&filter=fired&pure=" . $config['pure'];
} else { } else {
$urls['monitor_alerts'] = "index.php?sec=estado&amp;sec2=operation/agentes/alerts_status&amp;refr=60"; $urls['monitor_alerts'] = $config['homeurl']."index.php?sec=estado&amp;sec2=operation/agentes/alerts_status&amp;refr=60";
$urls['monitor_alerts_fired'] = "index.php?sec=estado&amp;sec2=operation/agentes/alerts_status&amp;refr=60&filter=fired"; $urls['monitor_alerts_fired'] = $config['homeurl']."index.php?sec=estado&amp;sec2=operation/agentes/alerts_status&amp;refr=60&filter=fired";
} }
} }
@ -7600,19 +7600,19 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he
// Link URLS // Link URLS
if ($links === false) { if ($links === false) {
$urls = array(); $urls = array();
$urls['monitor_critical'] = "index.php?" . $urls['monitor_critical'] = $config['homeurl']."index.php?" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" . "sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_CRITICAL_BAD . "&pure=" . $config['pure']; "refr=60&amp;status=" . AGENT_MODULE_STATUS_CRITICAL_BAD . "&pure=" . $config['pure'];
$urls['monitor_warning'] = "index.php?" . $urls['monitor_warning'] = $config['homeurl']."index.php?" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" . "sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_WARNING . "&pure=" . $config['pure']; "refr=60&amp;status=" . AGENT_MODULE_STATUS_WARNING . "&pure=" . $config['pure'];
$urls['monitor_ok'] = "index.php?" . $urls['monitor_ok'] = $config['homeurl']."index.php?" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" . "sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_NORMAL . "&pure=" . $config['pure']; "refr=60&amp;status=" . AGENT_MODULE_STATUS_NORMAL . "&pure=" . $config['pure'];
$urls['monitor_unknown'] = "index.php?" . $urls['monitor_unknown'] = $config['homeurl']."index.php?" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" . "sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_UNKNOWN . "&pure=" . $config['pure']; "refr=60&amp;status=" . AGENT_MODULE_STATUS_UNKNOWN . "&pure=" . $config['pure'];
$urls['monitor_not_init'] = "index.php?" . $urls['monitor_not_init'] = $config['homeurl']."index.php?" .
"sec=view&amp;sec2=operation/agentes/status_monitor&amp;" . "sec=view&amp;sec2=operation/agentes/status_monitor&amp;" .
"refr=60&amp;status=" . AGENT_MODULE_STATUS_NOT_INIT . "&pure=" . $config['pure']; "refr=60&amp;status=" . AGENT_MODULE_STATUS_NOT_INIT . "&pure=" . $config['pure'];
} }
@ -7715,8 +7715,8 @@ function reporting_get_stats_agents_monitors($data) {
} }
else { else {
$urls = array(); $urls = array();
$urls['total_agents'] = "index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60"; $urls['total_agents'] = $config['homeurl']."index.php?sec=estado&amp;sec2=operation/agentes/estado_agente&amp;refr=60";
$urls['monitor_checks'] = "index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;refr=60&amp;status=-1"; $urls['monitor_checks'] = $config['homeurl']."index.php?sec=view&amp;sec2=operation/agentes/status_monitor&amp;refr=60&amp;status=-1";
} }
// Agents and modules table // Agents and modules table

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.729 %define version 7.0NG.729
%define release 181130 %define release 181204
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd
@ -29,7 +29,7 @@ Requires: %{httpd_name} >= 2.0.0
Requires: mod_php >= 5.2.0 Requires: mod_php >= 5.2.0
Requires: php-gd, php-ldap, php-snmp, php-session, php-gettext Requires: php-gd, php-ldap, php-snmp, php-session, php-gettext
Requires: php-mysqlnd, php-mbstring, php-zip, php-zlib, php-curl Requires: php-mysqlnd, php-mbstring, php-zip, php-zlib, php-curl
Requires: xorg-x11-fonts-75dpi, xorg-x11-fonts-misc Requires: xorg-x11-fonts-75dpi, xorg-x11-fonts-misc, php-pecl-zip
Requires: graphviz Requires: graphviz
Provides: %{name}-%{version} Provides: %{name}-%{version}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.729 %define version 7.0NG.729
%define release 181130 %define release 181204
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2
@ -27,7 +27,8 @@ Prefix: /srv/www/htdocs
BuildRoot: %{_tmppath}/%{name} BuildRoot: %{_tmppath}/%{name}
BuildArch: noarch BuildArch: noarch
AutoReq: 0 AutoReq: 0
Requires: apache2, apache2-mod_php5 Requires: apache2
Requires: (apache2-mod_php5 or apache2-mod_php7)
Requires: php >= 4.3.0 Requires: php >= 4.3.0
Requires: php-gd, php-snmp, php-json, php-gettext Requires: php-gd, php-snmp, php-json, php-gettext
Requires: php-mysqlnd, php-ldap, php-mbstring, php Requires: php-mysqlnd, php-ldap, php-mbstring, php

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.729-181130 Version: 7.0NG.729-181204
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.729"; my $pandora_version = "7.0NG.729";
my $pandora_build = "181130"; my $pandora_build = "181204";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

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

View File

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

View File

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

View File

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

View File

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