diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index ee0f6d119d..62a75398c0 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-240207
+Version: 7.0NG.775-240213
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 157318b744..16ea70e4ba 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-240207"
+pandora_version="7.0NG.775-240213"
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 417ff01de6..fa4905c59d 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 => '240207';
+use constant AGENT_BUILD => '240213';
# 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 0daaad573f..8611d0250a 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 240207
+%define release 240213
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 f17d3385b7..442c7f3716 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 240207
+%define release 240213
%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 fd8eaa717c..6a0feb31ba 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 240207
+%define release 240213
%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 77ffa9603e..36c9775b6d 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 240207
+%define release 240213
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 df8a8298ab..40fe5e15df 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 240207
+%define release 240213
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 af838ca3e9..2acd20d575 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="240207"
+PI_BUILD="240213"
OS_NAME=`uname -s`
FORCE=0
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 20ceb59ecc..d49e9592a0 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
-{240207}
+{240213}
ViewReadme
{Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 5d63022c43..c22d598bf7 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 240207")
+#define PANDORA_VERSION ("7.0NG.775 Build 240213")
string pandora_path;
string pandora_dir;
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index f4a25d4253..826c2ea570 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 240207))"
+ VALUE "ProductVersion", "(7.0NG.775(Build 240213))"
VALUE "FileVersion", "1.0.0.0"
END
END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index 6db9add67d..71a05113e0 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-console
-Version: 7.0NG.775-240207
+Version: 7.0NG.775-240213
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 da77fff309..277343f1de 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-240207"
+pandora_version="7.0NG.775-240213"
package_pear=0
package_pandora=1
diff --git a/pandora_console/extras/mr/68.sql b/pandora_console/extras/mr/68.sql
index 67ce78c9bc..aa815a869a 100644
--- a/pandora_console/extras/mr/68.sql
+++ b/pandora_console/extras/mr/68.sql
@@ -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,4 +56,11 @@ 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');
+
COMMIT;
\ No newline at end of file
diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php
index fe44b479a9..f0c58035e9 100644
--- a/pandora_console/godmode/agentes/agent_manager.php
+++ b/pandora_console/godmode/agentes/agent_manager.php
@@ -675,6 +675,19 @@ if (enterprise_installed()) {
}
}
+ if ($id_os === '1') {
+ $modules = $agent_plugin->getModules();
+ foreach ($modules as $key => $row) {
+ if (preg_match('/Syslog/', $row['raw']) === 1) {
+ if ($row['disabled'] === 1) {
+ $enable_log_collector = 0;
+ } else {
+ $enable_log_collector = 1;
+ }
+ }
+ }
+ }
+
if ($id_os === '9') {
$modules = $agent_plugin->getModules();
foreach ($modules as $key => $row) {
diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php
index c2e3a2f4f6..a10833081c 100644
--- a/pandora_console/godmode/agentes/configurar_agente.php
+++ b/pandora_console/godmode/agentes/configurar_agente.php
@@ -1299,8 +1299,11 @@ if ($update_agent) {
}
$modules = $agent->getModules();
+
foreach ($modules as $key => $row) {
- if (preg_match('/PandoraAgent_log/', $row['raw']) === 1) {
+ if (preg_match('/PandoraAgent_log/', $row['raw']) === 1
+ || ($id_os === 1 && preg_match('/Syslog/', $row['raw']) === 1)
+ ) {
if ($enable_log_collector === 1) {
if ($row['disabled'] === 1) {
$agent->enableModule($row['module_name'], $row);
diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php
index 82698266a1..9a57ef9d53 100755
--- a/pandora_console/godmode/massive/massive_edit_agents.php
+++ b/pandora_console/godmode/massive/massive_edit_agents.php
@@ -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],
diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php
index 23a284caf9..1589f33fc9 100644
--- a/pandora_console/godmode/servers/servers.build_table.php
+++ b/pandora_console/godmode/servers/servers.build_table.php
@@ -115,7 +115,7 @@ foreach ($servers as $server) {
$table->cellclass[] = [
3 => 'progress_bar',
- 8 => 'table_action_buttons',
+ 9 => 'table_action_buttons',
];
$data[0] = ''.strip_tags($server['name']).'';
diff --git a/pandora_console/godmode/setup/os.builder.php b/pandora_console/godmode/setup/os.builder.php
index 6313aa3edd..4f7b77099b 100644
--- a/pandora_console/godmode/setup/os.builder.php
+++ b/pandora_console/godmode/setup/os.builder.php
@@ -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;
}
diff --git a/pandora_console/godmode/setup/os.php b/pandora_console/godmode/setup/os.php
index dcfe95ecdb..403232c868 100644
--- a/pandora_console/godmode/setup/os.php
+++ b/pandora_console/godmode/setup/os.php
@@ -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');
diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php
index 3754df5e12..f8a3ba8c77 100644
--- a/pandora_console/godmode/users/configure_user.php
+++ b/pandora_console/godmode/users/configure_user.php
@@ -1585,12 +1585,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."'");
- if (isset($select[0]['autorefresh_white_list']) === true) {
- $autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
- } else {
- $autorefresh_list = 0;
- }
-
+ $autorefresh_list = json_decode(($select[0]['autorefresh_white_list'] ?? ''));
if ($autorefresh_list === null || $autorefresh_list === 0) {
$autorefresh_list = [];
$autorefresh_list[0] = __('None');
diff --git a/pandora_console/images/widgets/GisMap.png b/pandora_console/images/widgets/GisMap.png
new file mode 100644
index 0000000000..0cbfbf37b6
Binary files /dev/null and b/pandora_console/images/widgets/GisMap.png differ
diff --git a/pandora_console/include/ajax/dashboard.ajax.php b/pandora_console/include/ajax/dashboard.ajax.php
index 40497a2ebc..b4bc158ecf 100644
--- a/pandora_console/include/ajax/dashboard.ajax.php
+++ b/pandora_console/include/ajax/dashboard.ajax.php
@@ -117,12 +117,25 @@ if ($method === 'draw') {
$where_name = 'name LIKE "%'.$filter['free_search'].'%"';
}
+ if (is_user_admin($config['id_user']) === false) {
+ $group_list = \users_get_groups(
+ $config['id_ser'],
+ 'RR',
+ true
+ );
+ }
+
$where_group = '';
if (empty($filter['group']) === false && $filter['group'] !== '0') {
$where_group = sprintf('id_group = %s', $filter['group']);
if (empty($where_name) === false) {
$where_group = 'AND '.$where_group;
}
+ } else if (empty($group_list) === false) {
+ $where_group = sprintf('id_group IN (%s)', implode(',', array_keys($group_list)));
+ if (empty($where_name) === false) {
+ $where_group = 'AND '.$where_group;
+ }
}
$where = '';
diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php
index e5a2f5018c..a3c6bcc092 100644
--- a/pandora_console/include/auth/mysql.php
+++ b/pandora_console/include/auth/mysql.php
@@ -572,7 +572,7 @@ 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'] = (string) $order['field'].' '.(string) $order['order'];
diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php
index 265c84b75c..5475a54238 100644
--- a/pandora_console/include/config_process.php
+++ b/pandora_console/include/config_process.php
@@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
-$build_version = 'PC240207';
+$build_version = 'PC240213';
$pandora_version = 'v7.0NG.775';
// Do not overwrite default timezone set if defined.
diff --git a/pandora_console/include/functions_io.php b/pandora_console/include/functions_io.php
index dd8dd1f6dc..cb6b5163ac 100755
--- a/pandora_console/include/functions_io.php
+++ b/pandora_console/include/functions_io.php
@@ -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('\\', '\', $valueHtmlEncode);
diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php
index d145393c19..dbe8b6ba7f 100755
--- a/pandora_console/include/functions_ui.php
+++ b/pandora_console/include/functions_ui.php
@@ -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 = "";
diff --git a/pandora_console/include/lib/Dashboard/Widgets/GisMap.php b/pandora_console/include/lib/Dashboard/Widgets/GisMap.php
new file mode 100644
index 0000000000..3cb967cf8c
--- /dev/null
+++ b/pandora_console/include/lib/Dashboard/Widgets/GisMap.php
@@ -0,0 +1,541 @@
+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 .= '