#9107 conflict resolved

This commit is contained in:
Daniel Maya 2022-08-29 10:13:39 +02:00
commit 53cbb4d3da
131 changed files with 151768 additions and 101427 deletions

View File

@ -72,7 +72,7 @@ check_pre_pandora () {
export MYSQL_PWD=$DBPASS
echo -en "${cyan}Checking environment ... ${reset}"
rpm -qa | grep pandora &>> /dev/null && local fail=true
rpm -qa | grep 'pandorafms_' &>> /dev/null && local fail=true
[ -d "$PANDORA_CONSOLE" ] && local fail=true
[ -f /usr/bin/pandora_server ] && local fail=true
echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true

View File

@ -76,7 +76,7 @@ check_pre_pandora () {
export MYSQL_PWD=$DBPASS
echo -en "${cyan}Checking environment ... ${reset}"
rpm -qa | grep pandora &>> /dev/null && local fail=true
rpm -qa | grep 'pandorafms_' &>> /dev/null && local fail=true
[ -d "$PANDORA_CONSOLE" ] && local fail=true
[ -f /usr/bin/pandora_server ] && local fail=true
echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true
@ -350,8 +350,8 @@ vmware_dependencies=" \
perl-Crypt-Random-Seed \
perl-Math-Random-ISAAC \
perl-JSON \
perl-Crypt-SSLeay \
http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm \
http://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm \
http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm"
execute_cmd "dnf install -y $vmware_dependencies" "Installing SDK VMware perl dependencies"

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, AIX version
# Version 7.0NG.764, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, FreeBSD Version
# Version 7.0NG.764, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, HP-UX Version
# Version 7.0NG.764, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, Solaris Version
# Version 7.0NG.764, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.763
# Version 7.0NG.764
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.763, AIX version
# Version 7.0NG.764, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.763
# Version 7.0NG.764
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.763, HPUX Version
# Version 7.0NG.764, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763
# Version 7.0NG.764
# Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763
# Version 7.0NG.764
# Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763
# Version 7.0NG.764
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.763, Solaris version
# Version 7.0NG.764, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, AIX version
# Version 7.0NG.764, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.763-220715
Version: 7.0NG.764-220829
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.763-220715"
pandora_version="7.0NG.764-220829"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
@ -61,7 +61,7 @@ chmod 755 -R temp_package/DEBIAN
#cp -aRf * temp_package/usr/share/pandora_agent/
#but don't copy recursive the temp_package into temp_package
for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v HP-UX | grep -v SunOS | grep -v temp_package`
for item in `ls | grep -v NT4 | grep -v AIX | grep -v FreeBSD | grep -v NetBSD | grep -v HP-UX | grep -v SunOS | grep -v Darwin | grep -v OpenWRT | grep -v pandorafms.agent_unix | grep -v temp_package`
do
#if [ \( $item != 'temp_package' \) -a \( $item != 'NT4' \) ]
#then
@ -133,9 +133,9 @@ echo "END"
echo "Make the package \"Pandorafms agent\"."
if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package
eval $DPKG_DEB --root-owner-group --build temp_package
else
dpkg-deb --build temp_package
dpkg-deb --root-owner-group --build temp_package
fi
mv temp_package.deb pandorafms.agent_unix_$pandora_version.deb

View File

@ -31,7 +31,7 @@ fi
if [ "$#" -ge 2 ]; then
VERSION="$2"
else
VERSION="7.0NG.763"
VERSION="7.0NG.764"
fi
# Path for the generated DMG file

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.763" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.764" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.763" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.764" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" />
<script>
<![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.763</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.763 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.763</string>
<key>CFBundleVersion</key> <string>7.0NG.764</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.764 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.764</string>
<key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, FreeBSD Version
# Version 7.0NG.764, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, HP-UX Version
# Version 7.0NG.764, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, NetBSD Version
# Version 7.0NG.764, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, Solaris Version
# Version 7.0NG.764, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1014,8 +1014,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.763';
use constant AGENT_BUILD => '220715';
use constant AGENT_VERSION => '7.0NG.764';
use constant AGENT_BUILD => '220829';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.763
%define release 220715
%define version 7.0NG.764
%define release 220829
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.763
%define release 220715
%define version 7.0NG.764
%define release 220829
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.763"
PI_BUILD="220715"
PI_VERSION="7.0NG.764"
PI_BUILD="220829"
OS_NAME=`uname -s`
FORCE=0

View File

@ -7,4 +7,7 @@
compress
notifempty
copytruncate
postrotate
/bin/systemctl restart pandora_agent_daemon
endscript
}

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.763
# Version 7.0NG.764
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.763}
{Pandora FMS Windows Agent v7.0NG.764}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{220715}
{220829}
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.763 Build 220715")
#define PANDORA_VERSION ("7.0NG.764 Build 220829")
string pandora_path;
string pandora_dir;

View File

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

View File

@ -1 +0,0 @@
/var/www/pandora_console/include/config.php

View File

@ -1,10 +1,10 @@
package: pandorafms-console
Version: 7.0NG.763-220715
Version: 7.0NG.764-220829
Architecture: all
Priority: optional
Section: admin
Installed-Size: 42112
Maintainer: Artica ST <deptec@artica.es>
Homepage: http://pandorafms.org/
Depends: php | php7.2, php7.2-snmp | php-snmp, php7.2-gd | php-gd, php7.2-mysqlnd | php-mysqlnd, php-db, php7.2-xmlrpc | php-xmlrpc, php-gettext, php7.2-curl | php-curl, graphviz, dbconfig-common, php7.2-ldap | php-ldap, mysql-client | virtual-mysql-client, php-xmlrpc, php7.2-zip | php-zip
Homepage: https://pandorafms.com/
Depends: php, php-snmp, php-gd, php-mysqlnd, php-db, php-xmlrpc, php-curl, graphviz, dbconfig-common, php-ldap, mysql-client | virtual-mysql-client, php-xmlrpc, php-zip, php-mbstring
Description: Pandora FMS is an Open Source monitoring tool. It monitor your systems and applications, and allows you to control the status of any element of them. The web console is the graphical user interface (GUI) to manage the pool and to generate reports and graphs from the Pandora FMS monitoring process.

View File

@ -1,6 +1,6 @@
#!/bin/bash
#Pandora FMS- http:#pandorafms.com
#Pandora FMS - https://pandorafms.com
# ==================================================
# Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
# Please see http:#pandorafms.org for full contribution list
@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.763-220715"
pandora_version="7.0NG.764-220829"
package_pear=0
package_pandora=1
@ -94,17 +94,19 @@ echo "Make a \"temp_package\" temporary dir for job."
mkdir -p temp_package
if [ $package_pandora -eq 1 ]
then
mkdir -p temp_package/var/www/pandora_console
mkdir -p temp_package/var/www/html/pandora_console
mkdir -p temp_package/var/log/pandora
mkdir -p temp_package/etc/logrotate.d
mkdir -p temp_package/etc/init.d
echo "Make directory system tree for package."
cp -R $(ls | grep -v temp_package | grep -v DEBIAN ) temp_package/var/www/pandora_console
cp -R $(ls | grep -v temp_package | grep -v DEBIAN | grep -v pandorafms.console_$pandora_version.deb) temp_package/var/www/html/pandora_console
cp -R DEBIAN temp_package
cp -aRf pandora_console_logrotate_ubuntu temp_package/etc/logrotate.d/pandora_console
find temp_package/var/www/pandora_console -name ".svn" | xargs rm -Rf
rm -Rf temp_package/var/www/pandora_console/pandora_console.spec
cp -aRf pandora_websocket_engine temp_package/etc/init.d/
find temp_package/var/www/html/pandora_console -name ".svn" | xargs rm -Rf
rm -Rf temp_package/var/www/html/pandora_console/pandora_console.spec
chmod 755 -R temp_package/DEBIAN
touch temp_package/var/www/pandora_console/include/config.php
echo "Remove the SVN files and other temp files."
@ -128,30 +130,31 @@ then
echo "END"
echo "Calculate md5sum for md5sums package control file."
for item in `find temp_package`
FILES=`find temp_package`
while read item
do
echo -n "."
if [ ! -d $item ]
if [ ! -d "$item" ]
then
echo $item | grep "DEBIAN" > /dev/null
echo "$item" | grep "DEBIAN" > /dev/null
#last command success
if [ $? -eq 1 ]
then
md5=`md5sum $item | cut -d" " -f1`
md5=`md5sum "$item" | cut -d" " -f1`
#delete "temp_package" in the path
final_path=${item#temp_package}
echo $md5" "$final_path >> temp_package/DEBIAN/md5sums
fi
fi
done
done < <(echo "$FILES")
echo "END"
echo "Make the package \"Pandorafms console\"."
if [ "$USE_DOCKER_APP" == "1" ]; then
eval $DPKG_DEB --build temp_package
eval $DPKG_DEB --root-owner-group --build temp_package
else
dpkg-deb --build temp_package
dpkg-deb --root-owner-group --build temp_package
fi
mv temp_package.deb pandorafms.console_$pandora_version.deb
fi

View File

@ -1,20 +1,15 @@
#!/bin/bash
echo Change the user and group to /var/www/pandora_console.
chmod -R u+rwX,g+rX,g-w,o-rwx /var/www/pandora_console
chgrp www-data /var/www/pandora_console -R
chown www-data /var/www/pandora_console -R
if [ -d /var/www/html ]; then mv /var/www/pandora_console /var/www/html/; fi
echo Change the user and group to /var/www/html/pandora_console.
chmod -R u+rwX,g+rX,g-w,o-rwx /var/www/html/pandora_console
chgrp www-data /var/www/html/pandora_console -R
chown www-data /var/www/html/pandora_console -R
if [ -f /etc/init.d/apache2 ]; then
echo Restart the apache.
/etc/init.d/apache2 restart
fi
# Install pandora_websocket_engine service.
cp -pf %{prefix}/pandora_console/pandora_websocket_engine /etc/init.d/
chmod +x /etc/init.d/pandora_websocket_engine
echo "You can now start the Pandora FMS Websocket service by executing"
echo " /etc/init.d/pandora_websocket_engine start"

View File

@ -43,20 +43,11 @@ function dbmanager_query($sql, &$error, $dbconnection)
$error = mysqli_error($dbconnection);
return false;
}
} else {
$result = mysql_query($sql, $dbconnection);
if ($result === false) {
$backtrace = debug_backtrace();
$error = mysql_error();
return false;
}
}
if ($result === true) {
if ($config['mysqli']) {
return mysqli_affected_rows($dbconnection);
} else {
return mysql_affected_rows();
}
}
@ -64,23 +55,17 @@ function dbmanager_query($sql, &$error, $dbconnection)
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
array_push($retval, $row);
}
} else {
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
array_push($retval, $row);
}
}
if ($config['mysqli']) {
mysqli_free_result($result);
} else {
mysql_free_result($result);
}
if (! empty($retval)) {
return $retval;
}
// Return false, check with === or !==
// Return false, check with === or !== .
return 'Empty';
}
@ -171,20 +156,6 @@ function dbmgr_extension_main()
$data[1][0] = "Some samples of usage: <blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>";
\enterprise_include_once('include/functions_metaconsole.php');
$servers = \metaconsole_get_servers();
if (is_array($servers) === true) {
$servers = array_reduce(
$servers,
function ($carry, $item) {
$carry[$item['id']] = $item['server_name'];
return $carry;
}
);
} else {
$servers = [];
}
$data[2][0] = html_print_textarea(
'sql',
5,
@ -195,6 +166,21 @@ function dbmgr_extension_main()
);
if (is_metaconsole() === true) {
// Get the servers.
\enterprise_include_once('include/functions_metaconsole.php');
$servers = \metaconsole_get_servers();
if (is_array($servers) === true) {
$servers = array_reduce(
$servers,
function ($carry, $item) {
$carry[$item['id']] = $item['server_name'];
return $carry;
}
);
} else {
$servers = [];
}
$data[3][2] = html_print_input(
[
'name' => 'node_id',
@ -223,7 +209,7 @@ function dbmgr_extension_main()
html_print_table($table);
echo '</form>';
// Processing SQL Code
// Processing SQL Code.
if ($sql == '') {
return;
}
@ -271,7 +257,7 @@ function dbmgr_extension_main()
return;
}
if (! is_array($result)) {
if (is_array($result) === false) {
echo '<strong>Output: <strong>'.$result;
db_pandora_audit(
@ -315,11 +301,10 @@ if (is_metaconsole() === true) {
);
extensions_add_meta_function('dbmgr_extension_main');
} else {
}
// This adds a option in the operation menu
// This adds a option in the operation menu.
extensions_add_godmode_menu_option(__('DB interface'), 'PM', 'gextensions', 'dbmanager/icon.png', 'v1r1', 'gdbman');
// This sets the function to be called when the extension is selected in the operation menu
// This sets the function to be called when the extension is selected in the operation menu.
extensions_add_godmode_function('dbmgr_extension_main');

View File

@ -38,4 +38,12 @@ ALTER TABLE `tautoconfig` ADD COLUMN `executed` TINYINT UNSIGNED NOT NULL DEFAUL
ALTER TABLE `tusuario` DROP COLUMN `metaconsole_assigned_server`;
ALTER TABLE `tagente` ADD COLUMN `fixed_ip` TINYINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tmetaconsole_agent` ADD COLUMN `fixed_ip` TINYINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tipam_network` DROP FOREIGN KEY `tipam_network_ibfk_1`;
ALTER TABLE `tipam_network` MODIFY COLUMN `id_recon_task` INT UNSIGNED DEFAULT 0;
ALTER TABLE `tipam_network` ADD CONSTRAINT `tipam_network_ibfk_1` FOREIGN KEY (`id_recon_task`) REFERENCES trecon_task(`id_rt`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `tevent_filter` ADD COLUMN `search_secondary_groups` INT NOT NULL DEFAULT 0;
COMMIT;

View File

@ -0,0 +1,6 @@
START TRANSACTION;
SET @id_config := (SELECT id_config FROM tconfig WHERE `token` = 'metaconsole_node_id' AND `value` IS NOT NULL ORDER BY id_config DESC LIMIT 1);
DELETE FROM tconfig WHERE `token` = 'metaconsole_node_id' AND (id_config < @id_config OR `value` IS NULL);
COMMIT;

View File

@ -436,9 +436,22 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
);
$header_logout .= '</a></div>';
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
if (is_reporting_console_node() === true) {
echo '<div class="header_left">';
echo '<span class="header_title">';
echo $config['custom_title_header'];
echo '</span>';
echo '<span class="header_subtitle">';
echo $config['custom_subtitle_header'];
echo '</span>';
echo '</div>';
echo '<div class="header_center"></div>';
echo '<div class="header_right">'.$header_support, $header_docu, $header_user, $header_logout.'</div>';
} else {
echo '<div class="header_left"><span class="header_title">'.$config['custom_title_header'].'</span><span class="header_subtitle">'.$config['custom_subtitle_header'].'</span></div>
<div class="header_center">'.$header_searchbar.'</div>
<div class="header_right">'.$header_autorefresh, $header_autorefresh_counter, $header_discovery, $servers_list, $header_feedback, $header_support, $header_docu, $header_user, $header_logout.'</div>';
}
?>
</div> <!-- Closes #table_header_inner -->
</div> <!-- Closes #table_header -->
@ -925,7 +938,9 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
layout: '%M%nn%M:%S%nn%S',
labels: ['', '', '', '', '', '', ''],
onExpiry: function () {
dt_events.draw(false);
$("#table_events")
.DataTable()
.draw(false);
}
});
}

View File

@ -58,6 +58,10 @@ if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_men
// Start of full lateral menu.
echo sprintf('<div id="menu_full" class="menu_full_%s">', $menuTypeClass);
$url_logo = ui_get_full_url('index.php');
if (is_reporting_console_node() === true) {
$url_logo = 'index.php?logged=1&sec=discovery&sec2=godmode/servers/discovery&wiz=tasklist';
}
// Header logo.
html_print_div(
@ -65,7 +69,7 @@ html_print_div(
'class' => 'logo_green',
'content' => html_print_anchor(
[
'href' => ui_get_full_url('index.php'),
'href' => $url_logo,
'content' => html_print_header_logo_image(
$menuCollapsed,
true

View File

@ -1,98 +1,115 @@
<html>
<head>
<style>
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/pandora_minimal.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/js/jquery-ui.min.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/js/jquery-ui_custom.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/select2.min.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $config['homeurl']; ?>include/styles/pandora.css" type="text/css" />
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/jquery.current.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/jquery.pandora.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/jquery-ui.min.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/select2.min.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/pandora.js'></script>
<script type='text/javascript' src='<?php echo $config['homeurl']; ?>include/javascript/pandora_ui.js'></script>
#alert_messages_na{
z-index:2;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
width:650px;
height: 400px;
background:white;
background-image:url('images/imagen-no-acceso.jpg');
background-repeat:no-repeat;
justify-content: center;
display: flex;
flex-direction: column;
box-shadow:4px 5px 10px 3px rgba(0, 0, 0, 0.4);
}
<style>
#alert_messages_na {
z-index: 2;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
width: 650px;
height: 400px;
background: white;
background-repeat: no-repeat;
justify-content: center;
display: flex;
flex-direction: column;
box-shadow: 4px 5px 10px 3px rgba(0, 0, 0, 0.4);
}
.modalheade{
text-align:center;
width:100%;
position:absolute;
top:0;
}
.modalheadertex{
color:#000;
line-height: 40px;
font-size: 23pt;
margin-bottom:30px;
}
.modalclose{
cursor:pointer;
display:inline;
float:right;
margin-right:10px;
margin-top:10px;
}
.modalconten{
color:black;
width:300px;
margin-left: 30px;
}
.modalcontenttex{
text-align:left;
color:black;
font-size: 11pt;
line-height:13pt;
margin-bottom:30px;
}
.modalokbutto{
cursor:pointer;
text-align:center;
display: inline-block;
padding: 6px 45px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color:white;
border: 1px solid #82b92e;
}
.modalokbuttontex{
color:#82b92e;
font-size:13pt;
}
.modalgobutto{
cursor:pointer;
text-align:center;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color:white;
border: 1px solid #82b92e;
}
.modalgobuttontex{
color:#82b92e;
font-size:10pt;
}
.modalheade {
text-align: center;
width: 100%;
position: absolute;
top: 0;
}
.modalheadertex {
color: #000;
line-height: 40px;
font-size: 23pt;
margin-bottom: 30px;
}
.modalclose {
cursor: pointer;
display: inline;
float: right;
margin-right: 10px;
margin-top: 10px;
}
.modalconten {
color: black;
width: 300px;
margin-left: 30px;
}
.modalcontenttex {
text-align: left;
color: black;
font-size: 11pt;
line-height: 13pt;
margin-bottom: 30px;
}
.modalokbutto {
cursor: pointer;
text-align: center;
display: inline-block;
padding: 6px 45px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color: white;
border: 1px solid #82b92e;
}
.modalokbuttontex {
color: #82b92e;
font-size: 13pt;
}
.modalgobutto {
cursor: pointer;
text-align: center;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color: white;
border: 1px solid #82b92e;
}
.modalgobuttontex {
color: #82b92e;
font-size: 10pt;
}
#opacidad{
position:fixed;
background:black;
opacity:0.6;
z-index:-1;
left:0px;
top:0px;
width:100%;
height:100%;
}
/*
#opacidad {
position: fixed;
background: black;
opacity: 0.6;
z-index: -1;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
/*
.textodialog{
margin-left: 0px;
color:#333;
@ -118,16 +135,16 @@ font-size:10pt;
</style>
</head>
<body>
<div id="alert_messages_na">
<div id="alert_messages_na" style='background-image: url(<?php echo ui_get_full_url('images/imagen-no-acceso.jpg', false, false, false); ?>)'>
<div class='modalheade'>
<img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>
<img class='modalclose cerrar' src='<?php echo $config['homeurl']; ?>images/input_cross.png'>
</div>
<div class='modalconten'>
<div class='modalheadertex'>
<?php echo __("You don't have access to this page"); ?>
<div class='modalheadertex' style='font-size: 23pt'>
<?php echo __('You do not have access to this page'); ?>
</div>
<div class='modalcontenttex'>
@ -141,7 +158,6 @@ font-size:10pt;
}
}
?>
</div>
<div class='modalokbutto cerrar'>
@ -149,18 +165,14 @@ font-size:10pt;
</div>
</div>
</div>
<div id="opacidad"></div>
</body>
</html>
<script>
$(".cerrar").click(function(){
window.location=".";
$(".cerrar").click(function() {
window.location = "<?php echo $config['homeurl']; ?>";
});
$('div#page').css('background-color','#d3d3d3');
</script>
$('div#page').css('background-color', '#d3d3d3');
</script>

View File

@ -0,0 +1,103 @@
<?php
/**
* Static page to lock access to console but console reporting
*
* @category Reporting
* @package Pandora FMS
* @subpackage Applications
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 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.
* ============================================================================
*/
global $config;
// Begin.
echo ui_require_css_file('maintenance', 'include/styles/', true);
$data = [];
$data['id_node'] = $config['metaconsole_node_id'];
$data['check_ver'] = $config['current_package'];
$data['check_mr'] = $config['MR'];
$data['collection_max_size'] = $config['collection_max_size'];
$data['check_post_max_size'] = ini_get('post_max_size');
$data['check_upload_max_filesize'] = ini_get('upload_max_filesize');
$data['check_memory_limit'] = ini_get('memory_limit');
$data['check_php_version'] = phpversion();
?>
<html>
<body class="responsive-height">
<div class="responsive center padding-6">
<p><?php echo __('Console only reporting node'); ?></p>
<br>
<br>
<?php
html_print_image(
'images/maintenance.png',
false,
[
'class' => 'responsive',
'width' => 800,
]
);
?>
<br>
<br>
<p><?php echo __('Info'); ?></p>
<ul class="container-list">
<li>
<span class=title>
<?php echo __('Version'); ?>:
</span>
<span>
<?php echo $config['current_package']; ?>
</span>
</li>
<li>
<span class=title>
<?php echo __('Mr'); ?>:
</span>
<span>
<?php echo $config['MR']; ?>
</span>
</li>
<li>
<span class=title>
<?php echo __('Memory limit'); ?>:
</span>
<span>
<?php echo ini_get('memory_limit'); ?>
</span>
</li>
<li>
<span class=title>
<?php echo __('Php version'); ?>:
</span>
<span>
<?php echo phpversion(); ?>
</span>
</li>
</ul>
</div>
</body>
</html>

View File

@ -302,6 +302,15 @@ $table_ip = '<div class="label_select"><p class="input_label">'.__('IP Address')
$table_ip .= '<div class="label_select_parent">';
$table_ip .= '<div class="label_select_child_left">'.html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).'</div>';
$table_ip .= '<div class="label_select_child_right">'.html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true).__('Unique IP').'</div>';
$table_ip .= '<div class="label_select_child_right">'.html_print_input(
[
'type' => 'switch',
'id' => 'fixed_ip',
'name' => 'fixed_ip',
'value' => $fixed_ip,
]
).__('Fix IP address').ui_print_help_tip(__('Avoid automatic IP address update when agent IP changes.'), true).'</div>';
$table_ip .= '</div></div>';
if ($id_agente) {
@ -1114,5 +1123,19 @@ ui_require_jquery_file('bgiframe');
}
$("#text-agente").prop('readonly', true);
// Disable fixed ip button if empty.
if($("#text-direccion").val() == '') {
$("#fixed_ip").prop('disabled',true);
}
$("#text-direccion").on('input',function(e){
if($("#text-direccion").val() == '') {
$("#fixed_ip").prop('disabled',true);
} else {
$("#fixed_ip").prop('disabled',false);
}
});
});
</script>

View File

@ -173,6 +173,7 @@ $url_description = '';
$quiet = 0;
$macros = '';
$cps = 0;
$fixed_ip = 0;
$create_agent = (bool) get_parameter('create_agent');
$module_macros = [];
@ -225,6 +226,7 @@ if ($create_agent) {
$url_description = (string) get_parameter('url_description');
$quiet = (int) get_parameter('quiet', 0);
$cps = (int) get_parameter_switch('cps', -1);
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
$secondary_groups = (string) get_parameter('secondary_hidden', '');
$fields = db_get_all_fields_in_table('tagent_custom_fields');
@ -282,6 +284,7 @@ if ($create_agent) {
'url_address' => $url_description,
'quiet' => $quiet,
'cps' => $cps,
'fixed_ip' => $fixed_ip,
]
);
enterprise_hook('update_agent', [$id_agente]);
@ -326,7 +329,7 @@ if ($create_agent) {
"Update GIS data":"'.$update_gis_data.'",
"Url description":"'.$url_description.'",
"Quiet":"'.(int) $quiet.'",
"Cps":"'.(int) $cps.'"}';
"Cps":"'.(int) $cps.'",}';
// Create the secondary groups.
enterprise_hook(
@ -987,6 +990,7 @@ if ($update_agent) {
$fields = db_get_all_fields_in_table('tagent_custom_fields');
$secondary_groups = (string) get_parameter('secondary_hidden', '');
$satellite_server = (int) get_parameter('satellite_server', 0);
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
if ($fields === false) {
$fields = [];
@ -1095,6 +1099,7 @@ if ($update_agent) {
'cps' => $cps,
'safe_mode_module' => $safe_mode_module,
'satellite_server' => $satellite_server,
'fixed_ip' => $fixed_ip,
];
if ($config['metaconsole_agent_cache'] == 1) {
@ -1234,6 +1239,7 @@ if ($id_agente) {
$safe_mode_module = $agent['safe_mode_module'];
$safe_mode = ($safe_mode_module) ? 1 : 0;
$satellite_server = (int) $agent['satellite_server'];
$fixed_ip = (int) $agent['fixed_ip'];
}
$update_module = (bool) get_parameter('update_module');

View File

@ -1518,7 +1518,7 @@ $(document).ready (function () {
}
else{
window.open(
'https://pandorafms.com/manual/en/documentation/03_monitoring/03_remote_monitorins#monitoring_through_network_modules_with_snmp',
'https://pandorafms.com/manual/en/documentation/03_monitoring/03_remote_monitoring#monitoring_through_network_modules_with_snmp',
'_blank',
'width=800,height=600'
);

View File

@ -797,13 +797,29 @@ $table = new StdClass();
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->size[0] = '25%';
$table->data[0][0] = __('Group filter');
$table->data[0][1] = html_print_select_groups(false, $access, $return_all_group, 'filter_group', $filter_group, '', '', '', true, false, true, '', false, 'min-width:180px;margin-right:15px;');
$table->data[0][1] = html_print_select_groups(
false,
$access,
$return_all_group,
'filter_group',
$filter_group,
'',
'',
'',
true,
false,
true,
'',
false,
'min-width:180px;margin-right:15px;'
);
$table->data[0][2] = __('Recursion').'&nbsp&nbsp'.html_print_checkbox('recursion', 1, $recursion, true, false, '');
$table->data[1][0] = __('Available agents');
$table->data[1][1] = html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, true, true, true, '', false, 'width: 180px;');
$table->data[1][1] = html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, true, true, true, '', false, 'min-width: 250px;width: 70%;');
if ($type_downtime != 'quiet') {
@ -855,7 +871,7 @@ $table->data[3][1] = html_print_select(
true,
'',
false,
'width: 180px;'
'min-width: 250px;width: 70%;'
);
echo '</div>';

View File

@ -89,6 +89,7 @@ if ($id) {
$tag_without_base64 = base64_encode($tag_without_json_clean);
$filter_only_alert = $filter['filter_only_alert'];
$search_secondary_groups = $filter['search_secondary_groups'];
$custom_data = $filter['custom_data'];
$custom_data_filter_type = $filter['custom_data_filter_type'];
@ -126,6 +127,7 @@ if ($id) {
$tag_without_json = $tag_without_json_clean = json_encode([]);
$tag_without_base64 = base64_encode($tag_without_json);
$filter_only_alert = '';
$search_secondary_groups = 0;
}
if ($update || $create) {
@ -167,6 +169,8 @@ if ($update || $create) {
$tag_without_json = io_safe_input(base64_decode($tag_without_base64));
$filter_only_alert = get_parameter('filter_only_alert', '');
$search_secondary_groups = get_parameter('search_secondary_groups', 0);
$custom_data = get_parameter('custom_data', '');
$custom_data_filter_type = get_parameter('custom_data_filter_type', '');
@ -193,6 +197,7 @@ if ($update || $create) {
'id_extra' => $id_extra,
'user_comment' => $user_comment,
'filter_only_alert' => $filter_only_alert,
'search_secondary_groups' => $search_secondary_groups,
'custom_data' => $custom_data,
'custom_data_filter_type' => $custom_data_filter_type,
];

View File

@ -169,154 +169,6 @@ if ($delete === true) {
}
}
$table = new stdClass;
$table->id = 'delete_table';
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->style = [];
$table->style[0] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold';
$table->size = [];
$table->size[0] = '15%';
$table->size[1] = '35%';
$table->size[2] = '15%';
$table->size[3] = '35%';
$table->data = [];
$table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(
false,
'AW',
true,
'id_group',
$id_group,
false,
'',
'',
true
);
$table->data[0][2] = __('Group recursion');
$table->data[0][3] = html_print_checkbox(
'recursion',
1,
$recursion,
true,
false
);
$status_list = [];
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[1][0] = __('Status');
$table->data[1][1] = html_print_select(
$status_list,
'status_agents',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true
);
$table->data[1][2] = __('Show agents');
$table->data[1][3] = html_print_select(
[
0 => 'Only enabled',
1 => 'Only disabled',
],
'disabled',
2,
'',
__('All'),
2,
true,
false,
true,
'',
false,
'width:30%;'
);
if (is_metaconsole() === true) {
$servers = metaconsole_get_servers();
$server_fields = [];
foreach ($servers as $key => $server) {
$server_fields[$key] = $server['server_name'];
}
$table->data[2][2] = __('Node');
$table->data[2][3] = html_print_select(
$server_fields,
'nodes[]',
0,
false,
'',
'',
true,
true,
true,
'',
false,
'min-width: 500px; max-width: 500px; max-height: 100px',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
);
}
$table->data[3][0] = __('Agents');
$table->data[3][0] .= '<span id="agent_loading" class="invisible">';
$table->data[3][0] .= html_print_image('images/spinner.png', true);
$table->data[3][0] .= '</span>';
$agents = [];
if (is_metaconsole() === false) {
$agents = agents_get_group_agents(
array_keys(users_get_groups($config['id_user'], 'AW', false)),
['disabled' => 2],
'none'
);
}
$table->data[3][1] = html_print_select(
$agents,
'id_agents[]',
0,
false,
'',
'',
true,
true,
true,
'',
false,
'min-width: 500px; max-width: 500px; max-height: 100px',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
);
$url = 'index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents';
if (is_metaconsole() === true) {
@ -324,10 +176,15 @@ if (is_metaconsole() === true) {
}
echo '<form method="post" id="form_agent" action="'.$url.'">';
html_print_table($table);
$params = [
'id_group' => $id_group,
'recursion' => $recursion,
];
echo get_table_inputs_masive_agents($params);
if (is_metaconsole() === true || is_management_allowed() === true) {
attachActionButton('delete', 'delete', $table->width);
attachActionButton('delete', 'delete', '100%');
}
echo '</form>';
@ -342,54 +199,6 @@ ui_require_jquery_file('pandora.controls');
$(document).ready (function () {
// Check Metaconsole.
var metaconsole = '<?php echo (is_metaconsole() === true) ? 1 : 0; ?>';
// Listeners.
var recursion;
$("#checkbox-recursion").click(function () {
recursion = this.checked ? 1 : 0;
$("#id_group").trigger("change");
});
var disabled;
$("#disabled").change(function () {
disabled = this.value;
$("#id_group").trigger("change");
});
var nodes;
$("#nodes").change(function () {
nodes = $("#nodes").val();
$("#id_group").trigger("change");
});
$("#status_agents").change(function() {
$("#id_group").trigger("change");
});
// Build data.
var data = {
status_agents: function () {
return $("#status_agents").val();
},
agentSelect: "select#id_agents",
privilege: "AW",
recursion: function() {
return recursion;
},
disabled: function() {
return disabled;
},
}
if (metaconsole == 1) {
data.serialized = true;
data.serialized_separator = '|';
data.nodes = function() {
return nodes;
};
}
// Change agents.
$("#id_group").pandoraSelectGroupAgent(data);
form_controls_massive_operations_agents(metaconsole);
});
</script>

File diff suppressed because it is too large Load Diff

View File

@ -68,11 +68,6 @@ $options_agents = [
'edit_agents' => __('Bulk agent edit'),
'delete_agents' => __('Bulk agent delete'),
];
if (is_metaconsole() === true) {
$options_agents = [
'delete_agents' => __('Bulk agent delete'),
];
}
if (check_acl($config['id_user'], 0, 'UM')) {
$options_users = [

View File

@ -28,15 +28,18 @@
// Begin.
require_once 'include/config.php';
require_once 'include/functions_menu.php';
check_login();
enterprise_include('godmode/menu.php');
require_once 'include/functions_menu.php';
$access_console_node = !is_reporting_console_node();
$menu_godmode = [];
$menu_godmode['class'] = 'godmode';
if ($access_console_node === true) {
enterprise_include('godmode/menu.php');
}
if ((bool) check_acl($config['id_user'], 0, 'AR') === true
|| (bool) check_acl($config['id_user'], 0, 'AW') === true
|| (bool) check_acl($config['id_user'], 0, 'RR') === true
@ -46,32 +49,35 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
$sub = [];
$sub['godmode/servers/discovery&wiz=main']['text'] = __('Start');
$sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery';
$sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list');
$sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist';
if ((bool) check_acl($config['id_user'], 0, 'AW') === true
|| (bool) check_acl($config['id_user'], 0, 'PM') === true
) {
if ($access_console_node === true) {
if ((bool) check_acl($config['id_user'], 0, 'AW') === true
|| (bool) check_acl($config['id_user'], 0, 'PM') === true
) {
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$sub2 = [];
$sub2['godmode/servers/discovery&wiz=hd&mode=netscan']['text'] = __('Network scan');
enterprise_hook('hostdevices_submenu');
$sub2['godmode/servers/discovery&wiz=hd&mode=customnetscan']['text'] = __('Custom network scan');
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub2['godmode/servers/discovery&wiz=hd&mode=managenetscanscripts']['text'] = __('Manage scan scripts');
}
$sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices');
$sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd';
$sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2;
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$sub2 = [];
$sub2['godmode/servers/discovery&wiz=hd&mode=netscan']['text'] = __('Network scan');
enterprise_hook('hostdevices_submenu');
$sub2['godmode/servers/discovery&wiz=hd&mode=customnetscan']['text'] = __('Custom network scan');
enterprise_hook('applications_menu');
enterprise_hook('cloud_menu');
enterprise_hook('console_task_menu');
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub2['godmode/servers/discovery&wiz=hd&mode=managenetscanscripts']['text'] = __('Manage scan scripts');
}
$sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices');
$sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd';
$sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2;
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
enterprise_hook('applications_menu');
enterprise_hook('cloud_menu');
enterprise_hook('console_task_menu');
}
// Add to menu.
@ -81,309 +87,312 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
$menu_godmode['discovery']['sub'] = $sub;
}
$sub = [];
if ((bool) check_acl($config['id_user'], 0, 'AW') === true || (bool) check_acl($config['id_user'], 0, 'AD') === true) {
$sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents');
$sub['godmode/agentes/modificar_agente']['id'] = 'Manage agents';
$sub['godmode/agentes/modificar_agente']['subsecs'] = ['godmode/agentes/configurar_agente'];
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub['godmode/agentes/fields_manager']['text'] = __('Custom fields');
$sub['godmode/agentes/fields_manager']['id'] = 'Custom fields';
$sub['godmode/modules/manage_nc_groups']['text'] = __('Component groups');
$sub['godmode/modules/manage_nc_groups']['id'] = 'Component groups';
// Category.
$sub['godmode/category/category']['text'] = __('Module categories');
$sub['godmode/category/category']['id'] = 'Module categories';
$sub['godmode/category/category']['subsecs'] = 'godmode/category/edit_category';
$sub['godmode/modules/module_list']['text'] = __('Module types');
$sub['godmode/modules/module_list']['id'] = 'Module types';
$sub['godmode/groups/modu_group_list']['text'] = __('Module groups');
$sub['godmode/groups/modu_group_list']['id'] = 'Module groups';
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
// Netflow.
if ((bool) $config['activate_netflow'] === true) {
$sub['godmode/netflow/nf_edit']['text'] = __('Netflow filters');
$sub['godmode/netflow/nf_edit']['id'] = 'Netflow filters';
}
}
if (empty($sub) === false) {
$menu_godmode['gagente']['text'] = __('Resources');
$menu_godmode['gagente']['sec2'] = 'godmode/agentes/modificar_agente';
$menu_godmode['gagente']['id'] = 'god-resources';
$menu_godmode['gagente']['sub'] = $sub;
}
$sub = [];
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub['godmode/groups/group_list']['text'] = __('Manage agents groups');
$sub['godmode/groups/group_list']['id'] = 'Manage agents groups';
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
// Tag.
$sub['godmode/tag/tag']['text'] = __('Module tags');
$sub['godmode/tag/tag']['id'] = 'Module tags';
$sub['godmode/tag/tag']['subsecs'] = 'godmode/tag/edit_tag';
enterprise_hook('enterprise_acl_submenu');
}
if ((bool) check_acl($config['id_user'], 0, 'UM') === true) {
$sub['godmode/users/user_list']['text'] = __('Users management');
$sub['godmode/users/user_list']['id'] = 'Users management';
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub['godmode/users/profile_list']['text'] = __('Profile management');
$sub['godmode/users/profile_list']['id'] = 'Profile management';
}
if (empty($sub) === false) {
$menu_godmode['gusuarios']['sub'] = $sub;
$menu_godmode['gusuarios']['text'] = __('Profiles');
$menu_godmode['gusuarios']['sec2'] = 'godmode/users/user_list';
$menu_godmode['gusuarios']['id'] = 'god-users';
}
$sub = [];
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub['templates']['text'] = __('Templates');
$sub['templates']['id'] = 'Templates';
$sub['templates']['type'] = 'direct';
$sub['templates']['subtype'] = 'nolink';
$sub2 = [];
$sub2['godmode/modules/manage_module_templates']['text'] = __('Module templates');
$sub2['godmode/modules/manage_module_templates']['id'] = 'Module templates';
$sub2['godmode/modules/private_enterprise_numbers']['text'] = __('Private Enterprise Numbers');
$sub2['godmode/modules/private_enterprise_numbers']['id'] = 'Private Enterprise Numbers';
$sub2['enterprise/godmode/modules/local_components']['text'] = __('Local components');
$sub2['enterprise/godmode/modules/local_components']['id'] = 'Local components';
$sub2['godmode/modules/manage_network_components']['text'] = __('Remote components');
$sub2['godmode/modules/manage_network_components']['id'] = 'Network components';
$sub['templates']['sub2'] = $sub2;
enterprise_hook('inventory_submenu');
enterprise_hook('autoconfiguration_menu');
enterprise_hook('agent_repository_menu');
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
enterprise_hook('policies_menu');
enterprise_hook('agents_submenu');
}
if ((bool) check_acl($config['id_user'], 0, 'NW') === true) {
enterprise_hook('agents_ncm_submenu');
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$sub['gmassive']['text'] = __('Bulk operations');
$sub['gmassive']['id'] = 'Bulk operations';
$sub['gmassive']['type'] = 'direct';
$sub['gmassive']['subtype'] = 'nolink';
$sub2 = [];
$sub2['godmode/massive/massive_operations&amp;tab=massive_agents']['text'] = __('Agents operations');
$sub2['godmode/massive/massive_operations&amp;tab=massive_modules']['text'] = __('Modules operations');
$sub2['godmode/massive/massive_operations&amp;tab=massive_plugins']['text'] = __('Plugins operations');
if ((bool) check_acl($config['id_user'], 0, 'UM') === true) {
$sub2['godmode/massive/massive_operations&amp;tab=massive_users']['text'] = __('Users operations');
}
$sub2['godmode/massive/massive_operations&amp;tab=massive_alerts']['text'] = __('Alerts operations');
enterprise_hook('massivepolicies_submenu');
enterprise_hook('massivesnmp_submenu');
enterprise_hook('massivesatellite_submenu');
enterprise_hook('massiveservices_submenu');
$sub['gmassive']['sub2'] = $sub2;
$sub2 = [];
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($config['id_user'], 0, 'UM') === true) {
$sub['godmode/groups/group_list&tab=credbox']['text'] = __('Credential store');
$sub['godmode/groups/group_list&tab=credbox']['id'] = 'credential store';
}
// Manage events.
$sub2 = [];
if ((bool) check_acl($config['id_user'], 0, 'EW') === true || (bool) check_acl($config['id_user'], 0, 'EM') === true) {
// Custom event fields.
$sub2['godmode/events/events&section=filter']['text'] = __('Event filters');
$sub2['godmode/events/events&section=filter']['id'] = 'Event filters';
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub2['godmode/events/events&section=fields']['text'] = __('Custom columns');
$sub2['godmode/events/events&section=fields']['id'] = 'Custom events';
$sub2['godmode/events/events&section=responses']['text'] = __('Event responses');
$sub2['godmode/events/events&section=responses']['id'] = 'Event responses';
}
if (empty($sub2) === false) {
$sub['geventos']['text'] = __('Events');
$sub['geventos']['id'] = 'events';
$sub['geventos']['sec2'] = 'godmode/events/events&section=filter';
$sub['geventos']['type'] = 'direct';
$sub['geventos']['subtype'] = 'nolink';
$sub['geventos']['sub2'] = $sub2;
}
if (empty($sub) === false) {
$menu_godmode['gmodules']['text'] = __('Configuration');
$menu_godmode['gmodules']['sec2'] = 'godmode/modules/manage_network_templates';
$menu_godmode['gmodules']['id'] = 'god-configuration';
$menu_godmode['gmodules']['sub'] = $sub;
}
if ((bool) check_acl($config['id_user'], 0, 'LW') === true
|| (bool) check_acl($config['id_user'], 0, 'LM') === true
|| (bool) check_acl($config['id_user'], 0, 'AD') === true
) {
$menu_godmode['galertas']['text'] = __('Alerts');
$menu_godmode['galertas']['sec2'] = 'godmode/alerts/alert_list';
$menu_godmode['galertas']['id'] = 'god-alerts';
if ($access_console_node === true) {
$sub = [];
$sub['godmode/alerts/alert_list']['text'] = __('List of Alerts');
$sub['godmode/alerts/alert_list']['id'] = 'List of Alerts';
$sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view'];
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
$sub['godmode/alerts/alert_templates']['text'] = __('Templates');
$sub['godmode/alerts/alert_templates']['id'] = 'Templates';
$sub['godmode/alerts/alert_templates']['pages'] = ['godmode/alerts/configure_alert_template'];
$sub['godmode/alerts/alert_actions']['text'] = __('Actions');
$sub['godmode/alerts/alert_actions']['id'] = 'Actions';
$sub['godmode/alerts/alert_actions']['pages'] = ['godmode/alerts/configure_alert_action'];
$sub['godmode/alerts/alert_commands']['text'] = __('Commands');
$sub['godmode/alerts/alert_commands']['id'] = 'Commands';
$sub['godmode/alerts/alert_commands']['pages'] = ['godmode/alerts/configure_alert_command'];
$sub['godmode/alerts/alert_special_days']['text'] = __('Special days list');
$sub['godmode/alerts/alert_special_days']['id'] = __('Special days list');
$sub['godmode/alerts/alert_special_days']['pages'] = ['godmode/alerts/configure_alert_special_days'];
enterprise_hook('eventalerts_submenu');
$sub['godmode/snmpconsole/snmp_alert']['text'] = __('SNMP alerts');
$sub['godmode/snmpconsole/snmp_alert']['id'] = 'SNMP alerts';
enterprise_hook('alert_inventory_submenu');
if ((bool) check_acl($config['id_user'], 0, 'AW') === true || (bool) check_acl($config['id_user'], 0, 'AD') === true) {
$sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents');
$sub['godmode/agentes/modificar_agente']['id'] = 'Manage agents';
$sub['godmode/agentes/modificar_agente']['subsecs'] = ['godmode/agentes/configurar_agente'];
}
$menu_godmode['galertas']['sub'] = $sub;
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
// Servers.
$menu_godmode['gservers']['text'] = __('Servers');
$menu_godmode['gservers']['sec2'] = 'godmode/servers/modificar_server';
$menu_godmode['gservers']['id'] = 'god-servers';
$sub = [];
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$sub['godmode/servers/modificar_server']['text'] = __('Manage servers');
$sub['godmode/servers/modificar_server']['id'] = 'Manage servers';
}
// This subtabs are only for Pandora Admin.
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
enterprise_hook('ha_cluster');
$sub['godmode/agentes/fields_manager']['text'] = __('Custom fields');
$sub['godmode/agentes/fields_manager']['id'] = 'Custom fields';
$sub['godmode/servers/plugin']['text'] = __('Plugins');
$sub['godmode/servers/plugin']['id'] = 'Plugins';
$sub['godmode/modules/manage_nc_groups']['text'] = __('Component groups');
$sub['godmode/modules/manage_nc_groups']['id'] = 'Component groups';
// Category.
$sub['godmode/category/category']['text'] = __('Module categories');
$sub['godmode/category/category']['id'] = 'Module categories';
$sub['godmode/category/category']['subsecs'] = 'godmode/category/edit_category';
$sub['godmode/servers/plugin_registration']['text'] = __('Register Plugin');
$sub['godmode/servers/plugin_registration']['id'] = 'register_plugin';
$sub['godmode/modules/module_list']['text'] = __('Module types');
$sub['godmode/modules/module_list']['id'] = 'Module types';
enterprise_hook('export_target_submenu');
$sub['godmode/groups/modu_group_list']['text'] = __('Module groups');
$sub['godmode/groups/modu_group_list']['id'] = 'Module groups';
enterprise_hook('manage_satellite_submenu');
$sub['godmode/setup/os']['text'] = __('Operating systems');
$sub['godmode/setup/os']['id'] = 'Edit OS';
}
$menu_godmode['gservers']['sub'] = $sub;
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
// Setup.
$menu_godmode['gsetup']['text'] = __('Setup');
$menu_godmode['gsetup']['sec2'] = 'general';
$menu_godmode['gsetup']['id'] = 'god-setup';
$sub = [];
// Options Setup.
$sub['general']['text'] = __('Setup');
$sub['general']['id'] = 'Setup';
$sub['general']['type'] = 'direct';
$sub['general']['subtype'] = 'nolink';
$sub2 = [];
$sub2['godmode/setup/setup&section=general']['text'] = __('General Setup');
$sub2['godmode/setup/setup&section=general']['id'] = 'General Setup';
$sub2['godmode/setup/setup&section=general']['refr'] = 0;
enterprise_hook('password_submenu');
enterprise_hook('enterprise_submenu');
enterprise_hook('historydb_submenu');
enterprise_hook('log_collector_submenu');
$sub2['godmode/setup/setup&section=auth']['text'] = __('Authentication');
$sub2['godmode/setup/setup&section=auth']['refr'] = 0;
$sub2['godmode/setup/setup&section=perf']['text'] = __('Performance');
$sub2['godmode/setup/setup&section=perf']['refr'] = 0;
$sub2['godmode/setup/setup&section=vis']['text'] = __('Visual styles');
$sub2['godmode/setup/setup&section=vis']['refr'] = 0;
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
// Netflow.
if ((bool) $config['activate_netflow'] === true) {
$sub2['godmode/setup/setup&section=net']['text'] = __('Netflow');
$sub2['godmode/setup/setup&section=net']['refr'] = 0;
$sub['godmode/netflow/nf_edit']['text'] = __('Netflow filters');
$sub['godmode/netflow/nf_edit']['id'] = 'Netflow filters';
}
}
$sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus');
$sub2['godmode/setup/setup&section=ehorus']['refr'] = 0;
$sub2['godmode/setup/setup&section=integria']['text'] = __('Integria IMS');
$sub2['godmode/setup/setup&section=integria']['refr'] = 0;
enterprise_hook('module_library_submenu');
$sub2['godmode/setup/setup&section=notifications']['text'] = __('Notifications');
$sub2['godmode/setup/setup&section=notifications']['refr'] = 0;
$sub2['godmode/setup/setup&section=websocket_engine']['text'] = __('Websocket Engine');
$sub2['godmode/setup/setup&section=websocket_engine']['refr'] = 0;
$sub2['godmode/setup/setup&section=external_tools']['text'] = __('External Tools');
$sub2['godmode/setup/setup&section=external_tools']['refr'] = 0;
if ((bool) $config['activate_gis'] === true) {
$sub2['godmode/setup/setup&section=gis']['text'] = __('Map conections GIS');
if (empty($sub) === false) {
$menu_godmode['gagente']['text'] = __('Resources');
$menu_godmode['gagente']['sec2'] = 'godmode/agentes/modificar_agente';
$menu_godmode['gagente']['id'] = 'god-resources';
$menu_godmode['gagente']['sub'] = $sub;
}
$sub['general']['sub2'] = $sub2;
$sub['godmode/setup/os']['text'] = __('Edit OS');
$sub['godmode/setup/os']['id'] = 'Edit OS';
$sub['godmode/setup/license']['text'] = __('License');
$sub['godmode/setup/license']['id'] = 'License';
$sub = [];
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub['godmode/groups/group_list']['text'] = __('Manage agents groups');
$sub['godmode/groups/group_list']['id'] = 'Manage agents groups';
}
enterprise_hook('skins_submenu');
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
// Tag.
$sub['godmode/tag/tag']['text'] = __('Module tags');
$sub['godmode/tag/tag']['id'] = 'Module tags';
$sub['godmode/tag/tag']['subsecs'] = 'godmode/tag/edit_tag';
$menu_godmode['gsetup']['sub'] = $sub;
enterprise_hook('enterprise_acl_submenu');
}
if ((bool) check_acl($config['id_user'], 0, 'UM') === true) {
$sub['godmode/users/user_list']['text'] = __('Users management');
$sub['godmode/users/user_list']['id'] = 'Users management';
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub['godmode/users/profile_list']['text'] = __('Profile management');
$sub['godmode/users/profile_list']['id'] = 'Profile management';
}
if (empty($sub) === false) {
$menu_godmode['gusuarios']['sub'] = $sub;
$menu_godmode['gusuarios']['text'] = __('Profiles');
$menu_godmode['gusuarios']['sec2'] = 'godmode/users/user_list';
$menu_godmode['gusuarios']['id'] = 'god-users';
}
$sub = [];
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub['templates']['text'] = __('Templates');
$sub['templates']['id'] = 'Templates';
$sub['templates']['type'] = 'direct';
$sub['templates']['subtype'] = 'nolink';
$sub2 = [];
$sub2['godmode/modules/manage_module_templates']['text'] = __('Module templates');
$sub2['godmode/modules/manage_module_templates']['id'] = 'Module templates';
$sub2['godmode/modules/private_enterprise_numbers']['text'] = __('Private Enterprise Numbers');
$sub2['godmode/modules/private_enterprise_numbers']['id'] = 'Private Enterprise Numbers';
$sub2['enterprise/godmode/modules/local_components']['text'] = __('Local components');
$sub2['enterprise/godmode/modules/local_components']['id'] = 'Local components';
$sub2['godmode/modules/manage_network_components']['text'] = __('Remote components');
$sub2['godmode/modules/manage_network_components']['id'] = 'Network components';
$sub['templates']['sub2'] = $sub2;
enterprise_hook('inventory_submenu');
enterprise_hook('autoconfiguration_menu');
enterprise_hook('agent_repository_menu');
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
enterprise_hook('policies_menu');
enterprise_hook('agents_submenu');
}
if ((bool) check_acl($config['id_user'], 0, 'NW') === true) {
enterprise_hook('agents_ncm_submenu');
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$sub['gmassive']['text'] = __('Bulk operations');
$sub['gmassive']['id'] = 'Bulk operations';
$sub['gmassive']['type'] = 'direct';
$sub['gmassive']['subtype'] = 'nolink';
$sub2 = [];
$sub2['godmode/massive/massive_operations&amp;tab=massive_agents']['text'] = __('Agents operations');
$sub2['godmode/massive/massive_operations&amp;tab=massive_modules']['text'] = __('Modules operations');
$sub2['godmode/massive/massive_operations&amp;tab=massive_plugins']['text'] = __('Plugins operations');
if ((bool) check_acl($config['id_user'], 0, 'UM') === true) {
$sub2['godmode/massive/massive_operations&amp;tab=massive_users']['text'] = __('Users operations');
}
$sub2['godmode/massive/massive_operations&amp;tab=massive_alerts']['text'] = __('Alerts operations');
enterprise_hook('massivepolicies_submenu');
enterprise_hook('massivesnmp_submenu');
enterprise_hook('massivesatellite_submenu');
enterprise_hook('massiveservices_submenu');
$sub['gmassive']['sub2'] = $sub2;
$sub2 = [];
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($config['id_user'], 0, 'UM') === true) {
$sub['godmode/groups/group_list&tab=credbox']['text'] = __('Credential store');
$sub['godmode/groups/group_list&tab=credbox']['id'] = 'credential store';
}
// Manage events.
$sub2 = [];
if ((bool) check_acl($config['id_user'], 0, 'EW') === true || (bool) check_acl($config['id_user'], 0, 'EM') === true) {
// Custom event fields.
$sub2['godmode/events/events&section=filter']['text'] = __('Event filters');
$sub2['godmode/events/events&section=filter']['id'] = 'Event filters';
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
$sub2['godmode/events/events&section=fields']['text'] = __('Custom columns');
$sub2['godmode/events/events&section=fields']['id'] = 'Custom events';
$sub2['godmode/events/events&section=responses']['text'] = __('Event responses');
$sub2['godmode/events/events&section=responses']['id'] = 'Event responses';
}
if (empty($sub2) === false) {
$sub['geventos']['text'] = __('Events');
$sub['geventos']['id'] = 'events';
$sub['geventos']['sec2'] = 'godmode/events/events&section=filter';
$sub['geventos']['type'] = 'direct';
$sub['geventos']['subtype'] = 'nolink';
$sub['geventos']['sub2'] = $sub2;
}
if (empty($sub) === false) {
$menu_godmode['gmodules']['text'] = __('Configuration');
$menu_godmode['gmodules']['sec2'] = 'godmode/modules/manage_network_templates';
$menu_godmode['gmodules']['id'] = 'god-configuration';
$menu_godmode['gmodules']['sub'] = $sub;
}
if ((bool) check_acl($config['id_user'], 0, 'LW') === true
|| (bool) check_acl($config['id_user'], 0, 'LM') === true
|| (bool) check_acl($config['id_user'], 0, 'AD') === true
) {
$menu_godmode['galertas']['text'] = __('Alerts');
$menu_godmode['galertas']['sec2'] = 'godmode/alerts/alert_list';
$menu_godmode['galertas']['id'] = 'god-alerts';
$sub = [];
$sub['godmode/alerts/alert_list']['text'] = __('List of Alerts');
$sub['godmode/alerts/alert_list']['id'] = 'List of Alerts';
$sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view'];
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
$sub['godmode/alerts/alert_templates']['text'] = __('Templates');
$sub['godmode/alerts/alert_templates']['id'] = 'Templates';
$sub['godmode/alerts/alert_templates']['pages'] = ['godmode/alerts/configure_alert_template'];
$sub['godmode/alerts/alert_actions']['text'] = __('Actions');
$sub['godmode/alerts/alert_actions']['id'] = 'Actions';
$sub['godmode/alerts/alert_actions']['pages'] = ['godmode/alerts/configure_alert_action'];
$sub['godmode/alerts/alert_commands']['text'] = __('Commands');
$sub['godmode/alerts/alert_commands']['id'] = 'Commands';
$sub['godmode/alerts/alert_commands']['pages'] = ['godmode/alerts/configure_alert_command'];
$sub['godmode/alerts/alert_special_days']['text'] = __('Special days list');
$sub['godmode/alerts/alert_special_days']['id'] = __('Special days list');
$sub['godmode/alerts/alert_special_days']['pages'] = ['godmode/alerts/configure_alert_special_days'];
enterprise_hook('eventalerts_submenu');
$sub['godmode/snmpconsole/snmp_alert']['text'] = __('SNMP alerts');
$sub['godmode/snmpconsole/snmp_alert']['id'] = 'SNMP alerts';
enterprise_hook('alert_inventory_submenu');
}
$menu_godmode['galertas']['sub'] = $sub;
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
// Servers.
$menu_godmode['gservers']['text'] = __('Servers');
$menu_godmode['gservers']['sec2'] = 'godmode/servers/modificar_server';
$menu_godmode['gservers']['id'] = 'god-servers';
$sub = [];
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
$sub['godmode/servers/modificar_server']['text'] = __('Manage servers');
$sub['godmode/servers/modificar_server']['id'] = 'Manage servers';
}
// This subtabs are only for Pandora Admin.
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
enterprise_hook('ha_cluster');
$sub['godmode/servers/plugin']['text'] = __('Plugins');
$sub['godmode/servers/plugin']['id'] = 'Plugins';
$sub['godmode/servers/plugin_registration']['text'] = __('Register Plugin');
$sub['godmode/servers/plugin_registration']['id'] = 'register_plugin';
enterprise_hook('export_target_submenu');
enterprise_hook('manage_satellite_submenu');
}
$menu_godmode['gservers']['sub'] = $sub;
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
// Setup.
$menu_godmode['gsetup']['text'] = __('Setup');
$menu_godmode['gsetup']['sec2'] = 'general';
$menu_godmode['gsetup']['id'] = 'god-setup';
$sub = [];
// Options Setup.
$sub['general']['text'] = __('Setup');
$sub['general']['id'] = 'Setup';
$sub['general']['type'] = 'direct';
$sub['general']['subtype'] = 'nolink';
$sub2 = [];
$sub2['godmode/setup/setup&section=general']['text'] = __('General Setup');
$sub2['godmode/setup/setup&section=general']['id'] = 'General Setup';
$sub2['godmode/setup/setup&section=general']['refr'] = 0;
enterprise_hook('password_submenu');
enterprise_hook('enterprise_submenu');
enterprise_hook('historydb_submenu');
enterprise_hook('log_collector_submenu');
$sub2['godmode/setup/setup&section=auth']['text'] = __('Authentication');
$sub2['godmode/setup/setup&section=auth']['refr'] = 0;
$sub2['godmode/setup/setup&section=perf']['text'] = __('Performance');
$sub2['godmode/setup/setup&section=perf']['refr'] = 0;
$sub2['godmode/setup/setup&section=vis']['text'] = __('Visual styles');
$sub2['godmode/setup/setup&section=vis']['refr'] = 0;
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
if ((bool) $config['activate_netflow'] === true) {
$sub2['godmode/setup/setup&section=net']['text'] = __('Netflow');
$sub2['godmode/setup/setup&section=net']['refr'] = 0;
}
}
$sub2['godmode/setup/setup&section=ehorus']['text'] = __('eHorus');
$sub2['godmode/setup/setup&section=ehorus']['refr'] = 0;
$sub2['godmode/setup/setup&section=integria']['text'] = __('Integria IMS');
$sub2['godmode/setup/setup&section=integria']['refr'] = 0;
enterprise_hook('module_library_submenu');
$sub2['godmode/setup/setup&section=notifications']['text'] = __('Notifications');
$sub2['godmode/setup/setup&section=notifications']['refr'] = 0;
$sub2['godmode/setup/setup&section=websocket_engine']['text'] = __('Websocket Engine');
$sub2['godmode/setup/setup&section=websocket_engine']['refr'] = 0;
$sub2['godmode/setup/setup&section=external_tools']['text'] = __('External Tools');
$sub2['godmode/setup/setup&section=external_tools']['refr'] = 0;
if ((bool) $config['activate_gis'] === true) {
$sub2['godmode/setup/setup&section=gis']['text'] = __('Map conections GIS');
}
$sub['general']['sub2'] = $sub2;
$sub['godmode/setup/license']['text'] = __('License');
$sub['godmode/setup/license']['id'] = 'License';
enterprise_hook('skins_submenu');
$menu_godmode['gsetup']['sub'] = $sub;
}
}
if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($config['id_user'], 0, 'DM') === true) {
$menu_godmode['gextensions']['text'] = __('Admin tools');
$menu_godmode['gextensions']['sec2'] = 'godmode/extensions';
@ -392,142 +401,148 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($
$sub = [];
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
// Audit //meter en extensiones.
$sub['godmode/audit_log']['text'] = __('System audit log');
$sub['godmode/audit_log']['id'] = 'System audit log';
$sub['godmode/setup/links']['text'] = __('Links');
$sub['godmode/setup/links']['id'] = 'Links';
$sub['tools/diagnostics']['text'] = __('Diagnostic info');
$sub['tools/diagnostics']['id'] = 'Diagnostic info';
enterprise_hook('omnishell');
enterprise_hook('ipam_submenu');
if ($access_console_node === true) {
// Audit //meter en extensiones.
$sub['godmode/audit_log']['text'] = __('System audit log');
$sub['godmode/audit_log']['id'] = 'System audit log';
$sub['godmode/setup/links']['text'] = __('Links');
$sub['godmode/setup/links']['id'] = 'Links';
$sub['tools/diagnostics']['text'] = __('Diagnostic info');
$sub['tools/diagnostics']['id'] = 'Diagnostic info';
enterprise_hook('omnishell');
enterprise_hook('ipam_submenu');
$sub['godmode/setup/news']['text'] = __('Site news');
$sub['godmode/setup/news']['id'] = 'Site news';
}
$sub['godmode/setup/news']['text'] = __('Site news');
$sub['godmode/setup/news']['id'] = 'Site news';
$sub['godmode/setup/file_manager']['text'] = __('File manager');
$sub['godmode/setup/file_manager']['id'] = 'File manager';
if (is_user_admin($config['id_user']) === true) {
$sub['extensions/db_status']['text'] = __('DB Schema Check');
$sub['extensions/db_status']['id'] = 'DB Schema Check';
$sub['extensions/db_status']['sec'] = 'gbman';
$sub['extensions/dbmanager']['text'] = __('DB Interface');
$sub['extensions/dbmanager']['id'] = 'DB Interface';
$sub['extensions/dbmanager']['sec'] = 'gbman';
enterprise_hook('dbBackupManager');
enterprise_hook('elasticsearch_interface_menu');
if ($access_console_node === true) {
if (is_user_admin($config['id_user']) === true) {
$sub['extensions/db_status']['text'] = __('DB Schema Check');
$sub['extensions/db_status']['id'] = 'DB Schema Check';
$sub['extensions/db_status']['sec'] = 'gbman';
$sub['extensions/dbmanager']['text'] = __('DB Interface');
$sub['extensions/dbmanager']['id'] = 'DB Interface';
$sub['extensions/dbmanager']['sec'] = 'gbman';
enterprise_hook('dbBackupManager');
enterprise_hook('elasticsearch_interface_menu');
}
}
}
$menu_godmode['gextensions']['sub'] = $sub;
}
if (is_array($config['extensions']) === true) {
$sub = [];
$sub2 = [];
if ($access_console_node === true) {
if (is_array($config['extensions']) === true) {
$sub = [];
$sub2 = [];
foreach ($config['extensions'] as $extension) {
// If no godmode_menu is a operation extension.
if (empty($extension['godmode_menu']) === true) {
continue;
}
foreach ($config['extensions'] as $extension) {
// If no godmode_menu is a operation extension.
if (empty($extension['godmode_menu']) === true) {
continue;
}
if ($extension['godmode_menu']['name'] === 'System Info') {
continue;
}
if ($extension['godmode_menu']['name'] === 'System Info') {
continue;
}
if ($extension['godmode_menu']['name'] !== __('DB Schema check') && $extension['godmode_menu']['name'] !== __('DB interface')) {
$extmenu = $extension['godmode_menu'];
}
if ($extension['godmode_menu']['name'] !== __('DB Schema check') && $extension['godmode_menu']['name'] !== __('DB interface')) {
$extmenu = $extension['godmode_menu'];
}
// Check the ACL for this user.
if ((bool) check_acl($config['id_user'], 0, $extmenu['acl']) === false) {
continue;
}
// Check the ACL for this user.
if ((bool) check_acl($config['id_user'], 0, $extmenu['acl']) === false) {
continue;
}
// Check if was displayed inside other menu.
if (empty($extension['godmode_menu']['fatherId']) === true) {
$sub2[$extmenu['sec2']]['text'] = __($extmenu['name']);
$sub2[$extmenu['sec2']]['id'] = $extmenu['name'];
$sub2[$extmenu['sec2']]['refr'] = 0;
} else {
if (is_array($extmenu) === true && array_key_exists('fatherId', $extmenu) === true) {
if (strlen($extmenu['fatherId']) > 0) {
if (array_key_exists('subfatherId', $extmenu) === true) {
if (strlen($extmenu['subfatherId']) > 0) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['text'] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['id'] = $extmenu['name'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['refr'] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['sec'] = 'extensions';
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['extension'] = true;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['enterprise'] = $extension['enterprise'];
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
// Check if was displayed inside other menu.
if (empty($extension['godmode_menu']['fatherId']) === true) {
$sub2[$extmenu['sec2']]['text'] = __($extmenu['name']);
$sub2[$extmenu['sec2']]['id'] = $extmenu['name'];
$sub2[$extmenu['sec2']]['refr'] = 0;
} else {
if (is_array($extmenu) === true && array_key_exists('fatherId', $extmenu) === true) {
if (strlen($extmenu['fatherId']) > 0) {
if (array_key_exists('subfatherId', $extmenu) === true) {
if (strlen($extmenu['subfatherId']) > 0) {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['text'] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['id'] = $extmenu['name'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['refr'] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['sec'] = 'extensions';
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['extension'] = true;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['enterprise'] = $extension['enterprise'];
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
} else {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['text'] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['id'] = $extmenu['name'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['refr'] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = $extmenu['fatherId'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['extension'] = true;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['enterprise'] = $extension['enterprise'];
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
}
} else {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['text'] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['id'] = $extmenu['name'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['refr'] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = $extmenu['fatherId'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = 'gextensions';
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['extension'] = true;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['enterprise'] = $extension['enterprise'];
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
}
} else {
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['text'] = __($extmenu['name']);
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['id'] = $extmenu['name'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['refr'] = 0;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = 'gextensions';
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['extension'] = true;
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['enterprise'] = $extension['enterprise'];
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
}
}
}
}
}
// Complete the submenu.
$extension_view = [];
$extension_view['godmode/extensions']['id'] = 'Extension manager view';
$extension_view['godmode/extensions']['text'] = __('Extension manager view');
$extension_submenu = array_merge($extension_view, $sub2);
// Complete the submenu.
$extension_view = [];
$extension_view['godmode/extensions']['id'] = 'Extension manager view';
$extension_view['godmode/extensions']['text'] = __('Extension manager view');
$extension_submenu = array_merge($extension_view, $sub2);
$sub['godmode/extensions']['sub2'] = $extension_submenu;
$sub['godmode/extensions']['text'] = __('Extension manager');
$sub['godmode/extensions']['id'] = 'Extension manager';
$sub['godmode/extensions']['type'] = 'direct';
$sub['godmode/extensions']['subtype'] = 'nolink';
$sub['godmode/extensions']['sub2'] = $extension_submenu;
$sub['godmode/extensions']['text'] = __('Extension manager');
$sub['godmode/extensions']['id'] = 'Extension manager';
$sub['godmode/extensions']['type'] = 'direct';
$sub['godmode/extensions']['subtype'] = 'nolink';
if (is_array($menu_godmode['gextensions']['sub']) === true) {
$submenu = array_merge($menu_godmode['gextensions']['sub'], $sub);
if ($menu_godmode['gextensions']['sub'] != null) {
$menu_godmode['gextensions']['sub'] = $submenu;
if (is_array($menu_godmode['gextensions']['sub']) === true) {
$submenu = array_merge($menu_godmode['gextensions']['sub'], $sub);
if ($menu_godmode['gextensions']['sub'] != null) {
$menu_godmode['gextensions']['sub'] = $submenu;
}
}
}
$menu_godmode['links']['text'] = __('Links');
$menu_godmode['links']['sec2'] = '';
$menu_godmode['links']['id'] = 'god-links';
$sub = [];
$rows = db_get_all_rows_in_table('tlink', 'name');
foreach ($rows as $row) {
// Audit //meter en extensiones.
$sub[$row['link']]['text'] = $row['name'];
$sub[$row['link']]['id'] = $row['name'];
$sub[$row['link']]['type'] = 'direct';
$sub[$row['link']]['subtype'] = 'new_blank';
}
$menu_godmode['links']['sub'] = $sub;
}
$menu_godmode['links']['text'] = __('Links');
$menu_godmode['links']['sec2'] = '';
$menu_godmode['links']['id'] = 'god-links';
$sub = [];
$rows = db_get_all_rows_in_table('tlink', 'name');
foreach ($rows as $row) {
// Audit //meter en extensiones.
$sub[$row['link']]['text'] = $row['name'];
$sub[$row['link']]['id'] = $row['name'];
$sub[$row['link']]['type'] = 'direct';
$sub[$row['link']]['subtype'] = 'new_blank';
}
$menu_godmode['links']['sub'] = $sub;
// Warp Manager.
if ((bool) check_acl($config['id_user'], 0, 'PM') === true && (bool) $config['enable_update_manager'] === true) {
$menu_godmode['messages']['text'] = __('Warp Update');
;
$menu_godmode['messages']['id'] = 'god-um_messages';
$menu_godmode['messages']['sec2'] = '';
@ -547,19 +562,21 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true && (bool) $config['en
$menu_godmode['messages']['sub'] = $sub;
}
// Module library.
if ((bool) check_acl($config['id_user'], 0, 'AR') === true) {
$menu_godmode['gmodule_library']['text'] = __('Module library');
$menu_godmode['gmodule_library']['id'] = 'god-module_library';
if ($access_console_node === true) {
// Module library.
if ((bool) check_acl($config['id_user'], 0, 'AR') === true) {
$menu_godmode['gmodule_library']['text'] = __('Module library');
$menu_godmode['gmodule_library']['id'] = 'god-module_library';
$sub = [];
$sub['godmode/module_library/module_library_view']['text'] = __('View');
$sub['godmode/module_library/module_library_view']['id'] = 'View';
$sub = [];
$sub['godmode/module_library/module_library_view']['text'] = __('View');
$sub['godmode/module_library/module_library_view']['id'] = 'View';
$sub['godmode/module_library/module_library_view&tab=categories']['text'] = __('Categories');
$sub['godmode/module_library/module_library_view&tab=categories']['id'] = 'categories';
$sub['godmode/module_library/module_library_view&tab=categories']['text'] = __('Categories');
$sub['godmode/module_library/module_library_view&tab=categories']['id'] = 'categories';
$menu_godmode['gmodule_library']['sub'] = $sub;
$menu_godmode['gmodule_library']['sub'] = $sub;
}
}
if ((bool) $config['pure'] === false) {

View File

@ -833,23 +833,21 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
var added_config = {
"selector": "#tinyMCE_editor",
"elements": "text-label",
"elements": "tinyMCE_editor",
"plugins": "noneditable",
"theme_advanced_buttons1":
"bold,italic,|,justifyleft,justifycenter,justifyright,|,undo,redo,|,image,link,|,fontselect,|,forecolor,fontsizeselect,|,code",
"theme_advanced_buttons1": "bold,italic,|,justifyleft,justifycenter,justifyright,|,undo,redo,|,image,link,|,fontselect,|,forecolor,fontsizeselect,|,code",
"valid_children": "+body[style]",
"theme_advanced_font_sizes": "true",
"content_css":
<?php echo '"'.ui_get_full_url('include/styles/pandora.css', false, false, false).'"'; ?>,
"content_css": <?php echo '"'.ui_get_full_url('include/styles/pandora.css', false, false, false).'"'; ?>,
"editor_deselector": "noselected",
"inline_styles": true,
"nowrap": true,
"width": "400",
"height": "200",
}
defineTinyMCE(added_config);
"body_class": "tinyMCEBody",
}
defineTinyMCE(added_config);
$("#dialog_label_editor").hide ()
.dialog ({
title: "<?php echo __('Edit label'); ?>",
@ -860,38 +858,33 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
opacity: 0.5,
background: "black"
},
width: 450,
width: 530,
height: 300,
autoOpen: false,
beforeClose: function() {
var id_layout_data = $("#active_id_layout_data").val();
var label = tinyMCE.activeEditor.getContent();
$("#hidden-label_" + id_layout_data).val(label);
}
});
});
var idText = $("#ip_text").html();
});
var idText = $("#ip_text").html();
function show_dialog_label_editor(id_layout_data) {
var label = $("#hidden-label_" + id_layout_data).val();
$("#active_id_layout_data").val(id_layout_data);
$("#tinyMCE_editor").val(label);
tinyMCE.activeEditor.setContent(label);
$("#dialog_label_editor").dialog("open");
}
function toggle_checkbox_multiple_delete() {
checked_head_multiple = $("input[name='head_multiple_delete']")
.is(":checked");
$("input[name='multiple_delete_items']")
.prop("checked", checked_head_multiple);
}
function submit_delete_multiple_items() {
delete_items = [];
jQuery.each($("input[name='multiple_delete_items']:checked"),
@ -899,8 +892,7 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
delete_items.push($(item).val());
}
);
$("input[name='id_item_json']").val(JSON.stringify(delete_items));
$("#form_multiple_delete").submit();
}

View File

@ -158,6 +158,12 @@ if ($classname_selected === null) {
// Load classes and print selector.
$wiz_data = [];
foreach ($classes as $classpath) {
if (is_reporting_console_node() === true) {
if ($classpath !== '/var/www/html/pandora_console/godmode/wizards/DiscoveryTaskList.class.php') {
continue;
}
}
$classname = basename($classpath, '.class.php');
$obj = new $classname();

View File

@ -122,26 +122,44 @@ if (isset($_GET['server'])) {
$buttons = '';
if ($server_type !== 13) {
// Buttons.
$buttons = [
'standard_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=standard_editor&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'</a>',
],
'advanced_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=advanced_editor&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'</a>',
],
];
// Buttons.
$buttons = [
'standard_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=standard_editor&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'</a>',
],
'advanced_editor' => [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=advanced_editor&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'</a>',
],
];
$buttons[$tab]['active'] = true;
if ($server_type === SERVER_TYPE_ENTERPRISE_SATELLITE) {
$buttons['agent_editor'] = [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=agent_editor&pure='.$pure.'">'.html_print_image('images/agent.png', true, ['title' => __('Advanced editor')]).'</a>',
];
}
$buttons[$tab]['active'] = true;
ui_print_page_header(__('Remote Configuration'), 'images/gm_servers.png', false, 'servers', true, $buttons);
if ($server_type !== 13 && $tab == 'standard_editor') {
if ($tab === 'standard_editor') {
$advanced_editor = false;
if ($server_type === 13) {
echo "<table cellpadding='4' cellspacing='4' class='databox filters font_bold margin-bottom-10' width='100%'>
<tr>";
echo '<td class="w100p">';
echo __('Dynamic search').'&nbsp;&nbsp;';
html_print_input_text('search_config_token', $search, '', 12);
echo '</td>';
echo '</tr></table>';
}
} else if ($tab === 'agent_editor' && $server_type === SERVER_TYPE_ENTERPRISE_SATELLITE) {
$advanced_editor = 'agent_editor';
}
enterprise_include('godmode/servers/server_disk_conf_editor.php');

View File

@ -208,7 +208,7 @@ if ($is_management_allowed === true) {
$buttons[$tab]['active'] = true;
$headerTitle = ($tab === 'builder') ? __('Edit OS') : __('List of OS');
$headerTitle = ($tab === 'builder') ? __('Edit OS') : __('List of Operating Systems');
if (is_metaconsole() === false) {
// Header.

View File

@ -324,7 +324,7 @@ switch ($section) {
}
// Put header inside div for special sizing.(No right margin).
echo '<div id="header_configuration" style="width: calc(100% + 3em);">';
echo '<div id="header_configuration" style="width: calc(100%);">';
// Header.
ui_print_page_header(
__('Configuration').$subpage,

View File

@ -497,6 +497,17 @@ $table->data[$i++][1] = html_print_checkbox_switch(
true
);
$table->data[$i][0] = __('Enable console report').ui_print_help_tip(
__('Enable console report'),
true
);
$table->data[$i++][1] = html_print_checkbox_switch(
'reporting_console_enable',
1,
$config['reporting_console_enable'],
true
);
echo '<form id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';
echo '<fieldset>';

View File

@ -162,7 +162,9 @@ class DiscoveryTaskList extends HTML
$ret = false;
}
$ret2 = $this->showList();
if (is_reporting_console_node() === false) {
$ret2 = $this->showList();
}
if ($ret === false && $ret2 === false) {
include_once $config['homedir'].'/general/first_task/recon_view.php';
@ -662,7 +664,7 @@ class DiscoveryTaskList extends HTML
$data[0] .= '\'';
if ($task['type'] == DISCOVERY_HOSTDEVICES) {
$title = __('Are you sure?');
$message = 'This action will rescan the target networks.';
$message = __('This action will rescan the target networks.');
$data[0] .= ', {title: \''.$title.'\', message: \''.$message.'\'}';
}

View File

@ -37,6 +37,8 @@ $get_actions_module = (bool) get_parameter('get_actions_module');
$show_update_action_menu = (bool) get_parameter('show_update_action_menu');
$get_agent_alerts_agent_view = (bool) get_parameter('get_agent_alerts_agent_view');
$resize_event_week = (bool) get_parameter('resize_event_week');
$get_agent_alerts_datatable = (bool) get_parameter('get_agent_alerts_datatable', 0);
$alert_validate = (bool) get_parameter('alert_validate', false);
if ($get_agent_alerts_simple) {
$id_agent = (int) get_parameter('id_agent');
@ -620,4 +622,325 @@ if ($resize_event_week === true) {
return;
}
if ($alert_validate === true) {
include_once 'operation/agentes/alerts_status.functions.php';
$all_groups = get_parameter('all_groups');
$alert_ids = get_parameter('alert_ids', '');
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') || check_acl_one_of_groups($config['id_user'], $all_groups, 'LM')) {
$result = validateAlert($alert_ids);
} else {
$result = ui_print_error_message(__('Insufficient permissions to validate alerts'), '', true);
}
echo json_encode($result);
return;
}
if ($get_agent_alerts_datatable === true) {
// Datatables offset, limit and order.
$filter_alert = get_parameter('filter', []);
unset($filter_alert[0]);
$start = (int) get_parameter('start', 0);
$length = (int) get_parameter('length', $config['block_size']);
$order = get_datatable_order(true);
$url = get_parameter('url', '#');
$free_search_alert = $filter_alert['free_search_alert'];
$idGroup = $filter_alert['ag_group'];
$tag_filter = $filter_alert['tag_filter'];
$action_filter = $filter_alert['action'];
try {
ob_start();
include_once $config['homedir'].'/include/functions_agents.php';
include_once $config['homedir'].'/operation/agentes/alerts_status.functions.php';
include_once $config['homedir'].'/include/functions_users.php';
$agent_a = check_acl($config['id_user'], 0, 'AR');
$agent_w = check_acl($config['id_user'], 0, 'AW');
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
$all_groups = get_parameter('all_groups');
$idAgent = (int) get_parameter('id_agent');
$sortField = $order['field'];
$sort = $order['direction'];
$selected = true;
$selectModuleUp = false;
$selectModuleDown = false;
$selectTemplateUp = false;
$selectTemplateDown = false;
$selectLastFiredUp = false;
$selectLastFiredDown = false;
switch ($sortField) {
case 'module':
switch ($sort) {
case 'asc':
$selectModuleasc = $selected;
$order = [
'field' => 'agent_module_name',
'order' => 'ASC',
];
break;
case 'desc':
$selectModuledesc = $selected;
$order = [
'field' => 'agent_module_name',
'order' => 'DESC',
];
break;
}
break;
case 'template':
switch ($sort) {
case 'asc':
$selectTemplateasc = $selected;
$order = [
'field' => 'template_name',
'order' => 'ASC',
];
break;
case 'desc':
$selectTemplatedesc = $selected;
$order = [
'field' => 'template_name',
'order' => 'DESC',
];
break;
}
break;
case 'lastFired':
switch ($sort) {
case 'asc':
$selectLastFiredasc = $selected;
$order = [
'field' => 'last_fired',
'order' => 'ASC',
];
break;
case 'desc':
$selectLastFireddesc = $selected;
$order = [
'field' => 'last_fired',
'order' => 'DESC',
];
break;
}
break;
case 'agent':
switch ($sort) {
case 'asc':
$selectLastFiredasc = $selected;
$order = [
'field' => 'agent_name',
'order' => 'ASC',
];
break;
case 'desc':
$selectLastFireddesc = $selected;
$order = [
'field' => 'agent_name',
'order' => 'DESC',
];
break;
}
break;
case 'status':
switch ($sort) {
case 'asc':
$selectLastFiredasc = $selected;
$order = [
'field' => 'times_fired',
'order' => 'ASC',
];
break;
case 'desc':
$selectLastFireddesc = $selected;
$order = [
'field' => 'times_fired',
'order' => 'DESC',
];
break;
}
break;
default:
$selectDisabledasc = '';
$selectDisableddesc = '';
$selectModuleasc = $selected;
$selectModuledesc = false;
$selectTemplateasc = false;
$selectTemplatedesc = false;
$selectLastFiredasc = false;
$selectLastFireddesc = false;
$order = [
'field' => 'agent_module_name',
'order' => 'ASC',
];
break;
}
if ($free_search_alert != '') {
$whereAlertSimple = 'AND ('.'id_alert_template IN (
SELECT id
FROM talert_templates
WHERE name LIKE "%'.$free_search_alert.'%") OR '.'id_alert_template IN (
SELECT id
FROM talert_templates
WHERE id_alert_action IN (
SELECT id
FROM talert_actions
WHERE name LIKE "%'.$free_search_alert.'%")) OR '.'talert_template_modules.id IN (
SELECT id_alert_template_module
FROM talert_template_module_actions
WHERE id_alert_action IN (
SELECT id
FROM talert_actions
WHERE name LIKE "%'.$free_search_alert.'%")) OR '.'id_agent_module IN (
SELECT id_agente_modulo
FROM tagente_modulo
WHERE nombre LIKE "%'.$free_search_alert.'%") OR '.'id_agent_module IN (
SELECT id_agente_modulo
FROM tagente_modulo
WHERE alias LIKE "%'.$free_search_alert.'%")'.')';
} else {
$whereAlertSimple = '';
}
// Add checks for user ACL.
$groups = users_get_groups($config['id_user'], $access);
$id_groups = array_keys($groups);
if (empty($id_groups)) {
$whereAlertSimple .= ' AND (1 = 0) ';
} else {
$whereAlertSimple .= sprintf(
' AND id_agent_module IN (
SELECT tam.id_agente_modulo
FROM tagente_modulo tam
WHERE tam.id_agente IN (SELECT ta.id_agente
FROM tagente ta LEFT JOIN tagent_secondary_group tasg ON
ta.id_agente = tasg.id_agent
WHERE (ta.id_grupo IN (%s) OR tasg.id_group IN (%s)))) ',
implode(',', $id_groups),
implode(',', $id_groups)
);
}
$alerts = [];
if ($agent_view_page === true) {
$options_simple = ['order' => $order];
} else {
$options_simple = [
'order' => $order,
'limit' => $length,
'offset' => $start,
];
}
if ($idAgent !== 0) {
$filter_alert['disabled'] = 'all_enabled';
}
if (is_metaconsole() === true) {
include_once $config['homedir'].'/enterprise/meta/include/functions_alerts_meta.php';
if ($idAgent != 0) {
$alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
$countAlertsSimple = alerts_meta_get_alerts($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
} else {
$id_groups = array_keys(
users_get_groups($config['id_user'], 'AR', false)
);
$alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
$countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
}
} else {
if ($idAgent != 0) {
$alerts['alerts_simple'] = agents_get_alerts_simple($idAgent, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter);
$countAlertsSimple = agents_get_alerts_simple($idAgent, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter);
} else {
$id_groups = array_keys(
users_get_groups($config['id_user'], $access, false)
);
$alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
$countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
}
}
$data = [];
if ($alerts['alerts_simple']) {
foreach ($alerts['alerts_simple'] as $alert) {
$data[] = ui_format_alert_row($alert, true, $url, 'font-size: 7pt;');
}
$data = array_reduce(
$data,
function ($carry, $row) {
// Transforms array of arrays $data into an array
// of objects, making a post-process of certain fields.
$tmp = new stdClass();
// Standby.
$tmp->policy = $row[0];
$tmp->standby = $row[1];
$tmp->force = $row[2];
$tmp->agent = $row[3];
$tmp->module = $row[4];
$tmp->template = $row[5];
$tmp->action = $row[6];
$tmp->lastFired = $row[7];
$tmp->status = $row[8];
$tmp->validate = $row[9];
$carry[] = $tmp;
return $carry;
}
);
}
// Datatables format: RecordsTotal && recordsfiltered.
echo json_encode(
[
'data' => $data,
'recordsTotal' => $countAlertsSimple,
'recordsFiltered' => $countAlertsSimple,
]
);
// Capture output.
$response = ob_get_clean();
} catch (\Exception $e) {
echo json_encode(['error' => $e->getMessage()]);
exit;
}
// If not valid, show error with issue.
json_decode($response);
if (json_last_error() == JSON_ERROR_NONE) {
// If valid dump.
echo $response;
} else {
echo json_encode(
['error' => $response]
);
}
}
return;

View File

@ -90,6 +90,7 @@ $node_id = (int) get_parameter('node_id', 0);
if ($get_comments === true) {
$event = get_parameter('event', false);
$event_rep = get_parameter('event_rep', false);
if ($event === false) {
return __('Failed to retrieve comments');
}
@ -97,13 +98,11 @@ if ($get_comments === true) {
$eventsGrouped = [];
// Consider if the event is grouped.
$whereGrouped = '1=1';
if (isset($event['event_rep']) === true && $event['event_rep'] > 0) {
if (isset($event_rep) === true && $event_rep > 0) {
// Default grouped message filtering (evento and estado).
$whereGrouped = sprintf(
'`evento` = "%s" AND `estado` = "%s" AND `event_type` = "%s" ',
$event['evento'],
$event['estado'],
$event['event_type']
'`evento` = "%s"',
$event['evento']
);
// If id_agente is reported, filter the messages by them as well.
@ -120,6 +119,8 @@ if ($get_comments === true) {
(int) $event['id_agentmodule']
);
}
} else {
$whereGrouped = sprintf('`id_evento` = %d', $event['id_evento']);
}
try {
@ -358,6 +359,7 @@ if ($save_event_filter) {
io_json_mb_encode([])
);
$values['filter_only_alert'] = get_parameter('filter_only_alert');
$values['search_secondary_groups'] = get_parameter('search_secondary_groups');
$values['id_group_filter'] = get_parameter('id_group_filter');
$values['date_from'] = get_parameter('date_from');
$values['time_from'] = get_parameter('time_from');
@ -414,6 +416,7 @@ if ($update_event_filter) {
io_json_mb_encode([])
);
$values['filter_only_alert'] = get_parameter('filter_only_alert');
$values['search_secondary_groups'] = get_parameter('search_secondary_groups');
$values['id_group_filter'] = get_parameter('id_group_filter');
$values['date_from'] = get_parameter('date_from');
$values['time_from'] = get_parameter('time_from');
@ -459,31 +462,32 @@ if ($get_filter_values) {
if ($event_filter === false) {
$event_filter = [
'status' => EVENT_NO_VALIDATED,
'event_view_hr' => $config['event_view_hr'],
'group_rep' => 1,
'tag_with' => [],
'tag_without' => [],
'history' => false,
'module_search' => '',
'filter_only_alert' => '-1',
'user_comment' => '',
'id_extra' => '',
'id_user_ack' => '',
'date_from' => '',
'time_from' => '',
'date_to' => '',
'time_to' => '',
'severity' => '',
'event_type' => '',
'group_rep' => 0,
'id_group' => 0,
'id_group_filter' => 0,
'group_name' => 'All',
'text_agent' => '',
'id_agent' => 0,
'id_name' => 'None',
'filter_id' => 0,
'status' => EVENT_NO_VALIDATED,
'event_view_hr' => $config['event_view_hr'],
'group_rep' => 1,
'tag_with' => [],
'tag_without' => [],
'history' => false,
'module_search' => '',
'filter_only_alert' => '-1',
'search_secondary_groups' => 0,
'user_comment' => '',
'id_extra' => '',
'id_user_ack' => '',
'date_from' => '',
'time_from' => '',
'date_to' => '',
'time_to' => '',
'severity' => '',
'event_type' => '',
'group_rep' => 0,
'id_group' => 0,
'id_group_filter' => 0,
'group_name' => 'All',
'text_agent' => '',
'id_agent' => 0,
'id_name' => 'None',
'filter_id' => 0,
];
} else {
$event_filter['module_search'] = io_safe_output(
@ -651,6 +655,8 @@ function load_form_filter() {
$("#hidden-tag_without").val(val);
if (i == 'filter_only_alert')
$("#filter_only_alert").val(val);
if (i == 'search_secondary_groups')
$("#checkbox-search_secondary_groups").val(val);
if (i == 'id_group_filter')
$("#id_group_filter").val(val);
if (i == 'source')
@ -893,6 +899,7 @@ function save_new_filter() {
"tag_with": Base64.decode($("#hidden-tag_with").val()),
"tag_without": Base64.decode($("#hidden-tag_without").val()),
"filter_only_alert" : $("#filter_only_alert").val(),
"search_secondary_groups" : $("#checkbox-search_secondary_groups").val(),
"id_group_filter": $("#id_group_filter_dialog").val(),
"date_from": $("#text-date_from").val(),
"time_from": $("#text-time_from").val(),
@ -968,6 +975,7 @@ function save_update_filter() {
"tag_with" : Base64.decode($("#hidden-tag_with").val()),
"tag_without" : Base64.decode($("#hidden-tag_without").val()),
"filter_only_alert" : $("#filter_only_alert").val(),
"search_secondary_groups" : $("#checkbox-search_secondary_groups").val(),
"id_group_filter": $("#id_group_filter_dialog").val(),
"date_from": $("#text-date_from").val(),
"time_from": $("#text-time_from").val(),
@ -1624,7 +1632,7 @@ if ($get_extended_event) {
$filter = get_parameter('filter', []);
$similar_ids = get_parameter('similar_ids', $event_id);
$group_rep = $filter['group_rep'];
$event_rep = $event['event_rep'];
$event_rep = $group_rep;
$timestamp_first = $event['timestamp_first'];
$timestamp_last = $event['timestamp_last'];
$server_id = $event['server_id'];
@ -1959,7 +1967,8 @@ if ($get_extended_event) {
data : {
page: "include/ajax/events",
get_comments: 1,
event: '.json_encode($event).'
event: '.json_encode($event).',
event_rep: '.$event_rep.'
},
dataType : "html",
success: function (data) {
@ -2469,6 +2478,7 @@ if ($get_events_fired) {
'tag_with' => [],
'tag_without' => [],
'filter_only_alert' => -1,
'search_secondary_groups' => 0,
'source' => '',
'id_extra' => '',
'user_comment' => '',

View File

@ -2483,14 +2483,12 @@ class ConsoleSupervisor
SERVER_TYPE_ENTERPRISE_SATELLITE
)
);
$missed = 0;
if (is_array($server_version_list) === true) {
foreach ($server_version_list as $server) {
if (strpos(
$server['version'],
(string) floor($config['current_package'])
(string) floor((int) $config['current_package'])
) === false
) {
$missed++;

View File

@ -0,0 +1,768 @@
<?php
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
/**
* Controller for Audit Logs
*
* @category Controller
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 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.
* ============================================================================
*/
use Mpdf\Tag\Address;
use PandoraFMS\Agent as PandoraFMSAgent;
use PandoraFMS\Enterprise\Agent;
use function Composer\Autoload\includeFile;
// Begin.
global $config;
// Necessary classes for extends.
require_once $config['homedir'].'/include/class/HTML.class.php';
require_once $config['homedir'].'/include/functions_servers.php';
enterprise_include_once('include/functions_satellite.php');
/**
* Class SatelliteAgent
*/
class SatelliteAgent extends HTML
{
/**
* Allowed methods to be called using AJAX request.
*
* @var array
*/
public $AJAXMethods = [
'draw',
'addAgent',
'deleteAgent',
'loadModal',
];
/**
* Ajax page.
*
* @var string
*/
private $ajaxController;
/**
* Class constructor
*
* @param string $ajaxController Ajax controller.
*/
public function __construct(string $ajaxController)
{
global $config;
check_login();
if (check_acl($config['id_user'], 0, 'PM') === false
&& is_user_admin($config['id_user']) === true
) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access Satellite agents'
);
include 'general/noaccess.php';
return;
}
// Set the ajax controller.
$this->ajaxController = $ajaxController;
// Capture all parameters before start.
$this->satellite_server = (int) get_parameter('server_remote');
if ($this->satellite_server !== 0) {
$this->satellite_name = servers_get_name($this->satellite_server);
$this->satellite_config = (array) config_satellite_get_config_file($this->satellite_name);
}
}
/**
* Run view
*
* @return void
*/
public function run()
{
// Javascript.
ui_require_jquery_file('pandora');
// CSS.
ui_require_css_file('wizard');
ui_require_css_file('discovery');
global $config;
// Datatables list.
try {
$columns = [
'name',
'address',
'actions',
];
$column_names = [
__('Agent Name'),
__('IP Adrress'),
__('Actions'),
];
$this->tableId = 'satellite_agents';
if (is_metaconsole() === true) {
// Only in case of Metaconsole, format the frame.
open_meta_frame();
}
// Load datatables user interface.
ui_print_datatable(
[
'id' => $this->tableId,
'class' => 'info_table',
'style' => 'width: 100%',
'columns' => $columns,
'column_names' => $column_names,
'ajax_url' => $this->ajaxController,
'ajax_data' => [
'method' => 'draw',
'server_remote' => $this->satellite_server,
],
'ajax_postprocces' => 'process_datatables_item(item)',
'no_sortable_columns' => [
0,
1,
2,
],
'search_button_class' => 'sub filter float-right',
'form' => [
'inputs' => [
[
'label' => __('Search').ui_print_help_tip(
__('Search filter by alias, name, description, IP address or custom fields content'),
true
),
'type' => 'text',
'name' => 'filter_search',
'size' => 12,
],
],
],
]
);
} catch (Exception $e) {
echo $e->getMessage();
}
if (is_metaconsole() === true) {
// Close the frame.
close_meta_frame();
}
// Auxiliar div.
$modal = '<div id="modal" class="invisible"></div>';
$msg = '<div id="msg" class="invisible"></div>';
$aux = '<div id="aux" class="invisible"></div>';
echo $modal.$msg.$aux;
// Create button.
echo '<div class="w100p flex-content-right">';
html_print_submit_button(
__('Add host'),
'create',
false,
'class="sub next"'
);
echo '</div>';
// Load own javascript file.
echo $this->loadJS();
}
/**
* Get the data for draw the table.
*
* @return void.
*/
public function draw()
{
global $config;
// Initialice filter.
$filter = '1=1';
// Init data.
$data = [];
// Count of total records.
$count = 0;
// Catch post parameters.
$start = get_parameter('start', 0);
$length = get_parameter('length', $config['block_size']);
$order = get_datatable_order(true);
$filters = get_parameter('filter', []);
try {
ob_start();
$data = [];
foreach ($this->satellite_config as $line) {
$re = '/^#*add_host \b(\S+) (\S*)$/m';
if (preg_match($re, $line, $matches, PREG_OFFSET_CAPTURE, 0) > 0) {
$agent['address'] = $matches[1][0];
if (isset($matches[2][0]) === false || empty($matches[2][0]) === true) {
$agent['name'] = '';
} else {
$agent['name'] = $matches[2][0];
}
if (empty($filters['filter_search']) === false) {
if (empty(preg_grep('/'.$filters['filter_search'].'?/mi', array_values($agent))) === true) {
continue;
}
}
array_push($data, $agent);
}
}
if (empty($data) === false) {
$data = array_reduce(
$data,
function ($carry, $item) {
global $config;
// Transforms array of arrays $data into an array
// of objects, making a post-process of certain fields.
$tmp = (object) $item;
$tmp->actions .= html_print_image(
'images/cross.png',
true,
[
'border' => '0',
'class' => 'action_button_img invert_filter',
'onclick' => 'delete_agent(\''.$tmp->address.'\',\''.$tmp->name.'\')',
]
);
$carry[] = $tmp;
return $carry;
}
);
}
$data = array_slice($data, $start, $length, true);
$total = count($data);
echo json_encode(
[
'data' => $data,
'recordsTotal' => $total,
'recordsFiltered' => $total,
]
);
// Capture output.
$response = ob_get_clean();
} catch (Exception $e) {
echo json_encode(['error' => $e->getMessage()]);
exit;
}
// If not valid, show error with issue.
json_decode($response);
if (json_last_error() == JSON_ERROR_NONE) {
// If valid dump.
echo $response;
} else {
echo json_encode(
['error' => $response]
);
}
exit;
}
/**
* Prints inputs for modal "Add agent".
*
* @return void
*/
public function loadModal()
{
$values['address'] = get_parameter('address', null);
$values['name'] = get_parameter('name', null);
echo $this->printInputs($values);
}
/**
* Generates inputs for new/update agents.
*
* @param array $values Values or null.
*
* @return string Inputs.
*/
public function printInputs($values=null)
{
if (!is_array($values)) {
$values = [];
}
$return_all_group = false;
if (users_can_manage_group_all('AR') === true) {
$return_all_group = true;
}
$form = [
'action' => '#',
'id' => 'modal_form',
'onsubmit' => 'return false;',
'class' => 'modal',
];
$inputs = [];
$inputs[] = [
'label' => __('Agent address'),
'id' => 'div-identifier',
'arguments' => [
'name' => 'address',
'type' => 'text',
'value' => $values['address'],
'return' => true,
],
];
$inputs[] = [
'label' => __('Agent name'),
'id' => 'div-identifier',
'arguments' => [
'name' => 'name',
'type' => 'text',
'value' => $values['name'],
'return' => true,
],
];
return $this->printForm(
[
'form' => $form,
'inputs' => $inputs,
],
true
);
}
/**
* Add agent to satellite conf.
*
* @return void
*/
public function addAgent()
{
global $config;
$values['address'] = get_parameter('address');
$values['name'] = get_parameter('name');
if ($this->parseSatelliteConf('save', $values) === false) {
$this->ajaxMsg('error', __('Error saving agent'));
} else {
$this->ajaxMsg('result', _('Host '.$values['addres'].' added.'));
}
exit;
}
/**
* Delete agent from satellite conf.
*
* @return void
*/
public function deleteAgent()
{
$values['address'] = get_parameter('address', '');
$values['name'] = get_parameter('name', '');
if ($this->parseSatelliteConf('delete', $values) === false) {
$this->ajaxMsg('error', __('Error saving agent'));
} else {
$this->ajaxMsg('result', _('Host '.$values['addres'].' added.'));
}
exit;
}
/**
* Parse satellite configuration .
*
* @param string $action Action to perform (save, delete).
* @param array $values.
* @return void
*/
private function parseSatelliteConf(string $action, array $values)
{
switch ($action) {
case 'save':
if (isset($values['address']) === true && empty($values['address']) === false) {
$string_hosts = 'add_host '.$values['address'].' '.$values['name']."\n";
// Add host to conf
array_push($this->satellite_config, $string_hosts);
// Check config.
if (empty($this->satellite_config)) {
return false;
}
$conf = implode('', $this->satellite_config);
} else {
return false;
}
break;
case 'delete':
$conf = implode('', $this->satellite_config);
// Find agent to mark for deletion.
$pattern = io_safe_expreg($values['address'].' '.$values['name']);
$re = "/add_host ($pattern)/m";
$subst = 'delete_host $1';
$conf = preg_replace($re, $subst, $conf);
break;
default:
$this->ajaxMsg('error', __('Error'));
exit;
}
return $this->saveAgent($conf);
}
/**
* Saves agent to satellite cofiguration file.
*
* @param array $values
* @return void
*/
private function saveAgent(string $new_conf)
{
global $config;
if (empty($new_conf)) {
return false;
}
db_pandora_audit(
AUDIT_LOG_SYSTEM,
'Update remote config for server '.$this->satellite_name
);
// Convert to config file encoding.
$encoding = config_satellite_get_encoding($new_conf);
if ($encoding !== false) {
$converted_server_config = mb_convert_encoding($new_conf, $encoding, 'UTF-8');
if ($converted_server_config !== false) {
$new_conf = $converted_server_config;
}
}
// Get filenames.
if ($this->satellite_server !== false) {
$files = config_satellite_get_satellite_config_filenames($this->satellite_name);
} else {
$files = [];
$files['conf'] = $config['remote_config'].'/conf/'.md5($this->satellite_name).'.srv.conf';
$files['md5'] = $config['remote_config'].'/md5/'.md5($this->satellite_name).'.srv.md5';
}
// Save configuration
$result = file_put_contents($files['conf'], $new_conf);
if ($result === false) {
return false;
}
// Save configuration md5
$result = file_put_contents($files['md5'], md5($new_conf));
}
/**
* Checks if target method is available to be called using AJAX.
*
* @param string $method Target method.
*
* @return boolean True allowed, false not.
*/
public function ajaxMethod(string $method)
{
return in_array($method, $this->AJAXMethods);
}
/**
* Minor function to dump json message as ajax response.
*
* @param string $type Type: result || error.
* @param string $msg Message.
* @param boolean $delete Deletion messages.
*
* @return void
*/
private function ajaxMsg($type, $msg, $delete=false)
{
$msg_err = 'Failed while saving: %s';
$msg_ok = 'Successfully saved agent ';
if ($delete) {
$msg_err = 'Failed while removing: %s';
$msg_ok = 'Successfully deleted ';
}
if ($type == 'error') {
echo json_encode(
[
$type => ui_print_error_message(
__(
$msg_err,
$msg
),
'',
true
),
]
);
} else {
echo json_encode(
[
$type => ui_print_success_message(
__(
$msg_ok,
$msg
),
'',
true
),
]
);
}
exit;
}
/**
* Load Javascript code.
*
* @return string.
*/
public function loadJS()
{
// Nothing for this moment.
ob_start();
// Javascript content.
?>
<script type="text/javascript">
/**
* Cleanup current dom entries.
*/
function cleanupDOM() {
$('#div-address').empty();
$('#div-name').empty();
}
/**
* Process ajax responses and shows a dialog with results.
*/
function showMsg(data) {
var title = "<?php echo __('Success'); ?>";
var dt_satellite_agents = $("#satellite_agents").DataTable();
var text = '';
var failed = 0;
try {
data = JSON.parse(data);
text = data['result'];
} catch (err) {
title = "<?php echo __('Failed'); ?>";
text = err.message;
failed = 1;
}
if (!failed && data['error'] != undefined) {
title = "<?php echo __('Failed'); ?>";
text = data['error'];
failed = 1;
}
if (data['report'] != undefined) {
data['report'].forEach(function (item){
text += '<br>'+item;
});
}
$('#msg').empty();
$('#msg').html(text);
$('#msg').dialog({
width: 450,
position: {
my: 'center',
at: 'center',
of: window,
collision: 'fit'
},
title: title,
buttons: [
{
class: "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next",
text: 'OK',
click: function(e) {
if (!failed) {
$(".ui-dialog-content").dialog("close");
$('.info').hide();
cleanupDOM();
dt_<?php echo $this->tableId; ?>.draw(false);
} else {
$(this).dialog('close');
}
}
}
]
});
}
/**
* Loads modal from AJAX to add a new agent.
*/
function show_form(address) {
var btn_ok_text = '<?php echo __('OK'); ?>';
var btn_cancel_text = '<?php echo __('Cancel'); ?>';
var title = '<?php echo __('Add agent to satellite'); ?>';
var method = 'addAgent';
load_modal({
target: $('#modal'),
form: 'modal_form',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
ajax_callback: showMsg,
cleanup: cleanupDOM,
modal: {
title: title,
ok: btn_ok_text,
cancel: btn_cancel_text,
},
extradata: [
{
name: 'server_remote',
value: <?php echo $this->satellite_server; ?>,
}
],
onshow: {
page: '<?php echo $this->ajaxController; ?>',
method: 'loadModal'
},
onsubmit: {
page: '<?php echo $this->ajaxController; ?>',
method: method
}
});
}
/**
* Delete selected agent
*/
function delete_agent(address, name) {
$('#aux').empty();
$('#aux').text('<?php echo __('Are you sure?'); ?>');
$('#aux').dialog({
title: '<?php echo __('Delete'); ?> ' + address,
buttons: [
{
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel',
text: '<?php echo __('Cancel'); ?>',
click: function(e) {
$(this).dialog('close');
cleanupDOM();
}
},
{
text: 'Delete',
class: 'ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next',
click: function(e) {
$.ajax({
method: 'post',
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
data: {
page: 'enterprise/godmode/servers/agents_satellite',
method: 'deleteAgent',
address: address,
name: name,
server_remote: <?php echo $this->satellite_server; ?>,
},
datatype: "json",
success: function (data) {
showMsg(data);
},
error: function(e) {
showMsg(e);
}
});
}
}
]
});
}
$(document).ready(function() {
$("#submit-create").on('click', function(){
show_form();
});
});
</script>
<?php
// EOF Javascript content.
return ob_get_clean();
}
}

View File

@ -252,6 +252,7 @@ class TreeService extends Tree
protected function getProcessedServices()
{
$is_favourite = $this->getServiceFavouriteFilter();
$service_search = $this->getServiceNameSearchFilter();
if (users_can_manage_group_all('AR')) {
$groups_acl = '';
@ -259,6 +260,16 @@ class TreeService extends Tree
$groups_acl = 'AND ts.id_group IN ('.implode(',', $this->userGroupsArray).')';
}
$exclude_children = 'ts.id NOT IN (
SELECT DISTINCT id_service_child
FROM tservice_element
WHERE id_server_meta = 0
)';
if ($service_search !== '') {
$exclude_children = '1=1';
}
$sql = sprintf(
'SELECT
ts.id,
@ -277,15 +288,14 @@ class TreeService extends Tree
FROM tservice ts
LEFT JOIN tservice_element tse
ON tse.id_service = ts.id
WHERE ts.id NOT IN (
SELECT DISTINCT id_service_child
FROM tservice_element
WHERE id_server_meta = 0
)
WHERE %s
%s
%s
%s
GROUP BY ts.id',
$exclude_children,
$is_favourite,
$service_search,
$groups_acl
);
@ -722,6 +732,23 @@ class TreeService extends Tree
}
/**
* Retrieve SQL filter for current filter
*
* @return string SQL filter.
*/
protected function getServiceNameSearchFilter()
{
if (isset($this->filter['searchService']) === true
&& empty($this->filter['searchService']) === false
) {
return " AND (ts.name LIKE '%".$this->filter['searchService']."%' OR ts.description LIKE '%".$this->filter['searchService']."%')";
}
return '';
}
/**
* Overwrites partial functionality of general Tree.class.
*

View File

@ -20,8 +20,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC220715';
$pandora_version = 'v7.0NG.763';
$build_version = 'PC220829';
$pandora_version = 'v7.0NG.764';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();

View File

@ -5996,6 +5996,38 @@ function send_test_email(
}
/**
* Check ip is valid into network
*
* @param string $ip Ip XXX.XXX.XXX.XXX.
* @param string $cidr Network XXX.XXX.XXX.XXX/XX.
*
* @return boolean
*/
function cidr_match($ip, $cidr)
{
list($subnet, $mask) = explode('/', $cidr);
if ((ip2long($ip) & ~((1 << (32 - $mask)) - 1) ) == ip2long($subnet)) {
return true;
}
return false;
}
/**
* Microtime float number.
*
* @return float
*/
function microtime_float()
{
list($usec, $sec) = explode(' ', microtime());
return ((float) $usec + (float) $sec);
}
/**
* Return array of ancestors of item, given array.
*
@ -6065,3 +6097,123 @@ if (function_exists('str_contains') === false) {
}
/**
* Is reporting console node.
*
* @return boolean
*/
function is_reporting_console_node()
{
global $config;
if (isset($config['reporting_console_enable']) === true
&& (bool) $config['reporting_console_enable'] === true
&& isset($config['reporting_console_node']) === true
&& (bool) $config['reporting_console_node'] === true
) {
return true;
}
return false;
}
/**
* Acl reporting console node.
*
* @param string $path Path.
*
* @return boolean
*/
function acl_reporting_console_node($path, $tab='')
{
global $config;
if (is_reporting_console_node() === false) {
return true;
}
if (is_metaconsole() === true) {
if ($path === 'advanced/metasetup') {
switch ($tab) {
case 'update_manager_online':
case 'update_manager_offline':
case 'update_manager_history':
case 'update_manager_setup':
case 'file_manager':
return true;
default:
return false;
}
}
if ($path === 'advanced/users_setup') {
switch ($tab) {
case 'user_edit':
return true;
default:
return false;
}
}
if ($path === $config['homedir'].'/godmode/users/configure_user'
|| $path === 'advanced/links'
|| $path === $config['homedir'].'/enterprise/extensions/cron'
) {
return true;
}
} else {
if ($path === 'godmode/servers/discovery') {
switch ($tab) {
case 'main':
case 'tasklist':
return true;
default:
return false;
}
}
if ($path === 'operation/users/user_edit'
|| $path === 'operation/users/user_edit_notifications'
|| $path === 'godmode/setup/file_manager'
|| $path === 'godmode/update_manager/update_manager'
) {
return true;
}
}
return false;
}
/**
* Necessary checks for the reporting console.
*
* @return string
*/
function notify_reporting_console_node()
{
$return = '';
// Check php memory limit.
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
if ($PHPmemory_limit !== -1) {
$url = 'http://php.net/manual/en/ini.core.php#ini.memory-limit';
if ($config['language'] == 'es') {
$url = 'http://php.net/manual/es/ini.core.php#ini.memory-limit';
}
$msg = __("Not recommended '%s' value in PHP configuration", $PHPmemory_limit);
$msg .= '<br>'.__('Recommended value is: -1');
$msg .= '<br>'.__('Please, change it on your PHP configuration file (php.ini) or contact with administrator');
$msg .= '<br><a href="'.$url.'" target="_blank">'.__('Documentation').'</a>';
$return = ui_print_error_message($msg, '', true);
}
return $return;
}

View File

@ -369,7 +369,11 @@ function agents_get_alerts_simple($id_agent=false, $filter='', $options=false, $
}
// Filter by agents id.
$id_agents_list = implode(',', $id_agent);
if (is_array($id_agent) === true && empty($id_agent) === false) {
$id_agents_list = implode(',', $id_agent);
} else {
$id_agents_list = $id_agent;
}
if ($id_agents_list === '') {
$id_agents_list = '0';

View File

@ -2109,7 +2109,7 @@ function get_group_alerts(
if (is_array($filter)) {
$disabled = $filter['disabled'];
if (isset($filter['standby'])) {
if ((isset($filter['standby']) === true) && ($filter['standby'] !== '')) {
$filter = $group_query.' AND talert_template_modules.standby = "'.$filter['standby'].'"';
} else {
$filter = $group_query;

View File

@ -358,6 +358,10 @@ function config_update_config()
$error_update[] = __('Module Custom ID read only');
}
if (config_update_value('reporting_console_enable', get_parameter('reporting_console_enable'), true) === false) {
$error_update[] = __('Enable console report');
}
if (config_update_value('unique_ip', get_parameter('unique_ip'), true) === false) {
$error_update[] = __('Unique IP');
}
@ -2193,6 +2197,10 @@ function config_process_config()
config_update_value('module_custom_id_ro', 0);
}
if (!isset($config['reporting_console_enable'])) {
config_update_value('reporting_console_enable', 0);
}
if (!isset($config['elasticsearch_ip'])) {
config_update_value('elasticsearch_ip', '');
}

View File

@ -422,11 +422,37 @@ function cron_list_table()
array_keys(users_get_groups())
);
$defined_tasks = db_get_all_rows_filter(
'tuser_task_scheduled',
'id_grupo IN ('.$user_groups.')'
$filter = '';
if (is_reporting_console_node() === true) {
$write_perms = false;
$manage_perms = false;
$manage_pandora = false;
$filter .= sprintf(
' AND (
tuser_task.function_name = "cron_task_generate_report"
OR tuser_task.function_name = "cron_task_generate_report_by_template"
OR tuser_task.function_name = "cron_task_save_report_to_disk"
)'
);
}
// Admin.
$sql = sprintf(
'SELECT tuser_task_scheduled.*
FROM tuser_task_scheduled
INNER JOIN tuser_task
ON tuser_task_scheduled.id_user_task = tuser_task.id
WHERE
id_grupo IN (%s)
%s
',
$user_groups,
$filter
);
$defined_tasks = db_get_all_rows_sql($sql);
if (!check_acl($config['id_user'], 0, 'PM')) {
$read_tasks = [];
foreach ($defined_tasks as $task) {
@ -466,7 +492,10 @@ function cron_list_table()
$table->head[4] = __('Next execution');
$table->head[5] = __('Last run');
$table->head[6] = __('Group');
$table->head[7] = __('Actions');
if ($manage_perms || $manage_pandora) {
$table->head[7] = __('Actions');
}
$table->align[7] = 'left';
foreach ($defined_tasks as $task) {
@ -521,7 +550,7 @@ function cron_list_table()
break;
case 'cron_task_generate_report':
if ((bool) $task['enabled'] === true && ($write_perms === true || $manage_pandora === true)) {
if ((bool) $task['enabled'] === true) {
$data[0] = html_print_anchor(
[
'href' => sprintf(
@ -576,7 +605,7 @@ function cron_list_table()
break;
case 'cron_task_generate_report_by_template':
if ((bool) $task['enabled'] === true && ($write_perms === true || $manage_pandora === true)) {
if ((bool) $task['enabled'] === true) {
$data[0] = html_print_anchor(
[
'href' => sprintf(
@ -928,25 +957,27 @@ function cron_list_table()
}
}
$data[7] .= html_print_anchor(
[
'href' => sprintf(
'%stoggle_console_task=%s&id_user_task=%s',
$url,
((bool) $task['enabled'] === true) ? '0' : '1',
$task['id']
),
'content' => html_print_image(
((bool) $task['enabled'] === true) ? 'images/lightbulb.png' : 'images/lightbulb_off.png',
true,
[
'title' => ((bool) $task['enabled'] === true) ? __('Disable task') : __('Enable task'),
'class' => 'invert_filter',
]
),
],
true
);
if ($manage_perms || $manage_pandora) {
$data[7] .= html_print_anchor(
[
'href' => sprintf(
'%stoggle_console_task=%s&id_user_task=%s',
$url,
((bool) $task['enabled'] === true) ? '0' : '1',
$task['id']
),
'content' => html_print_image(
((bool) $task['enabled'] === true) ? 'images/lightbulb.png' : 'images/lightbulb_off.png',
true,
[
'title' => ((bool) $task['enabled'] === true) ? __('Disable task') : __('Enable task'),
'class' => 'invert_filter',
]
),
],
true
);
}
array_push($table->data, $data);
}

View File

@ -626,6 +626,7 @@ function events_update_status($id_evento, $status, $filter=null)
* 'tag_with'
* 'tag_without'
* 'filter_only_alert'
* 'search_secondary_groups'
* 'module_search'
* 'group_rep'
* 'server_id'
@ -904,11 +905,18 @@ function events_get_all(
$groups = [ $groups ];
}
$sql_filters[] = sprintf(
' AND (te.id_grupo IN (%s) OR tasg.id_group IN (%s))',
join(',', $groups),
join(',', $groups)
);
if ((bool) $filter['search_secondary_groups'] === true) {
$sql_filters[] = sprintf(
' AND (te.id_grupo IN (%s) OR tasg.id_group IN (%s))',
join(',', $groups),
join(',', $groups)
);
} else {
$sql_filters[] = sprintf(
' AND te.id_grupo IN (%s)',
join(',', $groups)
);
}
}
// Skip system messages if user is not PM.
@ -982,11 +990,18 @@ function events_get_all(
$EW_groups = users_get_groups($config['id_user'], 'EW', true, true);
// Get groups where user have ER grants.
$sql_filters[] = sprintf(
' AND (te.id_grupo IN ( %s ) OR tasg.id_group IN (%s))',
join(', ', array_keys($ER_groups)),
join(', ', array_keys($ER_groups))
);
if ((bool) $filter['search_secondary_groups'] === true) {
$sql_filters[] = sprintf(
' AND (te.id_grupo IN ( %s ) OR tasg.id_group IN (%s))',
join(', ', array_keys($ER_groups)),
join(', ', array_keys($ER_groups))
);
} else {
$sql_filters[] = sprintf(
' AND te.id_grupo IN ( %s )',
join(', ', array_keys($ER_groups))
);
}
}
// Prepare agent join sql filters.
@ -1076,18 +1091,36 @@ function events_get_all(
// Custom data.
if (empty($filter['custom_data']) === false) {
if ($filter['custom_data_filter_type'] === '1') {
$sql_filters[] = sprintf(
' AND JSON_VALID(custom_data) = 1
AND (JSON_EXTRACT(custom_data, "$.*") LIKE lower("%%%s%%") COLLATE utf8mb4_0900_ai_ci) ',
io_safe_output($filter['custom_data'])
);
if (isset($config['dbconnection']->server_version) === true
&& $config['dbconnection']->server_version > 80000
) {
if ($filter['custom_data_filter_type'] === '1') {
$sql_filters[] = sprintf(
' AND JSON_VALID(custom_data) = 1
AND (JSON_EXTRACT(custom_data, "$.*") LIKE lower("%%%s%%") COLLATE utf8mb4_0900_ai_ci) ',
io_safe_output($filter['custom_data'])
);
} else {
$sql_filters[] = sprintf(
' AND JSON_VALID(custom_data) = 1
AND (JSON_SEARCH(JSON_KEYS(custom_data), "all", lower("%%%s%%") COLLATE utf8mb4_0900_ai_ci) IS NOT NULL) ',
io_safe_output($filter['custom_data'])
);
}
} else {
$sql_filters[] = sprintf(
' AND JSON_VALID(custom_data) = 1
AND (JSON_SEARCH(JSON_KEYS(custom_data), "all", lower("%%%s%%") COLLATE utf8mb4_0900_ai_ci) IS NOT NULL) ',
io_safe_output($filter['custom_data'])
);
if ($filter['custom_data_filter_type'] === '1') {
$sql_filters[] = sprintf(
' AND JSON_VALID(custom_data) = 1 AND JSON_EXTRACT(custom_data, "$.*") LIKE lower("%%%s%%") ',
$filter['custom_data'],
$filter['custom_data']
);
} else {
$sql_filters[] = sprintf(
' AND JSON_VALID(custom_data) = 1 AND JSON_KEYS(custom_data) REGEXP "%s" ',
$filter['custom_data'],
$filter['custom_data']
);
}
}
}
@ -1246,7 +1279,8 @@ function events_get_all(
// Table tag for id_grupo.
'te.',
// Alt table tag for id_grupo.
$user_admin_group_all
$user_admin_group_all,
(bool) $filter['search_secondary_groups']
);
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
} else if (check_acl($config['id_user'], 0, 'EW')) {
@ -1272,7 +1306,8 @@ function events_get_all(
// Table tag for id_grupo.
'te.',
// Alt table tag for id_grupo.
$user_admin_group_all
$user_admin_group_all,
(bool) $filter['search_secondary_groups']
);
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
} else if (check_acl($config['id_user'], 0, 'EM')) {
@ -1298,7 +1333,8 @@ function events_get_all(
// Table tag for id_grupo.
'te.',
// Alt table tag for id_grupo.
$user_admin_group_all
$user_admin_group_all,
(bool) $filter['search_secondary_groups']
);
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
}
@ -1368,7 +1404,7 @@ function events_get_all(
case '1':
// Group by events.
$group_by .= 'te.evento, te.id_agente, te.id_agentmodule, te.estado';
$group_by .= 'te.evento, te.id_agente, te.id_agentmodule';
break;
case '2':
@ -1396,19 +1432,33 @@ function events_get_all(
) {
$tgrupo_join = 'INNER';
if (is_array($groups) === true) {
$tgrupo_join_filters[] = sprintf(
' (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s))
OR (tg.id_grupo = tasg.id_group AND tasg.id_group IN (%s))',
join(', ', $groups),
join(', ', $groups)
);
if ((bool) $filter['search_secondary_groups'] === true) {
$tgrupo_join_filters[] = sprintf(
' (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s))
OR (tg.id_grupo = tasg.id_group AND tasg.id_group IN (%s))',
join(', ', $groups),
join(', ', $groups)
);
} else {
$tgrupo_join_filters[] = sprintf(
' (te.id_grupo = tg.id_grupo AND tg.id_grupo IN (%s))',
join(', ', $groups)
);
}
} else {
$tgrupo_join_filters[] = sprintf(
' (te.id_grupo = tg.id_grupo AND tg.id_grupo = %s)
OR (tg.id_grupo = tasg.id_group AND tasg.id_group = %s)',
$groups,
$groups
);
if ((bool) $filter['search_secondary_groups'] === true) {
$tgrupo_join_filters[] = sprintf(
' (te.id_grupo = tg.id_grupo AND tg.id_grupo = %s)
OR (tg.id_grupo = tasg.id_group AND tasg.id_group = %s)',
$groups,
$groups
);
} else {
$tgrupo_join_filters[] = sprintf(
' (te.id_grupo = tg.id_grupo AND tg.id_grupo = %s)',
$groups
);
}
}
} else {
$tgrupo_join_filters[] = ' te.id_grupo = tg.id_grupo';
@ -1418,7 +1468,9 @@ function events_get_all(
$event_lj = '';
if (!$user_is_admin || ($user_is_admin && isset($groups) === true && $groups > 0)) {
db_process_sql('SET group_concat_max_len = 9999999');
$event_lj = events_get_secondary_groups_left_join($table);
if ((bool) $filter['search_secondary_groups'] === true) {
$event_lj = events_get_secondary_groups_left_join($table);
}
}
$group_selects = '';
@ -2199,9 +2251,9 @@ function events_create_event(
'id_usuario' => $id_user,
'id_grupo' => $id_group,
'estado' => $status,
'timestamp' => 'NOW()',
'timestamp' => date('Y-m-d H:i:s'),
'evento' => $event,
'utimestamp' => 'UNIX_TIMESTAMP(NOW())',
'utimestamp' => time(),
'event_type' => $event_type,
'id_agentmodule' => $id_agent_module,
'id_alert_am' => $id_aam,
@ -3706,7 +3758,7 @@ function events_get_response_target(
// Parse the event custom data.
if (empty($event['custom_data']) === false) {
$custom_data = json_decode(base64_decode($event['custom_data']));
$custom_data = json_decode($event['custom_data']);
foreach ($custom_data as $key => $value) {
$target = str_replace('_customdata_'.$key.'_', $value, $target);
}
@ -4248,7 +4300,7 @@ function events_page_custom_data($event)
$table->head = [];
$table->class = 'table_modal_alternate';
$json_custom_data = base64_decode($event['custom_data']);
$json_custom_data = $event['custom_data'];
$custom_data = json_decode($json_custom_data);
if ($custom_data === null) {
@ -5259,7 +5311,7 @@ function events_get_field_value_by_event_id(
// Parse the event custom data.
if (!empty($event['custom_data'])) {
$custom_data = json_decode(base64_decode($event['custom_data']));
$custom_data = json_decode($event['custom_data']);
foreach ($custom_data as $key => $val) {
$value = str_replace('_customdata_'.$key.'_', $val, $value);
}

View File

@ -1013,13 +1013,17 @@ function html_print_select(
if(count_shift_'.$id.' == 2 ){
if(shift_array_'.$id.'[0] <= shift_array_'.$id.'[1]) {
for (var i = shift_array_'.$id.'[0]; i <= shift_array_'.$id.'[1]; i++) {
var option_value = $("#'.$id.' option").eq(i).val();
options_selecteds_'.$id.'.push(option_value);
if ($("#'.$id.' option").eq(i).text().includes($(".select2-search__field").val()) == true) {
var option_value = $("#'.$id.' option").eq(i).val();
options_selecteds_'.$id.'.push(option_value);
}
}
} else {
for (var i = shift_array_'.$id.'[0]; i >= shift_array_'.$id.'[1]; i--) {
var option_value = $("#'.$id.' option").eq(i).val();
options_selecteds_'.$id.'.push(option_value);
if ($("#'.$id.' option").eq(i).text().includes($(".select2-search__field").val()) == true) {
var option_value = $("#'.$id.' option").eq(i).val();
options_selecteds_'.$id.'.push(option_value);
}
}
}
@ -6134,3 +6138,36 @@ function html_print_select_agent_secondary($agent, $id_agente, $options=[])
return $output;
}
/**
* Prints a simple 'Go Back' button.
*
* @param string $url Destination Url.
* @param array $options Options.
* `button_class`: Class for button. 'w100p' by default.
* `title`: Title of the button. 'Go Back' by default.
* `action_class`: Class of icon of button. 'cancel' by default.
* @param boolean $return If true, return a formed HTML element.
*
* @return mixed
*/
function html_print_go_back_button(string $url, array $options=[], bool $return=false)
{
$output = html_print_div(
[
'class' => ($options['button_class'] ?? 'w100p'),
'content' => html_print_button(
($options['title'] ?? __('Go back')),
'go_back',
false,
'window.location.href = \''.$url.'\'',
'class="sub '.($options['action_class'] ?? ' cancel').' right"',
true
),
],
$return
);
return $output;
}

View File

@ -95,3 +95,168 @@ function attachActionButton(
$return
);
}
/**
* Get table inputs for massive operation agents edit and delete.
*
* @param array $params Params.
*
* @return string Output.
*/
function get_table_inputs_masive_agents($params)
{
global $config;
$table = new stdClass;
$table->id = 'delete_table';
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->style = [];
$table->style[0] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold';
$table->size = [];
$table->size[0] = '15%';
$table->size[1] = '35%';
$table->size[2] = '15%';
$table->size[3] = '35%';
$table->data = [];
$table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(
false,
'AW',
true,
'id_group',
$params['id_group'],
false,
'',
'',
true
);
$table->data[0][2] = __('Group recursion');
$table->data[0][3] = html_print_checkbox(
'recursion',
1,
$params['recursion'],
true,
false
);
$status_list = [];
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[1][0] = __('Status');
$table->data[1][1] = html_print_select(
$status_list,
'status_agents',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true
);
$table->data[1][2] = __('Show agents');
$table->data[1][3] = html_print_select(
[
0 => 'Only enabled',
1 => 'Only disabled',
],
'disabled',
2,
'',
__('All'),
2,
true,
false,
true,
'',
false,
'width:30%;'
);
if (is_metaconsole() === true) {
$servers = metaconsole_get_servers();
$server_fields = [];
foreach ($servers as $key => $server) {
$server_fields[$key] = $server['server_name'];
}
$table->data[2][2] = __('Node');
$table->data[2][3] = html_print_select(
$server_fields,
'nodes[]',
0,
false,
'',
'',
true,
true,
true,
'',
false,
'min-width: 500px; max-width: 500px; max-height: 100px',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
);
}
$table->data[3][0] = __('Agents');
$table->data[3][0] .= '<span id="agent_loading" class="invisible">';
$table->data[3][0] .= html_print_image('images/spinner.png', true);
$table->data[3][0] .= '</span>';
$agents = [];
if (is_metaconsole() === false) {
$agents = agents_get_group_agents(
array_keys(users_get_groups($config['id_user'], 'AW', false)),
['disabled' => 2],
'none'
);
}
$table->data[3][1] = html_print_select(
$agents,
'id_agents[]',
0,
false,
'',
'',
true,
true,
true,
'',
false,
'min-width: 500px; max-width: 500px; max-height: 100px',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
);
$output = html_print_table($table, true);
return $output;
}

View File

@ -7079,6 +7079,10 @@ function reporting_sql($report, $content)
$historical_db = db_get_value_sql(
'SELECT historical_db from treport_content where id_rc ='.$content['id_rc']
);
if (is_metaconsole() === true) {
$historical_db = $content['historical_db'];
}
} else {
$historical_db = $content['historical_db'];
}
@ -11121,7 +11125,7 @@ function reporting_get_group_stats($id_group=0, $access='AR', $recursion=true)
*
* @return array Group statistics
*/
function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_permissions=false)
function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_permissions=false, $recursive=false)
{
global $config;
@ -11165,6 +11169,8 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_per
$id_group = array_keys(
users_get_groups($config['id_user'], $access, false)
);
} else if ($recursive === true) {
$id_group = groups_get_children_ids($id_group);
}
// -----------------------------------------------------------------
@ -11295,7 +11301,7 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_per
$group_stat = db_get_all_rows_sql($sql);
$data = [
'monitor_checks' => (int) $group_stat[0]['modules'],
'monitor_alerts' => (int) groups_monitor_alerts($group_array),
'monitor_alerts' => (int) groups_monitor_alerts($group_stat[0]['id_group']),
'monitor_alerts_fired' => (int) $group_stat[0]['alerts_fired'],
'monitor_alerts_fire_count' => (int) $group_stat[0]['alerts_fired'],
'monitor_ok' => (int) $group_stat[0]['normal'],
@ -11309,10 +11315,33 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_per
'agent_warning' => (int) $group_stat[0]['agents_warnings'],
'agent_critical' => (int) $group_stat[0]['agents_critical'],
'total_checks' => (int) $group_stat[0]['modules'],
'total_alerts' => (int) groups_monitor_alerts($group_array),
'total_alerts' => (int) groups_monitor_alerts($group_stat[0]['id_group']),
'total_agents' => (int) $group_stat[0]['agents'],
'utimestamp' => (int) $group_stat[0]['utimestamp'],
];
if ($recursive === true) {
unset($group_stat[0]);
foreach ($group_stat as $value) {
$data['monitor_checks'] = ($data['monitor_checks'] + $value['modules']);
$data['monitor_alerts'] = ($data['monitor_alerts'] + groups_monitor_alerts($value['id_group']));
$data['monitor_alerts_fired'] = ($data['monitor_alerts_fired'] + $value['alerts_fired']);
$data['monitor_alerts_fire_count'] = ($data['monitor_alerts_fire_count'] + $value['alerts_fired']);
$data['monitor_ok'] = ($data['monitor_ok'] + $value['normal']);
$data['monitor_warning'] = ($data['monitor_warning'] + $value['warning']);
$data['monitor_critical'] = ($data['monitor_critical'] + $value['critical']);
$data['monitor_unknown'] = ($data['monitor_unknown'] + $value['unknown']);
$data['monitor_not_init'] = ($data['monitor_not_init'] + $value['non-init']);
$data['agent_not_init'] = ($data['agent_not_init'] + $value['agents_not_init']);
$data['agent_unknown'] = ($data['agent_unknown'] + $value['agents_unknown']);
$data['agent_ok'] = ($data['agent_ok'] + $value['agents_normal']);
$data['agent_warning'] = ($data['agent_warning'] + $value['agents_warnings']);
$data['agent_critical'] = ($data['agent_critical'] + $value['agents_critical']);
$data['total_checks'] = ($data['total_checks'] + $value['modules']);
$data['total_alerts'] = ($data['total_alerts'] + groups_monitor_alerts($value['id_group']));
$data['total_agents'] = ($data['total_agents'] + $value['agents']);
}
}
}
}

View File

@ -751,7 +751,8 @@ function tags_get_acl_tags(
$childrens_ids=[],
$force_group_and_tag=false,
$id_grupo_table_pretag='',
$alt_id_grupo_table_pretag=''
$alt_id_grupo_table_pretag='',
$search_secondary_group=true
) {
global $config;
@ -831,7 +832,8 @@ function tags_get_acl_tags(
$force_group_and_tag,
false,
$id_grupo_table_pretag,
$alt_id_grupo_table_pretag
$alt_id_grupo_table_pretag,
$search_secondary_group
);
if (!empty($condition)) {
@ -933,7 +935,8 @@ function tags_get_acl_tags_event_condition(
$force_group_and_tag=false,
$force_equal=false,
$id_grupo_table_pretag='',
$alt_id_grupo_table_pretag=''
$alt_id_grupo_table_pretag='',
$search_secondary_group=true
) {
global $config;
$condition = [];
@ -951,7 +954,13 @@ function tags_get_acl_tags_event_condition(
// Group condition (The module belongs to an agent of the group X)
// $group_condition = sprintf('id_grupo IN (%s)', implode(',', array_values(groups_get_children_ids($group_id, true))));.
$group_condition = '('.$id_grupo_table_pretag.'id_grupo = '.$group_id.' OR '.$alt_id_grupo_table_pretag.'id_group = '.$group_id.')';
$group_condition = '('.$id_grupo_table_pretag.'id_grupo = '.$group_id;
if ($search_secondary_group === true) {
$group_condition .= ' OR '.$alt_id_grupo_table_pretag.'id_group = '.$group_id;
}
$group_condition .= ')';
// Tags condition (The module has at least one of the restricted tags).
$tags_condition = '';
@ -987,7 +996,13 @@ function tags_get_acl_tags_event_condition(
}
$in_group = implode(',', $without_tags);
$condition .= sprintf('('.$id_grupo_table_pretag.'id_grupo IN (%s) OR '.$alt_id_grupo_table_pretag.'id_group IN (%s))', $in_group, $in_group);
$condition .= sprintf('('.$id_grupo_table_pretag.'id_grupo IN (%s)', $in_group);
if ($search_secondary_group === true) {
$condition .= sprintf(' OR '.$alt_id_grupo_table_pretag.'id_group IN (%s)', $in_group);
}
$condition .= ')';
}
$condition = !empty($condition) ? "($condition)" : '';

View File

@ -473,9 +473,9 @@ function treeview_printAlertsTable($id_module, $server_data=[], $no_head=false)
if ($user_access_node && check_acl($config['id_user'], $id_group, 'LW')) {
// Actions table
echo '<div class="w100p right mw300px right_align">';
echo '<div class="w100p right_align">';
echo '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name='.$module_name.'&id_agente='.$agent_id.$url_hash.'" target="_blank">';
html_print_submit_button(__('Go to alerts edition'), 'upd_button', false, 'class="sub search"');
html_print_submit_button(__('Go to alerts edition'), 'upd_button', false, 'class="sub search" style="margin-right: 20px"');
echo '</a>';
echo '</div>';
}

View File

@ -1178,8 +1178,14 @@ function ui_format_alert_row(
$id_agent = modules_get_agentmodule_agent($alert['id_agent_module']);
}
if (is_metaconsole() === true || !can_user_access_node()) {
$data[$index['agent_name']] = ui_print_truncate_text($agent_name, 'agent_small', false, true, true, '[&hellip;]', '');
if (is_metaconsole() === true) {
// Do not show link if user cannot access node
if ((bool) can_user_access_node() === true) {
$url = $server['server_url'].'/index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$agente['id_agente'];
$data[$index['agent_name']] .= '<a href="'.$url.'">'.'<b><span class="bolder" title="'.$agente['nombre'].'">'.$agente['alias'].'</span></b></a>';
} else {
$data[$index['agent_name']] .= '<b><span class="bolder" title="'.$agente['nombre'].'">'.$agente['alias'].'</span></b>';
}
} else {
if ($agent_style !== false) {
$data[$index['agent_name']] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agent.'"> <span class="bolder" title ="'.$agente['nombre'].'">'.$agente['alias'].'</span></a>';
@ -3173,6 +3179,7 @@ function ui_progress_extend(
* 'class' => th class.
* 'style' => th style.
* 'text' => 'column1'.
* 'title' => 'column title'.
* ]
* ],
* 'columns' => [
@ -3208,12 +3215,15 @@ function ui_progress_extend(
* 'option2'
* ...
* ]
* 'no_toggle' => Pint form withouth UI toggle.
* ]
* ],
* 'extra_html' => HTML content to be placed after 'filter' section.
* 'drawCallback' => function to be called after draw. Sample in:
* https://datatables.net/examples/advanced_init/row_grouping.html
* ]
* 'zeroRecords' => Message when zero records obtained from filter.(Leave blank for default).
* 'emptyTable' => Message when table data empty.(Leave blank for default).
* End.
*
* @return string HTML code with datatable.
@ -3392,16 +3402,18 @@ function ui_print_datatable(array $parameters)
$filter .= '</li>';
$filter .= '</ul><div id="both"></div></form>';
$filter = ui_toggle(
$filter,
__('Filter'),
'',
'',
true,
false,
'white_box white_box_opened',
'no-border'
);
if (isset($parameters['form']['no_toggle']) === false && ($parameters['form']['no_toggle'] !== true)) {
$filter = ui_toggle(
$filter,
__('Filter'),
'',
'',
true,
false,
'white_box white_box_opened',
'no-border'
);
}
} else if (isset($parameters['form_html'])) {
$filter = ui_toggle(
$parameters['form_html'],
@ -3416,7 +3428,20 @@ function ui_print_datatable(array $parameters)
}
// Languages.
$processing = __('Processing');
$processing = '<div class=\'processing-datatables-inside\'>';
$processing .= '<i>'.__('Processing').'</i> ';
$processing .= str_replace(
'"',
"'",
html_print_image(
'images/spinner.gif',
true
)
);
$processing .= '</div>';
$zeroRecords = isset($parameters['zeroRecords']) === true ? $parameters['zeroRecords'] : __('No matching records found');
$emptyTable = isset($parameters['emptyTable']) === true ? $parameters['emptyTable'] : __('No data available in table');
// Extra html.
$extra = '';
@ -3441,6 +3466,7 @@ function ui_print_datatable(array $parameters)
foreach ($names as $column) {
if (is_array($column)) {
$table .= '<th id="'.$column['id'].'" class="'.$column['class'].'" ';
$table .= 'title="'.__($column['title']).'" ';
$table .= ' style="'.$column['style'].'">'.__($column['text']);
$table .= $column['extra'];
$table .= '</th>';
@ -3500,7 +3526,9 @@ function ui_print_datatable(array $parameters)
responsive: true,
dom: "plfrtiBp",
language: {
processing:"'.$processing.'"
processing:"'.$processing.'",
zeroRecords:"'.$zeroRecords.'",
emptyYable:"'.$emptyTable.'",
},
buttons: '.$parameters['csv'].'== 1 ? [
{
@ -3524,6 +3552,10 @@ function ui_print_datatable(array $parameters)
url: "'.ui_get_full_url('ajax.php', false, false, false).'",
type: "POST",
dataSrc: function (json) {
if($("#'.$form_id.'_search_bt") != undefined) {
$("#'.$form_id.'_loading").remove();
}
if (json.error) {
console.error(json.error);
$("#error-'.$table_id.'").html(json.error);
@ -3570,6 +3602,18 @@ function ui_print_datatable(array $parameters)
}
},
data: function (data) {
if($("#'.$form_id.'_search_bt") != undefined) {
var loading = \''.html_print_image(
'images/spinner.gif',
true,
[
'id' => $form_id.'_loading',
'class' => 'loading-search-datatables-button',
]
).'\';
$("#'.$form_id.'_search_bt").parent().append(loading);
}
inputs = $("#'.$form_id.' :input");
values = {};

View File

@ -46,6 +46,12 @@ $hash = get_parameter('hash');
$file_raw = get_parameter('file');
$file = base64_decode(urldecode($file_raw));
// Avoid possible inifite loop with referer.
if (isset($_SERVER['HTTP_ORIGIN']) === false || (isset($_SERVER['HTTP_ORIGIN']) === true && $_SERVER['HTTP_REFERER'] === $_SERVER['HTTP_ORIGIN'].$_SERVER['REQUEST_URI'])) {
$refererPath = ui_get_full_url('index.php');
} else {
$refererPath = $_SERVER['HTTP_REFERER'];
}
if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$config['server_unique_identifier']) || isset($_SERVER['HTTP_REFERER']) === false) {
$errorMessage = __('Security error. Please contact the administrator.');
@ -84,12 +90,6 @@ if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$c
if (empty($downloadable_file) === true || file_exists($downloadable_file) === false) {
$errorMessage = __('File is missing in disk storage. Please contact the administrator.');
// Avoid possible inifite loop with referer.
if (isset($_SERVER['HTTP_ORIGIN']) === true && $_SERVER['HTTP_REFERER'] === $_SERVER['HTTP_ORIGIN'].$_SERVER['REQUEST_URI']) {
$refererPath = ui_get_full_url('index.php');
} else {
$refererPath = $_SERVER['HTTP_REFERER'];
}
} else {
// Everything went well.
header('Content-type: aplication/octet-stream;');
@ -106,11 +106,12 @@ if (empty($file) === true || empty($hash) === true || $hash !== md5($file_raw.$c
document.addEventListener('DOMContentLoaded', function () {
var refererPath = '<?php echo $refererPath; ?>';
var errorFileOutput = '<?php echo $errorMessage; ?>';
if(refererPath != ''){
document.body.innerHTML = `<form action="` + refererPath + `" name="failedReturn" method="post" style="display:none;">
<input type="hidden" name="errorFileOutput" value="` + errorFileOutput + `" />
</form>`;
document.forms['failedReturn'].submit();
}
}, false);
</script>

View File

@ -94,3 +94,55 @@ function showMassiveOperationMessage(message) {
});
}
*/
// eslint-disable-next-line no-unused-vars
function form_controls_massive_operations_agents(metaconsole) {
// Listeners.
var recursion;
$("#checkbox-recursion").click(function() {
recursion = this.checked ? 1 : 0;
$("#id_group").trigger("change");
});
var disabled;
$("#disabled").change(function() {
disabled = this.value;
$("#id_group").trigger("change");
});
var nodes;
$("#nodes").change(function() {
nodes = $("#nodes").val();
$("#id_group").trigger("change");
});
$("#status_agents").change(function() {
$("#id_group").trigger("change");
});
// Build data.
var data = {
status_agents: function() {
return $("#status_agents").val();
},
agentSelect: "select#id_agents",
privilege: "AW",
recursion: function() {
return recursion;
},
disabled: function() {
return disabled;
}
};
if (metaconsole == 1) {
data.serialized = true;
data.serialized_separator = "|";
data.nodes = function() {
return nodes;
};
}
// Change agents.
$("#id_group").pandoraSelectGroupAgent(data);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -64,39 +64,55 @@ final class Config
|| $config['history_db_connection'] === false
) {
ob_start();
$config['history_db_connection'] = db_connect(
$config['history_db_host'],
$config['history_db_name'],
$link = mysqli_init();
$link->options(MYSQLI_OPT_CONNECT_TIMEOUT, 2);
$rc = mysqli_real_connect(
$link,
$$config['history_db_host'],
$config['history_db_user'],
io_output_password($config['history_db_pass']),
$config['history_db_port'],
false
$config['history_db_name'],
$config['history_db_port']
);
if ($rc === false) {
$config['history_db_connection'] = false;
} else {
$config['history_db_connection'] = db_connect(
$config['history_db_host'],
$config['history_db_name'],
$config['history_db_user'],
io_output_password($config['history_db_pass']),
$config['history_db_port'],
false
);
}
ob_get_clean();
}
if ($config['history_db_connection'] !== false) {
$data = \db_get_all_rows_sql(
'SELECT * FROM `tconfig`',
false,
false,
$config['history_db_connection']
if ($config['history_db_connection'] !== false) {
$data = \db_get_all_rows_sql(
'SELECT * FROM `tconfig`',
false,
false,
$config['history_db_connection']
);
}
if (is_array($data) !== true) {
return [];
}
self::$settings = array_reduce(
$data,
function ($carry, $item) {
$carry[$item['token']] = $item['value'];
return $carry;
},
[]
);
}
if (is_array($data) !== true) {
return [];
}
self::$settings = array_reduce(
$data,
function ($carry, $item) {
$carry[$item['token']] = $item['value'];
return $carry;
},
[]
);
}

View File

@ -156,7 +156,10 @@ final class DBMaintainer
return true;
}
$dbc = new \mysqli(
$link = mysqli_init();
$link->options(MYSQLI_OPT_CONNECT_TIMEOUT, 2);
$rc = mysqli_real_connect(
$link,
$this->host,
$this->user,
$this->pass,
@ -164,25 +167,39 @@ final class DBMaintainer
$this->port
);
if ((bool) $dbc->connect_error === true) {
if ($rc === false) {
$this->dbh = null;
$this->connected = false;
$this->lastError = $dbc->connect_errno.': '.$dbc->connect_error;
$this->lastError = __('Connection problems');
} else {
$this->dbh = $dbc;
if (empty($this->charset) === false) {
$dbc->set_charset($this->charset);
}
$dbc = new \mysqli(
$this->host,
$this->user,
$this->pass,
null,
$this->port
);
if ($this->dbh->select_db($this->name) === false) {
$this->lastError = $this->dbh->errno.': '.$this->dbh->error;
$this->ready = false;
if ((bool) $dbc->connect_error === true) {
$this->dbh = null;
$this->connected = false;
$this->lastError = $dbc->connect_errno.': '.$dbc->connect_error;
} else {
$this->lastError = null;
$this->ready = true;
}
$this->dbh = $dbc;
if (empty($this->charset) === false) {
$dbc->set_charset($this->charset);
}
$this->connected = true;
if ($this->dbh->select_db($this->name) === false) {
$this->lastError = $this->dbh->errno.': '.$this->dbh->error;
$this->ready = false;
} else {
$this->lastError = null;
$this->ready = true;
}
$this->connected = true;
}
}
}

View File

@ -539,7 +539,7 @@ class BlockHistogram extends Widget
25,
false,
true,
true,
true
);
break;

View File

@ -193,6 +193,10 @@ class GroupsStatusWidget extends Widget
$values['groupId'] = $decoder['groupId'];
}
if (isset($decoder['groupRecursion']) === true) {
$values['groupRecursion'] = $decoder['groupRecursion'];
}
return $values;
}
@ -224,6 +228,16 @@ class GroupsStatusWidget extends Widget
],
];
$inputs[] = [
'label' => __('Group recursion'),
'arguments' => [
'name' => 'groupRecursion',
'id' => 'groupRecursion',
'type' => 'switch',
'value' => $values['groupRecursion'],
],
];
return $inputs;
}
@ -239,6 +253,7 @@ class GroupsStatusWidget extends Widget
$values = parent::getPost();
$values['groupId'] = \get_parameter('groupId', 0);
$values['groupRecursion'] = \get_parameter_switch('groupRecursion', 0);
return $values;
}
@ -260,9 +275,12 @@ class GroupsStatusWidget extends Widget
$output = '';
$user_groups = \users_get_groups(false, 'AR', false);
$stats = \reporting_get_group_stats_resume($this->values['groupId'], 'AR', true);
$stats = \reporting_get_group_stats_resume(
$this->values['groupId'],
'AR',
true,
(bool) $this->values['groupRecursion']
);
$data = '<div class="widget-groups-status"><span>';
$data .= ui_print_group_icon(
@ -393,7 +411,7 @@ class GroupsStatusWidget extends Widget
$table->data[0][0] .= '</span>';
$table->data[0][1] = '<span>';
$table->data[0][1] .= '<b>';
$table->data[0][1] .= $stats['monitor_total'];
$table->data[0][1] .= $stats['total_checks'];
$table->data[0][1] .= '</b>';
$table->data[0][1] .= '</span>';

View File

@ -39,7 +39,7 @@ form.flex-row ul {
margin: 0.5em 3em 0.5em 0;
}
div.filter_input_little {
form div.filter_input_little {
flex: 1;
display: flex;
flex-direction: row;
@ -132,6 +132,14 @@ table.dataTable tbody td {
flex: 1;
}
form.flex-row div.filter_input.filter_input_switch {
justify-content: flex-start;
}
form.flex-row div.filter_input.filter_input_switch .p-slider {
width: 30px;
}
fieldset {
margin: 0 auto;
}

View File

@ -10,6 +10,14 @@
height: auto;
}
.responsive-height {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
}
html {
font-size: 18px;
font-family: "lato-bolder", "Open Sans", sans-serif;
@ -58,3 +66,13 @@ a:hover {
color: #333;
text-decoration: none;
}
.container-list {
list-style: none;
width: 20%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: space-around;
margin: 0 auto;
}

View File

@ -1705,6 +1705,17 @@ div#agent_wizard_subtabs {
-webkit-border-radius: 4px;
border-radius: 4px;
}
.databox.no-border {
margin-bottom: 5px;
margin-top: 0px;
margin-left: 0px;
border: none;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
}
.databox_color {
padding-top: 5px;
background-color: #fafafa;
@ -9078,3 +9089,33 @@ div#err_msg_centralised {
margin-bottom: 4px !important;
padding: 2px 5px !important;
}
.dataTables_wrapper {
overflow: auto;
}
.dataTables_wrapper .dataTables_processing {
margin-top: -37px !important;
top: 50px !important;
padding-top: 0px !important;
height: 0px !important;
background: transparent !important;
}
.dataTables_wrapper .dataTables_processing .processing-datatables-inside {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
height: 100%;
}
.dataTables_wrapper .dataTables_processing .processing-datatables-inside img {
margin-left: 20px;
}
.loading-search-datatables-button {
float: right;
margin-right: -110px;
margin-top: 13px;
}

View File

@ -201,7 +201,7 @@ ol.steps li.visited a {
}
/* White text */
a,
a:not(.visual-console-item),
label,
#menu_tab_left li a,
#menu_tab_left li span,

View File

@ -605,6 +605,13 @@ if (isset($config['id_user']) === false) {
}
}
if (is_reporting_console_node() === true) {
$_GET['sec'] = 'discovery';
$_GET['sec2'] = 'godmode/servers/discovery';
$_GET['wiz'] = 'tasklist';
$home_page = '';
}
db_logon($nick_in_db, $_SERVER['REMOTE_ADDR']);
$_SESSION['id_usuario'] = $nick_in_db;
$config['id_user'] = $nick_in_db;
@ -624,8 +631,6 @@ if (isset($config['id_user']) === false) {
config_prepare_session();
}
// ==========================================================
// -------- SET THE CUSTOM CONFIGS OF USER ------------------
config_user_set_custom_config();
@ -1042,6 +1047,13 @@ if ((bool) ($config['maintenance_mode'] ?? false) === true
exit('</html>');
}
if (is_reporting_console_node() === true
&& (bool) users_is_admin() === false
) {
include 'general/reporting_console_node.php';
exit;
}
/*
* ----------------------------------------------------------------------
* EXTENSIONS
@ -1199,6 +1211,10 @@ if ($config['pure'] == 0) {
echo '<div id="main">';
}
if (is_reporting_console_node() === true) {
echo notify_reporting_console_node();
}
// Page loader / selector.
if ($searchPage) {
include 'operation/search_results.php';
@ -1224,6 +1240,17 @@ if ($searchPage) {
$sec2 = '';
}
$tab = get_parameter('tab', '');
if (empty($tab) === true) {
$tab = get_parameter('wiz', '');
}
$acl_reporting_console_node = acl_reporting_console_node($page, $tab);
if ($acl_reporting_console_node === false) {
include 'general/reporting_console_node.php';
exit;
}
$page .= '.php';
// Enterprise ACL check.

50532
pandora_console/index.pot Normal file

File diff suppressed because it is too large Load Diff

View File

@ -128,8 +128,8 @@
</div>
<div style='height: 10px'>
<?php
$version = '7.0NG.763';
$build = '220715';
$version = '7.0NG.764';
$build = '220829';
$banner = "v$version Build $build";
error_reporting(0);

Some files were not shown because too many files have changed in this diff Show More