Merge remote-tracking branch 'origin/develop' into ent-12317-mejora-del-discovery-host-scan-y-el-wizard-de-discovery-de-bienvenida

Conflicts:
	pandora_console/extras/mr/68.sql
This commit is contained in:
Enrique Martin 2024-02-12 09:29:28 +01:00
commit d382ca4066
100 changed files with 1082 additions and 199 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.775-240205
Version: 7.0NG.775-240212
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.775-240205"
pandora_version="7.0NG.775-240212"
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

@ -1039,7 +1039,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.775';
use constant AGENT_BUILD => '240126';
use constant AGENT_BUILD => '240212';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -3678,9 +3678,21 @@ sub write_module_xml ($@) {
return;
}
if ($module->{'func'} == \&module_logger) {
$Xml .= $data[0];
return
# Is it an extraction log module?
if($module->{'type'} eq "log"){
my $output = join('', @data);
if ($output eq "") {
return;
}
$Xml .="<log_module>\n";
$Xml .= " <source><![CDATA[" . $module->{'name'} . "]]></source>\n";
$Xml .= " <type><![CDATA[" . $module->{'type'} . "]]></type>\n";
$Xml .= " <encoding>base64</encoding>\n";
$Xml .= " <data><![CDATA[" . $output . "]]></data>\n";
$Xml .= "</log_module>\n";
return;
}
# Critical section
@ -3690,7 +3702,7 @@ sub write_module_xml ($@) {
" <name><![CDATA[" . $module->{'name'} . "]]></name>\n" .
" <description><![CDATA[" . $module->{'description'} . "]]></description>\n" .
" <type>" . $module->{'type'} . "</type>\n";
# Interval
$Xml .= " <module_interval>" . $module->{'interval'} . "</module_interval>\n";
@ -3889,7 +3901,8 @@ sub module_logger ($) {
my $status = grep_logs(
$module->{'name'},
$module->{'params'},
$module->{'filter'}
$module->{'filter'},
$module->{'type'}
);
return $status;
@ -3926,20 +3939,25 @@ my $encode_sub = defined(&MIME::Base64::encode_base64) ? \&MIME::Base64::encode_
};
sub grep_logs {
my ($str_name, $str_file, $str_regex) = @_;
my ($module_name, $log_file, $reg_exp, $module_type) = @_;
if(!$str_name){
if(!$module_name){
log_message("module_logger", "Missing module name");
return;
}
if(!$str_file){
if(!$log_file){
log_message("module_logger", "Missing file name");
return;
}
if(!$str_regex){
$str_regex = '.*';
if(!$module_type){
log_message("module_logger", "Missing module type");
return;
}
if(!$reg_exp){
$reg_exp = '.*';
}
my $idx_dir = '/tmp/';
@ -3947,9 +3965,6 @@ sub grep_logs {
my $idx_pos = 0;
my $idx_size = 0;
my $idx_ino = '';
my $module_name = $str_name;
my $log_file = $str_file;
my $reg_exp = $str_regex;
# Check that log file exists
if (! -e $log_file) {
@ -3975,7 +3990,7 @@ sub grep_logs {
return if load_idx(\$idx_pos, \$idx_ino, \$idx_file, \$idx_size) == 1;
my @data = parse_log(\$idx_pos, \$idx_ino, \$idx_file, \$log_file, \$module_name, \$reg_exp, \$idx_size);
my $output = create_log($module_name, @data);
my $output = create_log($module_name, $module_type, @data);
return $output;
}
@ -4090,27 +4105,32 @@ sub grep_logs {
}
sub create_log {
my ($module_name, @data) = @_;
my ($module_name, $module_type, @data) = @_;
# No data
if ($#data < 0) {
return;
}
# Log module
my $output = "<log_module>\n";
$output .= "<source><![CDATA[" . $module_name . "]]></source>\n";
$output .= "<encoding>base64</encoding>\n";
$output .= "<data><![CDATA[";
$output .= &$encode_sub(join('', @data), '');
$output .= "]]></data>\n";
$output .= "</log_module>\n";
my $data_content = process_log_monitoring($module_type, @data);
return $output;
return $data_content;
}
}
sub process_log_monitoring {
my ($module_type, @data) = @_;
my $output = "";
if ($module_type eq "log"){
$output = &$encode_sub(join('', @data), '');
} elsif ($module_type eq "generic_data") {
$output = scalar @data;
} elsif ($module_type eq "generic_proc"){
$output = scalar @data > 0 ? 1 : 0;
} elsif ($module_type eq "generic_data_string" || $module_type eq "async_string"){
$output = join('', @data);
}
return $output;
}
################################################################################
# TERM Handler
################################################################################

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.775
%define release 240205
%define release 240212
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.775
%define release 240205
%define release 240212
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.775
%define release 240205
%define release 240212
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.775
%define release 240205
%define release 240212
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.775
%define release 240205
%define release 240212
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.775"
PI_BUILD="240205"
PI_BUILD="240212"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{240205}
{240212}
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.775 Build 240205")
#define PANDORA_VERSION ("7.0NG.775 Build 240212")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.775(Build 240205))"
VALUE "ProductVersion", "(7.0NG.775(Build 240212))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

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

View File

@ -128,6 +128,6 @@ if (empty($data)) {
}
echo '{
"label": "'.htmlspecialchars($graph_title, ENT_QUOTES).'",
"data": [["'.time().'", '.htmlspecialchars($data, ENT_QUOTES).']]
"label": "'.htmlspecialchars(($graph_title ?? ''), ENT_QUOTES).'",
"data": [["'.time().'", '.htmlspecialchars(($data ?? ''), ENT_QUOTES).']]
}';

View File

@ -40,9 +40,6 @@ CREATE TABLE IF NOT EXISTS `tmerge_queries` (
ALTER TABLE `tmerge_queries` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
-- Update version for plugin oracle
UPDATE `tdiscovery_apps` SET `version` = '1.2' WHERE `short_name` = 'pandorafms.oracle';
ALTER TABLE `tevent_sound` MODIFY COLUMN `name` text NULL;
ALTER TABLE `tevent_sound` MODIFY COLUMN `sound` text NULL;
ALTER TABLE `treport_content` MODIFY COLUMN `use_prefix_notation` tinyint unsigned NOT NULL DEFAULT 1;
@ -59,6 +56,13 @@ ALTER TABLE `tmensajes` ADD COLUMN `icon_notification` VARCHAR(250) NULL DEFAULT
UPDATE `tncm_template` SET `vendors` = CONCAT('["', TRIM(BOTH '"' FROM TRIM(BOTH ']' FROM TRIM(BOTH '[' FROM vendors))), '"]'), `models` = CONCAT('["', TRIM(BOTH '"' FROM TRIM(BOTH ']' FROM TRIM(BOTH '[' FROM models))), '"]');
UPDATE `tncm_agent_data_template` SET `vendors` = CONCAT('["', TRIM(BOTH '"' FROM TRIM(BOTH ']' FROM TRIM(BOTH '[' FROM vendors))), '"]'), `models` = CONCAT('["', TRIM(BOTH '"' FROM TRIM(BOTH ']' FROM TRIM(BOTH '[' FROM models))), '"]');
-- Update version for plugin oracle
UPDATE `tdiscovery_apps` SET `version` = '1.2' WHERE `short_name` = 'pandorafms.oracle';
SET @widget_id = NULL;
SELECT @widget_id := `id` FROM `twidget` WHERE `unique_name` = 'GisMap';
INSERT IGNORE INTO `twidget` (`id`,`class_name`,`unique_name`,`description`,`options`,`page`) VALUES (@widget_id,'GisMap','GisMap','Gis map','','GisMap.php');
-- Create SNMPv3 credentials for recon tasks and update them
SET @creds_name = 'Recon-SNMP-creds-';
INSERT IGNORE INTO `tcredential_store` (`identifier`, `id_group`, `product`, `extra_1`)

View File

@ -150,7 +150,7 @@ if (is_ajax()) {
$component = db_get_row('tlocal_component', 'id', $id_component);
foreach ($component as $index => $element) {
$component[$index] = html_entity_decode(
$element,
(isset($element) === true) ? $element : '',
ENT_QUOTES,
'UTF-8'
);

View File

@ -505,7 +505,7 @@ $tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_p
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'str_warning',
str_replace('"', '', $str_warning),
str_replace('"', '', (isset($str_warning) === true) ? $str_warning : ''),
'',
10,
1024,
@ -602,7 +602,7 @@ $tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'str_critical',
str_replace('"', '', $str_critical),
str_replace('"', '', (isset($str_critical) === true) ? $str_critical : ''),
'',
10,
1024,

View File

@ -60,7 +60,12 @@ $data[1] = html_print_select_from_sql(
$disabledBecauseInPolicy
);
// Store the macros in base64 into a hidden control to move between pages
$data[1] .= html_print_input_hidden('macros', base64_encode($macros), true);
$data[1] .= html_print_input_hidden(
'macros',
(isset($macros) === true) ? base64_encode($macros) : '',
true
);
$table_simple->colspan['plugin_1'][2] = 2;
if (!empty($id_plugin)) {

View File

@ -319,9 +319,8 @@ if ($update_agents) {
$secondary_groups_removed
);
$agents_values = agents_get_agent((int) $array_id[1]);
$agents_values = db_get_row_filter('tagente', ['id_agente' => (int) $array_id[1]]);
$node->disconnect();
if (empty($values) === false) {
update_agents_in_metaconsole(
(int) $array_id[1],

View File

@ -768,7 +768,7 @@ $table_critical->tdid[0][0] = 'edit1-3-min';
$table_critical->data[0][0] = html_print_label_input_block(
__('Min.'),
html_print_input_text(
'min_warning',
'min_critical',
'',
'',
false,
@ -781,7 +781,7 @@ $table_critical->tdid[0][1] = 'edit1-3-max';
$table_critical->data[0][1] = html_print_label_input_block(
__('Max.'),
html_print_input_text(
'max_warning',
'max_critical',
'',
'',
false,
@ -1500,7 +1500,7 @@ $table->data[39][0] = html_print_label_input_block(
'',
'',
true
).html_print_input_hidden('macros', base64_encode($macros), true)
).html_print_input_hidden('macros', base64_encode(($macros ?? '')), true)
);
require_once $config['homedir'].'/include/class/CredentialStore.class.php';

View File

@ -247,7 +247,7 @@ if ($favorite_array == false) {
$url = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$favourite_v['id'];
}
echo "<a href='".$url."' title='Visual console".$favourite_v['name']."' alt='".$favourite_v['name']."'><li>";
echo "<a href='".$url."' title='".io_safe_output($favourite_v['name'])."' alt='".io_safe_output($favourite_v['name'])."'><li>";
echo "<div class='icon_img'>";
echo html_print_image(
'images/'.groups_get_icon($favourite_v['id_group']),
@ -256,7 +256,7 @@ if ($favorite_array == false) {
);
echo '</div>';
echo "<div class='text'>";
echo $favourite_v['name'];
echo io_safe_output($favourite_v['name']);
echo '</div>';
echo '</li></a>';
}

View File

@ -215,7 +215,7 @@ if ($create != '') {
// =====================================================================
if ($filemanager) {
if ($edit_file) {
$location_file = get_parameter('location_file', '');
$location_file = io_safe_output(get_parameter('location_file', ''));
$filename = array_pop(explode('/', $location_file));
$file = file_get_contents($location_file);
echo '<h4>'.__('Edit file').' '.$filename.'</h4>';
@ -250,7 +250,7 @@ if ($filemanager) {
echo '</form>';
} else {
if ($update_file) {
$location_file = get_parameter('location_file', '');
$location_file = io_safe_output(get_parameter('location_file', ''));
$contentFile = io_safe_output(get_parameter('content_file', ''));
$compatibility = get_parameter('compatibility', 'unix');
$is_win_compatible = strpos($contentFile, "\r\n");
@ -262,7 +262,12 @@ if ($filemanager) {
$contentFile = str_replace("\n", "\r\n", $contentFile);
}
$result = file_put_contents($location_file, $contentFile);
if (empty($location_file) === false
&& strpos($location_file, realpath('attachment/plugin')) !== false
&& file_exists($location_file) === true
) {
$result = file_put_contents($location_file, $contentFile);
}
}
$id_plugin = (int) get_parameter('id_plugin', 0);

View File

@ -115,7 +115,7 @@ foreach ($servers as $server) {
$table->cellclass[] = [
3 => 'progress_bar',
8 => 'table_action_buttons',
9 => 'table_action_buttons',
];
$data[0] = '<span title="'.$server['version'].'">'.strip_tags($server['name']).'</span>';

View File

@ -48,7 +48,7 @@ if ($idOS > 0) {
} else {
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$icon = get_parameter('icon', 0);
$icon = get_parameter('icon', 'os@svg.svg');
}
$icon_upload = get_parameter('icon_upload', null);
@ -246,7 +246,7 @@ $iconData[] = html_print_select(
'icon',
$icon,
'show_icon_OS();',
__('None'),
'',
0,
true
);
@ -356,6 +356,8 @@ function get_list_os_icons_dir()
}
}
$return['os@svg.svg'] = __('None');
return $return;
}

View File

@ -88,6 +88,14 @@ switch ($tab) {
break;
case 'manage_os':
$id_os = get_parameter('id_os', '');
if ($id_os !== '') {
$headerTitle = __('Edit OS');
} else {
$headerTitle = __('Create OS');
}
break;
case 'list':
if ($action === 'edit') {
$headerTitle = __('Edit OS');

View File

@ -386,7 +386,7 @@ if (empty($result) === false) {
$data[4] = $output;
$phone_large = io_safe_output($tag['phone']);
$phone_small = substr($phone_large, 0, 24);
$phone_small = substr(($phone_large ?? ''), 0, 24);
if ($phone_large == $phone_small) {
$output = $phone_large;
} else {

View File

@ -1581,7 +1581,7 @@ $autorefresh_list_out['operation/events/events'] = 'Events';
if (isset($autorefresh_list) === false || empty($autorefresh_list) === true || empty($autorefresh_list[0]) === true) {
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '".$id."'");
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
$autorefresh_list = json_decode(($select[0]['autorefresh_white_list'] ?? ''));
if ($autorefresh_list === null || $autorefresh_list === 0) {
$autorefresh_list = [];
$autorefresh_list[0] = __('None');

View File

@ -37,6 +37,20 @@ class Applications extends Wizard
*/
public $mode;
/**
* Task properties.
*
* @var array
*/
public $task;
/**
* Class of styles.
*
* @var string
*/
public $class;
/**
* Constructor.

View File

@ -37,6 +37,20 @@ class Custom extends Wizard
*/
public $mode;
/**
* Task properties.
*
* @var array
*/
public $task;
/**
* Class of styles.
*
* @var string
*/
public $class;
/**
* Constructor.

View File

@ -47,6 +47,13 @@ ui_require_javascript_file('simTree');
class DiscoveryTaskList extends HTML
{
/**
* Task properties.
*
* @var array
*/
public $task;
/**
* Constructor.

View File

@ -1126,7 +1126,7 @@ class HostDevices extends Wizard
'return' => true,
'selected' => explode(
',',
$this->task['id_network_profile']
(isset($this->task['id_network_profile']) === true) ? $this->task['id_network_profile'] : ''
),
'nothing_value' => 0,
'nothing' => __('None'),

View File

@ -97,6 +97,13 @@ class Wizard
*/
public $access = 'AR';
/**
* Root url.
*
* @var string
*/
public $rootUrl;
/**
* Setter for breadcrum
@ -550,7 +557,7 @@ class Wizard
}
echo '<ul class="bigbuttonlist">';
array_map('self::printBigButtonElement', $list_data);
array_map(['Wizard', 'printBigButtonElement'], $list_data);
echo '</ul>';
if ($return === true) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -2542,15 +2542,12 @@ if ($drawConsoleSound === true) {
$output .= '<div id="progressbar_time"></div>';
$output .= '<div class="buttons-sound-modal">';
$output .= '<div class="container-button-play">';
$output .= html_print_input(
[
'label' => __('Start'),
'type' => 'button',
'name' => 'start-search',
'attributes' => [ 'class' => 'play secondary' ],
'return' => true,
],
'div',
$output .= html_print_button(
__('Start'),
'start-search',
false,
'',
['icon' => 'play'],
true
);
$output .= '</div>';

View File

@ -250,6 +250,7 @@ if (is_ajax() === true) {
if ($getInfo === true) {
enterprise_include_once('include/functions_agents.php');
include_once $config['homedir'].'/include/functions_graph.php';
$id = get_parameter('id', 0);
$id_server = get_parameter('id_server', 0);
if (empty($id_server) === false) {

View File

@ -380,5 +380,7 @@ if (session_status() !== PHP_SESSION_DISABLED) {
// Could give a warning if no session file is created. Ignore.
@session_destroy();
header_remove('Set-Cookie');
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
if (isset($_COOKIE[session_name()]) === true) {
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
}
}

View File

@ -572,10 +572,10 @@ function get_user_info($user)
*
* @return array An array of user information
*/
function get_users($order='fullname', $filter=false, $fields=false)
function get_users($order='fullname', $filter=[], $fields=false)
{
if (is_array($order) === true) {
$filter['order'] = $order['field'].' '.$order['order'];
$filter['order'] = (string) $order['field'].' '.(string) $order['order'];
} else {
if ($order !== 'registered' || $order !== 'last_connect' || $order !== 'fullname') {
$order = 'fullname';

View File

@ -53,6 +53,48 @@ class AuditLog extends HTML
*/
private $ajaxController;
/**
* TableId
*
* @var integer
*/
public $tableId;
/**
* FilterIp
*
* @var array
*/
public $filterIp;
/**
* FilterPeriod
*
* @var integer
*/
public $filterPeriod;
/**
* FilterText
*
* @var string
*/
public $filterText;
/**
* FilterType
*
* @var string
*/
public $filterType;
/**
* FilterUser
*
* @var string
*/
public $filterUser;
/**
* Class constructor

View File

@ -66,6 +66,13 @@ class CalendarManager
*/
private $message;
/**
* Access
*
* @var string
*/
public $access;
/**
* Allowed methods to be called using AJAX request.
*

View File

@ -27,6 +27,7 @@
*/
use PandoraFMS\Tools\Files;
use PandoraFMS\Agent;
global $config;
@ -1214,6 +1215,7 @@ class ConsoleSupervisor
'',
$config['num_files_attachment']
);
if ($filecount > $config['num_files_attachment']) {
$this->notify(
[
@ -1331,17 +1333,28 @@ class ConsoleSupervisor
$MAX_FILES_DATA_IN = 1000;
$MAX_BADXML_FILES_DATA_IN = 150;
$filecount = $this->countFiles(
$remote_config_dir,
'',
$MAX_FILES_DATA_IN
);
$filecount = 0;
$agentId = db_get_value('id_agente', 'tagente', 'nombre', 'pandora.internals');
if ($agentId !== false) {
$agent = new Agent($agentId);
$moduleId = $agent->searchModules(
['nombre' => 'Data_in_files'],
1
)->toArray()['id_agente_modulo'];
if ($moduleId > 0) {
$filecount = (int) modules_get_last_value($moduleId);
}
}
// If cannot open directory, count is '-1', skip.
if ($filecount > $MAX_FILES_DATA_IN) {
$this->notify(
[
'type' => 'NOTIF.FILES.DATAIN',
'title' => __('There are too much files in spool').'.',
'title' => __('There are too many files in spool').'.',
'message' => __(
'There are more than %d files in %s. Consider checking DataServer performance',
$MAX_FILES_DATA_IN,

View File

@ -850,7 +850,7 @@ class CredentialStore extends Wizard
'privilege' => 'AR',
'type' => 'select_groups',
'nothing' => false,
'selected' => (defined($id_group_filter) ? $id_group_filter : 0),
'selected' => ((isset($id_group_filter) === true) ? $id_group_filter : 0),
'return' => true,
'size' => '80%',
],
@ -1637,7 +1637,7 @@ class CredentialStore extends Wizard
$(".ui-dialog-content").dialog("close");
$('.info').hide();
cleanupDOM();
dt_keystore.draw(false);
window.location.reload();
} else {
$(this).dialog('close');
}

View File

@ -54,6 +54,13 @@ class Diagnostics extends Wizard
*/
public $pdf;
/**
* Product name.
*
* @var string
*/
public $product_name;
/**
* Constructor.

View File

@ -38,6 +38,62 @@ require_once $config['homedir'].'/include/class/HTML.class.php';
class ExternalTools extends HTML
{
/**
* Origin
*
* @var string
*/
public $origin;
/**
* PathCustomComm
*
* @var string
*/
public $pathCustomComm;
/**
* PathDig
*
* @var string
*/
public $pathDig;
/**
* PathNmap
*
* @var string
*/
public $pathNmap;
/**
* PathPing
*
* @var string
*/
public $pathPing;
/**
* PathSnmpget
*
* @var string
*/
public $pathSnmpget;
/**
* PathTraceroute
*
* @var string
*/
public $pathTraceroute;
/**
* UpdatePaths
*
* @var string
*/
public $updatePaths;
/**
* Constructor.

View File

@ -706,7 +706,7 @@ class NetworkMap
*/
public function setNodes($nodes)
{
$this->nodes = $nodes;
$this->nodes = (array) $nodes;
}

View File

@ -52,6 +52,13 @@ class OrderInterpreter extends Wizard
*/
public $ajaxController;
/**
* Pages menu
*
* @var array
*/
public $pages_menu;
/**
* Generates a JSON error.

View File

@ -67,6 +67,34 @@ class SatelliteAgent extends HTML
*/
private $ajaxController;
/**
* Satellite_name
*
* @var string
*/
public $satellite_name;
/**
* Satellite_server
*
* @var string
*/
public $satellite_server;
/**
* TableId
*
* @var integer
*/
public $tableId;
/**
* Satellite_config
*
* @var string
*/
public $satellite_config;
/**
* Class constructor

View File

@ -1565,8 +1565,8 @@ class WelcomeWindow extends Wizard
draggable: true,
modal: true,
close: false,
height: 375,
width: 480,
height: 400,
width: 500,
overlay: {
opacity: 0.5,
background: "black"
@ -1582,7 +1582,7 @@ class WelcomeWindow extends Wizard
draggable: true,
modal: true,
close: false,
height: 265,
height: 300,
width: 480,
overlay: {
opacity: 0.5,

View File

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

View File

@ -2917,6 +2917,10 @@ function delete_dir($dir)
*/
function is_image_data($data)
{
if (isset($data) === false) {
return false;
}
return (substr($data, 0, 10) == 'data:image');
}
@ -2939,7 +2943,7 @@ function is_snapshot_data($data)
*/
function is_text_to_black_string($data)
{
if (is_image_data($data)) {
if (isset($data) === false || is_image_data($data)) {
return false;
}

View File

@ -541,7 +541,7 @@ function api_get_groups($thrash1, $thrash2, $other, $returnType, $user_in_db)
}
function api_get_agent_module_name_last_value($agentName, $moduleName, $other=';', $returnType)
function api_get_agent_module_name_last_value($agentName, $moduleName, $other=';', $returnType='string')
{
$idAgent = agents_get_agent_id($agentName);
@ -558,7 +558,7 @@ function api_get_agent_module_name_last_value($agentName, $moduleName, $other=';
}
function api_get_agent_module_name_last_value_alias($alias, $moduleName, $other=';', $returnType)
function api_get_agent_module_name_last_value_alias($alias, $moduleName, $other=';', $returnType='string')
{
$sql = sprintf(
'SELECT tagente_modulo.id_agente_modulo FROM tagente_modulo
@ -573,7 +573,7 @@ function api_get_agent_module_name_last_value_alias($alias, $moduleName, $other=
}
function api_get_module_last_value($idAgentModule, $trash1, $other=';', $returnType)
function api_get_module_last_value($idAgentModule, $trash1, $other=';', $returnType='string')
{
global $config;
if (defined('METACONSOLE')) {

View File

@ -440,7 +440,7 @@ function extensions_add_operation_menu_option($name, $fatherId=null, $icon=null,
$option_menu['acl'] = $acl;
$extension = &$config['extensions'][$extension_file];
$option_menu['sec2'] = $extension['dir'].'/'.mb_substr($extension_file, 0, -4);
$option_menu['sec2'] = $extension['dir'].'/'.mb_substr(($extension_file ?? ''), 0, -4);
$option_menu['fatherId'] = $fatherId;
$option_menu['subfatherId'] = $subfatherId;
$option_menu['icon'] = $icon;

View File

@ -100,7 +100,7 @@ function forecast_projection_graph(
$data[0] = '';
$data[1] = $cont;
$data[2] = date($config['date_format'], $row[0]);
$data[2] = date($config['date_format'], (int) $row[0]);
$data[3] = $row[0];
$data[4] = $row[1];
$data[5] = ($row[0] * $row[1]);

View File

@ -82,11 +82,11 @@ function io_safe_input($value)
return $value;
}
if (! mb_check_encoding($value, 'UTF-8')) {
if (isset($value) === true && !mb_check_encoding($value, 'UTF-8')) {
$value = utf8_encode($value);
}
$valueHtmlEncode = htmlentities($value, ENT_QUOTES, 'UTF-8', true);
$valueHtmlEncode = htmlentities(($value ?? ''), ENT_QUOTES, 'UTF-8', true);
// Replace the character '\' for the equivalent html entitie
$valueHtmlEncode = str_replace('\\', '&#92;', $valueHtmlEncode);
@ -561,10 +561,8 @@ function io_output_password($password, $wrappedBy='')
]
);
$output = ($plaintext === ENTERPRISE_NOT_HOOK) ? $password : $plaintext;
// If password already decrypt return same password.
$output = (empty($plaintext) === true) ? $password : $plaintext;
$output = (empty($plaintext) === true || $plaintext === ENTERPRISE_NOT_HOOK) ? $password : $plaintext;
return sprintf(
'%s%s%s',

View File

@ -819,7 +819,7 @@ function notifications_print_global_source_configuration($source)
$html_checkboxes = '';
$blacklist = json_decode($source['subtype_blacklist'], 1);
$blacklist = json_decode(($source['subtype_blacklist'] ?? ''), 1);
if (json_last_error() !== JSON_ERROR_NONE) {
$blacklist = [];
}

View File

@ -243,6 +243,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
$profile = json_decode($profile);
}
$result = [];
$result[] = [
'id_grupo' => $profile->group,
'id_perfil' => $profile->profile,

View File

@ -1039,7 +1039,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
echo "
<script>
function sendHash(url) {
window.open(url+'&loginhash=auto&loginhash_data=".$hashdata.'&loginhash_user='.str_rot13($user)."', '_blank');
window.open(url+'&loginhash=auto&loginhash_data=".$hashdata.'&loginhash_user='.str_rot13(($user ?? ''))."', '_blank');
}

View File

@ -148,7 +148,7 @@ function ui_print_truncate_text(
$text_html_decoded = io_safe_output($text);
$text_has_entities = $text != $text_html_decoded;
if (mb_strlen($text_html_decoded, 'UTF-8') > ($numChars)) {
if (isset($text_html_decoded) === true && mb_strlen($text_html_decoded, 'UTF-8') > ($numChars)) {
// '/2' because [...] is in the middle of the word.
$half_length = intval(($numChars - 3) / 2);
@ -969,15 +969,27 @@ function ui_print_os_icon(
$options['title'] = $os_name;
}
$output = html_print_image(
'images/'.$subfolder.'/'.$icon,
true,
$options,
false,
$relative,
$no_in_meta,
true
);
if ($icon === '.png') {
$output = html_print_image(
'images/os@svg.svg',
true,
$options,
false,
$relative,
$no_in_meta,
true
);
} else {
$output = html_print_image(
'images/'.$subfolder.'/'.$icon,
true,
$options,
false,
$relative,
$no_in_meta,
true
);
}
}
} else {
// $output = "<img src='images/os_icons/" . $icon . "' alt='" . $os_name . "' title='" . $os_name . "'>";

View File

@ -301,6 +301,13 @@ function gd_progress_bubble($width, $height, $progress, $title, $font, $out_of_l
function ImageRectangleWithRoundedCorners(&$im, $x1, $y1, $x2, $y2, $radius, $color)
{
$x1 = (int) $x1;
$y1 = (int) $y1;
$x2 = (int) $x2;
$y2 = (int) $y2;
$radius = (int) $radius;
$color = (int) $color;
// Draw rectangle without corners
imagefilledrectangle($im, ($x1 + $radius), $y1, ($x2 - $radius), $y2, $color);
imagefilledrectangle($im, $x1, ($y1 + $radius), $x2, ($y2 - $radius), $color);

View File

@ -1261,6 +1261,10 @@ function action_events_sound(mode, settings) {
$("#button-start-search")
.removeClass("play")
.addClass("stop");
$("#button-start-search")
.find("div")
.removeClass("play")
.addClass("stop");
// Change value button.
$("#button-start-search").val(settings.stop);
$("#button-start-search > span").text(settings.stop);
@ -1277,6 +1281,10 @@ function action_events_sound(mode, settings) {
$("#button-start-search")
.removeClass("stop")
.addClass("play");
$("#button-start-search")
.find("div")
.removeClass("stop")
.addClass("play");
// Change value button.
$("#button-start-search").val(settings.start);
$("#button-start-search > span").text(settings.start);
@ -1601,9 +1609,7 @@ $(document).ajaxSend(function(event, jqXHR, ajaxOptions) {
// Add the minimize icon to the minimize button
$("<span>", {
class: "ui-button-icon ui-icon",
style:
"background-color: rgb(51, 51, 51); -webkit-mask: url('images/arrow-down-white.png') no-repeat / contain !important;"
class: "ui-button-icon ui-icon"
}).appendTo(minimizeButton);
$("<span>", {
@ -1617,23 +1623,9 @@ $(document).ajaxSend(function(event, jqXHR, ajaxOptions) {
class:
"ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-disengage disengage-buttom-image",
type: "button",
title: "Disengage",
style: "float: right; position:relative;"
title: "Disengage"
}).insertBefore(minimizeButton);
// Add the disengage icon to the disengage button
$("<span>", {
class: "ui-button-icon ui-icon",
style:
"background-color: rgb(51, 51, 51); -webkit-mask: url('images/dashboard.menu.png') no-repeat center / contain !important;"
}).appendTo(disengageButton);
$("<span>", {
class: "ui-button-icon-space"
})
.html(" ")
.appendTo(disengageButton);
minimizeButton.click(function(e) {
if ($("#minimize_arrow_event_sound").hasClass("arrow_menu_up")) {
$("#minimize_arrow_event_sound").removeClass("arrow_menu_up");

View File

@ -82,6 +82,7 @@ function removeInputImage(e) {
}
}
function render({ title, text, url, files, method }) {
var positionButtonsBefore = $(".ui-dialog-buttonset").offset().top;
$("#title_tip").html(title);
$("#text_tip").html(text);
if (url) {
@ -123,6 +124,7 @@ function render({ title, text, url, files, method }) {
}
});
activeCarousel();
checkPositionButtons(positionButtonsBefore);
}
function close_dialog() {
@ -429,3 +431,20 @@ function validateImages() {
});
return validate;
}
function checkPositionButtons(positionButtonsBefore) {
// posicion actual botones
var buttonsNow = $(".ui-dialog-buttonset").offset().top;
// Position of dialog
var dialogPosition = $(".dialog_tips").position().top;
var positionFinal;
if (positionButtonsBefore > buttonsNow) {
positionFinal = dialogPosition + (positionButtonsBefore - buttonsNow);
positionFinal = positionFinal < 0 ? "100" : positionFinal;
$(".dialog_tips").css("top", positionFinal);
} else if (positionButtonsBefore < buttonsNow) {
positionFinal = dialogPosition - (buttonsNow - positionButtonsBefore);
positionFinal = positionFinal < 0 ? "100" : positionFinal;
$(".dialog_tips").css("top", positionFinal);
}
}

View File

@ -113,6 +113,13 @@ class ClusterWizard extends \HTML
*/
private $agent;
/**
* Id of clusters.
*
* @var integer
*/
public $id;
/**
* Builds a Cluster Wizard.

View File

@ -167,6 +167,20 @@ class Manager implements PublicLogin
*/
private $duplicateCellId;
/**
* Url
*
* @var string
*/
public $url;
/**
* Widget
*
* @var Widget
*/
public $cWidget;
/**
* Allowed methods to be called using AJAX request.
*

View File

@ -65,6 +65,27 @@ class Widget
*/
private $dateTo;
/**
* Data cell
*
* @var array
*/
public $dataCell;
/**
* Overflow scrollbar.
*
* @var boolean
*/
public $overflow_scrollbars;
/**
* Position
*
* @var array
*/
public $position;
/**
* Contructor widget.

View File

@ -226,7 +226,7 @@ class AgentHive extends Widget
'name' => 'groups[]',
'returnAllGroup' => false,
'privilege' => 'AR',
'selected' => explode(',', $values['groups'][0]),
'selected' => (isset($values['groups'][0]) === true) ? explode(',', $values['groups'][0]) : [],
'return' => true,
'multiple' => true,
'required' => true,

View File

@ -117,6 +117,13 @@ class DataMatrix extends Widget
*/
protected $cellId;
/**
* Position
*
* @var array
*/
public $size;
/**
* Construct.

View File

@ -0,0 +1,541 @@
<?php
/**
* Widget agiss map Pandora FMS Console
*
* @category Console Class
* @package Pandora FMS
* @subpackage Widget
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2024 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
namespace PandoraFMS\Dashboard;
use PandoraFMS\Enterprise\Metaconsole\Node;
global $config;
/**
* URL Widgets
*/
class GisMap extends Widget
{
/**
* Name widget.
*
* @var string
*/
protected $name;
/**
* Title widget.
*
* @var string
*/
protected $title;
/**
* Page widget;
*
* @var string
*/
protected $page;
/**
* Class name widget.
*
* @var [type]
*/
protected $className;
/**
* Values options for each widget.
*
* @var [type]
*/
protected $values;
/**
* Configuration required.
*
* @var boolean
*/
protected $configurationRequired;
/**
* Error load widget.
*
* @var boolean
*/
protected $loadError;
/**
* Width.
*
* @var integer
*/
protected $width;
/**
* Heigth.
*
* @var integer
*/
protected $height;
/**
* Grid Width.
*
* @var integer
*/
protected $gridWidth;
/**
* Cell ID.
*
* @var integer
*/
protected $cellId;
/**
* Construct.
*
* @param integer $cellId Cell ID.
* @param integer $dashboardId Dashboard ID.
* @param integer $widgetId Widget ID.
* @param integer|null $width New width.
* @param integer|null $height New height.
* @param integer|null $gridWidth Grid width.
*/
public function __construct(
int $cellId,
int $dashboardId=0,
int $widgetId=0,
?int $width=0,
?int $height=0,
?int $gridWidth=0
) {
global $config;
// WARNING: Do not edit. This chunk must be in the constructor.
parent::__construct(
$cellId,
$dashboardId,
$widgetId
);
// Width.
$this->width = $width;
// Height.
$this->height = $height;
// Grid Width.
$this->gridWidth = $gridWidth;
// Cell Id.
$this->cellId = $cellId;
// Options.
$this->values = $this->decoders($this->getOptionsWidget());
// Page.
$this->page = basename(__FILE__);
// ClassName.
$class = new \ReflectionClass($this);
$this->className = $class->getShortName();
// Title.
$this->title = __('Gis map');
// Name.
if (empty($this->name) === true) {
$this->name = 'GisMap';
}
// This forces at least a first configuration.
$this->configurationRequired = false;
if (empty($this->values['gis_map']) === true) {
$this->configurationRequired = true;
}
}
/**
* Decoders hack for retrocompability.
*
* @param array $decoder Values.
*
* @return array Returns the values with the correct key.
*/
public function decoders(array $decoder): array
{
$values = [];
// Retrieve global - common inputs.
$values = parent::decoders($decoder);
if (isset($decoder['gis_map']) === true) {
$values['gis_map'] = $decoder['gis_map'];
}
return $values;
}
/**
* Generates inputs for form (specific).
*
* @return array Of inputs.
*
* @throws Exception On error.
*/
public function getFormInputs(): array
{
global $config;
include_once $config['homedir'].'/include/functions_gis.php';
// Retrieve global - common inputs.
$inputs = parent::getFormInputs();
if ((bool) $config['activate_gis'] === true) {
$maps = gis_get_maps();
}
$array_map = [];
foreach ($maps as $map) {
if (check_acl($config['id_user'], $map['group_id'], 'MR') === false
&& check_acl($config['id_user'], $map['group_id'], 'MW') === false
&& check_acl($config['id_user'], $map['group_id'], 'MM') === false
) {
continue;
}
$array_map[$map['id_tgis_map']] = $map['map_name'];
}
// Filters.
$inputs[] = [
'class' => 'flex flex-row',
'label' => __('GIS maps'),
'arguments' => [
'type' => 'select',
'fields' => $array_map,
'name' => 'gis_map',
'return' => true,
'selected' => ($this->values['gis_map'] === null) ? 0 : $this->values['gis_map'],
],
];
return $inputs;
}
/**
* Get Post for widget.
*
* @return array
*/
public function getPost(): array
{
// Retrieve global - common inputs.
$values = parent::getPost();
$values['gis_map'] = \get_parameter('gis_map', 0);
return $values;
}
/**
* Draw widget.
*
* @return string;
*/
public function load()
{
global $config;
include_once $config['homedir'].'/include/functions_gis.php';
include_once $config['homedir'].'/include/functions_agents.php';
\ui_require_javascript_file('openlayers.pandora', 'include/javascript/', true);
\ui_require_javascript_file('OpenLayers/OpenLayers', 'include/javascript/', true);
$map = db_get_row('tgis_map', 'id_tgis_map', $this->values['gis_map']);
$output = '';
if (check_acl($config['id_user'], $map['group_id'], 'MR') === false
&& check_acl($config['id_user'], $map['group_id'], 'MW') === false
&& check_acl($config['id_user'], $map['group_id'], 'MM') === false
) {
$output .= '<div class="container-center">';
$output .= ui_print_error_message(
__('You don\'t have access'),
'',
true
);
$output .= '</div>';
return $output;
}
$confMap = gis_get_map_conf($this->values['gis_map']);
// Default open map (used to overwrite unlicensed google map view).
$confMapDefault = get_good_con();
$confMapDefaultFull = json_decode($confMapDefault['conection_data'], true);
$confMapUrlDefault = $confMapDefaultFull['url'];
$num_baselayer = 0;
// Initialy there is no Gmap base layer.
$gmap_layer = false;
if ($confMap !== false) {
foreach ($confMap as $mapC) {
$baselayers[$num_baselayer]['typeBaseLayer'] = $mapC['connection_type'];
$baselayers[$num_baselayer]['name'] = $mapC['conection_name'];
$baselayers[$num_baselayer]['num_zoom_levels'] = $mapC['num_zoom_levels'];
$decodeJSON = json_decode($mapC['conection_data'], true);
switch ($mapC['connection_type']) {
case 'OSM':
$baselayers[$num_baselayer]['url'] = $decodeJSON['url'];
break;
case 'Gmap':
if (!isset($decodeJSON['gmap_key']) || empty($decodeJSON['gmap_key'])) {
// If there is not gmap_key, show the default view.
$baselayers[$num_baselayer]['url'] = $confMapUrlDefault;
$baselayers[$num_baselayer]['typeBaseLayer'] = 'OSM';
} else {
$baselayers[$num_baselayer]['gmap_type'] = $decodeJSON['gmap_type'];
$baselayers[$num_baselayer]['gmap_key'] = $decodeJSON['gmap_key'];
$gmap_key = $decodeJSON['gmap_key'];
// Once a Gmap base layer is found we mark it to import the API.
$gmap_layer = true;
}
break;
case 'Static_Image':
$baselayers[$num_baselayer]['url'] = $decodeJSON['url'];
$baselayers[$num_baselayer]['bb_left'] = $decodeJSON['bb_left'];
$baselayers[$num_baselayer]['bb_right'] = $decodeJSON['bb_right'];
$baselayers[$num_baselayer]['bb_bottom'] = $decodeJSON['bb_bottom'];
$baselayers[$num_baselayer]['bb_top'] = $decodeJSON['bb_top'];
$baselayers[$num_baselayer]['image_width'] = $decodeJSON['image_width'];
$baselayers[$num_baselayer]['image_height'] = $decodeJSON['image_height'];
break;
case 'WMS':
$baselayers[$num_baselayer]['url'] = $decodeJSON['url'];
$baselayers[$num_baselayer]['layers'] = $decodeJSON['layers'];
break;
default:
// Do nothing.
break;
}
$num_baselayer++;
if ($mapC['default_map_connection'] == 1) {
$numZoomLevels = $mapC['num_zoom_levels'];
}
}
}
if ($gmap_layer === true) {
if (https_is_running()) {
?>
<script type="text/javascript" src="https://maps.google.com/maps?file=api&v=2&sensor=false&key=<?php echo $gmap_key; ?>" ></script>
<?php
} else {
?>
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=<?php echo $gmap_key; ?>" ></script>
<?php
}
}
$controls = [
'PanZoomBar',
'ScaleLine',
'Navigation',
'MousePosition',
'layerSwitcher',
];
$layers = gis_get_layers($this->values['gis_map']);
$output .= '<div id="map_'.$this->cellId.'" style="width: 100%; height: 100%" />';
gis_print_map(
'map_'.$this->cellId,
$map['zoom_level'],
$map['initial_latitude'],
$map['initial_longitude'],
$baselayers,
$controls
);
$output .= '</div>';
if (empty($layers) === false) {
foreach ($layers as $layer) {
gis_make_layer(
$layer['layer_name'],
$layer['view_layer'],
null,
$layer['id_tmap_layer']
);
// Calling agents_get_group_agents with none to obtain the names in the same case as they are in the DB.
$agentNamesByGroup = [];
if ($layer['tgrupo_id_grupo'] >= 0) {
$agentNamesByGroup = agents_get_group_agents(
$layer['tgrupo_id_grupo'],
false,
'none',
true,
true,
false
);
}
$agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer']);
$groupsByAgentId = gis_get_groups_layer_by_agent_id($layer['id_tmap_layer']);
$agentNamesOfGroupItems = [];
foreach ($groupsByAgentId as $agentId => $groupInfo) {
$agentNamesOfGroupItems[$agentId] = $groupInfo['agent_name'];
}
$agentNames = array_unique($agentNamesByGroup + $agentNamesByLayer + $agentNamesOfGroupItems);
foreach ($agentNames as $key => $agentName) {
$idAgent = $key;
$coords = gis_get_data_last_position_agent($idAgent);
if ($coords === false) {
$coords['stored_latitude'] = $map['default_latitude'];
$coords['stored_longitude'] = $map['default_longitude'];
} else {
if ($show_history == 'y') {
$lastPosition = [
'longitude' => $coords['stored_longitude'],
'latitude' => $coords['stored_latitude'],
];
gis_add_path($layer['layer_name'], $idAgent, $lastPosition);
}
}
$status = agents_get_status($idAgent, true);
$icon = gis_get_agent_icon_map($idAgent, true, $status);
$icon_size = getimagesize($icon);
$icon_width = $icon_size[0];
$icon_height = $icon_size[1];
// Is a group item.
if (empty($groupsByAgentId[$idAgent]) === false) {
$groupId = (int) $groupsByAgentId[$idAgent]['id'];
$groupName = $groupsByAgentId[$idAgent]['name'];
gis_add_agent_point(
$layer['layer_name'],
io_safe_output($groupName),
$coords['stored_latitude'],
$coords['stored_longitude'],
$icon,
$icon_width,
$icon_height,
$idAgent,
$status,
'point_group_info',
$groupId
);
} else {
$parent = db_get_value('id_parent', 'tagente', 'id_agente', $idAgent);
gis_add_agent_point(
$layer['layer_name'],
io_safe_output($agentName),
$coords['stored_latitude'],
$coords['stored_longitude'],
$icon,
$icon_width,
$icon_height,
$idAgent,
$status,
'point_agent_info',
$parent
);
}
}
}
gis_add_parent_lines();
$timestampLastOperation = db_get_value_sql('SELECT UNIX_TIMESTAMP()');
gis_activate_select_control();
gis_activate_ajax_refresh($layers, $timestampLastOperation);
}
return $output;
}
/**
* Get description.
*
* @return string.
*/
public static function getDescription()
{
return __('GIS map');
}
/**
* Get Name.
*
* @return string.
*/
public static function getName()
{
return 'GisMap';
}
/**
* Get size Modal Configuration.
*
* @return array
*/
public function getSizeModalConfiguration(): array
{
$size = [
'width' => 500,
'height' => 300,
];
return $size;
}
}

View File

@ -115,6 +115,13 @@ class ModulesByStatus extends Widget
*/
protected $cellId;
/**
* Size
*
* @var array
*/
public $size;
/**
* Construct.

View File

@ -355,7 +355,7 @@ class AgentModuleWidget extends Widget
*/
public function getIdCacheAgent($id_agents)
{
$target_agents = explode(',', $id_agents);
$target_agents = explode(',', ($id_agents ?? ''));
$cache_id_agents = [];
foreach ($target_agents as $agent_id) {
if (str_contains($agent_id, '|') === false) {

View File

@ -111,6 +111,20 @@ class EventsListWidget extends Widget
*/
protected $publicLink;
/**
* Overflow scrollbar.
*
* @var boolean
*/
public $overflow_scrollbars;
/**
* Position
*
* @var array
*/
public $position;
/**
* Construct.

View File

@ -271,7 +271,7 @@ class HeatmapWidget extends Widget
'name' => 'groups[]',
'returnAllGroup' => true,
'privilege' => 'AR',
'selected' => explode(',', $values['groups'][0]),
'selected' => (isset($values['groups'][0]) === true) ? explode(',', $values['groups'][0]) : [],
'return' => true,
'multiple' => true,
],
@ -305,7 +305,7 @@ class HeatmapWidget extends Widget
'type' => 'select',
'fields' => $tags,
'name' => 'tags[]',
'selected' => explode(',', $values['tags'][0]),
'selected' => (isset($values['tags'][0]) === true) ? explode(',', $values['tags'][0]) : [],
'return' => true,
'multiple' => true,
],
@ -332,7 +332,7 @@ class HeatmapWidget extends Widget
'type' => 'select',
'fields' => $module_groups,
'name' => 'module_groups[]',
'selected' => explode(',', $values['module_groups'][0]),
'selected' => (isset($values['module_groups'][0]) === true) ? explode(',', $values['module_groups'][0]) : [],
'return' => true,
'multiple' => true,
'nothing' => __('Not assigned'),

View File

@ -446,7 +446,7 @@ class SecurityHardening extends Widget
{
global $config;
$id_groups = explode(',', $group);
$id_groups = explode(',', ($group ?? ''));
if (in_array(0, $id_groups) === true) {
$id_groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
}

View File

@ -83,7 +83,11 @@ class SnmpTraps extends Element
{
if ($this->isEnabled() === true) {
$value = $this->valueMonitoring('snmp_trap_queue');
$total = round($value[0]['data']);
if (isset($value[0]['data']) === true) {
$total = round($value[0]['data']);
} else {
$total = __('N/A');
}
} else {
$total = __('N/A');
}
@ -109,7 +113,11 @@ class SnmpTraps extends Element
{
if ($this->isEnabled() === true) {
$value = $this->valueMonitoring('total_trap');
$total = round($value[0]['data']);
if (isset($value[0]['data']) === true) {
$total = round($value[0]['data']);
} else {
$total = __('N/A');
}
} else {
$total = __('N/A');
}

View File

@ -585,3 +585,7 @@ div.container-filter-buttons {
margin-right: 10px !important;
}
}
#button-start-search {
width: 115px;
}

View File

@ -61,15 +61,11 @@
}
.ui-dialog .ui-dialog-titlebar-disengage {
position: absolute !important;
right: 50px;
top: -3px;
width: 40px;
margin: 0px 0 0 0;
padding: 1px;
height: 40px;
height: 20px;
bottom: 30%;
background-color: #fff !important;
background-color: white;
}
.ui-dialog .ui-dialog-titlebar-disengage:hover {

View File

@ -12819,9 +12819,9 @@ div.agents_custom_fields #datatables_wrapper div.bottom {
.actions-sound-modal .buttons-sound-modal button.play,
.actions-sound-modal .buttons-sound-modal input[type="button"].play {
background: url(../../images/play-white.png), transparent !important;
/*background: url(../../images/play-white.png), transparent !important;
background-repeat: no-repeat !important;
background-position: 82px 14px !important;
background-position: 82px 14px !important;*/
color: #ffffff;
padding-left: 20px;
border: 0;

View File

@ -1,9 +1,6 @@
/*
* Css Modal Sound events.
*/
div.container-button-play > button#button-start-search {
transition: none !important;
}
.wizard {
text-align: left;
}
@ -217,9 +214,9 @@ div.container-button-play > button#button-start-search {
.actions-sound-modal .buttons-sound-modal button.play,
.actions-sound-modal .buttons-sound-modal input[type="button"].play {
background: url(../../images/play-white.png), transparent !important;
/*background: url(../../images/play-white.png), transparent !important;
background-repeat: no-repeat !important;
background-position: 82px 14px !important;
background-position: 82px 14px !important;*/
color: #ffffff !important;
padding-left: 20px;
border: 0;
@ -263,11 +260,6 @@ button#button-no-alerts.silence-alerts:hover {
background-position: 138px 4px !important;
}
.actions-sound-modal .container-button-play {
background-color: var(--primary-color);
border-radius: 8px;
}
.actions-sound-modal .container-button-alert.fired {
background: #ee2132;
border-radius: 8px;

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.775';
$build = '240205';
$build = '240212';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -505,7 +505,7 @@ if (is_ajax() === true) {
}
}
if (strlen($tmp->server_name) >= 10) {
if (isset($tmp->server_name) === true && strlen($tmp->server_name) >= 10) {
$tmp->server_name = ui_print_truncate_text(
$tmp->server_name,
10,

View File

@ -304,23 +304,7 @@ if ($layers != false) {
gis_add_parent_lines();
switch ($config['dbtype']) {
case 'mysql':
$timestampLastOperation = db_get_value_sql('SELECT UNIX_TIMESTAMP()');
break;
case 'postgresql':
$timestampLastOperation = db_get_value_sql(
"SELECT ceil(date_part('epoch', CURRENT_TIMESTAMP))"
);
break;
case 'oracle':
$timestampLastOperation = db_get_value_sql(
"SELECT ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) FROM dual'
);
break;
}
$timestampLastOperation = db_get_value_sql('SELECT UNIX_TIMESTAMP()');
gis_activate_select_control();
gis_activate_ajax_refresh($layers, $timestampLastOperation);

View File

@ -382,7 +382,7 @@ ui_print_standard_header(
$inventory_id_agent = (int) get_parameter('agent_id', -1);
$inventory_agent = (string) get_parameter('agent', '');
if (strlen($inventory_agent) == 0) {
if (strlen(($inventory_agent ?? '')) == 0) {
$inventory_id_agent = -1;
$inventory_agent = __('All');
} else if ($inventory_agent == __('All')) {

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.775
%define release 240205
%define release 240212
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.775
%define release 240205
%define release 240212
# 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.775
%define release 240205
%define release 240212
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -2832,7 +2832,8 @@ INSERT INTO `twidget` (`id`,`class_name`,`unique_name`,`description`,`options`,`
(44,'WuxWidget','wux_transaction','Agent WUX transaction','','wux_transaction.php'),
(45,'WuxStatsWidget','wux_transaction_stats','WUX transaction stats','','wux_transaction_stats.php'),
(46,'SecurityHardening','security_hardening','Security Hardening','','security_hardening.php'),
(47,'ServiceLevelWidget','service_level','Service Level','','service_level.php');
(47,'ServiceLevelWidget','service_level','Service Level','','service_level.php'),
(48,'GisMap','GisMap','Gis map','','GisMap.php');
INSERT INTO `tmap` (`id`,`id_group`,`id_user`,`type`,`subtype`,`name`,`description`,`height`,`width`,`center_x`,`center_y`,`background`,`background_options`,`source_period`,`source`,`source_data`,`generation_method`,`generated`,`filter`,`id_group_map`,`refresh_time`) VALUES (1,'0','admin',0,0,'Sample&#x20;dynamic&#x20;map','This&#x20;is&#x20;a&#x20;sample&#x20;dynamic&#x20;map.',900,900,0,0,'',0,60,0,'0',6,0,'{\"dont_show_subgroups\":0,\"node_radius\":40,\"x_offs\":\"0\",\"y_offs\":\"0\",\"z_dash\":\"1\",\"node_sep\":\"0.25\",\"rank_sep\":\"0.5\",\"mindist\":\"1\",\"kval\":\"0.3\"}',0,300);
INSERT INTO `treport` (`id_report`,`id_user`,`name`,`description`,`private`,`id_group`,`custom_logo`,`header`,`first_page`,`footer`,`custom_font`,`id_template`,`id_group_edit`,`metaconsole`,`non_interactive`,`hidden`,`orientation`,`cover_page_render`,`index_render`) VALUES (1,'admin','Sample&#x20;report&#x20;#1','This&#x20;is&#x20;a&#x20;sample&#x20;report,&#x20;just&#x20;to&#x20;show&#x20;you&#x20;some&#x20;general&#x20;report&#x20;items.',0,0,NULL,NULL,'&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;img&#x20;src=&quot;http://localhost/pandora_console//images/pandora_report_logo.png&quot;&#x20;alt=&quot;&quot;&#x20;width=&quot;800&quot;&#x20;/&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;xx-large;&quot;&gt;&#40;_REPORT_NAME_&#41;&lt;/span&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;large;&quot;&gt;&#40;_DATETIME_&#41;&lt;/span&gt;&lt;/p&gt;',NULL,'Lato-Regular.ttf',0,0,0,0,0,'vertical',1,1);

View File

@ -123,7 +123,7 @@ class Manager
string $public_url,
?string $ajax_url=null,
?string $page=null,
array $settings,
array $settings=[],
?int $mode=null,
bool $composer=false
) {

View File

@ -15,7 +15,7 @@ trait JsonSerializable
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return array_map(function ($value) {
if ($value instanceof JsonSerializableInterface) {

View File

@ -148,7 +148,7 @@ class Elements implements ArraySerializableInterface, JsonSerializable
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return $this->getArrayCopy();
}

View File

@ -34,7 +34,12 @@ if ($redraw === false) {
$output .= '<div class="header-widget">';
$output .= '<div>';
$options = json_decode($cellData['options'], true);
if (isset($cellData['options']) === true) {
$options = json_decode($cellData['options'], true);
} else {
$options = [];
}
if ($cellData['id_widget'] !== '0') {
$output .= $options['title'];
} else {

View File

@ -43,7 +43,7 @@ $form = [
'extra' => 'novalidate',
];
$js = 'tinymce.init({
$js .= ' tinymce.init({
selector: "#textarea_text",
plugins: "preview, searchreplace, table, nonbreaking, link, image",
promotion: false,

View File

@ -71,6 +71,10 @@ foreach ($widgets as $widget) {
continue;
}
if ($widget['unique_name'] === 'GisMap' && (bool) $config['activate_gis'] === false) {
continue;
}
$imageWidget = '/images/widgets/'.$widget['unique_name'].'.png';
$output .= '<div class="list-widgets">';

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.775-240205
Version: 7.0NG.775-240212
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.775-240205"
pandora_version="7.0NG.775-240212"
package_cpan=0
package_pandora=1

View File

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

View File

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

View File

@ -7,7 +7,7 @@
%define debug_package %{nil}
%define name pandorafms_server
%define version 7.0NG.775
%define release 240205
%define release 240212
Summary: Pandora FMS Server
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.775
%define release 240205
%define release 240212
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -38,7 +38,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.775 Build 240205";
my $version = "7.0NG.775 Build 240212";
# 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.775 Build 240205";
my $version = "7.0NG.775 Build 240212";
# save program name for logging
my $progname = basename($0);