mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
Merge branch 'develop' into ent-8763-g-sanchez-anadir-filtro-de-grupos-al-widget-de-vista-tactica
This commit is contained in:
commit
547962c83a
@ -256,6 +256,8 @@ console_dependencies=" \
|
||||
poppler-data \
|
||||
php-yaml \
|
||||
mod_ssl \
|
||||
libzstd \
|
||||
openldap-clients \
|
||||
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
|
||||
execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
|
||||
|
||||
|
@ -307,6 +307,8 @@ console_dependencies=" \
|
||||
poppler-data \
|
||||
php-yaml \
|
||||
mod_ssl \
|
||||
libzstd \
|
||||
openldap-clients \
|
||||
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
|
||||
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm"
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, AIX version
|
||||
# Version 7.0NG.763, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, FreeBSD Version
|
||||
# Version 7.0NG.763, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, HP-UX Version
|
||||
# Version 7.0NG.763, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, Solaris Version
|
||||
# Version 7.0NG.763, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# 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
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.762, AIX version
|
||||
# Version 7.0NG.763, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.762, HPUX Version
|
||||
# Version 7.0NG.763, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.762, Solaris version
|
||||
# Version 7.0NG.763, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, AIX version
|
||||
# Version 7.0NG.763, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.762-220606
|
||||
Version: 7.0NG.763-220629
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.762-220606"
|
||||
pandora_version="7.0NG.763-220629"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
@ -31,7 +31,7 @@ fi
|
||||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.762"
|
||||
VERSION="7.0NG.763"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG 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.762" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.763" 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.762" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.763" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
@ -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.762</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.762 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.762</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>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, FreeBSD Version
|
||||
# Version 7.0NG.763, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, HP-UX Version
|
||||
# Version 7.0NG.763, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, GNU/Linux
|
||||
# Version 7.0NG.763, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, NetBSD Version
|
||||
# Version 7.0NG.763, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.762, Solaris Version
|
||||
# Version 7.0NG.763, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
@ -1014,8 +1014,8 @@ my $Sem = undef;
|
||||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.762';
|
||||
use constant AGENT_BUILD => '220606';
|
||||
use constant AGENT_VERSION => '7.0NG.763';
|
||||
use constant AGENT_BUILD => '220629';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
@ -2,8 +2,8 @@
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.762
|
||||
%define release 220606
|
||||
%define version 7.0NG.763
|
||||
%define release 220629
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -2,8 +2,8 @@
|
||||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.762
|
||||
%define release 220606
|
||||
%define version 7.0NG.763
|
||||
%define release 220629
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
@ -9,8 +9,8 @@
|
||||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.762"
|
||||
PI_BUILD="220606"
|
||||
PI_VERSION="7.0NG.763"
|
||||
PI_BUILD="220629"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.762
|
||||
# Version 7.0NG.763
|
||||
# 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
|
||||
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
||||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.762}
|
||||
{Pandora FMS Windows Agent v7.0NG.763}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
@ -186,7 +186,7 @@ UpgradeApplicationID
|
||||
{}
|
||||
|
||||
Version
|
||||
{220606}
|
||||
{220629}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
||||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.762 Build 220606")
|
||||
#define PANDORA_VERSION ("7.0NG.763 Build 220629")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
@ -11,7 +11,7 @@ BEGIN
|
||||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.762(Build 220606))"
|
||||
VALUE "ProductVersion", "(7.0NG.763(Build 220629))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
@ -1,5 +1,5 @@
|
||||
package: pandorafms-console
|
||||
Version: 7.0NG.762-220606
|
||||
Version: 7.0NG.763-220629
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
@ -14,7 +14,7 @@
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.762-220606"
|
||||
pandora_version="7.0NG.763-220629"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
@ -14,7 +14,8 @@
|
||||
},
|
||||
"require": {
|
||||
"mpdf/mpdf": "^8.0.15",
|
||||
"swiftmailer/swiftmailer": "^6.0"
|
||||
"swiftmailer/swiftmailer": "^6.0",
|
||||
"amphp/parallel-functions": "^1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@ -23,7 +24,10 @@
|
||||
"PandoraFMS\\": "include/lib",
|
||||
"PandoraFMS\\Enterprise\\": "enterprise/include/lib",
|
||||
"UpdateManager\\": "update_manager_client/lib/UpdateManager"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"include/global_config.php"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
|
610
pandora_console/composer.lock
generated
610
pandora_console/composer.lock
generated
@ -4,8 +4,551 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "1ca1e8936d9ffb13f23a5b5cefbf02ad",
|
||||
"content-hash": "643ac0dc8a8e1f129104399054f8dd0c",
|
||||
"packages": [
|
||||
{
|
||||
"name": "amphp/amp",
|
||||
"version": "v2.6.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/amp.git",
|
||||
"reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
|
||||
"reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1",
|
||||
"ext-json": "*",
|
||||
"jetbrains/phpstorm-stubs": "^2019.3",
|
||||
"phpunit/phpunit": "^7 | ^8 | ^9",
|
||||
"psalm/phar": "^3.11@dev",
|
||||
"react/promise": "^2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/functions.php",
|
||||
"lib/Internal/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Daniel Lowrey",
|
||||
"email": "rdlowrey@php.net"
|
||||
},
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Bob Weinand",
|
||||
"email": "bobwei9@hotmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "A non-blocking concurrency framework for PHP applications.",
|
||||
"homepage": "https://amphp.org/amp",
|
||||
"keywords": [
|
||||
"async",
|
||||
"asynchronous",
|
||||
"awaitable",
|
||||
"concurrency",
|
||||
"event",
|
||||
"event-loop",
|
||||
"future",
|
||||
"non-blocking",
|
||||
"promise"
|
||||
],
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.org/amphp",
|
||||
"issues": "https://github.com/amphp/amp/issues",
|
||||
"source": "https://github.com/amphp/amp/tree/v2.6.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-02-20T17:52:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/byte-stream",
|
||||
"version": "v1.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/byte-stream.git",
|
||||
"reference": "acbd8002b3536485c997c4e019206b3f10ca15bd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd",
|
||||
"reference": "acbd8002b3536485c997c4e019206b3f10ca15bd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2",
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1.4",
|
||||
"friendsofphp/php-cs-fixer": "^2.3",
|
||||
"jetbrains/phpstorm-stubs": "^2019.3",
|
||||
"phpunit/phpunit": "^6 || ^7 || ^8",
|
||||
"psalm/phar": "^3.11.4"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\ByteStream\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "A stream abstraction to make working with non-blocking I/O simple.",
|
||||
"homepage": "http://amphp.org/byte-stream",
|
||||
"keywords": [
|
||||
"amp",
|
||||
"amphp",
|
||||
"async",
|
||||
"io",
|
||||
"non-blocking",
|
||||
"stream"
|
||||
],
|
||||
"support": {
|
||||
"irc": "irc://irc.freenode.org/amphp",
|
||||
"issues": "https://github.com/amphp/byte-stream/issues",
|
||||
"source": "https://github.com/amphp/byte-stream/tree/v1.8.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-03-30T17:13:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/parallel",
|
||||
"version": "v1.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/parallel.git",
|
||||
"reference": "fbc128383c1ffb3823866f71b88d8c4722a25ce9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/parallel/zipball/fbc128383c1ffb3823866f71b88d8c4722a25ce9",
|
||||
"reference": "fbc128383c1ffb3823866f71b88d8c4722a25ce9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2",
|
||||
"amphp/byte-stream": "^1.6.1",
|
||||
"amphp/parser": "^1",
|
||||
"amphp/process": "^1",
|
||||
"amphp/serialization": "^1",
|
||||
"amphp/sync": "^1.0.1",
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1.1",
|
||||
"phpunit/phpunit": "^8 || ^7"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/Context/functions.php",
|
||||
"lib/Sync/functions.php",
|
||||
"lib/Worker/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\Parallel\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Stephen Coakley",
|
||||
"email": "me@stephencoakley.com"
|
||||
}
|
||||
],
|
||||
"description": "Parallel processing component for Amp.",
|
||||
"homepage": "https://github.com/amphp/parallel",
|
||||
"keywords": [
|
||||
"async",
|
||||
"asynchronous",
|
||||
"concurrent",
|
||||
"multi-processing",
|
||||
"multi-threading"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/parallel/issues",
|
||||
"source": "https://github.com/amphp/parallel/tree/v1.4.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-10-25T19:16:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/parallel-functions",
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/parallel-functions.git",
|
||||
"reference": "af9795d51abfafc3676cbe7e17965479491abaad"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/parallel-functions/zipball/af9795d51abfafc3676cbe7e17965479491abaad",
|
||||
"reference": "af9795d51abfafc3676cbe7e17965479491abaad",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2.0.3",
|
||||
"amphp/parallel": "^1.1",
|
||||
"opis/closure": "^3.0.7",
|
||||
"php": ">=7"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/phpunit-util": "^1.0",
|
||||
"friendsofphp/php-cs-fixer": "^2.9",
|
||||
"phpunit/phpunit": "^6.5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\ParallelFunctions\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "Parallel processing made simple.",
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/parallel-functions/issues",
|
||||
"source": "https://github.com/amphp/parallel-functions/tree/master"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-07-10T17:05:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/parser",
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/parser.git",
|
||||
"reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/parser/zipball/f83e68f03d5b8e8e0365b8792985a7f341c57ae1",
|
||||
"reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^2.3",
|
||||
"phpunit/phpunit": "^6"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Amp\\Parser\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
},
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
}
|
||||
],
|
||||
"description": "A generator parser to make streaming parsers simple.",
|
||||
"homepage": "https://github.com/amphp/parser",
|
||||
"keywords": [
|
||||
"async",
|
||||
"non-blocking",
|
||||
"parser",
|
||||
"stream"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/parser/issues",
|
||||
"source": "https://github.com/amphp/parser/tree/is-valid"
|
||||
},
|
||||
"time": "2017-06-06T05:29:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/process",
|
||||
"version": "v1.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/process.git",
|
||||
"reference": "f09e3ed3b0a953ccbfff1140f12be4a884f0aa83"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/process/zipball/f09e3ed3b0a953ccbfff1140f12be4a884f0aa83",
|
||||
"reference": "f09e3ed3b0a953ccbfff1140f12be4a884f0aa83",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2",
|
||||
"amphp/byte-stream": "^1.4",
|
||||
"php": ">=7"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1",
|
||||
"phpunit/phpunit": "^6"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\Process\\": "lib"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Bob Weinand",
|
||||
"email": "bobwei9@hotmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "Asynchronous process manager.",
|
||||
"homepage": "https://github.com/amphp/process",
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/process/issues",
|
||||
"source": "https://github.com/amphp/process/tree/v1.1.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-12-17T19:09:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/serialization",
|
||||
"version": "v1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/serialization.git",
|
||||
"reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/serialization/zipball/693e77b2fb0b266c3c7d622317f881de44ae94a1",
|
||||
"reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"phpunit/phpunit": "^9 || ^8 || ^7"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\Serialization\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Niklas Keller",
|
||||
"email": "me@kelunik.com"
|
||||
}
|
||||
],
|
||||
"description": "Serialization tools for IPC and data storage in PHP.",
|
||||
"homepage": "https://github.com/amphp/serialization",
|
||||
"keywords": [
|
||||
"async",
|
||||
"asynchronous",
|
||||
"serialization",
|
||||
"serialize"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/serialization/issues",
|
||||
"source": "https://github.com/amphp/serialization/tree/master"
|
||||
},
|
||||
"time": "2020-03-25T21:39:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "amphp/sync",
|
||||
"version": "v1.4.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/amphp/sync.git",
|
||||
"reference": "85ab06764f4f36d63b1356b466df6111cf4b89cf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/amphp/sync/zipball/85ab06764f4f36d63b1356b466df6111cf4b89cf",
|
||||
"reference": "85ab06764f4f36d63b1356b466df6111cf4b89cf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"amphp/amp": "^2.2",
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"amphp/php-cs-fixer-config": "dev-master",
|
||||
"amphp/phpunit-util": "^1.1",
|
||||
"phpunit/phpunit": "^9 || ^8 || ^7"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"src/functions.php",
|
||||
"src/ConcurrentIterator/functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Amp\\Sync\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron Piotrowski",
|
||||
"email": "aaron@trowski.com"
|
||||
},
|
||||
{
|
||||
"name": "Stephen Coakley",
|
||||
"email": "me@stephencoakley.com"
|
||||
}
|
||||
],
|
||||
"description": "Mutex, Semaphore, and other synchronization tools for Amp.",
|
||||
"homepage": "https://github.com/amphp/sync",
|
||||
"keywords": [
|
||||
"async",
|
||||
"asynchronous",
|
||||
"mutex",
|
||||
"semaphore",
|
||||
"synchronization"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/amphp/sync/issues",
|
||||
"source": "https://github.com/amphp/sync/tree/v1.4.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/amphp",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2021-10-25T18:29:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/lexer",
|
||||
"version": "1.2.2",
|
||||
@ -280,6 +823,71 @@
|
||||
],
|
||||
"time": "2020-11-13T09:40:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "opis/closure",
|
||||
"version": "3.6.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/opis/closure.git",
|
||||
"reference": "3d81e4309d2a927abbe66df935f4bb60082805ad"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/3d81e4309d2a927abbe66df935f4bb60082805ad",
|
||||
"reference": "3d81e4309d2a927abbe66df935f4bb60082805ad",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.4 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"jeremeamia/superclosure": "^2.0",
|
||||
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.6.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"functions.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Opis\\Closure\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Marius Sarca",
|
||||
"email": "marius.sarca@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Sorin Sarca",
|
||||
"email": "sarca_sorin@hotmail.com"
|
||||
}
|
||||
],
|
||||
"description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.",
|
||||
"homepage": "https://opis.io/closure",
|
||||
"keywords": [
|
||||
"anonymous functions",
|
||||
"closure",
|
||||
"function",
|
||||
"serializable",
|
||||
"serialization",
|
||||
"serialize"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/opis/closure/issues",
|
||||
"source": "https://github.com/opis/closure/tree/3.6.3"
|
||||
},
|
||||
"time": "2022-01-27T09:35:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
"version": "v9.99.100",
|
||||
|
@ -1665,3 +1665,4 @@ godmode/um_client/vendor/sebastian/object-enumerator/tests
|
||||
godmode/um_client/vendor/sebastian/object-enumerator
|
||||
godmode/um_client/vendor/sebastian
|
||||
godmode/um_client/vendor
|
||||
update_manager_client/resources/styles/pandora.css
|
||||
|
@ -1,5 +1,76 @@
|
||||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `tservice` ADD COLUMN `enable_sunburst` tinyint(1) NOT NULL default 0;
|
||||
ALTER TABLE `tuser_double_auth` DROP FOREIGN KEY `tuser_double_auth_ibfk_1`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tnotification_user` DROP FOREIGN KEY `tnotification_user_ibfk_2`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tnotification_source_user` DROP FOREIGN KEY `tnotification_source_user_ibfk_2`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tnotification_source_group_user` DROP FOREIGN KEY `tnotification_source_group_user_ibfk_2`, MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tvisual_console_elements_cache` DROP FOREIGN KEY `tvisual_console_elements_cache_ibfk_3`, MODIFY COLUMN `user_id` VARCHAR(255) DEFAULT NULL;
|
||||
ALTER TABLE `tusuario` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tuser_double_auth` ADD CONSTRAINT `tuser_double_auth_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE;
|
||||
ALTER TABLE `tnotification_user` ADD CONSTRAINT `tnotification_user_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `tnotification_source_user` ADD CONSTRAINT `tnotification_source_user_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `tnotification_source_group_user` ADD CONSTRAINT `tnotification_source_group_user_ibfk_2` FOREIGN KEY (`id_user`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `tvisual_console_elements_cache` ADD CONSTRAINT `tvisual_console_elements_cache_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `tusuario` (`id_user`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
ALTER TABLE `tattachment` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tevento` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tincidencia` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tnota` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tsesion` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `ttrap` MODIFY COLUMN `id_usuario` VARCHAR(255) DEFAULT '';
|
||||
ALTER TABLE `tusuario_perfil` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `treset_pass_history` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tmensajes` MODIFY COLUMN `id_usuario_origen` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tgraph` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `treport` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tplanned_downtime` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tnetwork_map` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tpassword_history` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL;
|
||||
ALTER TABLE `tupdate_journal` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tmap` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tdashboard` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `treport_template` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tmetaconsole_event` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tmetaconsole_event_history` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `treset_pass` MODIFY COLUMN `id_user` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `tuser_task_scheduled` MODIFY COLUMN `id_usuario` VARCHAR(255) NOT NULL DEFAULT '0';
|
||||
ALTER TABLE `tbackup` MODIFY COLUMN `id_user` VARCHAR(255) DEFAULT '';
|
||||
|
||||
ALTER TABLE `tservice` ADD COLUMN `enable_sunburst` TINYINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `tservice` ADD COLUMN `asynchronous` TINYINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `tservice` ADD COLUMN `rca` TEXT;
|
||||
|
||||
ALTER TABLE `tdashboard` MODIFY `name` TEXT NOT NULL DEFAULT '';
|
||||
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field1_recovery` TEXT AFTER `recovery_notify`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field4_recovery` TEXT AFTER `field3_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field5_recovery` TEXT AFTER `field4_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field6_recovery` TEXT AFTER `field5_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field7_recovery` TEXT AFTER `field6_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field8_recovery` TEXT AFTER `field7_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field9_recovery` TEXT AFTER `field8_recovery`;
|
||||
ALTER TABLE `tevent_alert` ADD COLUMN `field10_recovery` TEXT AFTER `field9_recovery`;
|
||||
|
||||
ALTER TABLE `tagente` ADD COLUMN `satellite_server` INT NOT NULL default 0;
|
||||
ALTER TABLE `tmetaconsole_agent` ADD COLUMN `satellite_server` INT NOT NULL default 0;
|
||||
|
||||
ALTER TABLE `tmetaconsole_setup` DROP COLUMN `last_event_replication`;
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'event_replication';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'replication_interval';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'replication_limit';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'replication_mode';
|
||||
DELETE FROM `tconfig` WHERE `token` LIKE 'show_events_in_local';
|
||||
|
||||
UPDATE tconfig SET value='' WHERE token='lts_name';
|
||||
|
||||
SET @st_oum763 = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'tautoconfig' AND table_schema = DATABASE() AND column_name = 'disabled') > 0,
|
||||
"SELECT 1",
|
||||
"ALTER TABLE `tautoconfig` ADD COLUMN `disabled` TINYINT DEFAULT 0"
|
||||
));
|
||||
|
||||
PREPARE pr_oum763 FROM @st_oum763;
|
||||
EXECUTE pr_oum763;
|
||||
DEALLOCATE PREPARE pr_oum763;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
@ -412,8 +412,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_setup` (
|
||||
`auth_token` text default '',
|
||||
`id_group` int(10) unsigned NOT NULL default 0,
|
||||
`api_password` text NOT NULL,
|
||||
`disabled` tinyint(1) unsigned NOT NULL default '0',
|
||||
`last_event_replication` bigint(20) default '0'
|
||||
`disabled` tinyint(1) unsigned NOT NULL default '0'
|
||||
) ENGINE=InnoDB
|
||||
COMMENT = 'Table to store metaconsole sources'
|
||||
DEFAULT CHARSET=utf8;
|
||||
|
@ -954,7 +954,7 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
|
||||
$("a.autorefresh").click (function () {
|
||||
$("a.autorefresh_txt").toggle ();
|
||||
$("#combo_refr").toggle ();
|
||||
$("#combo_refr").toggle();
|
||||
$("select#ref").change (function () {
|
||||
href = $("a.autorefresh").attr ("href");
|
||||
|
||||
|
@ -281,7 +281,7 @@ foreach ($sessions as $session) {
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
$activity .= html_print_table($table, true);
|
||||
$activity = html_print_table($table, true);
|
||||
unset($table);
|
||||
|
||||
ui_toggle(
|
||||
|
@ -26,6 +26,8 @@
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
use function PHPSTORM_META\map;
|
||||
|
||||
// Begin.
|
||||
if (isset($config['id_user']) === false) {
|
||||
include 'general/login_page.php';
|
||||
@ -57,52 +59,22 @@ 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);
|
||||
|
||||
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
|
||||
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
|
||||
|
||||
if (defined('PANDORA_ENTERPRISE') === false) {
|
||||
$logo_title = get_product_name().' Opensource';
|
||||
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
|
||||
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
|
||||
} else {
|
||||
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo) === true) {
|
||||
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
|
||||
}
|
||||
|
||||
$logo_title = get_product_name().' Enterprise';
|
||||
}
|
||||
|
||||
echo '<div class="logo_green"><a href="index.php?sec=main">';
|
||||
|
||||
if (isset($config['custom_logo']) === true) {
|
||||
echo html_print_image(
|
||||
$custom_logo,
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'width' => '215',
|
||||
'alt' => $logo_title,
|
||||
'class' => 'logo_full',
|
||||
'style' => ($menuCollapsed === true) ? 'display:none' : 'display:block',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($config['custom_logo_collapsed']) === true) {
|
||||
echo html_print_image(
|
||||
$custom_logo_collapsed,
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'width' => '60',
|
||||
'alt' => $logo_title,
|
||||
'class' => 'logo_icon',
|
||||
'style' => ($menuCollapsed === true) ? 'display:block' : 'display:none',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
echo '</a></div>';
|
||||
// Header logo.
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'logo_green',
|
||||
'content' => html_print_anchor(
|
||||
[
|
||||
'href' => ui_get_full_url('index.php'),
|
||||
'content' => html_print_header_logo_image(
|
||||
$menuCollapsed,
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
),
|
||||
]
|
||||
);
|
||||
|
||||
require 'operation/menu.php';
|
||||
require 'godmode/menu.php';
|
||||
|
@ -245,8 +245,11 @@ if (!$new_agent && $alias != '') {
|
||||
}
|
||||
|
||||
// Remote configuration available.
|
||||
$remote_agent = false;
|
||||
if (isset($filename)) {
|
||||
if (file_exists($filename['md5'])) {
|
||||
$remote_agent = true;
|
||||
|
||||
$agent_name = agents_get_name($id_agente);
|
||||
$agent_name = io_safe_output($agent_name);
|
||||
$agent_md5 = md5($agent_name, false);
|
||||
@ -427,6 +430,42 @@ $table_server .= html_print_select(
|
||||
true
|
||||
).'<div class="label_select_child_icons"></div></div></div>';
|
||||
|
||||
|
||||
$table_satellite = '';
|
||||
if ($remote_agent === true) {
|
||||
// Satellite server selector.
|
||||
$satellite_servers = db_get_all_rows_filter(
|
||||
'tserver',
|
||||
['server_type' => SERVER_TYPE_ENTERPRISE_SATELLITE],
|
||||
[
|
||||
'id_server',
|
||||
'name',
|
||||
]
|
||||
);
|
||||
|
||||
$satellite_names = [];
|
||||
if (empty($satellite_servers) === false) {
|
||||
foreach ($satellite_servers as $s_server) {
|
||||
$satellite_names[$s_server['id_server']] = $s_server['name'];
|
||||
}
|
||||
|
||||
$table_satellite = '<div class="label_select"><p class="input_label">'.__('Satellite').'</p>';
|
||||
$table_satellite .= '<div class="label_select_parent">';
|
||||
|
||||
$table_satellite .= html_print_input(
|
||||
[
|
||||
'type' => 'select',
|
||||
'fields' => $satellite_names,
|
||||
'name' => 'satellite_server',
|
||||
'selected' => $satellite_server,
|
||||
'nothing' => __('None'),
|
||||
'nothinf_value' => 0,
|
||||
'return' => true,
|
||||
]
|
||||
).'<div class="label_select_child_icons"></div></div></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Description.
|
||||
$table_description = '<div class="label_select"><p class="input_label">'.__('Description').'</p>';
|
||||
$table_description .= html_print_textarea(
|
||||
@ -443,7 +482,7 @@ $table_description .= html_print_textarea(
|
||||
echo '<div class="first_row">
|
||||
<div class="box-shadow agent_options '.$agent_options_update.' white_box">
|
||||
<div class="agent_options_column_left">'.$table_agent_name.$table_alias.$table_ip.$table_primary_group.'</div>
|
||||
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_description.'</div>
|
||||
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_satellite.$table_description.'</div>
|
||||
</div>';
|
||||
if (!$new_agent && $alias != '') {
|
||||
echo $table_qr_code;
|
||||
@ -523,7 +562,6 @@ if (enterprise_installed()) {
|
||||
$table_adv_cascade .= $cps_html;
|
||||
}
|
||||
|
||||
|
||||
$table_adv_parent = '<div class="label_select"><label class="input_label">'.__('Parent').'</label>';
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
@ -536,6 +574,11 @@ $params['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
|
||||
$params['selectbox_id'] = 'cascade_protection_module';
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$params['cascade_protection'] = true;
|
||||
if ($id_agente !== 0) {
|
||||
// Deletes the agent's offspring.
|
||||
$params['delete_offspring_agents'] = $id_agente;
|
||||
}
|
||||
|
||||
$table_adv_parent .= '<div class="label_simple_items">';
|
||||
$table_adv_parent .= ui_print_agent_autocomplete_input($params);
|
||||
if (enterprise_installed()) {
|
||||
|
@ -155,6 +155,7 @@ $alert_d7 = 1;
|
||||
$alert_recovery = 0;
|
||||
$alert_priority = 0;
|
||||
$server_name = '';
|
||||
$satellite_server = 0;
|
||||
$grupo = 0;
|
||||
$id_os = 9;
|
||||
// Windows.
|
||||
@ -985,6 +986,7 @@ if ($update_agent) {
|
||||
$old_values = db_get_row('tagente', 'id_agente', $id_agente);
|
||||
$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);
|
||||
|
||||
if ($fields === false) {
|
||||
$fields = [];
|
||||
@ -1092,6 +1094,7 @@ if ($update_agent) {
|
||||
'quiet' => $quiet,
|
||||
'cps' => $cps,
|
||||
'safe_mode_module' => $safe_mode_module,
|
||||
'satellite_server' => $satellite_server,
|
||||
];
|
||||
|
||||
if ($config['metaconsole_agent_cache'] == 1) {
|
||||
@ -1230,6 +1233,7 @@ if ($id_agente) {
|
||||
$cps = $agent['cps'];
|
||||
$safe_mode_module = $agent['safe_mode_module'];
|
||||
$safe_mode = ($safe_mode_module) ? 1 : 0;
|
||||
$satellite_server = (int) $agent['satellite_server'];
|
||||
}
|
||||
|
||||
$update_module = (bool) get_parameter('update_module');
|
||||
|
@ -539,6 +539,12 @@ if ($id_downtime > 0) {
|
||||
// only action to postpone on once type is enabled and the other are disabled.
|
||||
$disabled_in_execution = (int) $running;
|
||||
|
||||
$return_all_group = false;
|
||||
|
||||
if (users_can_manage_group_all('AW') === true || $disabled) {
|
||||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$table = new StdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
@ -557,7 +563,7 @@ $table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
true,
|
||||
$return_all_group,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
@ -793,7 +799,7 @@ $table->width = '100%';
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = __('Group filter');
|
||||
$table->data[0][1] = html_print_select_groups(false, $access, true, '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').'  '.html_print_checkbox('recursion', 1, $recursion, true, false, '');
|
||||
|
||||
$table->data[1][0] = __('Available agents');
|
||||
|
@ -1,25 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* List view for Alerts.
|
||||
*
|
||||
* @category Alerts
|
||||
* @package Community
|
||||
* @subpackage Software agents repository
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ==========================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnológicas S.L
|
||||
* This code is NOT free software. This code is NOT licenced under GPL2 licence
|
||||
* You cannot redistribute it without written permission of copyright holder.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 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.
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
// Login check
|
||||
// Login check.
|
||||
check_login();
|
||||
|
||||
// Check if this page is included from a agent edition
|
||||
if (! check_acl($config['id_user'], 0, 'LW')
|
||||
&& ! check_acl($config['id_user'], 0, 'AD')
|
||||
&& ! check_acl($config['id_user'], 0, 'LM')
|
||||
// Check if this page is included from a agent edition.
|
||||
if ((bool) check_acl($config['id_user'], 0, 'LW') === false
|
||||
&& (bool) check_acl($config['id_user'], 0, 'AD') === false
|
||||
&& (bool) check_acl($config['id_user'], 0, 'LM') === false
|
||||
) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
@ -36,7 +46,7 @@ require_once $config['homedir'].'/include/functions_users.php';
|
||||
$pure = get_parameter('pure', 0);
|
||||
$agent_id = get_parameter('agent_id', 0);
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === true) {
|
||||
$sec = 'advanced';
|
||||
} else {
|
||||
$sec = 'galertas';
|
||||
@ -48,7 +58,7 @@ if ($id_agente) {
|
||||
$sec2 = 'godmode/alerts/alert_list';
|
||||
}
|
||||
|
||||
// Table for filter controls
|
||||
// Table for filter controls.
|
||||
$form_filter = '<form method="post" action="index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.((int) get_parameter('refr', 0)).'&pure='.$config['pure'].'">';
|
||||
$form_filter .= "<input type='hidden' name='search' value='1' />";
|
||||
$form_filter .= '<table cellpadding="0" cellspacing="0" class="databox filters w100p">';
|
||||
@ -60,7 +70,7 @@ $temp = agents_get_agents();
|
||||
$arrayAgents = [];
|
||||
|
||||
// Avoid empty arrays, warning messages are UGLY !
|
||||
if ($temp) {
|
||||
if ($temp !== false) {
|
||||
foreach ($temp as $agentElement) {
|
||||
$arrayAgents[$agentElement['id_agente']] = $agentElement['nombre'];
|
||||
}
|
||||
@ -93,11 +103,11 @@ $form_filter .= '</tr>';
|
||||
|
||||
$all_groups = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AD')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AD') === true) {
|
||||
$groups_user = users_get_groups($config['id_user'], 'AD', $all_groups);
|
||||
} else if (check_acl($config['id_user'], 0, 'LW')) {
|
||||
} else if ((bool) check_acl($config['id_user'], 0, 'LW') === true) {
|
||||
$groups_user = users_get_groups($config['id_user'], 'LW', $all_groups);
|
||||
} else if (check_acl($config['id_user'], 0, 'LM')) {
|
||||
} else if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||
$groups_user = users_get_groups($config['id_user'], 'LM', $all_groups);
|
||||
}
|
||||
|
||||
@ -109,16 +119,16 @@ $groups_id = implode(',', array_keys($groups_user));
|
||||
|
||||
$form_filter .= '<tr>';
|
||||
|
||||
$temp = db_get_all_rows_sql("SELECT id, name FROM talert_actions WHERE id_group IN ($groups_id);");
|
||||
$temp = db_get_all_rows_sql('SELECT id, name FROM talert_actions WHERE id_group IN ('.$groups_id.');');
|
||||
$arrayActions = [];
|
||||
if (is_array($temp)) {
|
||||
if (is_array($temp) === true) {
|
||||
foreach ($temp as $actionElement) {
|
||||
$arrayActions[$actionElement['id']] = $actionElement['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$form_filter .= "<td class='bolder''>".__('Actions').'</td><td>';
|
||||
$form_filter .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true);
|
||||
$form_filter .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true, false, true, '', false, 'width:95%');
|
||||
$form_filter .= '</td>';
|
||||
$form_filter .= "<td class='bolder''>".__('Field content').'</td><td>';
|
||||
$form_filter .= html_print_input_text('field_content', $fieldContent, '', 12, 255, true);
|
||||
@ -155,7 +165,7 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_
|
||||
$form_filter .= html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false);
|
||||
$form_filter .= '</td></tr>';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === true) {
|
||||
$form_filter .= '<tr>';
|
||||
$form_filter .= "<td colspan='6' align='right'>";
|
||||
$form_filter .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true);
|
||||
@ -170,7 +180,7 @@ if (defined('METACONSOLE')) {
|
||||
}
|
||||
|
||||
$form_filter .= '</form>';
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === true) {
|
||||
echo '<br>';
|
||||
}
|
||||
|
||||
@ -253,7 +263,7 @@ $total = agents_get_alerts_simple(
|
||||
true
|
||||
);
|
||||
|
||||
if (empty($total)) {
|
||||
if (empty($total) === true) {
|
||||
$total = 0;
|
||||
}
|
||||
|
||||
@ -277,14 +287,6 @@ $selectTemplateDown = false;
|
||||
switch ($sortField) {
|
||||
case 'disabled':
|
||||
switch ($sort) {
|
||||
case 'up':
|
||||
$selectDisabledUp = $selected;
|
||||
$order = [
|
||||
'field' => 'disabled',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'down':
|
||||
$selectDisabledDown = $selected;
|
||||
$order = [
|
||||
@ -292,19 +294,20 @@ switch ($sortField) {
|
||||
'order' => 'DESC',
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'up':
|
||||
$selectDisabledUp = $selected;
|
||||
$order = [
|
||||
'field' => 'disabled',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'standby':
|
||||
switch ($sort) {
|
||||
case 'up':
|
||||
$selectStandbyUp = $selected;
|
||||
$order = [
|
||||
'field' => 'standby',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'down':
|
||||
$selectStandbyDown = $selected;
|
||||
$order = [
|
||||
@ -312,19 +315,20 @@ switch ($sortField) {
|
||||
'order' => 'DESC',
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'up':
|
||||
$selectStandbyUp = $selected;
|
||||
$order = [
|
||||
'field' => 'standby',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'agent':
|
||||
switch ($sort) {
|
||||
case 'up':
|
||||
$selectAgentUp = $selected;
|
||||
$order = [
|
||||
'field' => 'agent_name',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'down':
|
||||
$selectAgentDown = $selected;
|
||||
$order = [
|
||||
@ -332,19 +336,20 @@ switch ($sortField) {
|
||||
'order' => 'DESC',
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'up':
|
||||
$selectAgentUp = $selected;
|
||||
$order = [
|
||||
'field' => 'agent_name',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'module':
|
||||
switch ($sort) {
|
||||
case 'up':
|
||||
$selectModuleUp = $selected;
|
||||
$order = [
|
||||
'field' => 'agent_module_name',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'down':
|
||||
$selectModuleDown = $selected;
|
||||
$order = [
|
||||
@ -352,19 +357,20 @@ switch ($sortField) {
|
||||
'order' => 'DESC',
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'up':
|
||||
$selectModuleUp = $selected;
|
||||
$order = [
|
||||
'field' => 'agent_module_name',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'template':
|
||||
switch ($sort) {
|
||||
case 'up':
|
||||
$selectTemplateUp = $selected;
|
||||
$order = [
|
||||
'field' => 'template_name',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
|
||||
case 'down':
|
||||
$selectTemplateDown = $selected;
|
||||
$order = [
|
||||
@ -372,6 +378,15 @@ switch ($sortField) {
|
||||
'order' => 'DESC',
|
||||
];
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'up':
|
||||
$selectTemplateUp = $selected;
|
||||
$order = [
|
||||
'field' => 'template_name',
|
||||
'order' => 'ASC',
|
||||
];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -717,13 +732,13 @@ foreach ($simple_alerts as $alert) {
|
||||
|
||||
$data[3] .= '<div id="add_action-div-'.$alert['id'].'" class="invisible">';
|
||||
$data[3] .= '<form id="add_action_form-'.$alert['id'].'" method="post" style="height:85%;">';
|
||||
$data[3] .= '<table class="databox_color w100p bg_color222" style="height:100%;">';
|
||||
$data[3] .= '<table class="w100p bg_color222">';
|
||||
$data[3] .= html_print_input_hidden('add_action', 1, true);
|
||||
$data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true);
|
||||
|
||||
if (! $id_agente) {
|
||||
$data[3] .= '<tr class="datos2">';
|
||||
$data[3] .= '<td class="datos2 bolder pdd_6px">';
|
||||
$data[3] .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Agent');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos">';
|
||||
@ -733,7 +748,7 @@ foreach ($simple_alerts as $alert) {
|
||||
}
|
||||
|
||||
$data[3] .= '<tr class="datos">';
|
||||
$data[3] .= '<td class="datos bolder pdd_6px">';
|
||||
$data[3] .= '<td class="datos bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Module');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos">';
|
||||
@ -741,15 +756,15 @@ foreach ($simple_alerts as $alert) {
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '</tr>';
|
||||
$data[3] .= '<tr class="datos2">';
|
||||
$data[3] .= '<td class="datos2 bolder pdd_6px">';
|
||||
$data[3] .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Action');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos2">';
|
||||
$data[3] .= html_print_select($actions, 'action_select', '', '', __('None'), 0, true, false, true, '', false, 'width:150px');
|
||||
$data[3] .= html_print_select($actions, 'action_select', '', '', __('None'), 0, true, false, true, '', false, 'width:95%');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '</tr>';
|
||||
$data[3] .= '<tr class="datos">';
|
||||
$data[3] .= '<td class="datos bolder pdd_6px">';
|
||||
$data[3] .= '<td class="datos bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Number of alerts match from');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos">';
|
||||
@ -773,7 +788,7 @@ foreach ($simple_alerts as $alert) {
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '</tr>';
|
||||
$data[3] .= '<tr class="datos2">';
|
||||
$data[3] .= '<td class="datos2 bolder pdd_6px">';
|
||||
$data[3] .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Threshold');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos2">';
|
||||
@ -1127,8 +1142,6 @@ function show_advance_options_action(id_alert) {
|
||||
function show_add_action(id_alert) {
|
||||
$("#add_action-div-" + id_alert).hide ()
|
||||
.dialog ({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
title: '<?php echo __('Add action'); ?>',
|
||||
modal: true,
|
||||
overlay: {
|
||||
@ -1136,14 +1149,14 @@ function show_add_action(id_alert) {
|
||||
background: "black"
|
||||
},
|
||||
open: function() {
|
||||
$(`#add_action-div-${id_alert}`).css('overflow', 'hidden');
|
||||
$(`#add_action-div-${id_alert}`).css('overflow', 'initial');
|
||||
$("select[id^='action_select'], select[id^='action_select']").select2({
|
||||
tags: true,
|
||||
dropdownParent: $("#add_action-div-" + id_alert)
|
||||
});
|
||||
},
|
||||
width: 455,
|
||||
height: 500
|
||||
width: 600,
|
||||
height: 300
|
||||
})
|
||||
.show ();
|
||||
}
|
||||
@ -1179,8 +1192,8 @@ function show_display_update_action(id_module_action, alert_id, alert_id_agent_m
|
||||
dropdownParent: $(`#update_action-div-${alert_id}`)
|
||||
});
|
||||
},
|
||||
width: 455,
|
||||
height: 500
|
||||
width: 600,
|
||||
height: 350
|
||||
})
|
||||
.show ();
|
||||
}
|
||||
|
@ -352,14 +352,15 @@ if ($search_string) {
|
||||
$filter[] = "(name LIKE '%".$search_string."%' OR description LIKE '%".$search_string."%' OR value LIKE '%".$search_string."%')";
|
||||
}
|
||||
|
||||
$total_templates = alerts_get_alert_templates($filter, ['COUNT(*) AS total']);
|
||||
$total_templates = $total_templates[0]['total'];
|
||||
$filter['offset'] = (int) get_parameter('offset');
|
||||
$filter['limit'] = (int) $config['block_size'];
|
||||
if (!is_user_admin($config['id_user'])) {
|
||||
$filter['id_group'] = array_keys(users_get_groups(false, 'LM'));
|
||||
}
|
||||
|
||||
$total_templates = alerts_get_alert_templates($filter, ['COUNT(*) AS total']);
|
||||
$total_templates = $total_templates[0]['total'];
|
||||
|
||||
$templates = alerts_get_alert_templates(
|
||||
$filter,
|
||||
[
|
||||
|
@ -261,7 +261,7 @@ $table->data[2][1] = html_print_select_from_sql(
|
||||
'id_command',
|
||||
$id_command,
|
||||
'',
|
||||
__('None'),
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
|
@ -77,7 +77,7 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
'images/custom_columns.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Custom fields'),
|
||||
'title' => __('Custom columns'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
@ -87,18 +87,17 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
switch ($section) {
|
||||
case 'filter':
|
||||
$buttons['filter']['active'] = true;
|
||||
$subpage = ' - '.__('Filters');
|
||||
$subpage = __('Filters');
|
||||
break;
|
||||
|
||||
case 'fields':
|
||||
$buttons['fields']['active'] = true;
|
||||
$subpage = ' - '.__('Custom fields');
|
||||
$subpage = __('Custom columns');
|
||||
break;
|
||||
|
||||
case 'responses':
|
||||
$buttons['responses']['active'] = true;
|
||||
$subpage = ' - '.__('Responses');
|
||||
$help_header = '';
|
||||
$subpage = __('Responses');
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
@ -107,18 +106,28 @@ switch ($section) {
|
||||
|
||||
default:
|
||||
$buttons['filter']['active'] = true;
|
||||
$subpage = ' - '.__('Filters');
|
||||
$subpage = __('Filters');
|
||||
break;
|
||||
}
|
||||
|
||||
if (! defined('METACONSOLE')) {
|
||||
ui_print_page_header(
|
||||
__('Manage events').$subpage,
|
||||
if (is_metaconsole() === false) {
|
||||
ui_print_standard_header(
|
||||
$subpage,
|
||||
'images/gm_events.png',
|
||||
false,
|
||||
$help_header,
|
||||
'',
|
||||
true,
|
||||
$buttons
|
||||
(array) $buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Configuration'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Events'),
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
ui_meta_print_header(__('Manage events').$subpage, '', $buttons);
|
||||
|
@ -140,7 +140,7 @@ function process_manage_delete($id_agents)
|
||||
}
|
||||
|
||||
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
$id_group = (is_metaconsole() === true) ? get_parameter('id_group', '') : (int) get_parameter('id_group');
|
||||
$id_agents = get_parameter('id_agents');
|
||||
$recursion = get_parameter('recursion');
|
||||
$delete = (bool) get_parameter_post('delete');
|
||||
@ -282,15 +282,15 @@ $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 = agents_get_group_agents(
|
||||
array_keys(users_get_groups($config['id_user'], 'AW', false)),
|
||||
['disabled' => 2],
|
||||
'none',
|
||||
false,
|
||||
false,
|
||||
is_metaconsole(),
|
||||
'|'
|
||||
);
|
||||
$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,
|
||||
|
@ -14,7 +14,7 @@
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* 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
|
||||
@ -89,9 +89,9 @@ if ($update) {
|
||||
$agents_ = [];
|
||||
}
|
||||
|
||||
// If the option to select all of one group or module type is checked
|
||||
// If the option to select all of one group or module type is checked.
|
||||
if ($force) {
|
||||
if ($force == 'type') {
|
||||
if ($force === 'type') {
|
||||
$type_condition = '';
|
||||
if ($module_type != 0) {
|
||||
$type_condition = "AND tam.id_tipo_modulo = $module_type";
|
||||
@ -109,7 +109,7 @@ if ($update) {
|
||||
$agents_ = [];
|
||||
}
|
||||
|
||||
// Create an array of agent ids
|
||||
// Create an array of agent ids.
|
||||
$agents_ = extract_column($agents_, 'id_agente');
|
||||
|
||||
foreach ($agents_ as $id_agent) {
|
||||
@ -136,7 +136,7 @@ if ($update) {
|
||||
if ($success == 0) {
|
||||
$error_msg = __('Error updating the modules from a module type');
|
||||
}
|
||||
} else if ($force == 'group') {
|
||||
} else if ($force === 'group') {
|
||||
$agents_ = array_keys(agents_get_group_agents($group_select, false, 'none'));
|
||||
|
||||
foreach ($agents_ as $id_agent) {
|
||||
@ -2226,28 +2226,30 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
|
||||
$values['quiet'] = get_parameter('quiet_select');
|
||||
}
|
||||
|
||||
$filter_modules = false;
|
||||
|
||||
if (!is_numeric($module_name) or ($module_name != 0)) {
|
||||
$filter_modules['nombre'] = $module_name;
|
||||
}
|
||||
|
||||
// Whether to update module tag info
|
||||
// Whether to update module tag info.
|
||||
$update_tags = get_parameter('id_tag', false);
|
||||
|
||||
if (array_search(0, $agents_select) !== false) {
|
||||
// Apply at All agents.
|
||||
$modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
$filter_modules,
|
||||
[
|
||||
'id_agente_modulo',
|
||||
'id_tipo_modulo',
|
||||
]
|
||||
if (is_numeric($module_name) === false || ($module_name !== 0)) {
|
||||
$filterModules = sprintf('AND tam.nombre = \'%s\'', $module_name);
|
||||
} else {
|
||||
$filterModules = '';
|
||||
}
|
||||
|
||||
// Apply at All agents (within valid groups).
|
||||
$modules = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT tam.id_agente_modulo, tam.id_tipo_modulo
|
||||
FROM tagente_modulo tam INNER JOIN tagente ta
|
||||
ON ta.id_agente = tam.id_agente
|
||||
WHERE ta.id_grupo IN (%s) %s;',
|
||||
implode(',', array_keys(users_get_groups())),
|
||||
$filterModules
|
||||
)
|
||||
);
|
||||
} else {
|
||||
if ($module_name == '0') {
|
||||
// Any module
|
||||
if ($module_name === '0') {
|
||||
// Any module.
|
||||
$modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
['id_agente' => $agents_select],
|
||||
@ -2275,12 +2277,12 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
|
||||
return false;
|
||||
}
|
||||
|
||||
if (($module_status == 'unknown') && ($module_name == '0')) {
|
||||
if (($module_status === 'unknown') && ($module_name == '0')) {
|
||||
$modules_to_delete = [];
|
||||
foreach ($modules as $mod_id) {
|
||||
$mod_status = (int) db_get_value_filter('estado', 'tagente_estado', ['id_agente_modulo' => $mod_id]);
|
||||
|
||||
// Unknown, not init and no data modules
|
||||
// Unknown, not init and no data modules.
|
||||
if ($mod_status == 3 || $mod_status == 4 || $mod_status == 5) {
|
||||
$modules_to_delete[$mod_id] = $mod_id;
|
||||
}
|
||||
|
@ -1,16 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Godmode menu.
|
||||
*
|
||||
* @category Menu
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 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; 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.
|
||||
// Begin.
|
||||
require_once 'include/config.php';
|
||||
|
||||
check_login();
|
||||
@ -21,11 +37,11 @@ require_once 'include/functions_menu.php';
|
||||
$menu_godmode = [];
|
||||
$menu_godmode['class'] = 'godmode';
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AR')
|
||||
|| check_acl($config['id_user'], 0, 'AW')
|
||||
|| check_acl($config['id_user'], 0, 'RR')
|
||||
|| check_acl($config['id_user'], 0, 'RW')
|
||||
|| check_acl($config['id_user'], 0, 'PM')
|
||||
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
|
||||
|| (bool) check_acl($config['id_user'], 0, 'RW') === true
|
||||
|| (bool) check_acl($config['id_user'], 0, 'PM') === true
|
||||
) {
|
||||
$sub = [];
|
||||
$sub['godmode/servers/discovery&wiz=main']['text'] = __('Start');
|
||||
@ -33,17 +49,17 @@ if (check_acl($config['id_user'], 0, 'AR')
|
||||
$sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list');
|
||||
$sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist';
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW')
|
||||
|| check_acl($config['id_user'], 0, 'PM')
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true
|
||||
|| (bool) check_acl($config['id_user'], 0, 'PM') === true
|
||||
) {
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
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 (check_acl($config['id_user'], 0, 'PM')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$sub2['godmode/servers/discovery&wiz=hd&mode=managenetscanscripts']['text'] = __('Manage scan scripts');
|
||||
}
|
||||
|
||||
@ -52,7 +68,7 @@ if (check_acl($config['id_user'], 0, 'AR')
|
||||
$sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2;
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
enterprise_hook('applications_menu');
|
||||
enterprise_hook('cloud_menu');
|
||||
enterprise_hook('console_task_menu');
|
||||
@ -67,19 +83,19 @@ if (check_acl($config['id_user'], 0, 'AR')
|
||||
|
||||
|
||||
$sub = [];
|
||||
if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'AD')) {
|
||||
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 (check_acl($config['id_user'], 0, 'PM')) {
|
||||
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
|
||||
// Category.
|
||||
$sub['godmode/category/category']['text'] = __('Module categories');
|
||||
$sub['godmode/category/category']['id'] = 'Module categories';
|
||||
$sub['godmode/category/category']['subsecs'] = 'godmode/category/edit_category';
|
||||
@ -91,15 +107,15 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$sub['godmode/groups/modu_group_list']['id'] = 'Module groups';
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
// Netflow
|
||||
if ($config['activate_netflow']) {
|
||||
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)) {
|
||||
if (empty($sub) === false) {
|
||||
$menu_godmode['gagente']['text'] = __('Resources');
|
||||
$menu_godmode['gagente']['sec2'] = 'godmode/agentes/modificar_agente';
|
||||
$menu_godmode['gagente']['id'] = 'god-resources';
|
||||
@ -107,13 +123,13 @@ if (!empty($sub)) {
|
||||
}
|
||||
|
||||
$sub = [];
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
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 (check_acl($config['id_user'], 0, 'PM')) {
|
||||
// Tag
|
||||
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';
|
||||
@ -121,17 +137,17 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
enterprise_hook('enterprise_acl_submenu');
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'UM')) {
|
||||
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 (check_acl($config['id_user'], 0, 'PM')) {
|
||||
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)) {
|
||||
if (empty($sub) === false) {
|
||||
$menu_godmode['gusuarios']['sub'] = $sub;
|
||||
$menu_godmode['gusuarios']['text'] = __('Profiles');
|
||||
$menu_godmode['gusuarios']['sec2'] = 'godmode/users/user_list';
|
||||
@ -139,8 +155,7 @@ if (!empty($sub)) {
|
||||
}
|
||||
|
||||
$sub = [];
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
// enterprise_hook('components_submenu');
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$sub['templates']['text'] = __('Templates');
|
||||
$sub['templates']['id'] = 'Templates';
|
||||
$sub['templates']['type'] = 'direct';
|
||||
@ -155,31 +170,22 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$sub2['godmode/modules/manage_network_components']['text'] = __('Remote components');
|
||||
$sub2['godmode/modules/manage_network_components']['id'] = 'Network components';
|
||||
$sub['templates']['sub2'] = $sub2;
|
||||
/*
|
||||
$sub2['godmode/modules/manage_snmp_modules']['text'] = __('SNMP Modules');
|
||||
$sub2['godmode/modules/manage_snmp_modules']['id'] = 'SNMP Modules';
|
||||
$sub2['godmode/modules/manage_wmi_modules']['text'] = __('WMI Modules');
|
||||
$sub2['godmode/modules/manage_wmi_modules']['id'] = 'WMI Modules';
|
||||
$sub['godmode/modules/manage_block_templates']['text'] = __('Module blocks');
|
||||
$sub['godmode/modules/manage_block_templates']['id'] = 'Module blocks';
|
||||
*/
|
||||
|
||||
|
||||
enterprise_hook('inventory_submenu');
|
||||
enterprise_hook('autoconfiguration_menu');
|
||||
enterprise_hook('agent_repository_menu');
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
enterprise_hook('policies_menu');
|
||||
enterprise_hook('agents_submenu');
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'NW')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'NW') === true) {
|
||||
enterprise_hook('agents_ncm_submenu');
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
$sub['gmassive']['text'] = __('Bulk operations');
|
||||
$sub['gmassive']['id'] = 'Bulk operations';
|
||||
$sub['gmassive']['type'] = 'direct';
|
||||
@ -188,7 +194,7 @@ if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
$sub2['godmode/massive/massive_operations&tab=massive_agents']['text'] = __('Agents operations');
|
||||
$sub2['godmode/massive/massive_operations&tab=massive_modules']['text'] = __('Modules operations');
|
||||
$sub2['godmode/massive/massive_operations&tab=massive_plugins']['text'] = __('Plugins operations');
|
||||
if (check_acl($config['id_user'], 0, 'UM')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'UM') === true) {
|
||||
$sub2['godmode/massive/massive_operations&tab=massive_users']['text'] = __('Users operations');
|
||||
}
|
||||
|
||||
@ -199,23 +205,48 @@ if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
enterprise_hook('massiveservices_submenu');
|
||||
|
||||
$sub['gmassive']['sub2'] = $sub2;
|
||||
$sub2 = [];
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'PM') || check_acl($config['id_user'], 0, 'UM')) {
|
||||
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';
|
||||
}
|
||||
|
||||
if (!empty($sub)) {
|
||||
// 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§ion=filter']['text'] = __('Event filters');
|
||||
$sub2['godmode/events/events§ion=filter']['id'] = 'Event filters';
|
||||
}
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$sub2['godmode/events/events§ion=fields']['text'] = __('Custom columns');
|
||||
$sub2['godmode/events/events§ion=fields']['id'] = 'Custom events';
|
||||
$sub2['godmode/events/events§ion=responses']['text'] = __('Event responses');
|
||||
$sub2['godmode/events/events§ion=responses']['id'] = 'Event responses';
|
||||
}
|
||||
|
||||
if (empty($sub2) === false) {
|
||||
$sub['geventos']['text'] = __('Events');
|
||||
$sub['geventos']['id'] = 'events';
|
||||
$sub['geventos']['sec2'] = 'godmode/events/events§ion=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 (check_acl($config['id_user'], 0, 'LW')
|
||||
|| check_acl($config['id_user'], 0, 'LM')
|
||||
|| check_acl($config['id_user'], 0, 'AD')
|
||||
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';
|
||||
@ -226,7 +257,7 @@ if (check_acl($config['id_user'], 0, 'LW')
|
||||
$sub['godmode/alerts/alert_list']['id'] = 'List of Alerts';
|
||||
$sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view'];
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'LM')) {
|
||||
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'];
|
||||
@ -250,44 +281,21 @@ if (check_acl($config['id_user'], 0, 'LW')
|
||||
$menu_godmode['galertas']['sub'] = $sub;
|
||||
}
|
||||
|
||||
// Manage events
|
||||
$sub = [];
|
||||
if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'EM')) {
|
||||
// Custom event fields
|
||||
$sub['godmode/events/events§ion=filter']['text'] = __('Event filters');
|
||||
$sub['godmode/events/events§ion=filter']['id'] = 'Event filters';
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$sub['godmode/events/events§ion=fields']['text'] = __('Custom events');
|
||||
$sub['godmode/events/events§ion=fields']['id'] = 'Custom events';
|
||||
$sub['godmode/events/events§ion=responses']['text'] = __('Event responses');
|
||||
$sub['godmode/events/events§ion=responses']['id'] = 'Event responses';
|
||||
}
|
||||
|
||||
if (!empty($sub)) {
|
||||
$menu_godmode['geventos']['text'] = __('Events');
|
||||
$menu_godmode['geventos']['sec2'] = 'godmode/events/events§ion=filter';
|
||||
$menu_godmode['geventos']['id'] = 'god-events';
|
||||
$menu_godmode['geventos']['sub'] = $sub;
|
||||
}
|
||||
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, 'PM')) {
|
||||
// Servers
|
||||
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 (check_acl($config['id_user'], 0, 'AW')) {
|
||||
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 (check_acl($config['id_user'], 0, 'PM')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
enterprise_hook('ha_cluster');
|
||||
|
||||
$sub['godmode/servers/plugin']['text'] = __('Plugins');
|
||||
@ -304,15 +312,15 @@ if (check_acl($config['id_user'], 0, 'AW') || check_acl($config['id_user'], 0, '
|
||||
$menu_godmode['gservers']['sub'] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
// Setup
|
||||
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
|
||||
// Options Setup.
|
||||
$sub['general']['text'] = __('Setup');
|
||||
$sub['general']['id'] = 'Setup';
|
||||
$sub['general']['type'] = 'direct';
|
||||
@ -337,8 +345,8 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$sub2['godmode/setup/setup§ion=vis']['text'] = __('Visual styles');
|
||||
$sub2['godmode/setup/setup§ion=vis']['refr'] = 0;
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
if ($config['activate_netflow']) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
if ((bool) $config['activate_netflow'] === true) {
|
||||
$sub2['godmode/setup/setup§ion=net']['text'] = __('Netflow');
|
||||
$sub2['godmode/setup/setup§ion=net']['refr'] = 0;
|
||||
}
|
||||
@ -361,7 +369,7 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$sub2['godmode/setup/setup§ion=external_tools']['text'] = __('External Tools');
|
||||
$sub2['godmode/setup/setup§ion=external_tools']['refr'] = 0;
|
||||
|
||||
if ($config['activate_gis']) {
|
||||
if ((bool) $config['activate_gis'] === true) {
|
||||
$sub2['godmode/setup/setup§ion=gis']['text'] = __('Map conections GIS');
|
||||
}
|
||||
|
||||
@ -376,14 +384,14 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
$menu_godmode['gsetup']['sub'] = $sub;
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'PM') || check_acl($config['id_user'], 0, 'DM')) {
|
||||
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';
|
||||
$menu_godmode['gextensions']['id'] = 'god-extensions';
|
||||
|
||||
$sub = [];
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'PM')) {
|
||||
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';
|
||||
@ -399,7 +407,7 @@ if (check_acl($config['id_user'], 0, 'PM') || check_acl($config['id_user'], 0, '
|
||||
$sub['godmode/setup/file_manager']['text'] = __('File manager');
|
||||
$sub['godmode/setup/file_manager']['id'] = 'File manager';
|
||||
|
||||
if (is_user_admin($config['id_user'])) {
|
||||
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';
|
||||
@ -414,40 +422,38 @@ if (check_acl($config['id_user'], 0, 'PM') || check_acl($config['id_user'], 0, '
|
||||
$menu_godmode['gextensions']['sub'] = $sub;
|
||||
}
|
||||
|
||||
if (is_array($config['extensions'])) {
|
||||
if (is_array($config['extensions']) === true) {
|
||||
$sub = [];
|
||||
$sub2 = [];
|
||||
|
||||
foreach ($config['extensions'] as $extension) {
|
||||
// If no godmode_menu is a operation extension
|
||||
if ($extension['godmode_menu'] == '') {
|
||||
// If no godmode_menu is a operation extension.
|
||||
if (empty($extension['godmode_menu']) === true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($extension['godmode_menu']['name'] == 'System Info') {
|
||||
if ($extension['godmode_menu']['name'] === 'System Info') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($extension['godmode_menu']['name'] != __('DB Schema check') && $extension['godmode_menu']['name'] != __('DB interface')) {
|
||||
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 (! check_acl($config['id_user'], 0, $extmenu['acl'])) {
|
||||
// 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 ($extension['godmode_menu']['fatherId'] == '') {
|
||||
// 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) && array_key_exists('fatherId', $extmenu)) {
|
||||
if (is_array($extmenu) === true && array_key_exists('fatherId', $extmenu) === true) {
|
||||
if (strlen($extmenu['fatherId']) > 0) {
|
||||
if (array_key_exists('subfatherId', $extmenu)) {
|
||||
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'];
|
||||
@ -462,12 +468,7 @@ if (is_array($config['extensions'])) {
|
||||
$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'];
|
||||
if ($extmenu['name'] == 'Cron jobs') {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = $extmenu['fatherId'];
|
||||
} else {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = $extmenu['fatherId'];
|
||||
}
|
||||
|
||||
$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;
|
||||
@ -487,7 +488,7 @@ if (is_array($config['extensions'])) {
|
||||
}
|
||||
}
|
||||
|
||||
// Complete the submenu
|
||||
// Complete the submenu.
|
||||
$extension_view = [];
|
||||
$extension_view['godmode/extensions']['id'] = 'Extension manager view';
|
||||
$extension_view['godmode/extensions']['text'] = __('Extension manager view');
|
||||
@ -499,7 +500,7 @@ if (is_array($config['extensions'])) {
|
||||
$sub['godmode/extensions']['type'] = 'direct';
|
||||
$sub['godmode/extensions']['subtype'] = 'nolink';
|
||||
|
||||
if (is_array($menu_godmode['gextensions']['sub'])) {
|
||||
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;
|
||||
@ -514,7 +515,7 @@ $menu_godmode['links']['id'] = 'god-links';
|
||||
$sub = [];
|
||||
$rows = db_get_all_rows_in_table('tlink', 'name');
|
||||
foreach ($rows as $row) {
|
||||
// Audit //meter en extensiones
|
||||
// Audit //meter en extensiones.
|
||||
$sub[$row['link']]['text'] = $row['name'];
|
||||
$sub[$row['link']]['id'] = $row['name'];
|
||||
$sub[$row['link']]['type'] = 'direct';
|
||||
@ -523,30 +524,30 @@ foreach ($rows as $row) {
|
||||
|
||||
$menu_godmode['links']['sub'] = $sub;
|
||||
|
||||
// Update Manager
|
||||
if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager']) {
|
||||
$menu_godmode['messages']['text'] = __('Update manager');
|
||||
// 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'] = '';
|
||||
|
||||
$sub = [];
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update offline');
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline';
|
||||
|
||||
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update Manager online');
|
||||
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update online');
|
||||
$sub['godmode/update_manager/update_manager&tab=online']['id'] = 'Online';
|
||||
|
||||
$sub['godmode/update_manager/update_manager&tab=setup']['text'] = __('Update Manager options');
|
||||
$sub['godmode/update_manager/update_manager&tab=setup']['text'] = __('Options');
|
||||
$sub['godmode/update_manager/update_manager&tab=setup']['id'] = 'Options';
|
||||
|
||||
$sub['godmode/update_manager/update_manager&tab=history']['text'] = __('Update Manager journal');
|
||||
$sub['godmode/update_manager/update_manager&tab=history']['text'] = __('Warp journal');
|
||||
$sub['godmode/update_manager/update_manager&tab=history']['id'] = 'Journal';
|
||||
|
||||
$menu_godmode['messages']['sub'] = $sub;
|
||||
}
|
||||
|
||||
// Module library.
|
||||
if (check_acl($config['id_user'], 0, 'AR')) {
|
||||
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';
|
||||
|
||||
@ -560,6 +561,6 @@ if (check_acl($config['id_user'], 0, 'AR')) {
|
||||
$menu_godmode['gmodule_library']['sub'] = $sub;
|
||||
}
|
||||
|
||||
if (!$config['pure']) {
|
||||
if ((bool) $config['pure'] === false) {
|
||||
menu_print_menu($menu_godmode);
|
||||
}
|
||||
|
@ -178,6 +178,7 @@ switch ($type) {
|
||||
break;
|
||||
}
|
||||
|
||||
$query_filter = [];
|
||||
if (empty($query_filter) === false) {
|
||||
$query_filter = json_decode($query_filter, true);
|
||||
}
|
||||
|
@ -135,6 +135,7 @@ $current_month = true;
|
||||
// Only avg is selected by default for the simple graphs.
|
||||
$fullscale = false;
|
||||
$percentil = false;
|
||||
$image_threshold = false;
|
||||
$time_compare_overlapped = false;
|
||||
|
||||
// Added for events items.
|
||||
@ -307,6 +308,7 @@ switch ($action) {
|
||||
case 'simple_graph':
|
||||
$fullscale = isset($style['fullscale']) ? (bool) $style['fullscale'] : 0;
|
||||
$percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0;
|
||||
$image_threshold = (isset($style['image_threshold']) === true) ? (bool) $style['image_threshold'] : false;
|
||||
$graph_render = $item['graph_render'];
|
||||
// The break hasn't be forgotten.
|
||||
case 'simple_baseline_graph':
|
||||
@ -606,6 +608,7 @@ switch ($action) {
|
||||
$event_graph_by_criticity = $style['event_graph_by_criticity'];
|
||||
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
|
||||
$include_extended_events = $item['show_extended_events'];
|
||||
$custom_data_events = $style['custom_data_events'];
|
||||
|
||||
$filter_search = $style['event_filter_search'];
|
||||
$filter_exclude = $style['event_filter_exclude'];
|
||||
@ -631,6 +634,7 @@ switch ($action) {
|
||||
|
||||
|
||||
$include_extended_events = $item['show_extended_events'];
|
||||
$custom_data_events = $style['custom_data_events'];
|
||||
break;
|
||||
|
||||
case 'event_report_module':
|
||||
@ -665,6 +669,7 @@ switch ($action) {
|
||||
|
||||
|
||||
$include_extended_events = $item['show_extended_events'];
|
||||
$custom_data_events = $style['custom_data_events'];
|
||||
break;
|
||||
|
||||
case 'general':
|
||||
@ -2501,6 +2506,23 @@ $class = 'databox filters';
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_image_threshold" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Show threshold');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox_switch(
|
||||
'image_threshold',
|
||||
1,
|
||||
$image_threshold
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_time_compare_overlapped" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
@ -2911,6 +2933,23 @@ $class = 'databox filters';
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_custom_data_events" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Show custom data');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox_switch(
|
||||
'custom_data_events',
|
||||
true,
|
||||
$custom_data_events
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_event_graphs" class="datos">
|
||||
<td class="bolder"><?php echo __('Event graphs'); ?></td>
|
||||
<td>
|
||||
@ -5945,6 +5984,7 @@ function chooseType() {
|
||||
$("#row_show_graph").hide();
|
||||
$("#row_max_min_avg").hide();
|
||||
$("#row_fullscale").hide();
|
||||
$("#row_image_threshold").hide();
|
||||
$("#row_graph_render").hide();
|
||||
$("#row_macros_definition").hide();
|
||||
$("#row_render_definition").hide();
|
||||
@ -5974,6 +6014,7 @@ function chooseType() {
|
||||
$("#row_event_graph_by_criticity").hide();
|
||||
$("#row_event_graph_by_validated").hide();
|
||||
$("#row_extended_events").hide();
|
||||
$("#row_custom_data_events").hide();
|
||||
$("#row_netflow_filter").hide();
|
||||
$("#row_max_values").hide();
|
||||
$("#row_resolution").hide();
|
||||
@ -6044,6 +6085,7 @@ function chooseType() {
|
||||
$("#row_event_graph_by_criticity").show();
|
||||
$("#row_event_graph_by_validated").show();
|
||||
$("#row_extended_events").show();
|
||||
$("#row_custom_data_events").show();
|
||||
|
||||
$("#row_filter_search").show();
|
||||
$("#row_filter_exclude").show();
|
||||
@ -6077,6 +6119,7 @@ function chooseType() {
|
||||
case 'simple_graph':
|
||||
$("#row_time_compare_overlapped").show();
|
||||
$("#row_fullscale").show();
|
||||
$("#row_image_threshold").show();
|
||||
$("#row_graph_render").show();
|
||||
$("#row_percentil").show();
|
||||
|
||||
@ -6371,6 +6414,7 @@ function chooseType() {
|
||||
$("#row_event_graph_by_validated").show();
|
||||
$("#row_event_type").show();
|
||||
$("#row_extended_events").show();
|
||||
$("#row_custom_data_events").show();
|
||||
|
||||
$("#row_filter_search").show();
|
||||
$("#row_filter_exclude").show();
|
||||
@ -6389,7 +6433,7 @@ function chooseType() {
|
||||
$("#row_event_graphs").show();
|
||||
$("#row_event_type").show();
|
||||
$("#row_extended_events").show();
|
||||
$("#row_extended_events").show();
|
||||
$("#row_custom_data_events").show();
|
||||
|
||||
$("#row_event_graph_by_user").show();
|
||||
$("#row_event_graph_by_criticity").show();
|
||||
@ -6414,6 +6458,7 @@ function chooseType() {
|
||||
$("#row_event_graphs").show();
|
||||
$("#row_event_type").show();
|
||||
$("#row_extended_events").show();
|
||||
$("#row_custom_data_events").show();
|
||||
|
||||
$("#row_event_graph_by_user").show();
|
||||
$("#row_event_graph_by_criticity").show();
|
||||
|
@ -2224,12 +2224,18 @@ switch ($action) {
|
||||
$filter_event_status
|
||||
);
|
||||
|
||||
$custom_data_events = get_parameter_switch(
|
||||
'custom_data_events',
|
||||
0
|
||||
);
|
||||
|
||||
$style['event_graph_by_agent'] = $event_graph_by_agent;
|
||||
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
|
||||
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
|
||||
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
|
||||
$style['event_filter_search'] = $event_filter_search;
|
||||
$style['event_filter_exclude'] = $event_filter_exclude;
|
||||
$style['custom_data_events'] = $custom_data_events;
|
||||
|
||||
|
||||
if ($label != '') {
|
||||
@ -2249,6 +2255,9 @@ switch ($action) {
|
||||
$style['fullscale'] = (int) get_parameter(
|
||||
'fullscale'
|
||||
);
|
||||
$style['image_threshold'] = (int) get_parameter(
|
||||
'image_threshold'
|
||||
);
|
||||
if ($label != '') {
|
||||
$style['label'] = $label;
|
||||
} else {
|
||||
@ -2957,6 +2966,11 @@ switch ($action) {
|
||||
''
|
||||
);
|
||||
|
||||
$custom_data_events = get_parameter_switch(
|
||||
'custom_data_events',
|
||||
0
|
||||
);
|
||||
|
||||
|
||||
// Added for events items.
|
||||
$style['show_summary_group'] = $show_summary_group;
|
||||
@ -2976,6 +2990,7 @@ switch ($action) {
|
||||
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
|
||||
$style['event_filter_search'] = $event_filter_search;
|
||||
$style['event_filter_exclude'] = $event_filter_exclude;
|
||||
$style['custom_data_events'] = $custom_data_events;
|
||||
|
||||
if ($label != '') {
|
||||
$style['label'] = $label;
|
||||
@ -2994,6 +3009,9 @@ switch ($action) {
|
||||
$style['fullscale'] = (int) get_parameter(
|
||||
'fullscale'
|
||||
);
|
||||
$style['image_threshold'] = (int) get_parameter(
|
||||
'image_threshold'
|
||||
);
|
||||
if ($label != '') {
|
||||
$style['label'] = $label;
|
||||
} else {
|
||||
|
@ -165,6 +165,7 @@ if ($layoutDatas === false) {
|
||||
|
||||
$alternativeStyle = true;
|
||||
|
||||
$parents = visual_map_get_items_parents($idVisualConsole);
|
||||
|
||||
foreach ($layoutDatas as $layoutData) {
|
||||
$idLayoutData = $layoutData['id'];
|
||||
@ -473,7 +474,6 @@ foreach ($layoutDatas as $layoutData) {
|
||||
break;
|
||||
|
||||
default:
|
||||
$parents = visual_map_get_items_parents($idVisualConsole);
|
||||
$table->data[($i + 1)][4] = html_print_select(
|
||||
$parents,
|
||||
'parent_'.$idLayoutData,
|
||||
@ -740,9 +740,9 @@ foreach ($layoutDatas as $layoutData) {
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if (!defined('METACONSOLE')) {
|
||||
echo '<form method="post" action="index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id'].'">';
|
||||
echo '<form class="vc_elem_form" method="post" action="index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id'].'">';
|
||||
} else {
|
||||
echo "<form method='post' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console=".$idVisualConsole."'>";
|
||||
echo "<form class='vc_elem_form' method='post' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console=".$idVisualConsole."'>";
|
||||
}
|
||||
|
||||
if (!defined('METACONSOLE')) {
|
||||
@ -807,7 +807,30 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
|
||||
$('form.vc_elem_form').submit(function() {
|
||||
var inputs_array = $(this).serializeArray();
|
||||
var form_action = {};
|
||||
|
||||
form_action.name = 'go';
|
||||
form_action.value = 'Update';
|
||||
inputs_array.push(form_action);
|
||||
|
||||
var serialized_form_inputs = JSON.stringify(inputs_array);
|
||||
var ajax_url = "<?php echo (is_metaconsole() === true) ? 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console='.$idVisualConsole : 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id']; ?>";
|
||||
|
||||
$.post({
|
||||
url: ajax_url,
|
||||
data: { serialized_form_inputs },
|
||||
dataType: "json",
|
||||
async: false,
|
||||
complete: function (data) {
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
var added_config = {
|
||||
"selector": "#tinyMCE_editor",
|
||||
"elements": "text-label",
|
||||
|
@ -40,6 +40,21 @@ require_once $config['homedir'].'/include/functions_visual_map.php';
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
enterprise_include_once('include/functions_visual_map.php');
|
||||
|
||||
// Bypass the size limitation of posted inputs given by PHP config token 'max_input_vars'.
|
||||
if (isset($_POST['serialized_form_inputs']) === true) {
|
||||
$posted_data_serialized = json_decode($_POST['serialized_form_inputs'], true);
|
||||
|
||||
unset($_POST['serialized_form_inputs']);
|
||||
|
||||
$posted_data_array = array_combine(
|
||||
array_column($posted_data_serialized, 'name'),
|
||||
array_column($posted_data_serialized, 'value')
|
||||
);
|
||||
|
||||
// Merge data to $_POST superglobal.
|
||||
$_POST += $posted_data_array;
|
||||
}
|
||||
|
||||
// Retrieve the visual console id.
|
||||
set_unless_defined($idVisualConsole, 0);
|
||||
// Set default.
|
||||
|
@ -337,7 +337,7 @@ if (($create != '') || ($view != '')) {
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Name');
|
||||
$data[1] = '<input type="text" name="form_name" size=100 value="'.$form_name.'">';
|
||||
$data[1] = '<input type="text" class="text_input" name="form_name" size=100 value="'.$form_name.'">';
|
||||
$table->colspan['plugin_name'][1] = 3;
|
||||
$table->data['plugin_name'] = $data;
|
||||
|
||||
@ -399,7 +399,7 @@ if (($create != '') || ($view != '')) {
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Plugin command').ui_print_help_tip(__('Specify interpreter and plugin path. The server needs permissions to run it.'), true);
|
||||
$data[1] = '<input type="text" name="form_execute" id="form_execute" class="command_component command_advanced_conf" size=100 value="'.$form_execute.'" '.$disabled.'>';
|
||||
$data[1] = '<input type="text" name="form_execute" id="form_execute" class="command_component command_advanced_conf text_input" size=100 value="'.$form_execute.'" '.$disabled.'>';
|
||||
if ($locked) {
|
||||
$data[1] .= html_print_image('images/lock_mc.png', true, ['class' => 'command_advanced_conf lock', 'class' => 'invert_filter']);
|
||||
}
|
||||
@ -411,7 +411,7 @@ if (($create != '') || ($view != '')) {
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Plug-in parameters');
|
||||
$data[1] = '<input type="text" name="form_parameters" id="form_parameters" class="command_component command_advanced_conf" size=100 value="'.$parameters.'" '.$disabled.'>';
|
||||
$data[1] = '<input type="text" name="form_parameters" id="form_parameters" class="command_component command_advanced_conf text_input" size=100 value="'.$parameters.'" '.$disabled.'>';
|
||||
if ($locked) {
|
||||
$data[1] .= html_print_image('images/lock_mc.png', true, ['class' => 'command_advanced_conf lock', 'class' => 'invert_filter']);
|
||||
}
|
||||
@ -484,13 +484,13 @@ if (($create != '') || ($view != '')) {
|
||||
$datam = [];
|
||||
$datam[0] = __('Description')."<span class='normal_weight'> ($macro_name)</span>";
|
||||
$datam[0] .= html_print_input_hidden($macro_name_name, $macro_name, true);
|
||||
$datam[1] = html_print_input_text_extended($macro_desc_name, $macro_desc_value, 'text-'.$macro_desc_name, '', 30, 255, $locked, '', "class='command_macro'", true);
|
||||
$datam[1] = html_print_input_text_extended($macro_desc_name, $macro_desc_value, 'text-'.$macro_desc_name, '', 30, 255, $locked, '', "class='command_macro text_input'", true);
|
||||
if ($locked) {
|
||||
$datam[1] .= html_print_image('images/lock_mc.png', true, ['class' => 'command_macro lock', 'class' => 'invert_filter']);
|
||||
}
|
||||
|
||||
$datam[2] = __('Default value')."<span class='normal_weight'> ($macro_name)</span>";
|
||||
$datam[3] = html_print_input_text_extended($macro_value_name, $macro_value_value, 'text-'.$macro_value_name, '', 30, 255, $locked, '', "class='command_component command_macro'", true);
|
||||
$datam[3] = html_print_input_text_extended($macro_value_name, $macro_value_value, 'text-'.$macro_value_name, '', 30, 255, $locked, '', "class='command_component command_macro text_input'", true);
|
||||
if ($locked) {
|
||||
$datam[3] .= html_print_image('images/lock_mc.png', true, ['class' => 'command_macro lock', 'class' => 'invert_filter']);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === false) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access File manager'
|
||||
@ -43,7 +43,24 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
require_once 'include/functions_filemanager.php';
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(__('File manager'), '', false, '', true);
|
||||
ui_print_standard_header(
|
||||
__('File manager'),
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Admin tools'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('File manager'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if (isset($config['filemanager']['message']) === true) {
|
||||
echo $config['filemanager']['message'];
|
||||
@ -66,7 +83,7 @@ $real_directory = realpath($config['homedir'].'/'.$directory);
|
||||
echo '<h4>'.__('Index of %s', io_safe_input($directory)).'</h4>';
|
||||
|
||||
$upload_file = (bool) get_parameter('upload_file');
|
||||
$create_text_file = (bool) get_parameter('create_text_file');
|
||||
$create_text_file = (bool) get_parameter('create_text_file');
|
||||
|
||||
$default_real_directory = realpath($config['homedir'].'/');
|
||||
|
||||
|
@ -114,11 +114,11 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
|
||||
echo "'>";
|
||||
echo '<tr>
|
||||
<td class="datos">'.__('Link name').'</td>
|
||||
<td class="datos"><input type="text" name="name" size="35" value="'.$nombre.'"></td>';
|
||||
<td class="datos"><input type="text" class="text_input" name="name" size="50" value="'.$nombre.'"></td>';
|
||||
echo '</tr><tr>
|
||||
<td class="datos2">'.__('Link').'</td>
|
||||
<td class="datos2">
|
||||
<input type="text" name="link" size="50" value="'.$link.'"></td>';
|
||||
<input type="text" class="text_input" name="link" size="50" value="'.$link.'"></td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo "<table width='100%'>";
|
||||
|
@ -181,7 +181,7 @@ if ((isset($_GET['form_add'])) || (isset($_GET['form_edit']))) {
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Subject').'<br>';
|
||||
$data[0] .= '<input type="text" name="subject" size="35" value="'.$subject.'" >';
|
||||
$data[0] .= '<input type="text" class="text_input" name="subject" size="35" value="'.$subject.'" >';
|
||||
|
||||
$data[1] = __('Group').'<br>';
|
||||
$data[1] .= '<div class="w250px">';
|
||||
|
@ -663,6 +663,16 @@ $tip = ui_print_help_tip(
|
||||
true
|
||||
);
|
||||
|
||||
$table_other->data[$i][0] = __('WMI binary');
|
||||
$table_other->data[$i++][1] = html_print_input_text(
|
||||
'wmiBinary',
|
||||
$config['wmiBinary'],
|
||||
'',
|
||||
50,
|
||||
50,
|
||||
true
|
||||
);
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
$table_other->data[$i][0] = __('PhantomJS cache cleanup ').$tip;
|
||||
$table_other->data[$i++][1] = html_print_input(
|
||||
|
@ -11,7 +11,7 @@
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
@ -181,7 +181,8 @@ $backgrounds_list = array_merge($backgrounds_list_jpg, $backgrounds_list_png);
|
||||
$backgrounds_list = array_merge($backgrounds_list, $backgrounds_list_gif);
|
||||
asort($backgrounds_list);
|
||||
|
||||
if (!enterprise_installed()) {
|
||||
$open = false;
|
||||
if (enterprise_installed() === false) {
|
||||
$open = true;
|
||||
}
|
||||
|
||||
@ -953,7 +954,7 @@ $options_full_escale[2] = __('On Boolean graphs');
|
||||
$table_chars->data[$row][1] = html_print_select(
|
||||
$options_full_escale,
|
||||
'full_scale_option',
|
||||
$config['full_scale_option'],
|
||||
(isset($config['full_scale_option']) === true) ? $config['full_scale_option'] : 0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
@ -973,7 +974,7 @@ $options_soft_graphs[1] = __('Show MAX/AVG/MIN by default');
|
||||
$table_chars->data[$row][1] = html_print_select(
|
||||
$options_soft_graphs,
|
||||
'type_mode_graph',
|
||||
$config['type_mode_graph'],
|
||||
(isset($config['type_mode_graph']) === true) ? $config['type_mode_graph'] : 0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
@ -1053,13 +1054,31 @@ $table_vc->data[$row][1] = html_print_extended_select_for_time(
|
||||
$row++;
|
||||
|
||||
$table_vc->data[$row][0] = __('Default interval for refresh on Visual Console');
|
||||
$table_vc->data[$row][1] = html_print_select($values, 'vc_refr', (int) $config['vc_refr'], '', 'N/A', 0, true, false, false);
|
||||
$table_vc->data[$row][1] = html_print_select(
|
||||
$values,
|
||||
'vc_refr',
|
||||
(int) $config['vc_refr'],
|
||||
'',
|
||||
'N/A',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$row++;
|
||||
|
||||
$vc_favourite_view_array[0] = __('Classic view');
|
||||
$vc_favourite_view_array[1] = __('View of favorites');
|
||||
$table_vc->data[$row][0] = __('Type of view of visual consoles');
|
||||
$table_vc->data[$row][1] = html_print_select($vc_favourite_view_array, 'vc_favourite_view', $config['vc_favourite_view'], '', '', 0, true);
|
||||
$table_vc->data[$row][1] = html_print_select(
|
||||
$vc_favourite_view_array,
|
||||
'vc_favourite_view',
|
||||
$config['vc_favourite_view'],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$row++;
|
||||
|
||||
$table_vc->data[$row][0] = __('Number of favorite visual consoles to show in the menu');
|
||||
@ -1067,7 +1086,23 @@ $table_vc->data[$row][1] = "<input type ='number' value=".$config['vc_menu_items
|
||||
$row++;
|
||||
|
||||
$table_vc->data[$row][0] = __('Default line thickness for the Visual Console');
|
||||
$table_vc->data[$row][1] = html_print_input_text('vc_line_thickness', (int) $config['vc_line_thickness'], '', 5, 5, true);
|
||||
$table_vc->data[$row][1] = html_print_input_text(
|
||||
'vc_line_thickness',
|
||||
(int) $config['vc_line_thickness'],
|
||||
'',
|
||||
5,
|
||||
5,
|
||||
true
|
||||
);
|
||||
|
||||
$table_vc->data[$row][0] = __('Mobile view not allow visual console orientation');
|
||||
$table_vc->data[$row][1] = html_print_checkbox_switch(
|
||||
'mobile_view_orientation_vc',
|
||||
1,
|
||||
(bool) $config['mobile_view_orientation_vc'],
|
||||
true
|
||||
);
|
||||
$row++;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@ -1133,7 +1168,17 @@ $interval_description = [
|
||||
'tiny' => 'Short',
|
||||
];
|
||||
$table_report->data[$row][0] = __('Interval description');
|
||||
$table_report->data[$row][1] = html_print_select($interval_description, 'interval_description', $config['interval_description'], '', '', '', true, false, false);
|
||||
$table_report->data[$row][1] = html_print_select(
|
||||
$interval_description,
|
||||
'interval_description',
|
||||
(isset($config['interval_description']) === true) ? $config['interval_description'] : 'large',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
$row++;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -203,20 +203,22 @@ if (is_ajax() !== true) {
|
||||
var clientMode = '<?php echo $mode; ?>';
|
||||
</script>
|
||||
<?php
|
||||
$server_version = (string) db_get_value_sql(
|
||||
'SELECT `version` FROM `tserver` ORDER BY `master` DESC'
|
||||
);
|
||||
if ($server_version !== false
|
||||
&& preg_match('/NG\.(\d\.*\d*?) /', $server_version, $matches) > 0
|
||||
) {
|
||||
if ((float) $matches[1] !== (float) $current_package) {
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'Master server version %s does not match console version %s.',
|
||||
(float) $matches[1],
|
||||
(float) $current_package
|
||||
)
|
||||
);
|
||||
if (function_exists('db_get_value_sql') === true) {
|
||||
$server_version = (string) db_get_value_sql(
|
||||
'SELECT `version` FROM `tserver` ORDER BY `master` DESC'
|
||||
);
|
||||
if ($server_version !== false
|
||||
&& preg_match('/NG\.(\d\.*\d*?) /', $server_version, $matches) > 0
|
||||
) {
|
||||
if ((float) $matches[1] !== floor((float) $current_package)) {
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'Master server version %s does not match console version %s.',
|
||||
(float) $matches[1],
|
||||
(float) $current_package
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -313,7 +315,7 @@ if (is_array($config) === true) {
|
||||
if ($mode === Manager::MODE_ONLINE
|
||||
&& ($puid === null || $puid === 'OFFLINE')
|
||||
) {
|
||||
ui_print_error_message(__('Update manager online requires registration.'));
|
||||
ui_print_error_message(__('Update online requires registration.'));
|
||||
}
|
||||
|
||||
if ($mode === Manager::MODE_OFFLINE) {
|
||||
|
@ -1,21 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Update manager.
|
||||
*
|
||||
* @category Update Manager
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 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; 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.
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
// The ajax is in
|
||||
// include/ajax/update_manager.php
|
||||
// The ajax is in include/ajax/update_manager.php.
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
@ -36,59 +51,65 @@ if ($php_version_array[0] < 7) {
|
||||
$tab = get_parameter('tab', 'online');
|
||||
|
||||
$buttons['setup'] = [
|
||||
'active' => ($tab == 'setup') ? true : false,
|
||||
'active' => ($tab === 'setup') ? true : false,
|
||||
'text' => '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup'
|
||||
).'">'.html_print_image('images/gm_setup.png', true, ['title' => __('Options'), 'class' => 'invert_filter']).'</a>',
|
||||
).'">'.html_print_image('images/gm_setup.png', true, ['title' => __('Setup'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
$buttons['history'] = [
|
||||
'active' => ($tab == 'history') ? true : false,
|
||||
'active' => ($tab === 'history') ? true : false,
|
||||
'text' => '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=histo'
|
||||
).'ry">'.html_print_image('images/gm_db.png', true, ['title' => __('Journal'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
$buttons['offline'] = [
|
||||
'active' => ($tab == 'offline') ? true : false,
|
||||
'active' => ($tab === 'offline') ? true : false,
|
||||
'text' => '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offli'
|
||||
).'ne">'.html_print_image('images/box.png', true, ['title' => __('Offline update manager'), 'class' => 'invert_filter']).'</a>',
|
||||
).'ne">'.html_print_image('images/box.png', true, ['title' => __('Offline update'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
$buttons['online'] = [
|
||||
'active' => ($tab == 'online') ? true : false,
|
||||
'active' => ($tab === 'online') ? true : false,
|
||||
'text' => '<a href="'.ui_get_full_url(
|
||||
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=onlin'
|
||||
).'e">'.html_print_image('images/op_gis.png', true, ['title' => __('Online update manager'), 'class' => 'invert_filter']).'</a>',
|
||||
).'e">'.html_print_image('images/op_gis.png', true, ['title' => __('Online update'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
switch ($tab) {
|
||||
case 'history':
|
||||
$title = __('Update manager » Journal');
|
||||
$title = __('Journal');
|
||||
break;
|
||||
|
||||
case 'setup':
|
||||
$title = __('Update manager » Setup');
|
||||
$title = __('Setup');
|
||||
break;
|
||||
|
||||
case 'offline':
|
||||
$title = __('Update manager » Offline');
|
||||
$title = __('Offline');
|
||||
break;
|
||||
|
||||
case 'online':
|
||||
default:
|
||||
$title = __('Update manager » Online');
|
||||
$title = __('Online');
|
||||
break;
|
||||
}
|
||||
|
||||
ui_print_page_header(
|
||||
ui_print_standard_header(
|
||||
$title,
|
||||
'images/gm_setup.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => 'Warp Update',
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
switch ($tab) {
|
||||
@ -107,6 +128,39 @@ switch ($tab) {
|
||||
|
||||
case 'online':
|
||||
default:
|
||||
if (is_metaconsole() === false && has_metaconsole() === true) {
|
||||
$meta_puid = null;
|
||||
|
||||
$server_id = $config['metaconsole_node_id'];
|
||||
$dbh = (object) $config['dbconnection'];
|
||||
|
||||
// Connect to metaconsole.
|
||||
$result_code = metaconsole_load_external_db(
|
||||
[
|
||||
'dbhost' => $config['replication_dbhost'],
|
||||
'dbuser' => $config['replication_dbuser'],
|
||||
'dbpass' => io_output_password($config['replication_dbpass']),
|
||||
'dbname' => $config['replication_dbname'],
|
||||
]
|
||||
);
|
||||
|
||||
if ($result_code < 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
$value = db_get_value('value', 'tconfig', 'token', 'pandora_uid');
|
||||
|
||||
$meta_puid = $value;
|
||||
|
||||
// Return connection to node.
|
||||
metaconsole_restore_db();
|
||||
|
||||
if ($meta_puid === false || $meta_puid === null) {
|
||||
ui_print_warning_message(__('Please register on metaconsole first.'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$mode = \UpdateManager\UI\Manager::MODE_ONLINE;
|
||||
include $config['homedir'].'/godmode/um_client/index.php';
|
||||
break;
|
||||
|
@ -268,17 +268,18 @@ $table->style[$i] = 'font-weight: bolder;width:250px';
|
||||
|
||||
$url_update_manager = update_manager_get_url();
|
||||
|
||||
$table->data[$i][0] = __('URL update manager:');
|
||||
$table->data[$i][0] = __('Warp Update URL');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'url_update_manager',
|
||||
$url_update_manager,
|
||||
__('URL update manager'),
|
||||
80,
|
||||
255,
|
||||
true,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Use secured update manager:');
|
||||
$table->data[$i][0] = __('Use secured Warp Update');
|
||||
$table->data[$i++][1] = html_print_input(
|
||||
[
|
||||
'type' => 'switch',
|
||||
@ -287,7 +288,7 @@ $table->data[$i++][1] = html_print_input(
|
||||
]
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy server:');
|
||||
$table->data[$i][0] = __('Proxy server');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'update_manager_proxy_server',
|
||||
$update_manager_proxy_server,
|
||||
@ -297,7 +298,7 @@ $table->data[$i++][1] = html_print_input_text(
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy port:');
|
||||
$table->data[$i][0] = __('Proxy port');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'update_manager_proxy_port',
|
||||
$update_manager_proxy_port,
|
||||
@ -307,7 +308,7 @@ $table->data[$i++][1] = html_print_input_text(
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy user:');
|
||||
$table->data[$i][0] = __('Proxy user');
|
||||
$table->data[$i++][1] = html_print_input_text(
|
||||
'update_manager_proxy_user',
|
||||
$update_manager_proxy_user,
|
||||
@ -317,7 +318,7 @@ $table->data[$i++][1] = html_print_input_text(
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Proxy password:');
|
||||
$table->data[$i][0] = __('Proxy password');
|
||||
$table->data[$i++][1] = html_print_input_password(
|
||||
'update_manager_proxy_password',
|
||||
$update_manager_proxy_password,
|
||||
@ -327,7 +328,7 @@ $table->data[$i++][1] = html_print_input_password(
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Allow no-consecutive patches:');
|
||||
$table->data[$i][0] = __('Allow no-consecutive patches');
|
||||
$table->data[$i++][1] = html_print_switch(
|
||||
[
|
||||
'name' => 'allow_offline_patches',
|
||||
@ -336,7 +337,7 @@ $table->data[$i++][1] = html_print_switch(
|
||||
]
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Limit to LTS updates:');
|
||||
$table->data[$i][0] = __('Limit to LTS updates');
|
||||
$table->data[$i++][1] = html_print_switch(
|
||||
[
|
||||
'name' => 'lts_updates',
|
||||
@ -346,11 +347,11 @@ $table->data[$i++][1] = html_print_switch(
|
||||
);
|
||||
|
||||
|
||||
$table->data[$i][0] = __('Registration ID:');
|
||||
$table->data[$i++][1] = '<i>'.$config['pandora_uid'].'</i>';
|
||||
$table->data[$i][0] = __('Registration ID');
|
||||
$table->data[$i++][1] = '<i>'.($config['pandora_uid'] ?? __('Not registred yet')).'</i>';
|
||||
|
||||
if (update_manager_verify_registration() === true && users_is_admin()) {
|
||||
$table->data[$i][0] = __('Cancel registration:');
|
||||
$table->data[$i][0] = __('Cancel registration');
|
||||
$table->data[$i][1] = '<a href="';
|
||||
if ((bool) is_metaconsole() === true) {
|
||||
$table->data[$i][1] .= ui_get_full_url(
|
||||
@ -367,7 +368,7 @@ if (update_manager_verify_registration() === true && users_is_admin()) {
|
||||
|
||||
if (license_free()) {
|
||||
$config['identification_reminder'] = isset($config['identification_reminder']) ? $config['identification_reminder'] : 1;
|
||||
$table->data[$i][0] = __('Pandora FMS community reminder').ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this Pandora instance'), true);
|
||||
$table->data[$i][0] = __('%s community reminder', get_product_name()).ui_print_help_tip(__('Every 8 days, a message is displayed to admin users to remember to register this %s instance', get_product_name()), true);
|
||||
$table->data[$i][1] = __('Yes').' '.html_print_radio_button('identification_reminder', 1, '', $config['identification_reminder'], true).' ';
|
||||
$table->data[$i++][1] .= __('No').' '.html_print_radio_button('identification_reminder', 0, '', $config['identification_reminder'], true);
|
||||
}
|
||||
|
@ -860,7 +860,7 @@ if (!$new_user) {
|
||||
'',
|
||||
'',
|
||||
20,
|
||||
100,
|
||||
255,
|
||||
!$new_user || $view_mode,
|
||||
'',
|
||||
[
|
||||
|
BIN
pandora_console/images/Cube.png
Normal file
BIN
pandora_console/images/Cube.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
pandora_console/images/Engranaje.png
Normal file
BIN
pandora_console/images/Engranaje.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
BIN
pandora_console/images/Warp-Update-bg.png
Normal file
BIN
pandora_console/images/Warp-Update-bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
BIN
pandora_console/images/custom_logo/logo-black-pandorafms.png
Normal file
BIN
pandora_console/images/custom_logo/logo-black-pandorafms.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
BIN
pandora_console/images/custom_logo/logo-default-pandorafms.png
Normal file
BIN
pandora_console/images/custom_logo/logo-default-pandorafms.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -86,6 +86,8 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
||||
$addedItems = json_decode($addedItems);
|
||||
$all = (string) get_parameter('all', 'all');
|
||||
|
||||
$delete_offspring_agents = (int) get_parameter('delete_offspring_agents', 0);
|
||||
|
||||
if ($addedItems != null) {
|
||||
foreach ($addedItems as $item) {
|
||||
echo $item."|\n";
|
||||
@ -111,21 +113,9 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
||||
}
|
||||
|
||||
$data = [];
|
||||
// Get agents for only the alias
|
||||
// Get agents for only the alias.
|
||||
$filter_alias = $filter;
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$filter_alias[] = '(UPPER(alias) LIKE "%'.$string.'%")';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$filter_alias[] = '(UPPER(alias) LIKE \'%'.$string.'%\')';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$filter_alias[] = '(UPPER(alias) LIKE UPPER(\'%'.$string.'%\'))';
|
||||
break;
|
||||
}
|
||||
$filter_alias[] = '(UPPER(alias) LIKE "%'.$string.'%")';
|
||||
|
||||
$agents = agents_get_agents($filter_alias, ['id_agente', 'nombre', 'direccion', 'alias']);
|
||||
if ($agents !== false) {
|
||||
@ -142,19 +132,7 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
||||
|
||||
// Get agents for only the name.
|
||||
$filter_agents = $filter;
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$filter_agents[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) LIKE "%'.$string.'%")';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$filter_agents[] = '(UPPER(alias) NOT LIKE \'%'.$string.'%\' AND UPPER(nombre) LIKE \'%'.$string.'%\')';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$filter_agents[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) LIKE UPPER(\'%'.$string.'%\'))';
|
||||
break;
|
||||
}
|
||||
$filter_agents[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) LIKE "%'.$string.'%")';
|
||||
|
||||
$agents = agents_get_agents($filter_agents, ['id_agente', 'nombre', 'direccion', 'alias']);
|
||||
if ($agents !== false) {
|
||||
@ -169,21 +147,9 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Get agents for only the address
|
||||
// Get agents for only the address.
|
||||
$filter_address = $filter;
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$filter_address[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) LIKE "%'.$string.'%")';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$filter_address[] = '(UPPER(alias) NOT LIKE \'%'.$string.'%\' AND UPPER(nombre) NOT LIKE \'%'.$string.'%\' AND UPPER(direccion) LIKE \'%'.$string.'%\')';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$filter_address[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) LIKE UPPER(\'%'.$string.'%\'))';
|
||||
break;
|
||||
}
|
||||
$filter_address[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) LIKE "%'.$string.'%")';
|
||||
|
||||
$agents = agents_get_agents($filter_address, ['id_agente', 'nombre', 'direccion', 'alias']);
|
||||
if ($agents !== false) {
|
||||
@ -198,21 +164,9 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Get agents for only the description
|
||||
// Get agents for only the description.
|
||||
$filter_description = $filter;
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$filter_description[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) NOT LIKE "%'.$string.'%" AND UPPER(comentarios) LIKE "%'.$string.'%")';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$filter_description[] = '(UPPER(alias) NOT LIKE \'%'.$string.'%\' AND UPPER(nombre) NOT LIKE \'%'.$string.'%\' AND UPPER(direccion) NOT LIKE \'%'.$string.'%\' AND UPPER(comentarios) LIKE \'%'.$string.'%\')';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$filter_description[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))';
|
||||
break;
|
||||
}
|
||||
$filter_description[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) NOT LIKE "%'.$string.'%" AND UPPER(comentarios) LIKE "%'.$string.'%")';
|
||||
|
||||
$agents = agents_get_agents($filter_description, ['id_agente', 'nombre', 'direccion', 'alias']);
|
||||
if ($agents !== false) {
|
||||
@ -227,6 +181,18 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data) === false && $delete_offspring_agents !== 0) {
|
||||
// Gets offspring and deletes them, including himself.
|
||||
$agents_offspring = agents_get_offspring($delete_offspring_agents);
|
||||
if (empty($agents_offspring) === false) {
|
||||
foreach ($data as $key => $value) {
|
||||
if (isset($agents_offspring[$value['id']]) === true) {
|
||||
unset($data[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
return;
|
||||
} else if ($search_agents && is_metaconsole()) {
|
||||
|
@ -1,18 +1,29 @@
|
||||
<?php
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 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.
|
||||
/**
|
||||
* Ajax script for List view for Alerts.
|
||||
*
|
||||
* @category Alerts
|
||||
* @package Community
|
||||
* @subpackage Software agents repository
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ==========================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnológicas S.L
|
||||
* This code is NOT free software. This code is NOT licenced under GPL2 licence
|
||||
* You cannot redistribute it without written permission of copyright holder.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
// Login check
|
||||
// Login check.
|
||||
check_login();
|
||||
|
||||
require_once 'include/functions_agents.php';
|
||||
@ -60,7 +71,7 @@ if ($get_agent_alerts_simple) {
|
||||
|
||||
|
||||
$alerts = agents_get_alerts_simple($id_agent);
|
||||
if (empty($alerts)) {
|
||||
if (empty($alerts) === true) {
|
||||
echo json_encode(false);
|
||||
return;
|
||||
}
|
||||
@ -424,7 +435,7 @@ if ($show_update_action_menu) {
|
||||
);
|
||||
|
||||
$data .= '<form id="update_action-'.$id_alert.'" method="post" style="height:85%;">';
|
||||
$data .= '<table class="databox_color w100p bg_color222" style="height:100%;">';
|
||||
$data .= '<table class="w100p bg_color222" style="height:100%;">';
|
||||
$data .= html_print_input_hidden(
|
||||
'update_action',
|
||||
1,
|
||||
@ -442,7 +453,7 @@ if ($show_update_action_menu) {
|
||||
);
|
||||
if (! $id_agente) {
|
||||
$data .= '<tr class="datos2">';
|
||||
$data .= '<td class="datos2 bolder_6px">';
|
||||
$data .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data .= __('Agent').' '.ui_print_help_icon(
|
||||
'alert_scalate',
|
||||
true,
|
||||
@ -463,7 +474,7 @@ if ($show_update_action_menu) {
|
||||
}
|
||||
|
||||
$data .= '<tr class="datos">';
|
||||
$data .= '<td class="datos bolder_6px">';
|
||||
$data .= '<td class="datos bolder pdd_6px font_10pt">';
|
||||
$data .= __('Module');
|
||||
$data .= '</td>';
|
||||
$data .= '<td class="datos">';
|
||||
@ -478,7 +489,7 @@ if ($show_update_action_menu) {
|
||||
$data .= '</td>';
|
||||
$data .= '</tr>';
|
||||
$data .= '<tr class="datos2">';
|
||||
$data .= '<td class="datos2 bolder_6px">';
|
||||
$data .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data .= __('Action');
|
||||
$data .= '</td>';
|
||||
$data .= '<td class="datos2">';
|
||||
@ -494,12 +505,12 @@ if ($show_update_action_menu) {
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:150px'
|
||||
'width:95%'
|
||||
);
|
||||
$data .= '</td>';
|
||||
$data .= '</tr>';
|
||||
$data .= '<tr class="datos">';
|
||||
$data .= '<td class="datos bolder_6px">';
|
||||
$data .= '<td class="datos bolder pdd_6px font_10pt">';
|
||||
$data .= __('Number of alerts match from');
|
||||
$data .= '</td>';
|
||||
$data .= '<td class="datos">';
|
||||
@ -523,7 +534,7 @@ if ($show_update_action_menu) {
|
||||
$data .= '</td>';
|
||||
$data .= '</tr>';
|
||||
$data .= '<tr class="datos2">';
|
||||
$data .= '<td class="datos2 bolder_6px">';
|
||||
$data .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data .= __('Threshold');
|
||||
$data .= '</td>';
|
||||
$data .= '<td class="datos2">';
|
||||
|
@ -410,7 +410,7 @@ if (check_login()) {
|
||||
$table_modules->head = [];
|
||||
$table_modules->head[0] = __('Module name');
|
||||
$table_modules->head[1] = __('Data');
|
||||
$table_modules->head[2] = __('Treshold');
|
||||
$table_modules->head[2] = __('Threshold');
|
||||
$table_modules->head[3] = __('Current interval');
|
||||
$table_modules->head[4] = __('Timestamp');
|
||||
$table_modules->head[5] = __('Status');
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -278,6 +278,13 @@ class AgentWizard extends HTML
|
||||
*/
|
||||
private $extraArguments = '';
|
||||
|
||||
/**
|
||||
* Binary of wmic.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $wmiBinary = '';
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -291,7 +298,7 @@ class AgentWizard extends HTML
|
||||
// Check access.
|
||||
check_login();
|
||||
|
||||
if (!check_acl($config['id_user'], 0, 'AR')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AR') === false) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access event viewer'
|
||||
@ -311,6 +318,7 @@ class AgentWizard extends HTML
|
||||
$this->idAgent = get_parameter('id_agente', '');
|
||||
$this->idPolicy = get_parameter('id', '');
|
||||
$this->targetIp = get_parameter('targetIp', '');
|
||||
$this->wmiBinary = $config['wmiBinary'];
|
||||
|
||||
if (empty($this->idAgent) === false) {
|
||||
$array_aux = db_get_all_rows_sql(
|
||||
@ -1044,7 +1052,7 @@ class AgentWizard extends HTML
|
||||
$oidExplore = '.1.3.6.1.2.1.1.2.0';
|
||||
}
|
||||
|
||||
// Explore general or interfaces
|
||||
// Explore general or interfaces.
|
||||
$receivedOid = $this->snmpWalkValues(
|
||||
$oidExplore,
|
||||
false,
|
||||
@ -1080,7 +1088,7 @@ class AgentWizard extends HTML
|
||||
// Capture the parameters.
|
||||
// Call WMI Explorer function.
|
||||
$this->wmiCommand = wmi_compose_query(
|
||||
'wmic',
|
||||
$this->wmiBinary,
|
||||
$this->usernameWMI,
|
||||
$this->passwordWMI,
|
||||
$this->targetIp,
|
||||
@ -1090,19 +1098,26 @@ class AgentWizard extends HTML
|
||||
// the host is Windows (and allow WMI).
|
||||
$commandQuery = $this->wmiCommand;
|
||||
$commandQuery .= ' "SELECT Caption FROM Win32_ComputerSystem"';
|
||||
// Execute the wmic command.
|
||||
// Declare the vars.
|
||||
$result = [];
|
||||
exec($commandQuery, $result);
|
||||
$execCorrect = true;
|
||||
$returnVar = 0;
|
||||
$tmpError = '';
|
||||
|
||||
// Look for the response if we have ERROR messages.
|
||||
foreach ($result as $info) {
|
||||
if (preg_match('/ERROR:/', $info) !== 0) {
|
||||
$execCorrect = false;
|
||||
$tmpError = strrchr($info, 'ERROR:');
|
||||
break;
|
||||
$execCorrect = true;
|
||||
// Execute the command.
|
||||
exec($commandQuery, $result, $returnVar);
|
||||
// Only is valid if return code is 0.
|
||||
if ($returnVar === 0) {
|
||||
// Look for the response if we have ERROR messages.
|
||||
foreach ($result as $info) {
|
||||
if (preg_match('/ERROR:/', $info) !== 0) {
|
||||
$execCorrect = false;
|
||||
$tmpError = strrchr($info, 'ERROR:');
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$tmpError = sprintf('Return Code %s', $returnVar);
|
||||
$execCorrect = false;
|
||||
}
|
||||
|
||||
// FOUND ERRORS: TIMEOUT.
|
||||
@ -1181,7 +1196,7 @@ class AgentWizard extends HTML
|
||||
$table->head[1] = '<b>'.__('Server').'</b>';
|
||||
$table->head[2] = '<b>'.__('Type').'</b>';
|
||||
$table->head[3] = '<b>'.__('Description').'</b>';
|
||||
$table->head[4] = '<b>'.__('Treshold').'</b>';
|
||||
$table->head[4] = '<b>'.__('Threshold').'</b>';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
@ -2806,7 +2821,7 @@ class AgentWizard extends HTML
|
||||
// Unpack the query filters.
|
||||
$queryFilters = json_decode($module['query_filters'], true);
|
||||
// Name of query filter field.
|
||||
$fieldValueName = $fieldSet[$queryFilters['field']];
|
||||
$fieldValueName = (empty($fieldSet[$queryFilters['field']]) === false) ? $fieldSet[$queryFilters['field']] : '1';
|
||||
|
||||
// Evaluate type of scan and execution.
|
||||
if ($module['scan_type'] == SCAN_TYPE_FIXED) {
|
||||
@ -2841,13 +2856,13 @@ class AgentWizard extends HTML
|
||||
|
||||
// If name of the module have a macro.
|
||||
$moduleBlocks[$k]['name'] = $this->macroFilter(
|
||||
$module['name'],
|
||||
io_safe_output($module['name']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
// Description can have macros too.
|
||||
$moduleBlocks[$k]['description'] = $this->macroFilter(
|
||||
$module['description'],
|
||||
io_safe_output($module['description']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
@ -2859,7 +2874,7 @@ class AgentWizard extends HTML
|
||||
);
|
||||
|
||||
foreach ($columnsList as $columnKey => $columnValue) {
|
||||
$macros['macros']['_'.$columnValue.'_'] = $rowList[$columnKey];
|
||||
$macros['macros']['_'.trim($columnValue).'_'] = $rowList[trim($columnKey)];
|
||||
}
|
||||
|
||||
$moduleBlocks[$k]['macros'] = json_encode($macros);
|
||||
@ -2892,6 +2907,7 @@ class AgentWizard extends HTML
|
||||
$dataCombined = array_combine($columnsList, $rowList);
|
||||
// Change the macros for values.
|
||||
foreach ($dataCombined as $macroKey => $macroValue) {
|
||||
$macroKey = trim($macroKey);
|
||||
if (preg_match('/_'.$macroKey.'_/', $valueOperation) !== 0) {
|
||||
$valueOperation = preg_replace(
|
||||
'/_'.$macroKey.'_/',
|
||||
@ -2937,19 +2953,19 @@ class AgentWizard extends HTML
|
||||
$rowList = explode('|', $rowContent);
|
||||
// If name of the module have a macro.
|
||||
$newModule['name'] = $this->macroFilter(
|
||||
$module['name'],
|
||||
io_safe_output($module['name']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
// Description can have macros too.
|
||||
$newModule['description'] = $this->macroFilter(
|
||||
$module['description'],
|
||||
io_safe_output($module['description']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
|
||||
$newModule['query_filters'] = $this->macroFilter(
|
||||
$module['query_filters'],
|
||||
io_safe_output($module['query_filters']),
|
||||
$columnsList,
|
||||
$rowList
|
||||
);
|
||||
@ -2995,6 +3011,7 @@ class AgentWizard extends HTML
|
||||
);
|
||||
// Change the macros for values.
|
||||
foreach ($dataCombined as $macroKey => $macroValue) {
|
||||
$macroKey = trim($macroKey);
|
||||
if (preg_match('/_'.$macroKey.'_/', $valueOperation) !== 0) {
|
||||
$valueOperation = preg_replace(
|
||||
'/_'.$macroKey.'_/',
|
||||
@ -3022,39 +3039,48 @@ class AgentWizard extends HTML
|
||||
}
|
||||
}
|
||||
|
||||
// Create the final table with all of data received.
|
||||
foreach ($moduleBlocks as $module) {
|
||||
// Prepare the blocks. If its new, create a new index.
|
||||
if (key_exists($module['group'], $blockTables) === false) {
|
||||
$blockTables[$module['group']] = [
|
||||
'name' => $module['group_name'],
|
||||
'data' => [],
|
||||
];
|
||||
// If we not retrieve information (P.E. connection refused).
|
||||
if (empty($moduleBlocks) === true) {
|
||||
$this->message['type'][] = 'warning';
|
||||
$this->message['message'][] = __(
|
||||
'No information could be retrieved.'
|
||||
);
|
||||
$this->showMessage();
|
||||
} else {
|
||||
// Create the final table with all of data received.
|
||||
foreach ($moduleBlocks as $module) {
|
||||
// Prepare the blocks. If its new, create a new index.
|
||||
if (key_exists($module['group'], $blockTables) === false) {
|
||||
$blockTables[$module['group']] = [
|
||||
'name' => $module['group_name'],
|
||||
'data' => [],
|
||||
];
|
||||
}
|
||||
|
||||
// Add the module info in the block.
|
||||
$blockTables[$module['group']]['data'][] = $module;
|
||||
if (isset($blockTables[$module['group']]['activeModules']) === false
|
||||
&& (int) $module['module_enabled'] === 1
|
||||
) {
|
||||
$blockTables[$module['group']]['activeModules'] = 2;
|
||||
} else if (isset($blockTables[$module['group']]['activeModules']) === true
|
||||
&& (int) $module['module_enabled'] === 0
|
||||
) {
|
||||
$blockTables[$module['group']]['activeModules'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Add the module info in the block.
|
||||
$blockTables[$module['group']]['data'][] = $module;
|
||||
if (isset($blockTables[$module['group']]['activeModules']) === false
|
||||
&& (int) $module['module_enabled'] === 1
|
||||
) {
|
||||
$blockTables[$module['group']]['activeModules'] = 2;
|
||||
} else if (isset($blockTables[$module['group']]['activeModules']) === true
|
||||
&& (int) $module['module_enabled'] === 0
|
||||
) {
|
||||
$blockTables[$module['group']]['activeModules'] = 1;
|
||||
}
|
||||
// General Default monitoring.
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'wizard wizard-result',
|
||||
'style' => 'margin-top: 20px;',
|
||||
'content' => $this->toggleTableModules($blockTables),
|
||||
]
|
||||
);
|
||||
// Add Create Modules form.
|
||||
$this->createModulesForm();
|
||||
}
|
||||
|
||||
// General Default monitoring.
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'wizard wizard-result',
|
||||
'style' => 'margin-top: 20px;',
|
||||
'content' => $this->toggleTableModules($blockTables),
|
||||
]
|
||||
);
|
||||
// Add Create Modules form.
|
||||
$this->createModulesForm();
|
||||
}
|
||||
|
||||
|
||||
@ -3559,7 +3585,8 @@ class AgentWizard extends HTML
|
||||
$this->targetPort,
|
||||
$this->server,
|
||||
$this->extraArguments,
|
||||
(($full_output === false) ? '-Oa -On' : '-Oa')
|
||||
(($full_output === false) ? '-On' : '-Oa'),
|
||||
''
|
||||
);
|
||||
|
||||
if ($pure === true) {
|
||||
@ -3572,7 +3599,12 @@ class AgentWizard extends HTML
|
||||
if ($full_output === true) {
|
||||
$output[] = $key.' = '.$oid_unit;
|
||||
} else {
|
||||
preg_match('/\.\d+$/', $key, $index);
|
||||
$index = [];
|
||||
$index[] = preg_replace('/^'.$oid.'/', '', $key);
|
||||
if (empty($index) === true) {
|
||||
preg_match('/\.\d+$/', $key, $index);
|
||||
}
|
||||
|
||||
$tmp = explode(': ', $oid_unit);
|
||||
$output[$index[0]] = str_replace('"', '', ($tmp[1] ?? ''));
|
||||
}
|
||||
@ -5536,13 +5568,13 @@ class AgentWizard extends HTML
|
||||
string $unit='',
|
||||
?int $type=0
|
||||
) {
|
||||
$output = '';
|
||||
try {
|
||||
// Avoid non-numeric or arithmetic chars for security reasons.
|
||||
if (preg_match('/(([^0-9\s\+\-\*\/\(\).,])+)/', $operation) === 1) {
|
||||
throw new Exception(sprintf(__("The operation '%s' is not permitted. Review for remote components."), $operation));
|
||||
} else {
|
||||
// Get the result of the operation and set it.
|
||||
$output = '';
|
||||
eval('$output = '.$operation.';');
|
||||
// If this module has unit, attach to current value.
|
||||
$output = $this->replacementUnit(
|
||||
@ -5717,7 +5749,7 @@ class AgentWizard extends HTML
|
||||
$(this).removeClass('hidden');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (this.id.match(regex)) {
|
||||
$(this).removeClass('hidden');
|
||||
} else {
|
||||
@ -5729,7 +5761,7 @@ class AgentWizard extends HTML
|
||||
$(this).addClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (filter_up == true) {
|
||||
if ($(this).attr('operstatus') != 1) {
|
||||
$(this).addClass('hidden');
|
||||
|
@ -245,7 +245,7 @@ class AgentsAlerts extends HTML
|
||||
);
|
||||
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
$table->class = 'info_table';
|
||||
$table->id = 'table_agent_module';
|
||||
$table->data = [];
|
||||
|
||||
@ -537,7 +537,7 @@ class AgentsAlerts extends HTML
|
||||
'alerts_agents'
|
||||
);
|
||||
|
||||
echo '<table cellpadding="4" cellspacing="4" border="0" class="agents_modules_table table">';
|
||||
echo '<table cellpadding="4" cellspacing="4" border="0" class="info_table">';
|
||||
echo '<tr>';
|
||||
echo '<th class="header_table_principal_cell">'.__('Agents').' / '.__('Alerts').'</th>';
|
||||
|
||||
@ -576,10 +576,11 @@ class AgentsAlerts extends HTML
|
||||
'images/arrow_left_green.png',
|
||||
true,
|
||||
[
|
||||
'style' => 'float: right;',
|
||||
'style' => 'display:flex;justify-content: center',
|
||||
'title' => __('Previous alerts'),
|
||||
]
|
||||
),
|
||||
'style' => 'display:flex;justify-content: center',
|
||||
]
|
||||
);
|
||||
echo '</th>';
|
||||
@ -612,9 +613,9 @@ class AgentsAlerts extends HTML
|
||||
$outputLine = html_print_div(
|
||||
[
|
||||
'id' => 'line_header_'.$id,
|
||||
'class' => 'rotate_text_module position_text_module',
|
||||
'class' => 'position_text_module',
|
||||
'style' => '',
|
||||
'content' => '<div title="'.io_safe_output($name).'">'.ui_print_truncate_text(io_safe_output($name), 20).'</div>',
|
||||
'content' => '<div style="font-size: 7.5pt !important" title="'.io_safe_output($name).'">'.ui_print_truncate_text(io_safe_output($name), 20).'</div>',
|
||||
],
|
||||
true
|
||||
);
|
||||
@ -657,7 +658,7 @@ class AgentsAlerts extends HTML
|
||||
$alias = db_get_row('tagente', 'id_agente', $agent['id_agente']);
|
||||
echo '<tr>';
|
||||
// Name of the agent.
|
||||
echo '<td class="bolder" style="text-align: right" >'.$alias['alias'].'</td>';
|
||||
echo '<td style="text-align: left;font-weight: bold;color: #3f3f3f;">'.$alias['alias'].'</td>';
|
||||
// Alerts of the agent.
|
||||
foreach ($templates as $tid => $tname) {
|
||||
$anyfired = 0;
|
||||
@ -669,18 +670,6 @@ class AgentsAlerts extends HTML
|
||||
echo '<td class="center">';
|
||||
|
||||
if (isset($agent_alerts[$alias['alias']][$tid])) {
|
||||
foreach ($agent_alerts[$alias['alias']][$tid] as $alert) {
|
||||
if ((int) $alert['times_fired'] > 0) {
|
||||
$anyfired = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($anyfired) {
|
||||
$cellstyle = 'background:'.COL_ALERTFIRED.';';
|
||||
} else {
|
||||
$cellstyle = 'background:'.COL_NORMAL.';';
|
||||
}
|
||||
|
||||
$uniqid = uniqid();
|
||||
|
||||
html_print_anchor(
|
||||
@ -689,8 +678,7 @@ class AgentsAlerts extends HTML
|
||||
'content' => html_print_div(
|
||||
[
|
||||
'id' => 'line_header_'.$temp['id'],
|
||||
'class' => 'status_rounded_rectangles text_inside',
|
||||
'style' => $cellstyle,
|
||||
'style' => 'font-size: 13pt;',
|
||||
'content' => count($agent_alerts[$alias['alias']][$tid]),
|
||||
],
|
||||
true
|
||||
|
@ -260,6 +260,8 @@ class CalendarManager
|
||||
*/
|
||||
public function deleteCalendar()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$id = (int) get_parameter('id');
|
||||
try {
|
||||
$calendar = new Calendar($id);
|
||||
@ -278,6 +280,22 @@ class CalendarManager
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_numeric($id) === true) {
|
||||
if ((bool) check_acl(
|
||||
$config['id_user'],
|
||||
$calendar->id_group(),
|
||||
'LM'
|
||||
) === false
|
||||
) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access calendar delete'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove.
|
||||
$calendar->delete();
|
||||
$this->message = \ui_print_success_message(
|
||||
@ -480,6 +498,35 @@ class CalendarManager
|
||||
$new = true;
|
||||
}
|
||||
|
||||
$group_id = null;
|
||||
|
||||
if ($new === true) {
|
||||
if (is_numeric(get_parameter('id_group')) === true) {
|
||||
$group_id = get_parameter('id_group');
|
||||
}
|
||||
} else {
|
||||
if (is_numeric($calendar->id_group()) === true) {
|
||||
$group_id = $calendar->id_group();
|
||||
}
|
||||
}
|
||||
|
||||
if (is_numeric($group_id) === true) {
|
||||
// Check for permissions before rendering edit view or performing save action.
|
||||
if ((bool) check_acl(
|
||||
$config['id_user'],
|
||||
$group_id,
|
||||
'LM'
|
||||
) === false
|
||||
) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access calendar editor'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$action = get_parameter('action');
|
||||
if ($action === 'save') {
|
||||
$success = false;
|
||||
@ -604,19 +651,23 @@ class CalendarManager
|
||||
$is_management_allowed = \is_management_allowed();
|
||||
|
||||
if ((bool) $data === true) {
|
||||
$manage = check_acl(
|
||||
$config['id_user'],
|
||||
0,
|
||||
'LM',
|
||||
true
|
||||
);
|
||||
$user_id = $config['id_user'];
|
||||
|
||||
$data = array_reduce(
|
||||
$data,
|
||||
function ($carry, $item) use ($manage, $is_management_allowed) {
|
||||
function ($carry, $item) use ($user_id, $is_management_allowed) {
|
||||
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
// Transforms array of arrays $data into an array
|
||||
// of objects, making a post-process of certain fields.
|
||||
// Users must only be able to manage items that belong to their groups.
|
||||
// IMPORTANT: if user does not have permission over 'All' group, items belonging to such
|
||||
// group must be listed but they must not allow for edition.
|
||||
$manage = check_acl_restricted_all(
|
||||
$user_id,
|
||||
$item['id_group'],
|
||||
'LM'
|
||||
);
|
||||
|
||||
$tmp = (object) $item;
|
||||
|
||||
if ((bool) $manage === true) {
|
||||
|
@ -1528,7 +1528,7 @@ class ConsoleSupervisor
|
||||
$this->cleanNotifications('NOTIF.PHP.UPLOAD_MAX_FILESIZE');
|
||||
}
|
||||
|
||||
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
|
||||
if ($PHPmemory_limit < $PHPmemory_limit_min && (int) $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';
|
||||
@ -2145,8 +2145,8 @@ class ConsoleSupervisor
|
||||
[
|
||||
'type' => 'NOTIF.UPDATEMANAGER.REGISTRATION',
|
||||
'title' => __('This instance is not registered in the Update manager section'),
|
||||
'message' => __('Click <a class="bolder underline" href="javascript: force_run_register();"> here</a> to start the registration process'),
|
||||
'url' => 'javascript: force_run_register();',
|
||||
'message' => __('Click here to start the registration process'),
|
||||
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
@ -2166,7 +2166,7 @@ class ConsoleSupervisor
|
||||
// Check default password for "admin".
|
||||
$admin_with_default_pass = db_get_value_sql(
|
||||
'SELECT count(*) FROM tusuario
|
||||
WHERE
|
||||
WHERE
|
||||
id_user="admin"
|
||||
AND password="1da7ee7d45b96d0e1f45ee4ee23da560"
|
||||
AND is_admin=1
|
||||
@ -2441,11 +2441,11 @@ class ConsoleSupervisor
|
||||
config_update_value('last_um_check', $future, true);
|
||||
|
||||
$messages = update_manager_get_messages();
|
||||
|
||||
if (is_array($messages) === true) {
|
||||
$source_id = get_notification_source_id(
|
||||
'Official communication'
|
||||
);
|
||||
|
||||
foreach ($messages as $message) {
|
||||
if (isset($message['url']) === false) {
|
||||
$message['url'] = '#';
|
||||
@ -2476,8 +2476,8 @@ class ConsoleSupervisor
|
||||
// List all servers except satellite server.
|
||||
$server_version_list = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT `name`, `version`
|
||||
FROM tserver
|
||||
'SELECT `name`, `version`
|
||||
FROM tserver
|
||||
WHERE server_type != %d
|
||||
GROUP BY `version`',
|
||||
SERVER_TYPE_ENTERPRISE_SATELLITE
|
||||
@ -2490,7 +2490,7 @@ class ConsoleSupervisor
|
||||
foreach ($server_version_list as $server) {
|
||||
if (strpos(
|
||||
$server['version'],
|
||||
$config['current_package']
|
||||
(string) floor($config['current_package'])
|
||||
) === false
|
||||
) {
|
||||
$missed++;
|
||||
@ -2511,6 +2511,8 @@ class ConsoleSupervisor
|
||||
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
]
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2741,7 +2743,7 @@ class ConsoleSupervisor
|
||||
$this->cleanNotifications('NOTIF.SYNCQUEUE.LENGTH.%');
|
||||
}
|
||||
|
||||
$items_min = $config['sync_queue_items_max'];
|
||||
$items_min = (isset($config['sync_queue_items_max']) === true) ? $config['sync_queue_items_max'] : 0;
|
||||
if (is_numeric($items_min) !== true && $items_min <= 0) {
|
||||
$items_min = self::MIN_SYNC_QUEUE_LENGTH;
|
||||
}
|
||||
|
@ -777,6 +777,7 @@ class HTML
|
||||
) {
|
||||
$form = ($data['form'] ?? null);
|
||||
$inputs = ($data['inputs'] ?? []);
|
||||
$blocks = ($data['blocks'] ?? []);
|
||||
$rawInputs = ($data['rawInputs'] ?? null);
|
||||
$js = ($data['js'] ?? null);
|
||||
$rawjs = ($data['js_block'] ?? null);
|
||||
@ -843,34 +844,59 @@ class HTML
|
||||
$output_submit = '';
|
||||
$output = '';
|
||||
|
||||
if ($print_white_box === true) {
|
||||
$output .= '<div class="white_box">';
|
||||
}
|
||||
if (empty($blocks) === false) {
|
||||
$output .= '<div class="container-block-column">';
|
||||
foreach ($blocks as $valueblock) {
|
||||
$output .= '<ul class="wizard">';
|
||||
foreach ($inputs[$valueblock] as $input) {
|
||||
if (is_array(($input['arguments'] ?? null)) === true
|
||||
&& isset($input['arguments']) === true
|
||||
&& isset($input['arguments']['type']) === true
|
||||
&& $input['arguments']['type'] === 'submit'
|
||||
) {
|
||||
$output_submit .= self::printBlock($input, true);
|
||||
} else {
|
||||
$output .= self::printBlock($input, true);
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '<ul class="wizard">';
|
||||
|
||||
foreach ($inputs as $input) {
|
||||
if (is_array(($input['arguments'] ?? null)) === true
|
||||
&& $input['arguments']['type'] === 'submit'
|
||||
) {
|
||||
$output_submit .= self::printBlock($input, true);
|
||||
} else {
|
||||
$output .= self::printBlock($input, true);
|
||||
$output .= '</ul>';
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '</ul>';
|
||||
|
||||
// There is possible add raw inputs for this form.
|
||||
if (empty($rawInputs) === false) {
|
||||
$output .= $rawInputs;
|
||||
}
|
||||
|
||||
if ($print_white_box === true) {
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
if ($print_white_box === true) {
|
||||
$output .= '<div class="white_box">';
|
||||
}
|
||||
|
||||
$output .= '<ul class="wizard">';
|
||||
|
||||
foreach ($inputs as $input) {
|
||||
if (is_array(($input['arguments'] ?? null)) === true
|
||||
&& isset($input['arguments']) === true
|
||||
&& isset($input['arguments']['type']) === true
|
||||
&& $input['arguments']['type'] === 'submit'
|
||||
) {
|
||||
$output_submit .= self::printBlock($input, true);
|
||||
} else {
|
||||
$output .= self::printBlock($input, true);
|
||||
}
|
||||
}
|
||||
|
||||
$output .= '</ul>';
|
||||
|
||||
// There is possible add raw inputs for this form.
|
||||
if (empty($rawInputs) === false) {
|
||||
$output .= $rawInputs;
|
||||
}
|
||||
|
||||
if ($print_white_box === true) {
|
||||
$output .= '</div>';
|
||||
}
|
||||
|
||||
$output .= '<ul class="wizard">'.$output_submit.'</ul>';
|
||||
}
|
||||
|
||||
$output .= '<ul class="wizard">'.$output_submit.'</ul>';
|
||||
$output .= html_print_csrf_hidden(true);
|
||||
$output .= '</form>';
|
||||
$output .= '<script>'.$js.'</script>';
|
||||
|
@ -336,7 +336,7 @@ class OrderInterpreter extends Wizard
|
||||
),
|
||||
],
|
||||
[
|
||||
'name' => __('Update Manager'),
|
||||
'name' => __('Warp Update'),
|
||||
'icon' => ui_get_full_url(
|
||||
'images/menu/um_messages.menu_gray.png'
|
||||
),
|
||||
@ -404,10 +404,10 @@ class OrderInterpreter extends Wizard
|
||||
'.$value['name'].'</a><br>';
|
||||
}
|
||||
|
||||
$iterator ++;
|
||||
$iterator++;
|
||||
|
||||
if ($iterator > 10) {
|
||||
$more_results ++;
|
||||
$more_results++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -523,6 +523,14 @@ class TreeService extends Tree
|
||||
continue 2;
|
||||
}
|
||||
|
||||
$title = get_parameter('title', '');
|
||||
if (empty($title) === true) {
|
||||
$tmp['title'] = '';
|
||||
} else {
|
||||
$tmp['title'] = $title.'/';
|
||||
}
|
||||
|
||||
$tmp['title'] .= $service->name();
|
||||
$tmp['id'] = (int) $item->service()->id();
|
||||
$tmp['name'] = $item->service()->name();
|
||||
$tmp['alias'] = $item->service()->name();
|
||||
|
@ -309,7 +309,7 @@ class WelcomeWindow extends Wizard
|
||||
{
|
||||
global $config;
|
||||
|
||||
return $config['welcome_id_agent'];
|
||||
return (isset($config['welcome_id_agent']) === true) ? $config['welcome_id_agent'] : '';
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,8 +20,8 @@
|
||||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC220606';
|
||||
$pandora_version = 'v7.0NG.762';
|
||||
$build_version = 'PC220629';
|
||||
$pandora_version = 'v7.0NG.763';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
@ -294,7 +294,11 @@ define('SERVICE_ELEMENT_DYNAMIC', 'dynamic');
|
||||
define('SERVICE_MODE_MANUAL', 0);
|
||||
define('SERVICE_MODE_SMART', 1);
|
||||
|
||||
|
||||
// New installation Product Logo.
|
||||
define('HEADER_LOGO_DEFAULT_CLASSIC', 'logo-default-pandorafms.png');
|
||||
define('HEADER_LOGO_DEFAULT_COLLAPSED', 'logo-default-pandorafms-collapsed.png');
|
||||
define('HEADER_LOGO_BLACK_CLASSIC', 'logo-black-pandorafms.png');
|
||||
define('HEADER_LOGO_BLACK_COLLAPSED', 'logo-default-pandorafms-collapsed.png');
|
||||
|
||||
// Status images.
|
||||
// For modules.
|
||||
@ -802,7 +806,7 @@ define('AUDIT_LOG_SNMP_MANAGEMENT', 'SNMP management');
|
||||
define('AUDIT_LOG_DASHBOARD_MANAGEMENT', 'Dashboard management');
|
||||
define('AUDIT_LOG_SERVICE_MANAGEMENT', 'Service management');
|
||||
define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management');
|
||||
define('AUDIT_LOG_UMC', 'Update Manager');
|
||||
define('AUDIT_LOG_UMC', 'Warp Manager');
|
||||
|
||||
// MIMEs.
|
||||
define(
|
||||
|
@ -1993,7 +1993,8 @@ function get_snmpwalk(
|
||||
$snmp_port='',
|
||||
$server_to_exec=0,
|
||||
$extra_arguments='',
|
||||
$format='-Oa'
|
||||
$format='-Oa',
|
||||
$load_mibs='-m ALL'
|
||||
) {
|
||||
global $config;
|
||||
|
||||
@ -2057,15 +2058,15 @@ function get_snmpwalk(
|
||||
case '3':
|
||||
switch ($snmp3_security_level) {
|
||||
case 'authNoPriv':
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
|
||||
case 'noAuthNoPriv':
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
|
||||
default:
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@ -2074,7 +2075,7 @@ function get_snmpwalk(
|
||||
case '2c':
|
||||
case '1':
|
||||
default:
|
||||
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -2398,9 +2399,9 @@ function check_acl_one_of_groups($id_user, $groups, $access, $cache=true)
|
||||
* LM - Alert Management
|
||||
* PM - Pandora Management
|
||||
*
|
||||
* @param integer $id_user User id
|
||||
* @param integer $id_group Agents group id to check from
|
||||
* @param string $access Access privilege
|
||||
* @param integer $id_user User id.
|
||||
* @param integer $id_group Agents group id to check from.
|
||||
* @param string $access Access privilege.
|
||||
* @param boolean $onlyOneGroup Flag to check acl for specified group only (not to roots up, or check acl for 'All' group when $id_group is 0).
|
||||
*
|
||||
* @return boolean 1 if the user has privileges, 0 if not.
|
||||
@ -2408,7 +2409,7 @@ function check_acl_one_of_groups($id_user, $groups, $access, $cache=true)
|
||||
function check_acl_restricted_all($id_user, $id_group, $access, $onlyOneGroup=false)
|
||||
{
|
||||
if (empty($id_user)) {
|
||||
// User ID needs to be specified
|
||||
// User ID needs to be specified.
|
||||
trigger_error('Security error: check_acl got an empty string for user id', E_USER_WARNING);
|
||||
return 0;
|
||||
} else if (is_user_admin($id_user)) {
|
||||
@ -4260,7 +4261,9 @@ function get_product_name()
|
||||
|
||||
$stored_name = enterprise_hook('enterprise_get_product_name');
|
||||
if (empty($stored_name) || $stored_name == ENTERPRISE_NOT_HOOK) {
|
||||
if ($config['rb_product_name_alt']) {
|
||||
if (isset($config['rb_product_name_alt']) === true
|
||||
&& empty($config['rb_product_name_alt']) === false
|
||||
) {
|
||||
return $config['rb_product_name_alt'];
|
||||
}
|
||||
|
||||
@ -5986,6 +5989,56 @@ function send_test_email(
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return array of ancestors of item, given array.
|
||||
*
|
||||
* @param integer $item From index.
|
||||
* @param array $data Array data.
|
||||
* @param string $key Pivot key (identifies the parent).
|
||||
* @param string|null $extract Extract certain column or index.
|
||||
* @param array $visited Cycle detection.
|
||||
*
|
||||
* @return array Array of ancestors.
|
||||
*/
|
||||
function get_ancestors(
|
||||
int $item,
|
||||
array $data,
|
||||
string $key,
|
||||
?string $extract=null,
|
||||
array &$visited=[]
|
||||
) :array {
|
||||
if (isset($visited[$item]) === true) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$visited[$item] = 1;
|
||||
|
||||
if (isset($data[$item]) === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (isset($data[$item][$key]) === false) {
|
||||
if ($extract !== null) {
|
||||
return [$data[$item][$extract]];
|
||||
}
|
||||
|
||||
return [$item];
|
||||
}
|
||||
|
||||
if ($extract !== null) {
|
||||
return array_merge(
|
||||
get_ancestors($data[$item][$key], $data, $key, $extract, $visited),
|
||||
[$data[$item][$extract]]
|
||||
);
|
||||
}
|
||||
|
||||
return array_merge(
|
||||
get_ancestors($data[$item][$key], $data, $key, $extract, $visited),
|
||||
[$item]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (function_exists('str_contains') === false) {
|
||||
|
||||
|
||||
|
@ -2598,10 +2598,9 @@ function agents_delete_agent($id_agents, $disableACL=false)
|
||||
'tagente_modulo',
|
||||
$filter
|
||||
);
|
||||
|
||||
if (is_array($rows) === true) {
|
||||
foreach ($rows as $row) {
|
||||
$modules[] = PandoraFMS\Module::build($row);
|
||||
$modules[] = PandoraFMS\Module::build($row, '\PandoraFMS\Module', true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4268,3 +4267,30 @@ function get_status_data_agent_modules($id_group, $agents=[], $modules=[])
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
function agents_get_offspring(int $id_agent)
|
||||
{
|
||||
$return = [];
|
||||
// Get parent.
|
||||
$agents = db_get_all_rows_filter(
|
||||
'tagente',
|
||||
[
|
||||
'id_parent' => $id_agent,
|
||||
'disabled' => 0,
|
||||
],
|
||||
'id_agente'
|
||||
);
|
||||
|
||||
if ($agents !== false) {
|
||||
foreach ($agents as $agent) {
|
||||
if ((int) $agent['id_agente'] !== 0) {
|
||||
$return += agents_get_offspring((int) $agent['id_agente']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$return += [$id_agent => 0];
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
@ -118,6 +118,9 @@ function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby
|
||||
$sql .= ' AND t3.id_agente = '.$id_agent;
|
||||
}
|
||||
|
||||
// Only enabled agent.
|
||||
$sql .= ' AND t3.disabled = 0';
|
||||
|
||||
$row_alerts = db_get_all_rows_sql($sql);
|
||||
|
||||
if ($total) {
|
||||
@ -2873,9 +2876,6 @@ function alerts_get_alert_fired($filters=[], $groupsBy=[])
|
||||
global $config;
|
||||
|
||||
$table = 'tevento';
|
||||
if (is_metaconsole() === true) {
|
||||
$table = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
$filter_date = '';
|
||||
if (isset($filters['period']) === true
|
||||
|
@ -53,8 +53,10 @@ enterprise_include_once('include/functions_clusters.php');
|
||||
enterprise_include_once('include/functions_alerts.php');
|
||||
|
||||
// Clases.
|
||||
use PandoraFMS\Agent;
|
||||
use PandoraFMS\Module;
|
||||
use PandoraFMS\Enterprise\Cluster;
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
use PandoraFMS\SpecialDay;
|
||||
|
||||
|
||||
@ -386,23 +388,6 @@ function api_get_test_agent_cache()
|
||||
}
|
||||
|
||||
|
||||
// Returs the string OK if a connection to the event replication DB can be established.
|
||||
function api_get_test_event_replication_db()
|
||||
{
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$status = enterprise_hook('events_test_replication_db', []);
|
||||
if ($status === ENTERPRISE_NOT_HOOK) {
|
||||
echo 'ERR';
|
||||
return;
|
||||
}
|
||||
|
||||
echo $status;
|
||||
}
|
||||
|
||||
|
||||
// -------------------------DEFINED OPERATIONS FUNCTIONS-----------------
|
||||
|
||||
|
||||
@ -1469,22 +1454,22 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3)
|
||||
// Check parameters.
|
||||
if ($idGroup == 0) {
|
||||
$agent_update_error = __('The agent could not be modified. For security reasons, use a group other than 0.');
|
||||
returnError('generic error', $agent_update_error);
|
||||
returnError($agent_update_error);
|
||||
return;
|
||||
}
|
||||
|
||||
$server_name = db_get_value_sql('SELECT name FROM tserver WHERE BINARY name LIKE "'.$nameServer.'"');
|
||||
if ($alias == '' && $alias_as_name === 0) {
|
||||
returnError('alias_not_specified', 'No agent alias specified');
|
||||
returnError('No agent alias specified');
|
||||
return;
|
||||
} else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$idGroup) === false) {
|
||||
returnError('id_grupo_not_exist', 'The group doesn`t exist.');
|
||||
returnError('The group doesn`t exist.');
|
||||
return;
|
||||
} else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$idOS) === false) {
|
||||
returnError('id_os_not_exist', 'The OS doesn`t exist.');
|
||||
returnError('The OS doesn`t exist.');
|
||||
return;
|
||||
} else if ($server_name === false) {
|
||||
returnError('server_not_exist', 'The '.get_product_name().' Server doesn`t exist.');
|
||||
returnError('The '.get_product_name().' Server doesn`t exist.');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1525,6 +1510,14 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3)
|
||||
returnError('The user cannot access to parent agent.');
|
||||
return;
|
||||
}
|
||||
|
||||
$agents_offspring = agents_get_offspring($id_agent);
|
||||
if (empty($agents_offspring) === false) {
|
||||
if (isset($agents_offspring[$idParent]) === true) {
|
||||
returnError('The parent cannot be a offspring');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$values_old = db_get_row_filter(
|
||||
@ -1751,6 +1744,14 @@ function api_set_update_agent_field($id_agent, $use_agent_alias, $params)
|
||||
returnError('The user cannot access to parent agent.');
|
||||
return;
|
||||
}
|
||||
|
||||
$agents_offspring = agents_get_offspring($id_agent);
|
||||
if (empty($agents_offspring) === false) {
|
||||
if (isset($agents_offspring[$data]) === true) {
|
||||
returnError('The parent cannot be a offspring');
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -1826,18 +1827,18 @@ function api_set_update_agent_field($id_agent, $use_agent_alias, $params)
|
||||
/**
|
||||
* Create a new agent, and print the id for new agent.
|
||||
*
|
||||
* @param $thrash1 Don't use.
|
||||
* @param $id_node Id_node target (if metaconsole)
|
||||
* @param $thrash2 Don't use.
|
||||
* @param array $other it's array, $other as param is <agent_name>;<ip>;<id_parent>;<id_group>;
|
||||
* <cascade_protection>;<interval_sec>;<id_os>;<id_server>;<custom_id>;<learning_mode>;<disabled>;<description> in this order
|
||||
* and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>)
|
||||
* example:
|
||||
* @param array $other it's array, $other as param is <agent_name>;<ip>;<id_parent>;<id_group>;
|
||||
* <cascade_protection>;<interval_sec>;<id_os>;<id_server>;<custom_id>;<learning_mode>;<disabled>;<description> in this order
|
||||
* and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_<separator>)
|
||||
* example:
|
||||
*
|
||||
* api.php?op=set&op2=new_agent&other=pepito|1.1.1.1|0|4|0|30|8|10||0|0|nose%20nose&other_mode=url_encode_separator_|
|
||||
* api.php?op=set&op2=new_agent&other=pepito|1.1.1.1|0|4|0|30|8|10||0|0|nose%20nose&other_mode=url_encode_separator_|
|
||||
*
|
||||
* @param $thrash3 Don't use.
|
||||
*/
|
||||
function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
|
||||
function api_set_new_agent($id_node, $thrash2, $other, $trhash3)
|
||||
{
|
||||
global $config;
|
||||
|
||||
@ -1846,158 +1847,117 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
|
||||
return;
|
||||
}
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((int) $other['data'][3] == 0) {
|
||||
returnError('For security reasons, the agent was not created. Use a group other than 0.');
|
||||
return;
|
||||
}
|
||||
|
||||
$alias = io_safe_input(
|
||||
trim(
|
||||
preg_replace(
|
||||
'/[\/\\\|%#&$]/',
|
||||
'',
|
||||
preg_replace(
|
||||
'/x20;/',
|
||||
' ',
|
||||
$other['data'][0]
|
||||
try {
|
||||
$agent = new Agent();
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
if ($id_node <= 0) {
|
||||
throw new Exception('No node id specified');
|
||||
}
|
||||
|
||||
$node = new Node($id_node);
|
||||
$id_agente = $node->callApi(
|
||||
'new_agent',
|
||||
'set',
|
||||
null,
|
||||
null,
|
||||
$other['data'],
|
||||
null
|
||||
);
|
||||
} else {
|
||||
$alias = io_safe_input(
|
||||
trim(
|
||||
preg_replace(
|
||||
'/[\/\\\|%#&$]/',
|
||||
'',
|
||||
preg_replace(
|
||||
'/x20;/',
|
||||
' ',
|
||||
$other['data'][0]
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$direccion_agente = io_safe_input($other['data'][1]);
|
||||
$nombre_agente = hash('sha256', $direccion_agente.'|'.$direccion_agente.'|'.time().'|'.sprintf('%04d', rand(0, 10000)));
|
||||
$id_parent = (int) $other['data'][2];
|
||||
$grupo = (int) $other['data'][3];
|
||||
$cascade_protection = (int) $other['data'][4];
|
||||
$cascade_protection_module = (int) $other['data'][5];
|
||||
$intervalo = (string) $other['data'][6];
|
||||
$id_os = (int) $other['data'][7];
|
||||
$server_name = (string) $other['data'][8];
|
||||
$custom_id = (string) $other['data'][9];
|
||||
$modo = (int) $other['data'][10];
|
||||
$disabled = (int) $other['data'][11];
|
||||
$comentarios = (string) $other['data'][12];
|
||||
$alias_as_name = (int) $other['data'][13];
|
||||
$update_module_count = (int) $config['metaconsole_agent_cache'] == 1;
|
||||
|
||||
if ($cascade_protection == 1) {
|
||||
if (($id_parent != 0) && (db_get_value_sql(
|
||||
'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente = '.$id_parent.' AND id_agente_modulo = '.$cascade_protection_module
|
||||
) === false)
|
||||
) {
|
||||
returnError('Cascade protection is not applied because it is not a parent module.');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$cascadeProtectionModule = 0;
|
||||
}
|
||||
|
||||
$server_name = db_get_value_sql('SELECT name FROM tserver WHERE BINARY name LIKE "'.$server_name.'"');
|
||||
|
||||
// Check if agent exists (BUG WC-50518-2).
|
||||
if ($alias == '' && $alias_as_name === 0) {
|
||||
returnError('No agent alias specified');
|
||||
} else if (agents_get_agent_id($nombre_agente)) {
|
||||
returnError('The agent name already exists in DB.');
|
||||
} else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$grupo) === false) {
|
||||
returnError('The group does not exist.');
|
||||
} else if (group_allow_more_agents($grupo, true, 'create') === false) {
|
||||
returnError('Agent cannot be created due to the maximum agent limit for this group');
|
||||
} else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$id_os) === false) {
|
||||
returnError('The OS does not exist.');
|
||||
} else if ($server_name === false) {
|
||||
returnError('The '.get_product_name().' Server does not exist.');
|
||||
} else {
|
||||
if ($alias_as_name === 1) {
|
||||
$exists_alias = db_get_row_sql('SELECT nombre FROM tagente WHERE nombre = "'.$alias.'"');
|
||||
$nombre_agente = $alias;
|
||||
}
|
||||
|
||||
$exists_ip = false;
|
||||
|
||||
if ($config['unique_ip'] && $direccion_agente != '') {
|
||||
$exists_ip = db_get_row_sql('SELECT direccion FROM tagente WHERE direccion = "'.$direccion_agente.'"');
|
||||
}
|
||||
|
||||
if (!$exists_alias && !$exists_ip) {
|
||||
$id_agente = db_process_sql_insert(
|
||||
'tagente',
|
||||
[
|
||||
'nombre' => $nombre_agente,
|
||||
'alias' => $alias,
|
||||
'alias_as_name' => $alias_as_name,
|
||||
'direccion' => $direccion_agente,
|
||||
'id_grupo' => $grupo,
|
||||
'intervalo' => $intervalo,
|
||||
'comentarios' => $comentarios,
|
||||
'modo' => $modo,
|
||||
'id_os' => $id_os,
|
||||
'disabled' => $disabled,
|
||||
'cascade_protection' => $cascade_protection,
|
||||
'cascade_protection_module' => $cascade_protection_module,
|
||||
'server_name' => $server_name,
|
||||
'id_parent' => $id_parent,
|
||||
'custom_id' => $custom_id,
|
||||
'os_version' => '',
|
||||
'agent_version' => '',
|
||||
'timezone_offset' => 0,
|
||||
'icon_path' => '',
|
||||
'url_address' => '',
|
||||
'update_module_count' => $update_module_count,
|
||||
]
|
||||
);
|
||||
enterprise_hook('update_agent', [$id_agente]);
|
||||
} else {
|
||||
$id_agente = false;
|
||||
}
|
||||
|
||||
if ($id_agente !== false) {
|
||||
// Create address for this agent in taddress.
|
||||
if ($direccion_agente != '') {
|
||||
agents_add_address($id_agente, $direccion_agente);
|
||||
$direccion_agente = io_safe_input($other['data'][1]);
|
||||
$id_parent = (int) $other['data'][2];
|
||||
$grupo = (int) $other['data'][3];
|
||||
$cascade_protection = (int) $other['data'][4];
|
||||
$cascade_protection_module = (int) $other['data'][5];
|
||||
$intervalo = (string) $other['data'][6];
|
||||
$id_os = (int) $other['data'][7];
|
||||
$server_name = (string) $other['data'][8];
|
||||
$custom_id = (string) $other['data'][9];
|
||||
$modo = (int) $other['data'][10];
|
||||
$disabled = (int) $other['data'][11];
|
||||
$comentarios = (string) html_entity_decode($other['data'][12]);
|
||||
$alias_as_name = (int) $other['data'][13];
|
||||
$update_module_count = (int) $config['metaconsole_agent_cache'] == 1;
|
||||
|
||||
$agent->nombre($alias);
|
||||
$agent->alias($alias);
|
||||
$agent->alias_as_name($alias_as_name);
|
||||
$agent->direccion($direccion_agente);
|
||||
$agent->id_grupo($grupo);
|
||||
$agent->intervalo($intervalo);
|
||||
$agent->comentarios($comentarios);
|
||||
$agent->modo($modo);
|
||||
$agent->id_os($id_os);
|
||||
$agent->disabled($disabled);
|
||||
$agent->cascade_protection($cascade_protection);
|
||||
$agent->cascade_protection_module($cascade_protection_module);
|
||||
$agent->server_name($server_name);
|
||||
$agent->id_parent($id_parent);
|
||||
$agent->custom_id($custom_id);
|
||||
$agent->timezone_offset(0);
|
||||
$agent->update_module_count($update_module_count);
|
||||
|
||||
if ($cascade_protection == 1) {
|
||||
if ($id_parent != 0) {
|
||||
try {
|
||||
$parent = new Agent($id_parent);
|
||||
} catch (\Exception $e) {
|
||||
returnError('Cascade protection is not applied because it is not a parent module.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$info = '{"Name":"'.$nombre_agente.'",
|
||||
"IP":"'.$direccion_agente.'",
|
||||
"Group":"'.$grupo.'",
|
||||
"Interval":"'.$intervalo.'",
|
||||
"Comments":"'.$comentarios.'",
|
||||
"Mode":"'.$modo.'",
|
||||
"ID_parent:":"'.$id_parent.'",
|
||||
"Server":"'.$server_name.'",
|
||||
"ID os":"'.$id_os.'",
|
||||
"Disabled":"'.$disabled.'",
|
||||
"Custom ID":"'.$custom_id.'",
|
||||
"Cascade protection":"'.$cascade_protection.'",
|
||||
"Cascade protection module":"'.$cascade_protection_module.'"}';
|
||||
$server_name = db_get_value_sql('SELECT name FROM tserver WHERE BINARY name LIKE "'.$server_name.'"');
|
||||
|
||||
$unsafe_alias = io_safe_output($alias);
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_AGENT_MANAGEMENT,
|
||||
'Created agent '.$unsafe_alias,
|
||||
false,
|
||||
true,
|
||||
$info
|
||||
);
|
||||
} else {
|
||||
$id_agente = 0;
|
||||
|
||||
if ($exists_alias) {
|
||||
$agent_creation_error = 'Could not be created because name already exists';
|
||||
} else if ($exists_ip) {
|
||||
$agent_creation_error = 'Could not be created because IP already exists';
|
||||
// Check if agent exists (BUG WC-50518-2).
|
||||
if ($alias == '' && $alias_as_name === 0) {
|
||||
returnError('No agent alias specified');
|
||||
} else if (agents_get_agent_id($nombre_agente)) {
|
||||
returnError('The agent name already exists in DB.');
|
||||
} else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$grupo) === false) {
|
||||
returnError('The group does not exist.');
|
||||
} else if (group_allow_more_agents($grupo, true, 'create') === false) {
|
||||
returnError('Agent cannot be created due to the maximum agent limit for this group');
|
||||
} else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$id_os) === false) {
|
||||
returnError('The OS does not exist.');
|
||||
} else if ($server_name === false) {
|
||||
returnError('The '.get_product_name().' Server does not exist.');
|
||||
} else {
|
||||
$agent_creation_error = 'Could not be created for unknown reason';
|
||||
}
|
||||
if ($alias_as_name === 1) {
|
||||
$exists_alias = db_get_row_sql('SELECT nombre FROM tagente WHERE nombre = "'.$alias.'"');
|
||||
$nombre_agente = $alias;
|
||||
}
|
||||
|
||||
returnError($agent_creation_error);
|
||||
return;
|
||||
$exists_ip = false;
|
||||
|
||||
if ($config['unique_ip'] && $direccion_agente != '') {
|
||||
$exists_ip = db_get_row_sql('SELECT direccion FROM tagente WHERE direccion = "'.$direccion_agente.'"');
|
||||
}
|
||||
|
||||
$agent->save((bool) $alias_as_name);
|
||||
$id_agente = $agent->id_agente();
|
||||
$agent->updateFromCache();
|
||||
}
|
||||
}
|
||||
|
||||
returnData(
|
||||
@ -2007,6 +1967,9 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3)
|
||||
'data' => $id_agente,
|
||||
]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
returnError($e->getMessage());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5100,7 +5063,7 @@ function api_set_update_snmp_module($id_module, $thrash1, $other, $thrash3)
|
||||
function api_set_new_network_component($id, $thrash1, $other, $thrash2)
|
||||
{
|
||||
global $config;
|
||||
if (is_metaconsole() === true) {
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -5202,7 +5165,7 @@ function api_set_new_plugin_component($id, $thrash1, $other, $thrash2)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -5482,7 +5445,7 @@ function api_set_new_local_component($id, $thrash1, $other, $thrash2)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
if (defined('METACONSOLE')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -10912,11 +10875,6 @@ function api_set_event_validate_filter_pro($trash1, $trash2, $other, $trash3)
|
||||
return;
|
||||
}
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (is_metaconsole()) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
if ($other['type'] == 'string') {
|
||||
if ($other['data'] != '') {
|
||||
returnError('Parameter error.');
|
||||
@ -10982,7 +10940,7 @@ function api_set_event_validate_filter_pro($trash1, $trash2, $other, $trash3)
|
||||
}
|
||||
|
||||
$count = db_process_sql_update(
|
||||
$table_events,
|
||||
'tevento',
|
||||
['estado' => 1],
|
||||
$filterString
|
||||
);
|
||||
@ -11008,12 +10966,6 @@ function api_set_event_validate_filter($trash1, $trash2, $other, $trash3)
|
||||
}
|
||||
|
||||
$simulate = false;
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (is_metaconsole()) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
if ($other['type'] == 'string') {
|
||||
if ($other['data'] != '') {
|
||||
returnError('Parameter error.');
|
||||
@ -11048,14 +11000,14 @@ function api_set_event_validate_filter($trash1, $trash2, $other, $trash3)
|
||||
}
|
||||
|
||||
if ($simulate) {
|
||||
$rows = db_get_all_rows_filter($table_events, $filterString);
|
||||
$rows = db_get_all_rows_filter('tevento', $filterString);
|
||||
if ($rows !== false) {
|
||||
returnData('string', count($rows));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$count = db_process_sql_update(
|
||||
$table_events,
|
||||
'tevento',
|
||||
['estado' => 1],
|
||||
$filterString
|
||||
);
|
||||
@ -11325,9 +11277,6 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
global $config;
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (is_metaconsole() === true) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
// By default.
|
||||
$status = 3;
|
||||
@ -11545,21 +11494,19 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
}
|
||||
|
||||
if ($group_rep == 0) {
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
if ($filter['total']) {
|
||||
$sql = 'SELECT COUNT(*)
|
||||
if ($filter['total']) {
|
||||
$sql = 'SELECT COUNT(*)
|
||||
FROM '.$table_events.'
|
||||
WHERE 1=1 '.$sql_post;
|
||||
} else if ($filter['more_criticity']) {
|
||||
$sql = 'SELECT criticity
|
||||
} else if ($filter['more_criticity']) {
|
||||
$sql = 'SELECT criticity
|
||||
FROM '.$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
ORDER BY criticity DESC
|
||||
LIMIT 1';
|
||||
} else {
|
||||
if (is_metaconsole() === true) {
|
||||
$sql = 'SELECT *,
|
||||
} else {
|
||||
if (is_metaconsole() === true) {
|
||||
$sql = 'SELECT *,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = '.$table_events.'.id_grupo) AS group_name,
|
||||
@ -11569,8 +11516,8 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
FROM '.$table_events.$alert_join.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
ORDER BY utimestamp DESC';
|
||||
} else {
|
||||
$sql = 'SELECT *,
|
||||
} else {
|
||||
$sql = 'SELECT *,
|
||||
(SELECT t1.alias
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
@ -11589,109 +11536,19 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
|
||||
FROM '.$table_events.$alert_join.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
ORDER BY utimestamp DESC';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
// TODO TOTAL
|
||||
$sql = 'SELECT *,
|
||||
(SELECT t1.alias
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_name,
|
||||
(SELECT t2.icon
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_icon,
|
||||
(SELECT tmodule.name
|
||||
FROM tmodule
|
||||
WHERE id_module IN (
|
||||
SELECT tagente_modulo.id_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE tagente_modulo.id_agente_modulo=tevento.id_agentmodule)) AS module_name
|
||||
FROM tevento
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
ORDER BY utimestamp DESC';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
// TODO TOTAL
|
||||
$set = [];
|
||||
|
||||
$sql = 'SELECT *,
|
||||
(SELECT t1.alias
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS alias,
|
||||
(SELECT t1.nombre
|
||||
FROM tagente t1
|
||||
WHERE t1.id_agente = tevento.id_agente) AS agent_name,
|
||||
(SELECT t2.nombre
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_name,
|
||||
(SELECT t2.icon
|
||||
FROM tgrupo t2
|
||||
WHERE t2.id_grupo = tevento.id_grupo) AS group_icon,
|
||||
(SELECT tmodule.name
|
||||
FROM tmodule
|
||||
WHERE id_module IN (
|
||||
SELECT tagente_modulo.id_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE tagente_modulo.id_agente_modulo=tevento.id_agentmodule)) AS module_name
|
||||
FROM tevento
|
||||
WHERE 1=1 '.$sql_post.' ORDER BY utimestamp DESC';
|
||||
$sql = oracle_recode_query($sql, $set);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
db_process_sql('SET group_concat_max_len = 9999999');
|
||||
db_process_sql('SET group_concat_max_len = 9999999');
|
||||
|
||||
$sql = "SELECT *, MAX(id_evento) AS id_evento,
|
||||
GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado,
|
||||
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
||||
FROM ".$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
GROUP BY evento, id_agentmodule
|
||||
ORDER BY timestamp_rep DESC';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$sql = "SELECT *, MAX(id_evento) AS id_evento,
|
||||
array_to_string(array_agg(DISTINCT user_comment), '') AS user_comment,
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado,
|
||||
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_rep
|
||||
FROM ".$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
GROUP BY evento, id_agentmodule
|
||||
ORDER BY timestamp_rep DESC';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$set = [];
|
||||
// TODO: Remove duplicate user comments
|
||||
$sql = 'SELECT a.*, b.event_rep, b.timestamp_rep
|
||||
FROM (SELECT *
|
||||
FROM tevento
|
||||
WHERE 1=1 '.$sql_post.") a,
|
||||
(SELECT MAX (id_evento) AS id_evento,
|
||||
to_char(evento) AS evento, id_agentmodule,
|
||||
COUNT(*) AS event_rep, MIN(estado) AS min_estado,
|
||||
MAX(estado) AS max_estado,
|
||||
LISTAGG(user_comment, '') AS user_comment,
|
||||
MAX(utimestamp) AS timestamp_rep
|
||||
FROM ".$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
GROUP BY to_char(evento), id_agentmodule) b
|
||||
WHERE a.id_evento=b.id_evento AND
|
||||
to_char(a.evento)=to_char(b.evento) AND
|
||||
a.id_agentmodule=b.id_agentmodule';
|
||||
$sql = oracle_recode_query($sql, $set);
|
||||
break;
|
||||
}
|
||||
$sql = "SELECT *, MAX(id_evento) AS id_evento,
|
||||
GROUP_CONCAT(DISTINCT user_comment SEPARATOR '') AS user_comment,
|
||||
MIN(estado) AS min_estado, MAX(estado) AS max_estado,
|
||||
COUNT(*) AS event_rep, MAX(utimestamp) AS timestamp_last
|
||||
FROM ".$table_events.'
|
||||
WHERE 1=1 '.$sql_post.'
|
||||
GROUP BY evento, id_agentmodule
|
||||
ORDER BY timestamp_last DESC';
|
||||
}
|
||||
|
||||
if ($other['type'] == 'string') {
|
||||
@ -11822,17 +11679,9 @@ function api_set_event($id_event, $unused1, $params, $unused2, $unused3)
|
||||
}
|
||||
}
|
||||
|
||||
// In meta or node.
|
||||
if (is_metaconsole() === true) {
|
||||
$table = 'tmetaconsole_event';
|
||||
} else {
|
||||
$table = 'tevento';
|
||||
}
|
||||
|
||||
// TODO. Stablish security for prevent sql injection?
|
||||
// Update the row
|
||||
$result = db_process_sql_update(
|
||||
$table,
|
||||
'tevento',
|
||||
$paramsSerialize,
|
||||
[ 'id_evento' => $id_event ]
|
||||
);
|
||||
@ -11903,15 +11752,7 @@ function api_get_events($node_id, $trash2, $other, $returnType, $user_in_db=null
|
||||
$filterString = otherParameter2Filter($other, false, $use_agent_name);
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
if ((int) $node_id !== 0) {
|
||||
$filterString .= ' AND server_id = '.$node_id;
|
||||
}
|
||||
|
||||
$dataRows = db_get_all_rows_filter('tmetaconsole_event', $filterString);
|
||||
} else {
|
||||
$dataRows = db_get_all_rows_filter('tevento', $filterString);
|
||||
}
|
||||
$dataRows = db_get_all_rows_filter('tevento', $filterString);
|
||||
|
||||
$last_error = error_get_last();
|
||||
if (empty($dataRows)) {
|
||||
@ -13128,18 +12969,20 @@ function api_get_event_info($id_event, $trash1, $trash, $returnType)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (defined('METACONSOLE')) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
$sql = sprintf(
|
||||
'SELECT *
|
||||
FROM tevento
|
||||
WHERE id_evento= %d',
|
||||
$id_event
|
||||
);
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM '.$table_events."
|
||||
WHERE id_evento=$id_event";
|
||||
$event_data = db_get_row_sql($sql);
|
||||
|
||||
// Check the access to group
|
||||
if (!empty($event_data['id_grupo']) && $event_data['id_grupo'] > 0 && !$event_data['id_agente']) {
|
||||
if (!empty($event_data['id_grupo'])
|
||||
&& $event_data['id_grupo'] > 0
|
||||
&& !$event_data['id_agente']
|
||||
) {
|
||||
if (!check_acl($config['id_user'], $event_data['id_grupo'], 'ER')) {
|
||||
returnError('forbidden', $returnType);
|
||||
return;
|
||||
@ -13147,8 +12990,14 @@ function api_get_event_info($id_event, $trash1, $trash, $returnType)
|
||||
}
|
||||
|
||||
// Check the access to agent
|
||||
if (!empty($event_data['id_agente']) && $event_data['id_agente'] > 0) {
|
||||
if (!util_api_check_agent_and_print_error($event_data['id_agente'], $returnType)) {
|
||||
if (!empty($event_data['id_agente'])
|
||||
&& $event_data['id_agente'] > 0
|
||||
) {
|
||||
if (!util_api_check_agent_and_print_error(
|
||||
$event_data['id_agente'],
|
||||
$returnType
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -13436,13 +13285,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
||||
|
||||
if ($other['data'][18] != '') {
|
||||
$values['id_extra'] = $other['data'][18];
|
||||
if (is_metaconsole()) {
|
||||
$table_event = 'tmetaconsole_event';
|
||||
} else {
|
||||
$table_event = 'tevento';
|
||||
}
|
||||
|
||||
$sql_validation = 'SELECT id_evento FROM '.$table_event.' where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
|
||||
$sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
|
||||
$validation = db_get_all_rows_sql($sql_validation);
|
||||
if ($validation) {
|
||||
foreach ($validation as $val) {
|
||||
@ -13484,9 +13327,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
||||
$res = events_comment(
|
||||
$return,
|
||||
$user_comment,
|
||||
'Added comment',
|
||||
is_metaconsole(),
|
||||
$config['history_db_enabled']
|
||||
'Added comment'
|
||||
);
|
||||
if ($other['data'][13] != '') {
|
||||
// owner user
|
||||
@ -13496,9 +13337,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
||||
events_change_owner(
|
||||
$return,
|
||||
$owner_user,
|
||||
true,
|
||||
is_metaconsole(),
|
||||
$config['history_db_enabled']
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -13554,9 +13393,7 @@ function api_set_add_event_comment($id, $thrash2, $other, $thrash3)
|
||||
$status = events_comment(
|
||||
$id,
|
||||
$comment,
|
||||
'Added comment',
|
||||
$meta,
|
||||
$history
|
||||
'Added comment'
|
||||
);
|
||||
if (is_error($status)) {
|
||||
returnError(
|
||||
@ -13719,17 +13556,12 @@ function api_set_validate_event_by_id($id, $trash1=null, $trash2=null, $returnTy
|
||||
return;
|
||||
}
|
||||
|
||||
$table_events = 'tevento';
|
||||
if (is_metaconsole()) {
|
||||
$table_events = 'tmetaconsole_event';
|
||||
}
|
||||
|
||||
$data['type'] = 'string';
|
||||
$check_id = db_get_value('id_evento', $table_events, 'id_evento', $id);
|
||||
$check_id = db_get_value('id_evento', 'tevento', 'id_evento', $id);
|
||||
|
||||
if ($check_id) {
|
||||
// event exists
|
||||
$status = db_get_value('estado', $table_events, 'id_evento', $id);
|
||||
$status = db_get_value('estado', 'tevento', 'id_evento', $id);
|
||||
if ($status == 1) {
|
||||
// event already validated
|
||||
$data['data'] = 'Event already validated.';
|
||||
@ -13743,7 +13575,7 @@ function api_set_validate_event_by_id($id, $trash1=null, $trash2=null, $returnTy
|
||||
'estado' => 1,
|
||||
];
|
||||
|
||||
$result = db_process_sql_update($table_events, $values, ['id_evento' => $id]);
|
||||
$result = db_process_sql_update('tevento', $values, ['id_evento' => $id]);
|
||||
|
||||
if ($result === false) {
|
||||
$data['data'] = 'The event could not be validated.';
|
||||
@ -14867,7 +14699,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
|
||||
'type_graph' => $config['type_module_charts'],
|
||||
'fullscale' => false,
|
||||
'return_img_base_64' => true,
|
||||
'image_treshold' => $graph_threshold,
|
||||
'image_threshold' => $graph_threshold,
|
||||
'graph_font_size' => $graph_font_size,
|
||||
];
|
||||
|
||||
@ -17510,7 +17342,7 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access='A
|
||||
* Function for get event id and node id, then we get in return the Metaconsole event ID.
|
||||
*
|
||||
* @param [string] $server_id id server (Node)
|
||||
* @param [string] $console_event_id console Id node event in tmetaconsole_event
|
||||
* @param [string] $console_event_id console Id node event in tevent
|
||||
* @param [string] $trash2 don't use
|
||||
* @param [string] $returnType
|
||||
*
|
||||
@ -17521,19 +17353,54 @@ function util_api_check_agent_and_print_error($id_agent, $returnType, $access='A
|
||||
*/
|
||||
function api_get_event_mcid($server_id, $console_event_id, $trash2, $returnType)
|
||||
{
|
||||
global $config;
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node = new Node($server_id);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
// Get grouped comments.
|
||||
$mc_event_id = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT id_evento
|
||||
FROM tevento
|
||||
WHERE id_evento = %d
|
||||
',
|
||||
$console_event_id
|
||||
)
|
||||
);
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$mc_event_id = db_get_all_rows_sql("SELECT id_evento FROM tmetaconsole_event WHERE id_source_event = $console_event_id AND server_id = $server_id ");
|
||||
if ($mc_event_id !== false) {
|
||||
returnData($returnType, ['type' => 'string', 'data' => $mc_event_id]);
|
||||
returnData(
|
||||
$returnType,
|
||||
[
|
||||
'type' => 'string',
|
||||
'data' => $mc_event_id,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
returnError('id_not_found', 'string');
|
||||
}
|
||||
} else {
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
returnError('forbidden', 'string');
|
||||
return;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -17581,20 +17448,14 @@ function api_get_is_centralized($server_id, $thrash1, $thrash2, $returnType)
|
||||
function api_set_event_in_progress($event_id, $trash2, $returnType)
|
||||
{
|
||||
global $config;
|
||||
if (is_metaconsole()) {
|
||||
$table = 'tmetaconsole_event';
|
||||
} else {
|
||||
$table = 'tevento';
|
||||
}
|
||||
|
||||
$event = db_process_sql_update(
|
||||
$table,
|
||||
'tevento',
|
||||
['estado' => 2],
|
||||
['id_evento' => $event_id]
|
||||
);
|
||||
|
||||
if ($event !== false) {
|
||||
returnData('string', ['data' => $event]);
|
||||
returnData('string', ['data' => $event]);
|
||||
} else {
|
||||
returnError('id_not_found', 'string');
|
||||
}
|
||||
|
@ -409,32 +409,6 @@ function config_update_config()
|
||||
$error_update[] = __('Size of collection');
|
||||
}
|
||||
|
||||
if (config_update_value('event_replication', (int) get_parameter('event_replication'), true) === false) {
|
||||
$error_update[] = __('Events replication');
|
||||
}
|
||||
|
||||
if ((int) get_parameter('event_replication') === 1) {
|
||||
if (config_update_value('replication_interval', (int) get_parameter('replication_interval'), true) === false) {
|
||||
$error_update[] = __('Replication interval');
|
||||
}
|
||||
|
||||
if (config_update_value('replication_limit', (int) get_parameter('replication_limit'), true) === false) {
|
||||
$error_update[] = __('Replication limit');
|
||||
}
|
||||
|
||||
if (config_update_value('replication_mode', (string) get_parameter('replication_mode'), true) === false) {
|
||||
$error_update[] = __('Replication mode');
|
||||
}
|
||||
|
||||
if (config_update_value('show_events_in_local', (string) get_parameter('show_events_in_local'), true) === false) {
|
||||
$error_update[] = __('Show events list in local console (read only)');
|
||||
}
|
||||
}
|
||||
|
||||
if (config_update_value('replication_dbengine', (string) get_parameter('replication_dbengine'), true) === false) {
|
||||
$error_update[] = __('Replication DB engine');
|
||||
}
|
||||
|
||||
if (config_update_value('replication_dbhost', (string) get_parameter('replication_dbhost'), true) === false) {
|
||||
$error_update[] = __('Replication DB host');
|
||||
}
|
||||
@ -928,6 +902,10 @@ function config_update_config()
|
||||
$error_update[] = __('SNMP walk binary path (fallback for v1)');
|
||||
}
|
||||
|
||||
if (config_update_value('wmiBinary', get_parameter('wmiBinary'), true) === false) {
|
||||
$error_update[] = __('Default WMI Binary');
|
||||
}
|
||||
|
||||
$pjs = get_parameter('phantomjs_cache_interval');
|
||||
switch ($pjs) {
|
||||
case $config['phantomjs_cache_interval']:
|
||||
@ -1183,6 +1161,10 @@ function config_update_config()
|
||||
$error_update[] = __('Default line thickness for the Visual Console');
|
||||
}
|
||||
|
||||
if (config_update_value('mobile_view_orientation_vc', (int) get_parameter('mobile_view_orientation_vc'), true) === false) {
|
||||
$error_update[] = __('Mobile view not allow visual console orientation');
|
||||
}
|
||||
|
||||
if (config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10), true) === false) {
|
||||
$error_update[] = __('Default line menu items for the Services');
|
||||
}
|
||||
@ -1607,7 +1589,7 @@ function config_update_config()
|
||||
'port' => $config['history_db_port'],
|
||||
'name' => $config['history_db_name'],
|
||||
'user' => $config['history_db_user'],
|
||||
'pass' => $config['history_db_pass'],
|
||||
'pass' => io_output_password($config['history_db_pass']),
|
||||
]
|
||||
);
|
||||
|
||||
@ -1619,48 +1601,47 @@ function config_update_config()
|
||||
$dbm->process();
|
||||
} else if ($dbm->check() !== true) {
|
||||
$errors[] = $dbm->getLastError();
|
||||
config_update_value('history_db_enabled', false);
|
||||
}
|
||||
|
||||
if ($dbm->check() === true) {
|
||||
// Historical configuration tokens (stored in historical db).
|
||||
if ($dbm->setConfigToken(
|
||||
'days_purge',
|
||||
get_parameter('history_dbh_purge')
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database purge');
|
||||
}
|
||||
|
||||
if ($dbm->setConfigToken(
|
||||
'history_partitions_auto',
|
||||
get_parameter_switch('history_partitions_auto', 0)
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database partitions');
|
||||
}
|
||||
|
||||
if ($dbm->setConfigToken(
|
||||
'event_purge',
|
||||
get_parameter('history_dbh_events_purge')
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database events purge');
|
||||
}
|
||||
|
||||
if ($dbm->setConfigToken(
|
||||
'string_purge',
|
||||
get_parameter('history_dbh_string_purge')
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database string purge');
|
||||
}
|
||||
|
||||
// Disable history db in history db.
|
||||
$dbm->setConfigToken('history_db_enabled', 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Historical configuration tokens (stored in historical db).
|
||||
if (Config::set(
|
||||
'days_purge',
|
||||
get_parameter('history_dbh_purge'),
|
||||
true
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database purge');
|
||||
}
|
||||
|
||||
if (Config::set(
|
||||
'history_partitions_auto',
|
||||
get_parameter_switch('history_partitions_auto', 0),
|
||||
true
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database partitions');
|
||||
}
|
||||
|
||||
if (Config::set(
|
||||
'event_purge',
|
||||
get_parameter('history_dbh_events_purge'),
|
||||
true
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database events purge');
|
||||
}
|
||||
|
||||
if (Config::set(
|
||||
'string_purge',
|
||||
get_parameter('history_dbh_string_purge'),
|
||||
true
|
||||
) !== true
|
||||
) {
|
||||
$error_update[] = __('Historical database string purge');
|
||||
}
|
||||
|
||||
// Disable history db in history db.
|
||||
Config::set('history_db_enabled', 0, true);
|
||||
break;
|
||||
|
||||
case 'ehorus':
|
||||
@ -2054,6 +2035,10 @@ function config_process_config()
|
||||
config_update_value('max_execution_event_response', 10);
|
||||
}
|
||||
|
||||
if (!isset($config['max_number_of_events_per_node'])) {
|
||||
config_update_value('max_number_of_events_per_node', 100000);
|
||||
}
|
||||
|
||||
if (!isset($config['max_macro_fields'])) {
|
||||
config_update_value('max_macro_fields', 10);
|
||||
}
|
||||
@ -2088,6 +2073,10 @@ function config_process_config()
|
||||
config_update_value('snmpwalk_fallback', 'snmpwalk');
|
||||
}
|
||||
|
||||
if (isset($config['wmiBinary']) === false) {
|
||||
config_update_value('wmiBinary', 'pandorawmic');
|
||||
}
|
||||
|
||||
if (!isset($config['event_purge'])) {
|
||||
config_update_value('event_purge', 15);
|
||||
}
|
||||
@ -2132,22 +2121,6 @@ function config_process_config()
|
||||
config_update_value('policy_add_max_agents', 200);
|
||||
}
|
||||
|
||||
if (!isset($config['event_replication'])) {
|
||||
config_update_value('event_replication', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['replication_interval'])) {
|
||||
config_update_value('replication_interval', 10);
|
||||
}
|
||||
|
||||
if (!isset($config['replication_limit'])) {
|
||||
config_update_value('replication_limit', 50);
|
||||
}
|
||||
|
||||
if (!isset($config['replication_dbengine'])) {
|
||||
config_update_value('replication_dbengine', 'mysql');
|
||||
}
|
||||
|
||||
if (!isset($config['replication_dbhost'])) {
|
||||
config_update_value('replication_dbhost', '');
|
||||
}
|
||||
@ -2168,18 +2141,10 @@ function config_process_config()
|
||||
config_update_value('replication_dbport', '');
|
||||
}
|
||||
|
||||
if (!isset($config['replication_mode'])) {
|
||||
config_update_value('replication_mode', 'only_validated');
|
||||
}
|
||||
|
||||
if (!isset($config['metaconsole_agent_cache'])) {
|
||||
config_update_value('metaconsole_agent_cache', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['show_events_in_local'])) {
|
||||
config_update_value('show_events_in_local', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['log_collector'])) {
|
||||
config_update_value('log_collector', 0);
|
||||
}
|
||||
@ -2357,12 +2322,12 @@ function config_process_config()
|
||||
config_update_value('custom_favicon', '');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_logo'])) {
|
||||
config_update_value('custom_logo', 'pandora_logo_head_4.png');
|
||||
if (isset($config['custom_logo']) === false) {
|
||||
config_update_value('custom_logo', HEADER_LOGO_DEFAULT_CLASSIC);
|
||||
}
|
||||
|
||||
if (!isset($config['custom_logo_collapsed'])) {
|
||||
config_update_value('custom_logo_collapsed', 'pandora_logo_green_collapsed.png');
|
||||
if (isset($config['custom_logo_collapsed']) === false) {
|
||||
config_update_value('custom_logo_collapsed', HEADER_LOGO_DEFAULT_COLLAPSED);
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
@ -3066,6 +3031,10 @@ function config_process_config()
|
||||
config_update_value('vc_line_thickness', 2);
|
||||
}
|
||||
|
||||
if (isset($config['mobile_view_orientation_vc']) === false) {
|
||||
config_update_value('mobile_view_orientation_vc', 0);
|
||||
}
|
||||
|
||||
if (!isset($config['agent_size_text_small'])) {
|
||||
config_update_value('agent_size_text_small', 18);
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ function db_pandora_audit($accion, $descripcion, $user_id=false, $ip=true, $info
|
||||
if (isset($config['remote_addr']) === true) {
|
||||
$ip = $config['remote_addr'];
|
||||
} else {
|
||||
if ($_SERVER['REMOTE_ADDR']) {
|
||||
if (isset($_SERVER['REMOTE_ADDR']) === true) {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
} else {
|
||||
$ip = __('N/A');
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user