diff --git a/pandora_agents/pc/pandora_agent_installer b/pandora_agents/pc/pandora_agent_installer
index 7d8de1134d..bcfee3eb00 100644
--- a/pandora_agents/pc/pandora_agent_installer
+++ b/pandora_agents/pc/pandora_agent_installer
@@ -467,7 +467,7 @@ fi
# Script banner at start
echo " "
-echo "Pandora FMS Agent UNIX Installer $PI_VERSION $PI_BUILD (c) 2008-2015 ArticaST"
+echo "Pandora FMS Agent UNIX Installer $PI_VERSION $PI_BUILD (c) 2008-2024 PandoraFMS"
echo "This program is licensed under GPL2 Terms. http://pandorafms.com"
echo " "
diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 4540647ff4..574029ce9f 100644
--- a/pandora_agents/unix/DEBIAN/control
+++ b/pandora_agents/unix/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-agent-unix
-Version: 7.0NG.775-240212
+Version: 7.0NG.775-240220
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh
index f1bb519b3a..2b0d9e0fb4 100644
--- a/pandora_agents/unix/DEBIAN/make_deb_package.sh
+++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.775-240212"
+pandora_version="7.0NG.775-240220"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index e32233b28d..5a963ef6e5 100755
--- a/pandora_agents/unix/pandora_agent
+++ b/pandora_agents/unix/pandora_agent
@@ -1039,7 +1039,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.775';
-use constant AGENT_BUILD => '240212';
+use constant AGENT_BUILD => '240220';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec
index 72733d6131..53d0db8510 100644
--- a/pandora_agents/unix/pandora_agent.redhat.spec
+++ b/pandora_agents/unix/pandora_agent.redhat.spec
@@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.775
-%define release 240212
+%define release 240220
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec
index 586d2e851e..3e053d1139 100644
--- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec
+++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec
@@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.775
-%define release 240212
+%define release 240220
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version
diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec
index 3b7519d4e9..2d3be11084 100644
--- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec
+++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec
@@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.775
-%define release 240212
+%define release 240220
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version
diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec
index e4642d5e3b..78495c142d 100644
--- a/pandora_agents/unix/pandora_agent.redhat_bin.spec
+++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec
@@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.775
-%define release 240212
+%define release 240220
Summary: Pandora FMS Linux agent, binary version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec
index 596bb71efe..ae7336afaa 100644
--- a/pandora_agents/unix/pandora_agent.spec
+++ b/pandora_agents/unix/pandora_agent.spec
@@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.775
-%define release 240212
+%define release 240220
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}
diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer
index 45b115904a..4231f83ca3 100755
--- a/pandora_agents/unix/pandora_agent_installer
+++ b/pandora_agents/unix/pandora_agent_installer
@@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.775"
-PI_BUILD="240212"
+PI_BUILD="240220"
OS_NAME=`uname -s`
FORCE=0
@@ -579,7 +579,7 @@ fi
# Script banner at start
echo " "
-echo "Pandora FMS Agent UNIX Installer $PI_VERSION $PI_BUILD (c) 2008-2015 ArticaST"
+echo "Pandora FMS Agent UNIX Installer $PI_VERSION $PI_BUILD (c) 2008-2024 PandoraFMS"
echo "This program is licensed under GPL2 Terms. http://pandorafms.com"
echo " "
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 89f3ebefbc..dfdeecea3d 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
-{240212}
+{240220}
ViewReadme
{Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 69f5bb8200..0f7f128e46 100644
--- a/pandora_agents/win32/pandora.cc
+++ b/pandora_agents/win32/pandora.cc
@@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
-#define PANDORA_VERSION ("7.0NG.775 Build 240212")
+#define PANDORA_VERSION ("7.0NG.775 Build 240220")
string pandora_path;
string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index 047164560c..ff6ed8fa7e 100644
--- a/pandora_agents/win32/versioninfo.rc
+++ b/pandora_agents/win32/versioninfo.rc
@@ -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 240212))"
+ VALUE "ProductVersion", "(7.0NG.775(Build 240220))"
VALUE "FileVersion", "1.0.0.0"
END
END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 2085adac6e..cab607fc18 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-console
-Version: 7.0NG.775-240212
+Version: 7.0NG.775-240220
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh
index 0a0086ffb2..610e452556 100644
--- a/pandora_console/DEBIAN/make_deb_package.sh
+++ b/pandora_console/DEBIAN/make_deb_package.sh
@@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-pandora_version="7.0NG.775-240212"
+pandora_version="7.0NG.775-240220"
package_pear=0
package_pandora=1
diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php
index 9ea79ba364..a3f5872f84 100644
--- a/pandora_console/extensions/quick_shell.php
+++ b/pandora_console/extensions/quick_shell.php
@@ -394,7 +394,7 @@ function quickShellSettings()
__('Address'),
html_print_input_text(
'gotty_addr',
- $config['gotty_addr'],
+ ($config['gotty_addr'] ?? ''),
'',
30,
100,
@@ -443,9 +443,8 @@ function quickShellSettings()
html_print_checkbox_switch(
'gotty_ssh_use_ssl',
1,
- $config['gotty_ssh_use_ssl'],
- true,
- $disable_agentaccess
+ ($config['gotty_ssh_use_ssl'] ?? false),
+ true
)
);
@@ -497,7 +496,7 @@ function quickShellSettings()
html_print_checkbox_switch(
'gotty_telnet_use_ssl',
1,
- $config['gotty_telnet_use_ssl'],
+ ($config['gotty_telnet_use_ssl'] ?? false),
true
)
);
diff --git a/pandora_console/extensions/resource_exportation.php b/pandora_console/extensions/resource_exportation.php
deleted file mode 100755
index 476b7ef1bf..0000000000
--- a/pandora_console/extensions/resource_exportation.php
+++ /dev/null
@@ -1,497 +0,0 @@
-'."\n";
- echo "
'.__('You can export resource templates in .ptr format.')
- );
-
- $table = new stdClass();
- $table->class = 'databox filter-table-adv';
- $table->id = 'resource_exportation_table';
- $table->style = [];
- $table->style[0] = 'width: 30%';
- $table->style[1] = 'vertical-align: bottom;';
- $table->data = [];
- $table->data[0][] = html_print_label_input_block(
- __('Report'),
- html_print_div(
- [
- 'class' => 'flex-content-left',
- 'content' => html_print_select_from_sql('SELECT id_report, name FROM treport', 'report', '', '', '', 0, true),
- ],
- true
- )
- );
- $table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr("report");', '', true);
-
- $table->data[1][] = html_print_label_input_block(
- __('Visual console'),
- html_print_div(
- [
- 'class' => 'flex-content-left',
- 'content' => html_print_select_from_sql('SELECT id, name FROM tlayout', 'visual_console', '', '', '', 0, true),
- ],
- true
- )
- );
- $table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr("visual_console");', '', true);
-
- if ($hook_enterprise === true) {
- add_rows_for_enterprise($table->data);
- }
-
- html_print_table($table);
-
- ?>
-
- $name) {
- $values['id_report'] = $id;
- $result = (bool) db_process_sql_insert('treport_content', $values);
-
- ui_print_result_message(
- $result,
- sprintf(
- __("Success add '%s' item in report '%s'."),
- $values['type'],
- $name
- ),
- sprintf(
- __("Error create '%s' item in report '%s'."),
- $values['type'],
- $name
- )
- );
- }
-}
-
-
-function process_upload_xml_report($xml, $group_filter=0)
-{
- foreach ($xml->xpath('/report') as $reportElement) {
- $values = [];
-
- if (isset($reportElement->name)) {
- $values['name'] = $reportElement->name;
-
- $posible_name = $values['name'];
- $exist = true;
- $loops = 30;
- // Loops to exit or tries.
- while ($exist && $loops > 0) {
- $exist = (bool) db_get_row_filter(
- 'treport',
- ['name' => io_safe_input($posible_name)]
- );
-
- if ($exist) {
- $loops--;
- $posible_name = $values['name'].' ('.(30 - $loops).')';
- }
- }
-
- if ($exist) {
- ui_print_error_message(
- sprintf(
- __("Error create '%s' report, the name exist and there aren't free name."),
- $reportElement->name
- )
- );
- break;
- } else if ($loops != 30) {
- ui_print_warning_message(
- sprintf(
- __("Warning create '%s' report, the name exist, the report have a name %s."),
- $reportElement->name,
- $posible_name
- )
- );
- }
-
- $values['name'] = io_safe_input($posible_name);
- } else {
- ui_print_error_message(__("Error the report haven't name."));
- break;
- }
-
- if (isset($reportElement->group) === true
- && empty($reportElement->group) === false
- ) {
- $id_group = db_get_value(
- 'id_grupo',
- 'tgrupo',
- 'nombre',
- $reportElement->group
- );
- if ($id_group === false) {
- ui_print_error_message(__("Error the report haven't group."));
- break;
- }
- }
-
- if (isset($reportElement->description) === true) {
- $values['description'] = $reportElement->description;
- }
-
- $id_report = db_process_sql_insert('treport', $values);
-
- ui_print_result_message(
- $id_report,
- sprintf(__("Success create '%s' report."), $posible_name),
- sprintf(__("Error create '%s' report."), $posible_name)
- );
-
- if ($id_report) {
- db_pandora_audit(
- AUDIT_LOG_REPORT_MANAGEMENT,
- 'Create report '.$id_report,
- false,
- false
- );
- } else {
- db_pandora_audit(
- AUDIT_LOG_REPORT_MANAGEMENT,
- 'Fail to create report',
- false,
- false
- );
- break;
- }
-
- foreach ($reportElement->item as $item) {
- $item = (array) $item;
-
- $values = [];
- $values['id_report'] = $id_report;
- if (isset($item['description']) === true) {
- $values['description'] = io_safe_input($item['description']);
- }
-
- if (isset($item['period']) === true) {
- $values['period'] = io_safe_input($item['period']);
- }
-
- if (isset($item['type']) === true) {
- $values['type'] = io_safe_input($item['type']);
- }
-
- $agents_item = [];
- if (isset($item['agent']) === true) {
- $agents = agents_get_agents(
- ['id_grupo' => $group_filter],
- [
- 'id_agente',
- 'alias',
- ]
- );
-
- $agent_clean = str_replace(
- [
- '[',
- ']',
- ],
- '',
- io_safe_output($item['agent'])
- );
- $regular_expresion = ($agent_clean != $item['agent']);
-
- foreach ($agents as $agent) {
- if ($regular_expresion) {
- if ((bool) preg_match('/'.$agent_clean.'/', io_safe_output($agent['alias']))) {
- $agents_item[$agent['id_agente']]['name'] = $agent['alias'];
- }
- } else {
- if ($agent_clean == io_safe_output($agent['alias'])) {
- $agents_item[$agent['id_agente']]['name'] = $agent['alias'];
- }
- }
- }
- }
-
- if (isset($item['module']) === true) {
- $module_clean = str_replace(['[', ']'], '', $item['module']);
- $regular_expresion = ($module_clean != $item['module']);
-
- foreach ($agents_item as $id => $agent) {
- $modules = db_get_all_rows_filter(
- 'tagente_modulo',
- ['id_agente' => $id],
- [
- 'id_agente_modulo',
- 'nombre',
- ]
- );
-
- $agents_item[$id]['modules'] = [];
-
- foreach ($modules as $module) {
- if ($regular_expresion) {
- if ((bool) preg_match('/'.$module_clean.'/', io_safe_output($module['nombre']))) {
- $agents_item[$id]['modules'][$module['id_agente_modulo']]['name'] = $module['nombre'];
- }
- } else {
- if ($module_clean == io_safe_output($module['nombre'])) {
- $agents_item[$id]['modules'][$module['id_agente_modulo']]['name'] = $module['nombre'];
- }
- }
- }
- }
- }
-
- switch ($item['type']) {
- case 2:
- case 'custom_graph':
- case 'automatic_custom_graph':
- $group = db_get_value('id_grupo', 'tgrupo', 'nombre', io_safe_input($item['graph']));
- $values['id_gs'] = $group;
- break;
-
- case 3:
- case 'SLA':
- if (isset($item['only_display_wrong'])) {
- $values['only_display_wrong'] = (string) $item['only_display_wrong'];
- }
-
- if (isset($item['monday'])) {
- $values['monday'] = (string) $item['monday'];
- }
-
- if (isset($item['tuesday'])) {
- $values['tuesday'] = (string) $item['tuesday'];
- }
-
- if (isset($item['wednesday'])) {
- $values['wednesday'] = (string) $item['wednesday'];
- }
-
- if (isset($item['thursday'])) {
- $values['thursday'] = (string) $item['thursday'];
- }
-
- if (isset($item['friday'])) {
- $values['friday'] = (string) $item['friday'];
- }
-
- if (isset($item['saturday'])) {
- $values['saturday'] = (string) $item['saturday'];
- }
-
- if (isset($item['sunday'])) {
- $values['sunday'] = (string) $item['sunday'];
- }
-
- if (isset($item['time_from'])) {
- $values['time_from'] = (string) $item['time_from'];
- }
-
- if (isset($item['time_to'])) {
- $values['time_to'] = (string) $item['time_to'];
- }
-
- $slas = [];
- if (!isset($item['sla'])) {
- $item['sla'] = [];
- }
-
- foreach ($item['sla'] as $sla_xml) {
- if (isset($sla_xml->agent)) {
- $agents = agents_get_agents(['id_grupo' => $group_filter], ['id_agente', 'nombre']);
-
- $agent_clean = str_replace(['[', ']'], '', $sla_xml->agent);
- $regular_expresion = ($agent_clean != $sla_xml->agent);
-
- foreach ($agents as $agent) {
- $id_agent = false;
- if ($regular_expresion) {
- if ((bool) preg_match('/'.$agent_clean.'/', io_safe_output($agent['nombre']))) {
- $id_agent = $agent['id_agente'];
- } else {
- if ($agent_clean == io_safe_output($agent['nombre'])) {
- $id_agent = $agent['id_agente'];
- }
- }
- }
-
- if ($id_agent) {
- if (isset($sla_xml->module)) {
- $module_clean = str_replace(['[', ']'], '', $sla_xml->module);
- $regular_expresion = ($module_clean != $sla_xml->module);
-
- $modules = db_get_all_rows_filter(
- 'tagente_modulo',
- ['id_agente' => $id_agent],
- [
- 'id_agente_modulo',
- 'nombre',
- ]
- );
-
- foreach ($modules as $module) {
- if ($regular_expresion) {
- if ((bool) preg_match('/'.$module_clean.'/', io_safe_output($module['nombre']))) {
- $slas[] = [
- 'id_agent_module' => $module['id_agente_modulo'],
- 'sla_max' => (string) $sla_xml->sla_max,
- 'sla_min' => (string) $sla_xml->sla_min,
- 'sla_limit' => (string) $sla_xml->sla_limit,
- ];
- }
- } else {
- if ($module_clean == io_safe_output($module['nombre'])) {
- $slas[] = [
- 'id_agent_module' => $module['id_agente_modulo'],
- 'sla_max' => (string) $sla_xml->sla_max,
- 'sla_min' => (string) $sla_xml->sla_min,
- 'sla_limit' => (string) $sla_xml->sla_limit,
- ];
- }
- }
- }
- }
- }
- }
- }
- }
- break;
-
- case 'text':
- $values['text'] = io_safe_input($item['text']);
- break;
-
- case 'sql':
- $values['header_definition'] = io_safe_input($item['header_definition']);
- $values['external_source'] = io_safe_input($item['sql']);
- break;
-
- case 'sql_graph_pie':
- case 'sql_graph_vbar':
- case 'sql_graph_hbar':
- $values['header_definition'] = io_safe_input($item['header_definition']);
- $values['external_source'] = io_safe_input($item['sql']);
- break;
-
- case 'event_report_group':
- $values['id_agent'] = db_get_value('id_grupo', 'tgrupo', 'nombre', io_safe_input($item->group));
- break;
-
- case 'url':
- $values['external_source'] = io_safe_input($item['url']);
- break;
-
- case 'database_serialized':
- $values['header_definition'] = io_safe_input($item['header_definition']);
- $values['line_separator'] = io_safe_input($item['line_separator']);
- $values['column_separator'] = io_safe_input($item['column_separator']);
- break;
-
- case 1:
- case 'simple_graph':
- case 'simple_baseline_graph':
- case 6:
- case 'monitor_report':
- case 7:
- case 'avg_value':
- case 8:
- case 'max_value':
- case 9:
- case 'min_value':
- case 10:
- case 'sumatory':
- case 'event_report_module':
- case 'alert_report_module':
- case 'alert_report_agent':
- case 'alert_report_group':
- case 'agent_detailed_event':
- case 'event_report_agent':
- default:
- // Do nothing.
- break;
- }
-
- if (empty($agents_item) === true) {
- $id_content = db_process_sql_insert('treport_content', $values);
- ui_print_result_message(
- $id_content,
- sprintf(__("Success add '%s' content."), $values['type']),
- sprintf(__("Error add '%s' action."), $values['type'])
- );
-
- if ($item['type'] == 'SLA') {
- foreach ($slas as $sla) {
- $sla['id_report_content'] = $id_content;
- $result = db_process_sql_insert('treport_content_sla_combined', $sla);
- ui_print_result_message(
- $result,
- sprintf(__("Success add '%s' SLA."), $sla['id_agent_module']),
- sprintf(__("Error add '%s' SLA."), $sla['id_agent_module'])
- );
- }
- }
- } else {
- foreach ($agents_item as $id_agent => $agent) {
- if (empty($agent['modules'])) {
- $values['id_agent'] = $id_agent;
- $id_content = db_process_sql_insert('treport_content', $values);
- ui_print_result_message(
- $id_content,
- sprintf(__("Success add '%s' content."), $values['type']),
- sprintf(__("Error add '%s' action."), $values['type'])
- );
- } else {
- foreach ($agent['modules'] as $id_module => $module) {
- $values['id_agent_module'] = $id_module;
- $values['id_agent'] = $id_agent;
-
- $id_content = db_process_sql_insert('treport_content', $values);
- ui_print_result_message(
- $id_content,
- sprintf(__("Success add '%s' content."), $values['type']),
- sprintf(__("Error add '%s' action."), $values['type'])
- );
- }
- }
- }
- }
- }
- }
-}
-
-
-function process_upload_xml_visualmap($xml, $filter_group=0)
-{
- global $config;
-
- foreach ($xml->xpath('/visual_map') as $visual_map) {
- if (isset($visual_map->name)) {
- $values['name'] = (string) $visual_map->name;
- } else {
- ui_print_error_message(
- __("Error create '%s' visual map, lost tag name.")
- );
- break;
- }
-
- $values['id_group'] = 0;
- if (isset($visual_map->group)) {
- $id_group = db_get_value('id_grupo', 'tgrupo', 'nombre', io_safe_input($visual_map->group));
- if ($id_group !== false) {
- $values['id_group'] = $id_group;
- }
- }
-
- if (isset($visual_map->background)) {
- $values['background'] = (string) $visual_map->background;
- }
-
- $values['width'] = 0;
- if (isset($visual_map->width)) {
- $values['width'] = (string) $visual_map->width;
- }
-
- $values['height'] = 0;
- if (isset($visual_map->height)) {
- $values['height'] = (string) $visual_map->height;
- }
-
- $posible_name = $values['name'];
- $exist = true;
- $loops = 30;
- // Loops to exit or tries
- while ($exist && $loops > 0) {
- $exist = (bool) db_get_row_filter('tlayout', ['name' => io_safe_input($posible_name)]);
-
- if ($exist) {
- $loops--;
- $posible_name = $values['name'].' ('.(30 - $loops).')';
- }
- }
-
- if ($exist) {
- ui_print_error_message(
- sprintf(
- __("Error create '%s' visual map, the name exist and there aren't free name."),
- $values['name']
- )
- );
- continue;
- } else if ($loops != 30) {
- ui_print_error_message(
- sprintf(
- __("Warning create '%s' visual map, the name exist, the report have a name %s."),
- $values['name'],
- $posible_name
- )
- );
- }
-
- $values['name'] = io_safe_input($posible_name);
- $id_visual_map = db_process_sql_insert('tlayout', $values);
-
- ui_print_result_message(
- (bool) $id_visual_map,
- sprintf(__("Success create '%s' visual map."), $posible_name),
- sprintf(__("Error create '%s' visual map."), $posible_name)
- );
-
- if ($id_visual_map !== false) {
- db_pandora_audit(
- AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
- sprintf('Create Visual Console #%s', $id_visual_map),
- $config['id_user']
- );
- } else {
- break;
- }
-
- $relation_other_ids = [];
-
- foreach ($visual_map->item as $item) {
- $no_agents = true;
-
- if (isset($item->agent)) {
- $agent_clean = str_replace(['[', ']'], '', $item->agent);
- $regular_expresion = ($agent_clean != $item->agent);
-
- $agents = agents_get_agents(['id_grupo' => $filter_group], ['id_agente', 'nombre']);
- if ($agents === false) {
- $agents = [];
- }
-
- $temp = [];
- foreach ($agents as $agent) {
- $temp[$agent['id_agente']] = $agent['nombre'];
- }
-
- $agents = $temp;
-
- $agents_in_item = [];
- foreach ($agents as $id => $agent) {
- if ($regular_expresion) {
- if ((bool) preg_match('/'.$agent_clean.'/', io_safe_output($agent))) {
- $agents_in_item[$id]['name'] = $agent;
- $no_agents = false;
- }
- } else {
- if ($agent_clean == io_safe_output($agent)) {
- $agents_in_item[$id]['name'] = $agent;
- $no_agents = false;
- break;
- }
- }
- }
- }
-
- $no_modules = true;
- if (isset($item->module)) {
- $module_clean = str_replace(['[', ']'], '', $item->module);
- $regular_expresion = ($module_clean != $item->module);
-
- foreach ($agents_in_item as $id => $agent) {
- $modules = db_get_all_rows_filter(
- 'tagente_modulo',
- ['id_agente' => $id],
- [
- 'id_agente_modulo',
- 'nombre',
- ]
- );
-
- $modules_in_item = [];
- foreach ($modules as $module) {
- if ($regular_expresion) {
- if ((bool) preg_match('/'.$module_clean.'/', io_safe_output($module['nombre']))) {
- $modules_in_item[$module['id_agente_modulo']] = $module['nombre'];
- $no_modules = false;
- }
- } else {
- if ($module_clean == io_safe_output($module['nombre'])) {
- $modules_in_item[$module['id_agente_modulo']] = $module['nombre'];
- $no_modules = false;
- break;
- }
- }
- }
-
- $agents_in_item[$id]['modules'] = $modules_in_item;
- }
- }
-
- $values = [];
-
- $values['id_layout'] = $id_visual_map;
- if (isset($item->label)) {
- $values['label'] = io_safe_input($item->label);
- }
-
- if (isset($item->x)) {
- $values['pos_x'] = (string) $item->x;
- }
-
- if (isset($item->y)) {
- $values['pos_y'] = (string) $item->y;
- }
-
- if (isset($item->height)) {
- $values['height'] = (string) $item->height;
- }
-
- if (isset($item->width)) {
- $values['width'] = (string) $item->width;
- }
-
- if (isset($item->image)) {
- $values['image'] = (string) $item->image;
- }
-
- if (isset($item->period)) {
- $values['period'] = (string) $item->period;
- }
-
- if (isset($item->parent_item)) {
- // Hack for link the items use the
'.__('Here you can upload a resource template in .ptr format.').'
'.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'
'.__('You can get more resurces in our Public Resource Library')
- );
-
- $table = new stdClass();
- $table->class = 'databox filter-table-adv';
- $table->id = 'resource_registration_table';
-
- $table->data = [];
-
- $table->data[0][] = html_print_label_input_block(
- __('File to upload'),
- html_print_input_file('resource_upload', true)
- );
-
- $table->data[0][] = html_print_label_input_block(
- __('Group filter'),
- html_print_select_groups(false, 'AW', true, 'group', '', '', __('All'), 0, true)
- );
-
- // Upload form.
- echo '
"; - echo ' | '.__('Group filter: ').' | '; - echo ''; - html_print_select_groups(false, 'AW', true, 'group'); - echo ' | '; - echo ""; - echo ' |