Merge remote-tracking branch 'origin/develop' into 2221-Actualizacion_de_Pandora_a_version_7_de_PHP

This commit is contained in:
daniel 2018-10-18 12:51:32 +02:00
commit 9492d11cc8
32 changed files with 87 additions and 68 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.727-181016
Version: 7.0NG.727-181018
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.727-181016"
pandora_version="7.0NG.727-181018"
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.727';
use constant AGENT_BUILD => '181016';
use constant AGENT_BUILD => '181018';
# 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.727
%define release 181016
%define release 181018
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.727"
PI_BUILD="181016"
PI_BUILD="181018"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{181016}
{181018}
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.727(Build 181016)")
#define PANDORA_VERSION ("7.0NG.727(Build 181018)")
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.727(Build 181016))"
VALUE "ProductVersion", "(7.0NG.727(Build 181018))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.727-181016
Version: 7.0NG.727-181018
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.727-181016"
pandora_version="7.0NG.727-181018"
package_pear=0
package_pandora=1

View File

@ -385,6 +385,9 @@ echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
ui_require_jquery_file ('form');
//Hack to translate text "none" in PHP to javascript
echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>';
echo '<span id ="select_agent_first_text" style="display: none;">' . __('Please, select an agent first') . '</span>';
ui_require_jquery_file ('pandora.controls');
if ($selection_mode == 'modules') {

View File

@ -709,6 +709,7 @@ echo '</form>';
echo '<h3 class="error invisible" id="message"> </h3>';
//Hack to translate text "none" in PHP to javascript
echo '<span id ="none_text" style="display: none;">' . __('None') . '</span>';
echo '<span id ="select_agent_first_text" style="display: none;">' . __('Please, select an agent first') . '</span>';
ui_require_jquery_file ('pandora.controls');
if ($selection_mode == 'modules') {

View File

@ -1087,6 +1087,34 @@ You can of course remove the warnings, that's why we include the source and do n
$agents2[$value['id_agente']] = $value['alias'];
}
if ((empty($agents2)) || $agents2 == -1) $agents = array();
$agents_select = array();
if (is_array($id_agents) || is_object($id_agents)){
foreach ($id_agents as $id) {
foreach ($agents2 as $key => $a) {
if ($key == (int)$id) {
$agents_select[$key] = $key;
}
}
}
}
html_print_select($agents2, 'id_agents3[]', $agents_select, $script = '', "", 0, false, true, true, '', false, "min-width: 180px");
echo "<span id='spinner_hack' style='display:none;'>" . html_print_image('images/spinner.gif', true) . "</span>";
?>
</td>
</tr>
<tr id="agents_modules_row" style="" class="datos">
<td style="font-weight:bold;"><?php echo __('Agents'); ?></td>
<td>
<?php
$all_agent_log = agents_get_agents(false,array('id_agente','alias'));
foreach ($all_agent_log as $key => $value) {
$agents2[$value['id_agente']] = $value['alias'];
}
// $agents = agents_get_group_agents($group);
if ((empty($agents2)) || $agents2 == -1) $agents = array();
@ -1101,7 +1129,6 @@ You can of course remove the warnings, that's why we include the source and do n
}
}
html_print_select($agents2, 'id_agents2[]', $agents_select, $script = '', "", 0, false, true, true, '', false, "min-width: 180px");
echo "<span id='spinner_hack' style='display:none;'>" . html_print_image('images/spinner.gif', true) . "</span>";
?>
</td>
</tr>
@ -2862,6 +2889,7 @@ function chooseType() {
$("#row_percentil").hide();
$("#log_help_tip").css("visibility", "hidden");
$("#agents_row").hide();
$("#agents_modules_row").hide();
$("#select_agent_modules").hide();
$("#modules_row").hide();
$("#row_show_summary_group").hide();
@ -3328,7 +3356,7 @@ function chooseType() {
$("#row_group").show();
$("#row_module_group").show();
$("#select_agent_modules").show();
$("#agents_row").show();
$("#agents_modules_row").show();
$("#modules_row").show();
$("#row_historical_db_check").hide();
break;
@ -3499,7 +3527,7 @@ function set_last_value_period() {
}
function source_change_agents() {
$("#id_agents2").empty();
$("#id_agents3").empty();
$("#spinner_hack").show();
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
@ -3508,7 +3536,7 @@ function source_change_agents() {
},
function (data, status) {
for (var clave in data) {
$("#id_agents2").append('<option value="'+clave+'">'+data[clave]+'</option>');
$("#id_agents3").append('<option value="'+clave+'">'+data[clave]+'</option>');
}
$("#spinner_hack").hide();
},

View File

@ -41,6 +41,8 @@ class Tree {
protected $L2conditionInside = '';
protected $L2inner = '';
protected $L3forceTagCondition = false;
const TV_DEFAULT_AGENT_STATUS = -1;
public function __construct($type, $rootType = '', $id = -1, $rootID = -1, $serverID = false, $childrenMethod = "on_demand", $access = 'AR') {
@ -891,7 +893,9 @@ class Tree {
$module_status_filter = $this->getModuleStatusFilterFromTestado();
$agent_filter = "AND ta.id_agente = " . $this->id;
$tag_condition = $this->getTagCondition();
$tag_join = empty($tag_condition) ? '' : $this->getTagJoin();
$tag_join = empty($tag_condition) && (!$this->L3forceTagCondition)
? ''
: $this->getTagJoin();
$condition = $this->L2condition;
$inner = $this->L2inner;

View File

@ -37,6 +37,8 @@ class TreeTag extends Tree {
$this->L2condition = "AND ttm.id_tag = " . $this->rootID;
$this->L2inner = $this->L1innerInside;
$this->L3forceTagCondition = true;
}
protected function getData() {
@ -52,10 +54,6 @@ class TreeTag extends Tree {
protected function getTagJoin () {
return '';
}
protected function getTagCondition () {
return '';
}
}
?>

View File

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

View File

@ -1069,7 +1069,7 @@ function agents_get_group_agents (
*/
function agents_get_modules ($id_agent = null, $details = false,
$filter = false, $indexed = true, $get_not_init_modules = true,
$noACLs = false) {
$force_tags = false) {
global $config;
@ -1205,7 +1205,7 @@ function agents_get_modules ($id_agent = null, $details = false,
}
$sql_tags_join = "";
if (tags_has_user_acl_tags($config['id_user'])){
if (tags_has_user_acl_tags($config['id_user']) || $force_tags){
$where_tags = tags_get_acl_tags($config['id_user'], $id_groups, 'AR',
'module_condition', 'AND', 'tagente_modulo', false, array(),
true);

View File

@ -189,8 +189,10 @@ function agent_changed_by_multiple_agents (event, id_agent, selected) {
$('#module').empty ();
if (isEmptyObject(data)) {
var noneText = $("#none_text").html(); //Trick for catch the translate text.
//Trick for catch the translate text.
var noneText = $("#id_agents").val() === null
? $("#select_agent_first_text").html()
: $("#none_text").html();
if (noneText == null) {
noneText = 'None';
}

View File

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

View File

@ -340,6 +340,11 @@ if (is_ajax ()) {
'tmetaconsole_setup', 'id', $id_server);
}
if (empty($idAgents[0])) {
echo json_encode(array());
return;
}
$filter = '1 = 1';
$all = (string)get_parameter('all', 'all');
@ -674,24 +679,25 @@ if (is_ajax ()) {
}
else
$search = false;
$force_tags = !empty($tags);
if ($force_tags) {
$filter['ttag_module.id_tag IN '] = "(" . implode(",", $tags) . ")";
}
if (is_metaconsole() && !$force_local_modules) {
if (enterprise_include_once ('include/functions_metaconsole.php') !== ENTERPRISE_NOT_HOOK) {
$connection = metaconsole_get_connection($server_name);
if ($server_id > 0) {
$connection = metaconsole_get_connection_by_id($server_id);
}
if (metaconsole_load_external_db($connection) == NOERR) {
/* Get all agents if no agent was given */
if ($id_agent == 0)
$id_agent = array_keys(
agents_get_group_agents(
array_keys (users_get_groups ()), $search, "none"));
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed, true, false, $tags);
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed, true, $force_tags);
}
// Restore db connection
metaconsole_restore_db();
@ -703,35 +709,12 @@ if (is_ajax ()) {
$id_agent = array_keys(
agents_get_group_agents(
array_keys(users_get_groups ()), $search, "none"));
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed, true, false, $tags);
$agent_modules = agents_get_modules ($id_agent, $fields, $filter, $indexed, true, $force_tags);
}
if (empty($agent_modules))
$agent_modules = array();
if (!empty($tags)) {
$implode_tags = implode(",", $tags);
$tag_modules = db_get_all_rows_sql("SELECT DISTINCT id_agente_modulo FROM ttag_module WHERE id_tag IN (" . $implode_tags . ")");
if ($tag_modules) {
$final_modules = array();
foreach ($agent_modules as $key => $module) {
$in_array = false;
foreach ($tag_modules as $t_module) {
if ($module['id_agente_modulo'] == $t_module['id_agente_modulo']) {
$in_array = true;
}
}
if ($in_array) {
$final_modules[] = $module;
}
}
$agent_modules = $final_modules;
}
else {
$agent_modules = array();
}
}
foreach ($agent_modules as $key => $module) {
$agent_modules[$key]['nombre'] = io_safe_output($module['nombre']);
}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.727
%define release 181016
%define release 181018
# 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.727
%define release 181016
%define release 181018
%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.727-181016
Version: 7.0NG.727-181018
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.727-181016"
pandora_version="7.0NG.727-181018"
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.727";
my $pandora_build = "181016";
my $pandora_build = "181018";
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.727";
my $pandora_build = "181016";
my $pandora_build = "181018";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

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

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.727"
PI_BUILD="181016"
PI_BUILD="181018"
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.727 PS181016";
my $version = "7.0NG.727 PS181018";
# 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.727 PS181016";
my $version = "7.0NG.727 PS181018";
# save program name for logging
my $progname = basename($0);