Merge branch 'develop' into ent-13579-color-de-fondo-parcial-en-tema-oscuro-para-algunos-widgets
This commit is contained in:
commit
c141ddfd47
|
@ -8,7 +8,7 @@ Pandora FMS gives you the agility to find and solve problems quickly, scaling th
|
|||
|
||||
### Support
|
||||
|
||||
For community support you can visit our forums at https://pandorafms.com/community/
|
||||
For community support you can visit our forums at https://pandorafms.com/community/
|
||||
|
||||
Pandora FMS has a "commercial" solution, with different features, oriented to companies that do not want to spend time using open source solutions, but closed packaged products, with periodic updates and professional support. Its name is Pandora FMS Enterprise, and you can find more information about it at https://pandorafms.com.
|
||||
|
||||
|
@ -18,11 +18,11 @@ Installing Pandora FMS from sources is a complex task. Please visit our wiki and
|
|||
|
||||
### What is Pandora FMS?
|
||||
|
||||
Pandora FMS is an open source monitoring application whose origin dates back to 2004. It integrates in the same application the monitoring of different infrastructure elements: networks, applications, servers, web, and other specific data sources such as logs, WMI, Netflow or SNMP traps.
|
||||
Pandora FMS is an open source monitoring application whose origin dates back to 2004. It integrates in the same application the monitoring of different infrastructure elements: networks, applications, servers, web, and other specific data sources such as logs, WMI, Netflow or SNMP traps.
|
||||
|
||||
It allows you to supervise systems and applications of all types, through remote monitoring or with software agents installed on the equipment to be monitored.
|
||||
It allows you to supervise systems and applications of all types, through remote monitoring or with software agents installed on the equipment to be monitored.
|
||||
|
||||
Pandora FMS monitors your hardware, software, your multilayer system and, of course, your operating system. Pandora FMS can detect if a network interface is down or the movement of the market value of any new NASDAQ technology. If desired, Pandora FMS can send an SMS message when your system or application fails or when the value of Tesla's stock drops below $180. Pandora FMS will adapt to your systems and requirements, because it has been designed to be open, modular, multiplatform and easy to customize.
|
||||
Pandora FMS monitors your hardware, software, your multilayer system and, of course, your operating system. Pandora FMS can detect if a network interface is down or the movement of the market value of any new NASDAQ technology. If desired, Pandora FMS can send an SMS message when your system or application fails or when the value of Tesla's stock drops below \$180. Pandora FMS will adapt to your systems and requirements, because it has been designed to be open, modular, multiplatform and easy to customize.
|
||||
|
||||
Pandora FMS can be deployed over any OS, with specific agents for each platform. There are agents for Windows (2000, XP, 2003), GNU/Linux, Solaris, HP-UX, BSD, AIX, IPSO and OpenWRT. Pandora FMS not only gathers information through its agents, but it can also monitor any hardware system with TCP/IP connectivity, such as load balancing systems, routers, switches or printers, through SNMP and TCP/ICMP checks.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.776-240425
|
||||
Version: 7.0NG.776-240430
|
||||
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.776-240425"
|
||||
pandora_version="7.0NG.776-240430"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1039,7 +1039,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.776';
|
||||
use constant AGENT_BUILD => '240425';
|
||||
use constant AGENT_BUILD => '240430';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.776
|
||||
%define release 240425
|
||||
%define release 240430
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.776
|
||||
%define release 240425
|
||||
%define release 240430
|
||||
%define debug_package %{nil}
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.776
|
||||
%define release 240425
|
||||
%define release 240430
|
||||
%define debug_package %{nil}
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.776
|
||||
%define release 240425
|
||||
%define release 240430
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.776
|
||||
%define release 240425
|
||||
%define release 240430
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.776"
|
||||
PI_BUILD="240425"
|
||||
PI_BUILD="240430"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{240425}
|
||||
{240430}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.776 Build 240425")
|
||||
#define PANDORA_VERSION ("7.0NG.776 Build 240430")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Pandora FMS"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.776(Build 240425))"
|
||||
VALUE "ProductVersion", "(7.0NG.776(Build 240430))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.776-240425
|
||||
Version: 7.0NG.776-240430
|
||||
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.776-240425"
|
||||
pandora_version="7.0NG.776-240430"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -75,23 +75,19 @@ if (empty($_REQUEST) === true) {
|
|||
}
|
||||
|
||||
// Hash login process.
|
||||
if (isset($_GET['loginhash']) === true) {
|
||||
$loginhash_data = get_parameter('loginhash_data', '');
|
||||
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
|
||||
|
||||
if ($config['loginhash_pwd'] != ''
|
||||
&& $loginhash_data == md5(
|
||||
$loginhash_user.io_output_password($config['loginhash_pwd'])
|
||||
)
|
||||
) {
|
||||
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
||||
$_SESSION['id_usuario'] = $loginhash_user;
|
||||
$config['id_user'] = $loginhash_user;
|
||||
if (isset($_POST['auth_token']) === true && (bool) $config['JWT_signature'] !== false) {
|
||||
include_once $config['homedir'].'/include/class/JWTRepository.class.php';
|
||||
$jwt = new JWTRepository($config['JWT_signature']);
|
||||
if ($jwt->setToken($_POST['auth_token']) && $jwt->validate()) {
|
||||
$id_user = $jwt->payload()->get('id_user');
|
||||
db_logon($id_user, $_SERVER['REMOTE_ADDR']);
|
||||
$_SESSION['id_usuario'] = $id_user;
|
||||
$config['id_user'] = $id_user;
|
||||
} else {
|
||||
include_once 'general/login_page.php';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_REGISTRATION,
|
||||
'Loginhash failed',
|
||||
'Login token failed',
|
||||
'system'
|
||||
);
|
||||
while (ob_get_length() > 0) {
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
"php-di/php-di": "^7.0",
|
||||
"zircote/swagger-php": "^4.8",
|
||||
"doctrine/annotations": "^2.0",
|
||||
"ramsey/uuid": "^4.7"
|
||||
"ramsey/uuid": "^4.7",
|
||||
"lcobucci/jwt": "^5.2",
|
||||
"lcobucci/clock": "^3.2"
|
||||
},
|
||||
"repositories": {
|
||||
"phpchartjs": {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "0d777bd9c0ca68c9ec0fe911e71b1b2a",
|
||||
"content-hash": "c7549451bb31a635714731144a995123",
|
||||
"packages": [
|
||||
{
|
||||
"name": "amphp/amp",
|
||||
|
@ -1553,6 +1553,143 @@
|
|||
},
|
||||
"time": "2023-11-08T14:08:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "lcobucci/clock",
|
||||
"version": "3.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/lcobucci/clock.git",
|
||||
"reference": "6f28b826ea01306b07980cb8320ab30b966cd715"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/lcobucci/clock/zipball/6f28b826ea01306b07980cb8320ab30b966cd715",
|
||||
"reference": "6f28b826ea01306b07980cb8320ab30b966cd715",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "~8.2.0 || ~8.3.0",
|
||||
"psr/clock": "^1.0"
|
||||
},
|
||||
"provide": {
|
||||
"psr/clock-implementation": "1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"infection/infection": "^0.27",
|
||||
"lcobucci/coding-standard": "^11.0.0",
|
||||
"phpstan/extension-installer": "^1.3.1",
|
||||
"phpstan/phpstan": "^1.10.25",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.1.3",
|
||||
"phpstan/phpstan-phpunit": "^1.3.13",
|
||||
"phpstan/phpstan-strict-rules": "^1.5.1",
|
||||
"phpunit/phpunit": "^10.2.3"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Lcobucci\\Clock\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Luís Cobucci",
|
||||
"email": "lcobucci@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Yet another clock abstraction",
|
||||
"support": {
|
||||
"issues": "https://github.com/lcobucci/clock/issues",
|
||||
"source": "https://github.com/lcobucci/clock/tree/3.2.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/lcobucci",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/lcobucci",
|
||||
"type": "patreon"
|
||||
}
|
||||
],
|
||||
"time": "2023-11-17T17:00:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "lcobucci/jwt",
|
||||
"version": "5.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/lcobucci/jwt.git",
|
||||
"reference": "0ba88aed12c04bd2ed9924f500673f32b67a6211"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/lcobucci/jwt/zipball/0ba88aed12c04bd2ed9924f500673f32b67a6211",
|
||||
"reference": "0ba88aed12c04bd2ed9924f500673f32b67a6211",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-openssl": "*",
|
||||
"ext-sodium": "*",
|
||||
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
|
||||
"psr/clock": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"infection/infection": "^0.27.0",
|
||||
"lcobucci/clock": "^3.0",
|
||||
"lcobucci/coding-standard": "^11.0",
|
||||
"phpbench/phpbench": "^1.2.9",
|
||||
"phpstan/extension-installer": "^1.2",
|
||||
"phpstan/phpstan": "^1.10.7",
|
||||
"phpstan/phpstan-deprecation-rules": "^1.1.3",
|
||||
"phpstan/phpstan-phpunit": "^1.3.10",
|
||||
"phpstan/phpstan-strict-rules": "^1.5.0",
|
||||
"phpunit/phpunit": "^10.2.6"
|
||||
},
|
||||
"suggest": {
|
||||
"lcobucci/clock": ">= 3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Lcobucci\\JWT\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Luís Cobucci",
|
||||
"email": "lcobucci@gmail.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "A simple library to work with JSON Web Token and JSON Web Signature",
|
||||
"keywords": [
|
||||
"JWS",
|
||||
"jwt"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/lcobucci/jwt/issues",
|
||||
"source": "https://github.com/lcobucci/jwt/tree/5.2.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/lcobucci",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/lcobucci",
|
||||
"type": "patreon"
|
||||
}
|
||||
],
|
||||
"time": "2023-11-20T21:17:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "3.5.0",
|
||||
|
@ -2307,6 +2444,54 @@
|
|||
},
|
||||
"time": "2021-02-03T23:26:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/clock",
|
||||
"version": "1.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/clock.git",
|
||||
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d",
|
||||
"reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.0 || ^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Clock\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for reading the clock.",
|
||||
"homepage": "https://github.com/php-fig/clock",
|
||||
"keywords": [
|
||||
"clock",
|
||||
"now",
|
||||
"psr",
|
||||
"psr-20",
|
||||
"time"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-fig/clock/issues",
|
||||
"source": "https://github.com/php-fig/clock/tree/1.0.0"
|
||||
},
|
||||
"time": "2022-11-25T14:36:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
"version": "2.0.2",
|
||||
|
@ -4338,5 +4523,5 @@
|
|||
"platform-overrides": {
|
||||
"php": "8.2"
|
||||
},
|
||||
"plugin-api-version": "2.3.0"
|
||||
"plugin-api-version": "2.2.0"
|
||||
}
|
||||
|
|
|
@ -50,14 +50,7 @@ function extension_db_status()
|
|||
}
|
||||
|
||||
ui_print_info_message(
|
||||
" - " .
|
||||
__('This extension checks the DB is correct. Because sometimes the old DB from a migration has not some fields in the tables or the data is changed.') .
|
||||
"<br>" .
|
||||
" - " .
|
||||
__('At the moment the checks is for MySQL/MariaDB.') .
|
||||
"<br>" .
|
||||
" - " .
|
||||
__('User must have Select, Drop, Create and References privileges.')
|
||||
' - '.__('This extension checks the DB is correct. Because sometimes the old DB from a migration has not some fields in the tables or the data is changed.').'<br>'.' - '.__('At the moment the checks is for MySQL/MariaDB.').'<br>'.' - '.__('User must have Select, Drop, Create and References privileges.')
|
||||
);
|
||||
|
||||
echo "<form method='post' class='max_floating_element_size'>";
|
||||
|
@ -195,7 +188,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
|
|||
|
||||
try {
|
||||
$query = "SELECT IF(EXISTS(SELECT 1 FROM information_schema.SCHEMATA WHERE schema_name = '$db_name'), 'true', 'false') AS result";
|
||||
if ($config['mysqli']) {
|
||||
if ($config['mysqli']) {
|
||||
$exist_db = mysqli_fetch_assoc(mysqli_query($connection_test, $query))['result'];
|
||||
} else {
|
||||
$exist_db = mysql_fetch_assoc(mysqli_query($connection_test, $query))['result'];
|
||||
|
@ -204,7 +197,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
|
|||
ui_print_error_message(__("There was a problem during verification of the existence of the `$db_name` table"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ($exist_db == 'true') {
|
||||
ui_print_error_message(__("The testing DB `$db_name` already exists"));
|
||||
return;
|
||||
|
@ -231,13 +224,13 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
|
|||
|
||||
if (check_ref_privileges($connection_test) == 0) {
|
||||
drop_database($connection_test, $db_name);
|
||||
ui_print_error_message(__("Unable to <b>create references</b> with the provided user please check its privileges"));
|
||||
ui_print_error_message(__('Unable to <b>create references</b> with the provided user please check its privileges'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (check_explain_privileges($connection_test) == 0) {
|
||||
drop_database($connection_test, $db_name);
|
||||
ui_print_error_message(__("Unable to <b>explain</b> with the provided user please check its privileges"));
|
||||
ui_print_error_message(__('Unable to <b>explain</b> with the provided user please check its privileges'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -261,7 +254,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
|
|||
if (!$install_tables) {
|
||||
ui_print_error_message(__('Unsuccessful installed tables into the testing DB'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
extension_db_check_tables_differences(
|
||||
$connection_test,
|
||||
|
@ -269,7 +262,7 @@ function extension_db_status_execute_checks($db_user, $db_password, $db_host, $d
|
|||
$db_name,
|
||||
$config['dbname']
|
||||
);
|
||||
|
||||
|
||||
drop_database($connection_test, $db_name);
|
||||
}
|
||||
|
||||
|
@ -348,7 +341,7 @@ function extension_db_check_tables_differences(
|
|||
if ($config['mysqli'] === true) {
|
||||
mysqli_select_db($connection_test, $db_name_test);
|
||||
$result = mysqli_query($connection_test, 'SHOW CREATE TABLE '.$table);
|
||||
$create_query = mysqli_fetch_assoc($result)["Create Table"];
|
||||
$create_query = mysqli_fetch_assoc($result)['Create Table'];
|
||||
mysqli_free_result($result);
|
||||
ui_print_info_message(
|
||||
__('You can execute this SQL query for to fix.').'<br />'.'<pre>'.$create_query.'</pre>'
|
||||
|
@ -356,7 +349,7 @@ function extension_db_check_tables_differences(
|
|||
} else {
|
||||
mysql_select_db($db_name_test, $connection_test);
|
||||
$result = mysql_query('SHOW CREATE TABLE '.$table, $connection_test);
|
||||
$create_query = mysqli_fetch_assoc($result)["Create Table"];
|
||||
$create_query = mysqli_fetch_assoc($result)['Create Table'];
|
||||
mysql_free_result($result);
|
||||
ui_print_info_message(
|
||||
__('You can execute this SQL query for to fix.').'<br />'.'<pre>'.$create_query.'</pre>'
|
||||
|
@ -539,6 +532,7 @@ function extension_db_status_execute_sql_file($url, $connection)
|
|||
} else {
|
||||
$result = mysql_query($query, $connection);
|
||||
}
|
||||
|
||||
if (!$result) {
|
||||
echo mysqli_error($connection);
|
||||
// Uncomment for debug
|
||||
|
@ -563,19 +557,19 @@ function check_explain_privileges($connection)
|
|||
global $config;
|
||||
$has_privileges = 1;
|
||||
|
||||
$explain_check= "EXPLAIN tb1";
|
||||
$explain_check = 'EXPLAIN tb1';
|
||||
|
||||
$create_tb1= "CREATE TABLE tb1 (
|
||||
$create_tb1 = 'CREATE TABLE tb1 (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY
|
||||
)";
|
||||
)';
|
||||
|
||||
drop_database($connection, 'pandora_tmp_privilege_check');
|
||||
|
||||
try {
|
||||
if ($config['mysqli']) {
|
||||
mysqli_query($connection, "CREATE DATABASE `pandora_tmp_privilege_check`");
|
||||
mysqli_query($connection, 'CREATE DATABASE `pandora_tmp_privilege_check`');
|
||||
} else {
|
||||
mysql_query("CREATE DATABASE `pandora_tmp_privilege_check`", $connection);
|
||||
mysql_query('CREATE DATABASE `pandora_tmp_privilege_check`', $connection);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
ui_print_error_message(__('There was an error creating the DB during reference check'));
|
||||
|
@ -584,9 +578,9 @@ function check_explain_privileges($connection)
|
|||
|
||||
try {
|
||||
if ($config['mysqli'] === true) {
|
||||
mysqli_select_db($connection, "pandora_tmp_privilege_check");
|
||||
mysqli_select_db($connection, 'pandora_tmp_privilege_check');
|
||||
} else {
|
||||
mysql_select_db("reference_check", $connection);
|
||||
mysql_select_db('reference_check', $connection);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
ui_print_error_message(__('There was an error selecting the DB during reference check'));
|
||||
|
@ -600,8 +594,8 @@ function check_explain_privileges($connection)
|
|||
$result = mysql_query($create_tb1, $connection);
|
||||
}
|
||||
|
||||
if(!$result){
|
||||
throw new Exception("Error on explain check: " . $connection->error);
|
||||
if (!$result) {
|
||||
throw new Exception('Error on explain check: '.$connection->error);
|
||||
}
|
||||
|
||||
if ($config['mysqli'] === true) {
|
||||
|
@ -610,10 +604,9 @@ function check_explain_privileges($connection)
|
|||
$result = mysql_query($explain_check, $connection);
|
||||
}
|
||||
|
||||
if(!$result){
|
||||
throw new Exception("Error on explain check: " . $connection->error);
|
||||
if (!$result) {
|
||||
throw new Exception('Error on explain check: '.$connection->error);
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
$has_privileges = 0;
|
||||
} finally {
|
||||
|
@ -630,31 +623,31 @@ function check_drop_privileges($connection)
|
|||
|
||||
try {
|
||||
if ($config['mysqli']) {
|
||||
$create_db = mysqli_query($connection, "CREATE DATABASE IF NOT EXISTS`pandora_tmp_privilege_check`");
|
||||
$create_db = mysqli_query($connection, 'CREATE DATABASE IF NOT EXISTS`pandora_tmp_privilege_check`');
|
||||
} else {
|
||||
$create_db = mysql_query("CREATE DATABASE IF NOT EXISTS `pandora_tmp_privilege_check`", $connection);
|
||||
$create_db = mysql_query('CREATE DATABASE IF NOT EXISTS `pandora_tmp_privilege_check`', $connection);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$error_message = $e->getMessage();
|
||||
}
|
||||
|
||||
if (!$create_db) {
|
||||
if (stripos($error_message, "access denied for user") !== false) {
|
||||
if (stripos($error_message, 'access denied for user') !== false) {
|
||||
preg_match("/'.+?'\@'.+?'/", $error_message, $error_user);
|
||||
$error_user = $error_user[0];
|
||||
ui_print_error_message(__("Unable to <b>create databases</b> with the provided user please check its privileges"));
|
||||
ui_print_error_message(__('Unable to <b>create databases</b> with the provided user please check its privileges'));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ui_print_error_message(__('There was an error creating the DB during drop check'));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if ($config['mysqli'] === true) {
|
||||
mysqli_select_db($connection, "pandora_tmp_privilege_check");
|
||||
mysqli_select_db($connection, 'pandora_tmp_privilege_check');
|
||||
} else {
|
||||
mysql_select_db("reference_check", $connection);
|
||||
mysql_select_db('reference_check', $connection);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
ui_print_error_message(__('There was an error selecting the DB during drop check'));
|
||||
|
@ -666,9 +659,7 @@ function check_drop_privileges($connection)
|
|||
} catch (Exception $e) {
|
||||
$has_privileges = 0;
|
||||
ui_print_error_message(
|
||||
__("Unable to <b>drop databases</b> with the provided user please check its privileges.") .
|
||||
"<br>" .
|
||||
__("Test databases may have been left over due to lack of drop privileges.")
|
||||
__('Unable to <b>drop databases</b> with the provided user please check its privileges.').'<br>'.__('Test databases may have been left over due to lack of drop privileges.')
|
||||
);
|
||||
} finally {
|
||||
return $has_privileges;
|
||||
|
@ -683,21 +674,21 @@ function check_ref_privileges($connection)
|
|||
|
||||
drop_database($connection, 'pandora_tmp_privilege_check');
|
||||
|
||||
$create_tb1= "CREATE TABLE tb1 (
|
||||
$create_tb1 = 'CREATE TABLE tb1 (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY
|
||||
)";
|
||||
)';
|
||||
|
||||
$create_tb2 = "CREATE TABLE tb2 (
|
||||
$create_tb2 = 'CREATE TABLE tb2 (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
id_tb1 INT,
|
||||
FOREIGN KEY (id_tb1) REFERENCES tb2(id)
|
||||
)";
|
||||
|
||||
)';
|
||||
|
||||
try {
|
||||
if ($config['mysqli']) {
|
||||
mysqli_query($connection, "CREATE DATABASE `pandora_tmp_privilege_check`");
|
||||
mysqli_query($connection, 'CREATE DATABASE `pandora_tmp_privilege_check`');
|
||||
} else {
|
||||
mysql_query("CREATE DATABASE `pandora_tmp_privilege_check`", $connection);
|
||||
mysql_query('CREATE DATABASE `pandora_tmp_privilege_check`', $connection);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
ui_print_error_message(__('There was an error creating the DB during reference check'));
|
||||
|
@ -706,9 +697,9 @@ function check_ref_privileges($connection)
|
|||
|
||||
try {
|
||||
if ($config['mysqli'] === true) {
|
||||
mysqli_select_db($connection, "pandora_tmp_privilege_check");
|
||||
mysqli_select_db($connection, 'pandora_tmp_privilege_check');
|
||||
} else {
|
||||
mysql_select_db("reference_check", $connection);
|
||||
mysql_select_db('reference_check', $connection);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
ui_print_error_message(__('There was an error selecting the DB during reference check'));
|
||||
|
@ -722,8 +713,8 @@ function check_ref_privileges($connection)
|
|||
$result = mysql_query($create_tb1, $connection);
|
||||
}
|
||||
|
||||
if(!$result){
|
||||
throw new Exception("Error on reference check: " . $connection->error);
|
||||
if (!$result) {
|
||||
throw new Exception('Error on reference check: '.$connection->error);
|
||||
}
|
||||
|
||||
if ($config['mysqli'] === true) {
|
||||
|
@ -732,10 +723,9 @@ function check_ref_privileges($connection)
|
|||
$result = mysql_query($create_tb2, $connection);
|
||||
}
|
||||
|
||||
if(!$result){
|
||||
throw new Exception("Error on reference check: " . $connection->error);
|
||||
if (!$result) {
|
||||
throw new Exception('Error on reference check: '.$connection->error);
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
$has_privileges = 0;
|
||||
} finally {
|
||||
|
|
|
@ -55,7 +55,7 @@ switch ($graph) {
|
|||
if ($os == 'windows') {
|
||||
$data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(httpd)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."');
|
||||
} else {
|
||||
$apache = exec("ps aux | grep apache2 | grep -v safe | grep -v grep && echo 1 || echo 0") == 1 ? "apache2" : "apache";
|
||||
$apache = exec('ps aux | grep apache2 | grep -v safe | grep -v grep && echo 1 || echo 0') == 1 ? 'apache2' : 'apache';
|
||||
$data = exec("ps aux | grep $apache | grep -v safe | grep -v grep | awk '{ sum+=$3 } END { print sum }'");
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
pandorafms.vmware=3d1785e1baa07db0a40b9e47bb30472c
|
||||
pandorafms.vmware=999bbda7bbcc313aee81d6816f8a5c0e
|
||||
pandorafms.mysql=33d470c7492214d4b384ed307e81adf4
|
||||
pandorafms.vmware=1deafce1d55d3574645d8b136104e9ad
|
||||
pandorafms.mysql=ca7dd8b80a1a03a25eb0fb077818ad63
|
||||
|
|
|
@ -7754,4 +7754,14 @@ ALTER TABLE `tdeployment_hosts` DROP COLUMN `arch`;
|
|||
-- Update all deployment recon tasks port
|
||||
UPDATE `trecon_task` SET `field4` = 41121 WHERE `type` = 9;
|
||||
|
||||
-- Update execution in proxmox discovery plugin
|
||||
SET @short_name = 'pandorafms.proxmox';
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
UPDATE `tdiscovery_apps_executions` SET `execution` = ''_exec1_' --conf '_tempfileProxmox_'' WHERE `id_app` = @id_app;
|
||||
|
||||
INSERT INTO `tconfig` (`token`, `value`) VALUES ('JWT_signature', 1);
|
||||
DELETE FROM tconfig WHERE `token` = 'loginhash_pwd';
|
||||
|
||||
UPDATE `tdiscovery_apps` SET `version` = '1.5' WHERE `short_name` = 'pandorafms.vmware';
|
||||
|
||||
COMMIT;
|
|
@ -363,20 +363,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$display_counter = 'display:none';
|
||||
}
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$header_setup .= '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general').'">';
|
||||
$header_setup .= html_print_image(
|
||||
'images/configuration@svg.svg',
|
||||
true,
|
||||
[
|
||||
'alt' => __('Setup'),
|
||||
'class' => 'bot invert_filter main_menu_icon',
|
||||
'title' => __('Setup'),
|
||||
]
|
||||
);
|
||||
$header_setup .= '</a></div>';
|
||||
}
|
||||
|
||||
$header_autorefresh = '<div id="header_autorefresh">';
|
||||
$header_autorefresh .= $autorefresh_link_open_img;
|
||||
$header_autorefresh .= $autorefresh_img;
|
||||
|
@ -391,6 +377,20 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$header_autorefresh_counter .= '</div>';
|
||||
}
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$header_setup .= '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general').'">';
|
||||
$header_setup .= html_print_image(
|
||||
'images/configuration@svg.svg',
|
||||
true,
|
||||
[
|
||||
'alt' => __('Setup'),
|
||||
'class' => 'bot invert_filter main_menu_icon',
|
||||
'title' => __('Setup'),
|
||||
]
|
||||
);
|
||||
$header_setup .= '</a></div>';
|
||||
}
|
||||
|
||||
$modal_box = '<div id="modal_help" class="invisible">
|
||||
<div id="modal-feedback-form" class="invisible"></div>
|
||||
<div id="msg-header" class="invisible"></div>
|
||||
|
|
|
@ -763,7 +763,7 @@ if ($agents !== false) {
|
|||
$agent['id_agente']
|
||||
);
|
||||
$agentViewUrl = sprintf(
|
||||
'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=%s',
|
||||
'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&id_agente=%s',
|
||||
$agent['id_agente']
|
||||
);
|
||||
$agentAlertUrl = sprintf(
|
||||
|
|
|
@ -906,7 +906,8 @@ $table->data[0][] = html_print_label_input_block(
|
|||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
$disabled_in_execution,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -939,8 +940,9 @@ $table->data[1][] = html_print_label_input_block(
|
|||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
'w100p',
|
||||
$disabled_in_execution,
|
||||
'width: 100%;'
|
||||
).ui_print_input_placeholder(
|
||||
__('Quiet: Modules will not generate events or fire alerts.').'<br>'.__('Disable Agents: Disables the selected agents.').'<br>'.__('Disable Alerts: Disable alerts for the selected agents.'),
|
||||
true
|
||||
|
@ -964,7 +966,8 @@ $table->data[2][] = html_print_label_input_block(
|
|||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
$disabled_in_execution,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -294,10 +294,14 @@ $(document).ready (function () {
|
|||
// configure your validation
|
||||
$("form.add_alert_form").validate({
|
||||
rules: {
|
||||
id_agent_module: { valueNotEquals: "0" }
|
||||
id_agent_module: { valueNotEquals: "0" },
|
||||
template: { valueNotEquals: "0" },
|
||||
id_agent: { valueNotEquals: "" },
|
||||
},
|
||||
messages: {
|
||||
id_agent_module: { valueNotEquals: "Please select an item!" }
|
||||
id_agent_module: { valueNotEquals: "<?php echo __('Please select an item'); ?>!"},
|
||||
template: { valueNotEquals: "<?php echo __('Please select a templete'); ?>!"},
|
||||
id_agent: { valueNotEquals: "<?php echo __('Please select an agent'); ?>!"},
|
||||
}
|
||||
});
|
||||
$("select#template").change (function () {
|
||||
|
|
|
@ -220,7 +220,6 @@ if ($create_alert) {
|
|||
if (is_metaconsole()) {
|
||||
// Restore db connection.
|
||||
metaconsole_restore_db();
|
||||
echo '<script>window.location.assign("index.php?sec=estado&sec2=operation/agentes/alerts_status")</script>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -473,6 +473,13 @@ if ($access_console_node === true) {
|
|||
enterprise_hook('translate_string_submenu');
|
||||
|
||||
$menu_godmode['gsetup']['sub'] = $sub;
|
||||
} else if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
$menu_godmode['gservers']['text'] = __('Servers');
|
||||
$menu_godmode['gservers']['sec2'] = 'godmode/servers/modificar_server';
|
||||
$menu_godmode['gservers']['id'] = 'god-servers';
|
||||
$sub = [];
|
||||
enterprise_hook('manage_satellite_submenu');
|
||||
$menu_godmode['gservers']['sub'] = $sub;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -154,14 +154,16 @@ $table->data[0][1] = html_print_label_input_block(
|
|||
echo '<span id ="none_text" class="invisible">'.__('None').'</span>';
|
||||
echo "<form id='agentmodules' method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&add_module=1&edit_graph=1&id=".$id_graph."'>";
|
||||
|
||||
echo "<table width='100%' cellpadding='4' cellpadding='4' class='databox filters max_floating_element_size'>";
|
||||
echo "<table width='100%' cellpadding='4' cellpadding='4' class='databox filters max_floating_element_size custom-graph-editor'>";
|
||||
echo '<tr>';
|
||||
echo '<td class="w50p pdd_50px" id="select_multiple_modules_filtered">'.html_print_input(
|
||||
[
|
||||
'type' => 'select_multiple_modules_filtered',
|
||||
'uniqId' => 'modules',
|
||||
'class' => 'flex flex-row',
|
||||
'searchBar' => false,
|
||||
'searchBar' => true,
|
||||
'searchBarAgents' => false,
|
||||
'searchBarModules' => true,
|
||||
'placeholderAgents' => __('Search agent name'),
|
||||
]
|
||||
).'</td>';
|
||||
|
|
|
@ -6645,26 +6645,6 @@ function create_custom_graph() {
|
|||
$("#meta_target_servers").css('display', 'inline');
|
||||
}
|
||||
else {
|
||||
var hash_data;
|
||||
var params1 = [];
|
||||
params1.push("get_metaconsole_hash_data=1");
|
||||
params1.push("server_name=" + target_server);
|
||||
params1.push("page=include/ajax/reporting.ajax");
|
||||
jQuery.ajax ({
|
||||
data: params1.join ("&"),
|
||||
type: 'POST',
|
||||
url: action=
|
||||
<?php
|
||||
echo '"'.ui_get_full_url(false, false, false, false).'"';
|
||||
?>
|
||||
+ "/ajax.php",
|
||||
async: false,
|
||||
timeout: 10000,
|
||||
success: function (data) {
|
||||
hash_data = data;
|
||||
}
|
||||
});
|
||||
|
||||
var server_url;
|
||||
var params1 = [];
|
||||
params1.push("get_metaconsole_server_url=1");
|
||||
|
@ -6690,7 +6670,7 @@ function create_custom_graph() {
|
|||
}
|
||||
});
|
||||
|
||||
window.location.href = server_url + "/index.php?sec=reporting&sec2=godmode/reporting/graph_builder&create=Create graph" + hash_data;
|
||||
redirectNode(server_url + "/index.php?sec=reporting&sec2=godmode/reporting/graph_builder&create=Create graph", "_self");
|
||||
}
|
||||
<?php
|
||||
} else {
|
||||
|
@ -6719,31 +6699,6 @@ function edit_custom_graph() {
|
|||
id_server = agent_server_temp[1];
|
||||
}
|
||||
|
||||
var hash_data;
|
||||
var params1 = [];
|
||||
params1.push("get_metaconsole_hash_data=1");
|
||||
params1.push("server_name=" + id_server);
|
||||
params1.push("page=include/ajax/reporting.ajax");
|
||||
jQuery.ajax ({
|
||||
data: params1.join ("&"),
|
||||
type: 'POST',
|
||||
url: action=
|
||||
<?php
|
||||
echo '"'.ui_get_full_url(
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
).'"';
|
||||
?>
|
||||
+ "/ajax.php",
|
||||
async: false,
|
||||
timeout: 10000,
|
||||
success: function (data) {
|
||||
hash_data = data;
|
||||
}
|
||||
});
|
||||
|
||||
var server_url;
|
||||
var params1 = [];
|
||||
params1.push("get_metaconsole_server_url=1");
|
||||
|
@ -6769,7 +6724,7 @@ function edit_custom_graph() {
|
|||
}
|
||||
});
|
||||
|
||||
window.location.href = server_url + "index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id=" + id_element_graph + hash_data;
|
||||
redirectNode(server_url + "index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id=" + id_element_graph, "_self");
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
|
|
|
@ -870,7 +870,7 @@ switch ($action) {
|
|||
// ui_pagination($total_reports, $url, $offset, $pagination);
|
||||
$table = new stdClass();
|
||||
$table->id = 'report_list';
|
||||
$table->styleTable = 'margin: 0 10px;';
|
||||
$table->styleTable = '';
|
||||
$table->class = 'info_table';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
|
|
|
@ -260,9 +260,8 @@ $layoutSizeElements[] = html_print_button(
|
|||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'link',
|
||||
'value' => 'modsize',
|
||||
'class' => 'buttonButton mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -275,9 +274,8 @@ $layoutSizeElements[] = html_print_button(
|
|||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'link',
|
||||
'value' => 'modsize',
|
||||
'class' => 'buttonButton mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -287,7 +285,7 @@ $table->data[4][] = html_print_label_input_block(
|
|||
__('Layout size'),
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'flex flex-items-center',
|
||||
'class' => 'flex flex-space-around w600px',
|
||||
'content' => implode('', $layoutSizeElements),
|
||||
],
|
||||
true
|
||||
|
|
|
@ -34,7 +34,7 @@ require_once $config['homedir'].'/include/functions_graph.php';
|
|||
|
||||
check_login();
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ((bool) check_acl($config['id_user'], 0, 'AW') === true && $_GET['server_remote'] === null)) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Server Management'
|
||||
|
@ -286,19 +286,21 @@ if (isset($_GET['server']) === true) {
|
|||
$id_server
|
||||
);
|
||||
|
||||
$buttons = '';
|
||||
$buttons = [];
|
||||
|
||||
// Buttons.
|
||||
$buttons = [
|
||||
'standard_editor' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=standard_editor&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'</a>',
|
||||
],
|
||||
'advanced_editor' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=advanced_editor&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'</a>',
|
||||
],
|
||||
];
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$buttons = [
|
||||
'standard_editor' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=standard_editor&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'</a>',
|
||||
],
|
||||
'advanced_editor' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=advanced_editor&pure='.$pure.'">'.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'</a>',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
if ($server_type === SERVER_TYPE_ENTERPRISE_SATELLITE) {
|
||||
$buttons['agent_editor'] = [
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
|
||||
// Begin.
|
||||
require_once 'include/functions_clippy.php';
|
||||
require_once 'pending_alerts_list.php';
|
||||
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||
include 'pending_alerts_list.php';
|
||||
}
|
||||
|
||||
global $config;
|
||||
|
||||
|
|
|
@ -196,14 +196,20 @@ if (is_ajax() === true) {
|
|||
$row['name'] = __('Admin LDAP password');
|
||||
$row['control'] = html_print_input_password(
|
||||
'ldap_admin_pass',
|
||||
io_output_password($config['ldap_admin_pass']),
|
||||
(empty(io_output_password($config['ldap_admin_pass'])) === false) ? '*****' : '',
|
||||
$alt = '',
|
||||
60,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w400px-important'
|
||||
'w400px-important',
|
||||
'on',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data['ldap_admin_pass'] = $row;
|
||||
|
|
|
@ -267,18 +267,6 @@ $table->data[$i][] = html_print_label_input_block(
|
|||
);
|
||||
|
||||
$table->data[$i++][] = html_print_label_input_block(
|
||||
__('Auto login (hash) password'),
|
||||
html_print_input_password(
|
||||
'loginhash_pwd',
|
||||
io_output_password($config['loginhash_pwd']),
|
||||
'',
|
||||
15,
|
||||
15,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[$i][] = html_print_label_input_block(
|
||||
__('Time source'),
|
||||
html_print_select(
|
||||
$sources,
|
||||
|
|
|
@ -328,23 +328,6 @@ if (check_login()) {
|
|||
if (isset($array_nodes) && is_array($array_nodes)) {
|
||||
$hash_array_nodes = [];
|
||||
foreach ($array_nodes as $key => $server) {
|
||||
$pwd = $server['auth_token'];
|
||||
$auth_serialized = json_decode($pwd, true);
|
||||
|
||||
if (is_array($auth_serialized)) {
|
||||
$pwd = $auth_serialized['auth_token'];
|
||||
$api_password = $auth_serialized['api_password'];
|
||||
$console_user = $auth_serialized['console_user'];
|
||||
$console_password = $auth_serialized['console_password'];
|
||||
}
|
||||
|
||||
$user = $config['id_user'];
|
||||
$user_rot13 = str_rot13($config['id_user']);
|
||||
$hashdata = $user.$pwd;
|
||||
$hashdata = md5($hashdata);
|
||||
$url_hash = '&loginhash=auto&loginhash_data='.$hashdata.'&loginhash_user='.$user_rot13;
|
||||
|
||||
$hash_array_nodes[$server['id']]['hashurl'] = $url_hash;
|
||||
$hash_array_nodes[$server['id']]['server_url'] = $server['server_url'];
|
||||
}
|
||||
}
|
||||
|
@ -355,7 +338,7 @@ if (check_login()) {
|
|||
$image_status = agents_get_image_status($values['status']);
|
||||
// Link nodes.
|
||||
if (is_metaconsole() === true) {
|
||||
$agent_link = '<a href="'.$hash_array_nodes[$values['id_tmetaconsole_setup']]['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$values['id_tagente'].$hash_array_nodes[$values['id_tmetaconsole_setup']]['hashurl'].'">';
|
||||
$agent_link = '<a href="#" onclick="redirectNode(\''.$hash_array_nodes[$values['id_tmetaconsole_setup']]['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$values['id_tagente'].'\')">';
|
||||
$agent_alias = ui_print_truncate_text(
|
||||
$values['alias'],
|
||||
'agent_small',
|
||||
|
|
|
@ -55,6 +55,7 @@ if (check_login()) {
|
|||
$get_id_tag = (bool) get_parameter('get_id_tag', 0);
|
||||
$get_type = (bool) get_parameter('get_type', 0);
|
||||
$list_modules = (bool) get_parameter('list_modules', 0);
|
||||
$list_snmp_modules = (bool) get_parameter('list_snmp_modules', 0);
|
||||
$get_agent_modules_json_by_name = (bool) get_parameter(
|
||||
'get_agent_modules_json_by_name',
|
||||
0
|
||||
|
@ -1538,6 +1539,133 @@ if (check_login()) {
|
|||
unset($table_data);
|
||||
}
|
||||
|
||||
if ($list_snmp_modules) {
|
||||
include_once $config['homedir'].'/include/functions_graph.php';
|
||||
$agent = get_parameter('agent');
|
||||
$id_agente = $agent;
|
||||
$paginate_module = false;
|
||||
if (isset($config['paginate_module']) === true) {
|
||||
$paginate_module = (bool) $config['paginate_module'];
|
||||
}
|
||||
|
||||
$network_interfaces_by_agents = agents_get_network_interfaces([$agent], false, $paginate_module, get_parameter('offset', 0));
|
||||
$count_network_incerfaces = agents_get_network_interfaces([$agent], false, false, 0, true);
|
||||
$network_interfaces = [];
|
||||
if (empty($network_interfaces_by_agents) === false && empty($network_interfaces_by_agents[$id_agente]) === false) {
|
||||
$network_interfaces = $network_interfaces_by_agents[$id_agente]['interfaces'];
|
||||
}
|
||||
|
||||
if (empty($network_interfaces) === false) {
|
||||
$table_interface = new stdClass();
|
||||
$table_interface->id = 'agent_interface_info';
|
||||
$table_interface->class = 'info_table';
|
||||
$table_interface->width = '100%';
|
||||
$table_interface->style = [];
|
||||
$table_interface->style['interface_event_graph'] = 'width: 35%;';
|
||||
|
||||
$table_interface->head = [];
|
||||
$options = [
|
||||
'class' => 'closed',
|
||||
'style' => 'cursor:pointer;',
|
||||
];
|
||||
$table_interface->data = [];
|
||||
$event_text_cont = 0;
|
||||
|
||||
foreach ($network_interfaces as $interface_name => $interface) {
|
||||
if (empty($interface['traffic']) === false) {
|
||||
$permission = check_acl_one_of_groups($config['id_user'], $all_groups, 'RR');
|
||||
|
||||
if ($permission) {
|
||||
$params = [
|
||||
'interface_name' => $interface_name,
|
||||
'agent_id' => $id_agente,
|
||||
'traffic_module_in' => $interface['traffic']['in'],
|
||||
'traffic_module_out' => $interface['traffic']['out'],
|
||||
];
|
||||
$params_json = json_encode($params);
|
||||
$params_encoded = base64_encode($params_json);
|
||||
$win_handle = dechex(crc32($interface['status_module_id'].$interface_name));
|
||||
$graph_link = "<a href=\"javascript:winopeng_var('operation/agentes/interface_traffic_graph_win.php?params=";
|
||||
$graph_link .= $params_encoded."','";
|
||||
$graph_link .= $win_handle."', 800, 480)\">";
|
||||
$graph_link .= html_print_image(
|
||||
'images/chart.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Interface traffic'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
} else {
|
||||
$graph_link = '';
|
||||
}
|
||||
} else {
|
||||
$graph_link = '';
|
||||
}
|
||||
|
||||
$content = [
|
||||
'id_agent_module' => $interface['status_module_id'],
|
||||
'id_group' => $id_group,
|
||||
'period' => SECONDS_1DAY,
|
||||
'time_from' => '00:00:00',
|
||||
'time_to' => '00:00:00',
|
||||
'sizeForTicks' => 250,
|
||||
'height_graph' => 40,
|
||||
[
|
||||
['id_agent_module' => $interface['status_module_id']],
|
||||
]
|
||||
];
|
||||
|
||||
$e_graph = \reporting_module_histogram_graph(
|
||||
['datetime' => time()],
|
||||
$content
|
||||
);
|
||||
|
||||
$sqlLast_contact = sprintf(
|
||||
'
|
||||
SELECT timestamp
|
||||
FROM tagente_estado
|
||||
WHERE id_agente_modulo = '.$interface['status_module_id']
|
||||
);
|
||||
|
||||
$last_contact = db_get_all_rows_sql($sqlLast_contact);
|
||||
$last_contact = array_shift($last_contact);
|
||||
$last_contact = array_shift($last_contact);
|
||||
|
||||
$data = [];
|
||||
$data['interface_name'] = '<strong>'.$interface_name.'</strong>';
|
||||
$data['interface_status'] = $interface['status_image'];
|
||||
$data['interface_graph'] = $graph_link;
|
||||
$data['interface_ip'] = $interface['ip'];
|
||||
$data['interface_mac'] = $interface['mac'];
|
||||
$data['last_contact'] = __('Last contact: ').$last_contact;
|
||||
$data['interface_event_graph'] = $e_graph['chart'];
|
||||
|
||||
$table_interface->data[] = $data;
|
||||
}
|
||||
|
||||
if ($paginate_module === true) {
|
||||
ui_pagination(
|
||||
$count_network_incerfaces,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
false,
|
||||
'offset',
|
||||
true,
|
||||
'',
|
||||
'change_page_snmp(offset_param)',
|
||||
[
|
||||
'count' => '',
|
||||
'offset' => 'offset_param',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
html_print_table($table_interface);
|
||||
}
|
||||
}
|
||||
|
||||
if ($get_type === true) {
|
||||
$id_module = (int) get_parameter('id_module');
|
||||
$module = modules_get_agentmodule($id_module);
|
||||
|
|
|
@ -37,7 +37,6 @@ $add_sla = get_parameter('add_sla', 0);
|
|||
$add_general = get_parameter('add_general', 0);
|
||||
$id = get_parameter('id', 0);
|
||||
$truncate_text = get_parameter('truncate_text', 0);
|
||||
$get_metaconsole_hash_data = get_parameter('get_metaconsole_hash_data', 0);
|
||||
$get_metaconsole_server_url = get_parameter('get_metaconsole_server_url', 0);
|
||||
$change_custom_fields_macros_report = (bool) get_parameter(
|
||||
'change_custom_fields_macros_report',
|
||||
|
@ -186,37 +185,6 @@ if ($truncate_text) {
|
|||
return ui_print_truncate_text($text, GENERIC_SIZE_TEXT, true, false);
|
||||
}
|
||||
|
||||
if ($get_metaconsole_hash_data) {
|
||||
$server_name = get_parameter('server_name');
|
||||
|
||||
enterprise_include_once('include/functions_metaconsole.php');
|
||||
|
||||
$server = enterprise_hook('metaconsole_get_connection', [$server_name]);
|
||||
|
||||
// Bad data
|
||||
if (empty($server)) {
|
||||
echo '';
|
||||
return;
|
||||
}
|
||||
|
||||
// Deserialization of auth_token
|
||||
$auth_serialized = json_decode($server['auth_token'], true);
|
||||
|
||||
$auth_token = '';
|
||||
|
||||
if (is_array($auth_serialized)) {
|
||||
$auth_token = $auth_serialized['auth_token'];
|
||||
$api_password = $auth_serialized['api_password'];
|
||||
$console_user = $auth_serialized['console_user'];
|
||||
$console_password = $auth_serialized['console_password'];
|
||||
}
|
||||
|
||||
$url_hash = metaconsole_get_servers_url_hash($server);
|
||||
|
||||
echo $url_hash;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($get_metaconsole_server_url) {
|
||||
$server_name = get_parameter('server_name');
|
||||
|
||||
|
|
|
@ -26,11 +26,14 @@
|
|||
* ============================================================================
|
||||
*/
|
||||
|
||||
global $config;
|
||||
require_once $config['homedir'].'/include/class/JWTRepository.class.php';
|
||||
|
||||
$list_user_tokens = (bool) get_parameter('list_user_tokens');
|
||||
$get_jwt_for_login = (bool) get_parameter('get_jwt_for_login', false);
|
||||
|
||||
// Tokens for api 2.0.
|
||||
if ($list_user_tokens === true) {
|
||||
global $config;
|
||||
|
||||
// Datatables offset, limit and order.
|
||||
$filter = get_parameter('filter', []);
|
||||
$page = (int) get_parameter('start', 0);
|
||||
|
@ -162,3 +165,20 @@ if ($list_user_tokens === true) {
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Token for JWT auth in metaconsole.
|
||||
if ($get_jwt_for_login === true) {
|
||||
if (is_metaconsole() === true
|
||||
&& ((bool) users_is_admin($config['id_user']) === true || (bool) can_user_access_node() === true)
|
||||
&& empty($config['JWT_signature']) === false
|
||||
) {
|
||||
$jwtRepository = new JWTRepository($config['JWT_signature']);
|
||||
$token = $jwtRepository->create();
|
||||
echo json_encode(['success' => true, 'data' => $token]);
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'error' => 'User does not have permission or is not a metaconsole.']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,225 @@
|
|||
<?php
|
||||
/**
|
||||
* Class to JWT.
|
||||
*
|
||||
* @category Class
|
||||
* @package Pandora FMS
|
||||
* @subpackage Token
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ 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.
|
||||
use Lcobucci\JWT\Configuration;
|
||||
use Lcobucci\JWT\Encoding\JoseEncoder;
|
||||
use Lcobucci\JWT\Signer\Hmac\Sha256;
|
||||
use Lcobucci\JWT\Signer\Key\InMemory;
|
||||
use Lcobucci\JWT\Token\Parser;
|
||||
use Lcobucci\JWT\Validation\Constraint\SignedWith;
|
||||
use Lcobucci\Clock\SystemClock;
|
||||
use Lcobucci\JWT\Validation\Constraint\StrictValidAt;
|
||||
enterprise_include_once('include/functions_metaconsole.php');
|
||||
|
||||
/**
|
||||
* JWT Repository.
|
||||
*/
|
||||
final class JWTRepository
|
||||
{
|
||||
|
||||
/**
|
||||
* Allowed methods to be called using AJAX request.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $AJAXMethods = ['create'];
|
||||
|
||||
/**
|
||||
* Signature
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $signature;
|
||||
|
||||
/**
|
||||
* Token
|
||||
*
|
||||
* @var Token
|
||||
*/
|
||||
private $token;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param string $_signature Signature of JWT.
|
||||
*/
|
||||
public function __construct(string $_signature)
|
||||
{
|
||||
$this->signature = $_signature;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if target method is available to be called using AJAX.
|
||||
*
|
||||
* @param string $method Target method.
|
||||
*
|
||||
* @return boolean True allowed, false not.
|
||||
*/
|
||||
public function ajaxMethod($method)
|
||||
{
|
||||
// Check access.
|
||||
check_login();
|
||||
|
||||
return in_array($method, $this->AJAXMethods);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create token
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function create(): string
|
||||
{
|
||||
global $config;
|
||||
try {
|
||||
$sha = new Sha256();
|
||||
$configJWT = Configuration::forSymmetricSigner(
|
||||
$sha,
|
||||
InMemory::plainText($this->signature)
|
||||
);
|
||||
|
||||
$now = new DateTimeImmutable();
|
||||
$token = $configJWT->builder()->issuedAt($now)->canOnlyBeUsedAfter($now)->expiresAt($now->modify('+1 minute'))->withClaim('id_user', $config['id_user'])->getToken($configJWT->signer(), $configJWT->signingKey());
|
||||
|
||||
return $token->toString();
|
||||
} catch (Exception $e) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validate a JWT, USE FIRST setToken().
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function validate():bool
|
||||
{
|
||||
try {
|
||||
$sha = new Sha256();
|
||||
$configJWT = Configuration::forSymmetricSigner(
|
||||
$sha,
|
||||
InMemory::plainText($this->signature)
|
||||
);
|
||||
$signed = new SignedWith($sha, InMemory::plainText($this->signature));
|
||||
$now = new DateTimeZone('UTC');
|
||||
$strictValid = new StrictValidAt(SystemClock::fromUTC());
|
||||
$constraints = [
|
||||
$signed,
|
||||
$strictValid,
|
||||
];
|
||||
return $configJWT->validator()->validate($this->token, ...$constraints);
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get payload of token.
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function payload():object
|
||||
{
|
||||
return $this->token->claims();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Setting token.
|
||||
*
|
||||
* @param string $tokenString String token to setting.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function setToken(string $tokenString):bool
|
||||
{
|
||||
try {
|
||||
$encoder = new JoseEncoder();
|
||||
$parser = new Parser($encoder);
|
||||
$this->token = $parser->parse($tokenString);
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate random signature.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function generateSignature(): string
|
||||
{
|
||||
return bin2hex(random_bytes(32));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sync the signature with nodes for jwt.
|
||||
*
|
||||
* @param string|null $signature Signature to send nodes.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function syncSignatureWithNodes(?string $signature):void
|
||||
{
|
||||
if (function_exists('metaconsole_get_servers') === true
|
||||
&& function_exists('metaconsole_push_conf_to_node') === true
|
||||
) {
|
||||
$sync_server = 0;
|
||||
$servers = metaconsole_get_servers();
|
||||
foreach ($servers as $server) {
|
||||
$ok_sync = metaconsole_push_conf_to_node(
|
||||
$server,
|
||||
[ 'JWT_signature' => $signature],
|
||||
true
|
||||
);
|
||||
|
||||
if ($ok_sync === true) {
|
||||
$sync_server++;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($servers) === true
|
||||
&& count($servers) === $sync_server
|
||||
&& count($servers) > 0
|
||||
) {
|
||||
config_update_value('JWT_signature', $signature, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -553,7 +553,6 @@ class SatelliteCollection extends HTML
|
|||
},
|
||||
datatype: "json",
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
showMsg(data);
|
||||
},
|
||||
error: function(e) {
|
||||
|
@ -596,7 +595,6 @@ class SatelliteCollection extends HTML
|
|||
},
|
||||
datatype: "json",
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
showMsg(data);
|
||||
},
|
||||
error: function(e) {
|
||||
|
@ -615,7 +613,7 @@ class SatelliteCollection extends HTML
|
|||
function showMsg(data) {
|
||||
var title = "<?php echo __('Success'); ?>";
|
||||
var dt_satellite_agents = $("#satellite_collections").DataTable();
|
||||
dt_<?php echo $this->tableId; ?>.draw(false);
|
||||
dt_satellite_agents.draw(false);
|
||||
|
||||
var text = '';
|
||||
var failed = 0;
|
||||
|
|
|
@ -22,7 +22,7 @@ use DI\ContainerBuilder;
|
|||
/*
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC240425';
|
||||
$build_version = 'PC240430';
|
||||
$pandora_version = 'v7.0NG.776';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -185,6 +185,7 @@ if (session_status() === PHP_SESSION_NONE) {
|
|||
|
||||
config_process_config();
|
||||
config_prepare_session();
|
||||
config_prepare_jwt_signature();
|
||||
|
||||
if ((bool) $config['console_log_enabled'] === true) {
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
|
|
@ -1544,7 +1544,9 @@ function agents_get_modules(
|
|||
$indexed=true,
|
||||
$get_not_init_modules=true,
|
||||
$force_tags=false,
|
||||
$filter_include_sql=true
|
||||
$filter_include_sql=true,
|
||||
$pagination=false,
|
||||
$offset=0,
|
||||
) {
|
||||
global $config;
|
||||
|
||||
|
@ -1717,7 +1719,17 @@ function agents_get_modules(
|
|||
$sql_tags_join,
|
||||
$where
|
||||
);
|
||||
$result = db_get_all_rows_sql($sql);
|
||||
|
||||
$limit = '';
|
||||
if ($pagination === true && isset($config['paginate_module']) === true) {
|
||||
if ($offset === 0) {
|
||||
$limit = ' LIMIT '.$config['block_size'].' OFFSET 0';
|
||||
} else {
|
||||
$limit = ' LIMIT '.$config['block_size'].' OFFSET '.$offset;
|
||||
}
|
||||
}
|
||||
|
||||
$result = db_get_all_rows_sql($sql.$limit);
|
||||
|
||||
if (empty($result)) {
|
||||
return [];
|
||||
|
@ -3333,7 +3345,7 @@ function agents_update_gis(
|
|||
*
|
||||
* @return array A list of network interfaces information by agents.
|
||||
*/
|
||||
function agents_get_network_interfaces($agents=false, $agents_filter=false)
|
||||
function agents_get_network_interfaces($agents=false, $agents_filter=false, $pagination=false, $offset=0, $count=false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
|
@ -3432,8 +3444,17 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
|
|||
$columns,
|
||||
$filter,
|
||||
true,
|
||||
false
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
$pagination,
|
||||
$offset
|
||||
);
|
||||
|
||||
if ($count === true) {
|
||||
return (count($modules) ?? 0);
|
||||
}
|
||||
|
||||
if (!empty($modules)) {
|
||||
$interfaces = [];
|
||||
|
||||
|
@ -4934,7 +4955,7 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||
$module_score = modules_get_agentmodule_id(io_safe_input('Hardening - Score'), $agent['id_agente']);
|
||||
$hardening = '';
|
||||
if (is_array($module_score) === true && key_exists('id_agente_modulo', $module_score) == true) {
|
||||
$raw_data_score = modules_get_raw_data($module_score['id_agente_modulo'], 0, time());
|
||||
$raw_data_score = modules_get_raw_data($module_score['id_agente_modulo'], 0, time(), false);
|
||||
$hardening = format_numeric($raw_data_score[0]['datos'], 2);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Hardening').'</b>';
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
// Config functions.
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
require_once __DIR__.'/functions.php';
|
||||
require_once __DIR__.'/class/JWTRepository.class.php';
|
||||
enterprise_include_once('include/functions_config.php');
|
||||
|
||||
use PandoraFMS\Core\DBMaintainer;
|
||||
|
@ -207,10 +208,6 @@ function config_update_config()
|
|||
$error_update[] = __('Chromium config directory');
|
||||
}
|
||||
|
||||
if (config_update_value('loginhash_pwd', (string) get_parameter('loginhash_pwd'), true, true) === false) {
|
||||
$error_update[] = __('Auto login (hash) password');
|
||||
}
|
||||
|
||||
if (config_update_value('timesource', (string) get_parameter('timesource'), true) === false) {
|
||||
$error_update[] = __('Time source');
|
||||
}
|
||||
|
@ -706,8 +703,10 @@ function config_update_config()
|
|||
$error_update[] = __('Admin LDAP login');
|
||||
}
|
||||
|
||||
if (config_update_value('ldap_admin_pass', get_parameter('ldap_admin_pass'), true, true) === false) {
|
||||
$error_update[] = __('Admin LDAP password');
|
||||
if ((bool) get_parameter('ldap_admin_pass_password_changed', false) === true) {
|
||||
if (config_update_value('ldap_admin_pass', get_parameter('ldap_admin_pass'), true, true) === false) {
|
||||
$error_update[] = __('Admin LDAP password');
|
||||
}
|
||||
}
|
||||
|
||||
if (config_update_value('ldap_search_timeout', (int) get_parameter('ldap_search_timeout', 5), true) === false) {
|
||||
|
@ -2224,10 +2223,6 @@ function config_process_config()
|
|||
config_update_value('events_per_query', 5000);
|
||||
}
|
||||
|
||||
if (!isset($config['loginhash_pwd'])) {
|
||||
config_update_value('loginhash_pwd', (rand(0, 1000) * rand(0, 1000)).'pandorahash', false, true);
|
||||
}
|
||||
|
||||
if (!isset($config['trap2agent'])) {
|
||||
config_update_value('trap2agent', 0);
|
||||
}
|
||||
|
@ -2491,6 +2486,10 @@ function config_process_config()
|
|||
config_update_value('number_modules_queue', 500);
|
||||
}
|
||||
|
||||
if (!isset($config['JWT_signature'])) {
|
||||
config_update_value('JWT_signature', 1);
|
||||
}
|
||||
|
||||
if (!isset($config['eastern_eggs_disabled'])) {
|
||||
config_update_value('eastern_eggs_disabled', 1);
|
||||
}
|
||||
|
@ -4224,3 +4223,13 @@ function config_prepare_session()
|
|||
ini_set('post_max_size', $config['max_file_size']);
|
||||
ini_set('upload_max_filesize', $config['max_file_size']);
|
||||
}
|
||||
|
||||
|
||||
function config_prepare_jwt_signature()
|
||||
{
|
||||
global $config;
|
||||
if (is_metaconsole() === true && $config['JWT_signature'] == 1) {
|
||||
$signature = JWTRepository::generateSignature();
|
||||
JWTRepository::syncSignatureWithNodes($signature);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4393,12 +4393,9 @@ function events_page_details($event, $server_id=0)
|
|||
global $config;
|
||||
|
||||
// If metaconsole switch to node to get details and custom fields.
|
||||
$hashstring = '';
|
||||
$serverstring = '';
|
||||
if (is_metaconsole() === true && empty($server_id) === false) {
|
||||
$server = metaconsole_get_connection_by_id($server_id);
|
||||
$hashdata = metaconsole_get_server_hashdata($server);
|
||||
$hashstring = '&loginhash=auto&loginhash_data='.$hashdata.'&loginhash_user='.str_rot13($config['id_user']);
|
||||
$serverstring = $server['server_url'].'/';
|
||||
|
||||
if (metaconsole_connect($server) !== NOERR) {
|
||||
|
@ -4439,28 +4436,7 @@ function events_page_details($event, $server_id=0)
|
|||
true
|
||||
).ui_print_help_tip(__('This agent belongs to metaconsole, is not possible display it'), true);
|
||||
} else if (can_user_access_node() && is_metaconsole()) {
|
||||
// Workaround to pass login hash data in POST body instead of directly in the URL.
|
||||
parse_str($hashstring, $url_hash_array);
|
||||
$redirection_form = "<form id='agent-redirection' method='POST' action='".$serverstring.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event['id_agente']."'>";
|
||||
$redirection_form .= html_print_input_hidden(
|
||||
'loginhash',
|
||||
$url_hash_array['loginhash'],
|
||||
true
|
||||
);
|
||||
$redirection_form .= html_print_input_hidden(
|
||||
'loginhash_data',
|
||||
$url_hash_array['loginhash_data'],
|
||||
true
|
||||
);
|
||||
$redirection_form .= html_print_input_hidden(
|
||||
'loginhash_user',
|
||||
$url_hash_array['loginhash_user'],
|
||||
true
|
||||
);
|
||||
$redirection_form .= '</form>';
|
||||
|
||||
$data[1] = $redirection_form;
|
||||
$data[1] .= "<a target=_blank onclick='event.preventDefault(); document.getElementById(\"agent-redirection\").submit();' href='#'>";
|
||||
$data[1] = '<a target=_blank onclick="redirectNode(\''.$serverstring.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event['id_agente'].'\')" href="#">';
|
||||
$data[1] .= '<b>'.$agent['alias'].'</b>';
|
||||
$data[1] .= '</a>';
|
||||
} else if (can_user_access_node()) {
|
||||
|
@ -4471,7 +4447,7 @@ function events_page_details($event, $server_id=0)
|
|||
'',
|
||||
false,
|
||||
$serverstring,
|
||||
$hashstring,
|
||||
'',
|
||||
$agent['alias']
|
||||
);
|
||||
} else {
|
||||
|
@ -4604,7 +4580,7 @@ function events_page_details($event, $server_id=0)
|
|||
'id_mg',
|
||||
$id_module_group
|
||||
);
|
||||
$data[1] = '<a href="'.$serverstring.'index.php?sec=view&sec2=operation/agentes/status_monitor&status=-1&modulegroup='.$id_module_group.$hashstring.'">';
|
||||
$data[1] = '<a href="#" onclick="redirectNode(\''.$serverstring.'index.php?sec=view&sec2=operation/agentes/status_monitor&status=-1&modulegroup='.$id_module_group.'\')">';
|
||||
$data[1] .= $module_group;
|
||||
$data[1] .= '</a>';
|
||||
}
|
||||
|
@ -4670,7 +4646,7 @@ function events_page_details($event, $server_id=0)
|
|||
if ($event['id_alert_am'] != 0) {
|
||||
$data = [];
|
||||
$data[0] = '<div class="normal_weight mrgn_lft_20px">'.__('Source').'</div>';
|
||||
$data[1] = '<a href="'.$serverstring.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event['id_agente'].'&tab=alert'.$hashstring.'">';
|
||||
$data[1] = '<a href="#" onclick="redirectNode(\''.$serverstring.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$event['id_agente'].'&tab=alert\')">';
|
||||
$standby = db_get_value('standby', 'talert_template_modules', 'id', $event['id_alert_am']);
|
||||
if (!$standby) {
|
||||
$data[1] .= html_print_image(
|
||||
|
|
|
@ -1032,7 +1032,7 @@ function filemanager_file_explorer(
|
|||
false,
|
||||
'show_form_create_folder()',
|
||||
[
|
||||
'class' => 'margin-right-2 invert_filter secondary',
|
||||
'class' => 'margin-right-2 primary buttonButton',
|
||||
'icon' => 'create_directory',
|
||||
],
|
||||
true,
|
||||
|
@ -1047,7 +1047,7 @@ function filemanager_file_explorer(
|
|||
false,
|
||||
'show_create_text_file()',
|
||||
[
|
||||
'class' => 'margin-right-2 invert_filter secondary',
|
||||
'class' => 'margin-right-2 primary buttonButton',
|
||||
'icon' => 'create_file',
|
||||
],
|
||||
true,
|
||||
|
@ -1061,7 +1061,7 @@ function filemanager_file_explorer(
|
|||
false,
|
||||
'show_upload_file()',
|
||||
[
|
||||
'class' => 'margin-right-2 invert_filter secondary',
|
||||
'class' => 'margin-right-2 primary buttonButton',
|
||||
'icon' => 'upload_file',
|
||||
],
|
||||
true,
|
||||
|
|
|
@ -1686,34 +1686,56 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||
);
|
||||
$output .= '</div>';
|
||||
|
||||
$agent_class = '';
|
||||
if (empty($data['searchBar']) === false && $data['searchBar'] === true) {
|
||||
$output .= '<div>';
|
||||
$output .= '<div class="agents-modules-multiple-search-bar">';
|
||||
|
||||
$output .= '<div>';
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'text',
|
||||
'name' => 'agent-searchBar-'.$uniqId,
|
||||
'onKeyUp' => 'searchAgent(\''.$uniqId.'\')',
|
||||
'placeholder' => __('Type to search agents'),
|
||||
'return' => true,
|
||||
]
|
||||
);
|
||||
if (isset($data['searchBarAgents']) === false) {
|
||||
$data['searchBarAgents'] = true;
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
if (isset($data['searchBarModules']) === false) {
|
||||
$data['searchBarModules'] = true;
|
||||
}
|
||||
|
||||
$output .= '<div>';
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'text',
|
||||
'name' => 'module-searchBar-'.$uniqId,
|
||||
'onKeyUp' => 'searchModule(\''.$uniqId.'\')',
|
||||
'return' => true,
|
||||
'placeholder' => __('Type to search modules'),
|
||||
]
|
||||
);
|
||||
if ($data['searchBarAgents'] === true) {
|
||||
$output .= '<div>';
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'text',
|
||||
'label_class' => 'font-title-font',
|
||||
'label' => __('Filter agent'),
|
||||
'name' => 'agent-searchBar-'.$uniqId,
|
||||
'onKeyUp' => 'searchAgent(\''.$uniqId.'\')',
|
||||
'placeholder' => __('Type to search agents'),
|
||||
'return' => true,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
$agent_class = 'custom-graph-editor-agents-module-filter';
|
||||
$output .= '<div></div>';
|
||||
}
|
||||
|
||||
if ($data['searchBarModules'] === true) {
|
||||
$output .= '<div>';
|
||||
$output .= html_print_input(
|
||||
[
|
||||
'type' => 'text',
|
||||
'label_class' => 'font-title-font',
|
||||
'label' => __('Filter module'),
|
||||
'name' => 'module-searchBar-'.$uniqId,
|
||||
'onKeyUp' => 'searchModule(\''.$uniqId.'\')',
|
||||
'return' => true,
|
||||
'placeholder' => __('Type to search modules'),
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
$output .= '<div></div>';
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
}
|
||||
|
@ -1770,6 +1792,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||
'style' => 'min-width: 200px;max-width:200px;',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '',
|
||||
'input_class' => $agent_class,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1786,6 +1809,7 @@ function html_print_select_multiple_modules_filtered(array $data):string
|
|||
'style' => 'min-width: 200px;max-width:200px;',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '',
|
||||
'input_class' => $agent_class,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -1929,7 +1953,7 @@ function html_print_select_multiple_modules_filtered_formated(array $data):strin
|
|||
'return' => true,
|
||||
'nothing' => __('All'),
|
||||
'nothing_value' => 0,
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().', true)',
|
||||
]
|
||||
);
|
||||
$output .= '</div>';
|
||||
|
@ -1965,7 +1989,7 @@ function html_print_select_multiple_modules_filtered_formated(array $data):strin
|
|||
'name' => 'filtered-module-show-common-modules-'.$uniqId,
|
||||
'id' => 'filtered-module-show-common-modules-'.$uniqId,
|
||||
'return' => true,
|
||||
'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
'onchange' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().', true)',
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -2053,7 +2077,7 @@ function html_print_select_multiple_modules_filtered_formated(array $data):strin
|
|||
'return' => true,
|
||||
'multiple' => true,
|
||||
'style' => 'min-width: 200px;max-width:200px;',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().', true)',
|
||||
'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '',
|
||||
'truncate_size' => 300,
|
||||
]
|
||||
|
@ -2070,7 +2094,7 @@ function html_print_select_multiple_modules_filtered_formated(array $data):strin
|
|||
'return' => true,
|
||||
'multiple' => true,
|
||||
'style' => 'min-width: 200px;max-width:200px;',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
|
||||
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().', true)',
|
||||
'placeholder' => (isset($data['placeholderAgents']) === true) ? $data['placeholderAgents'] : '',
|
||||
'truncate_size' => 300,
|
||||
]
|
||||
|
@ -3466,13 +3490,19 @@ function html_print_anchor(
|
|||
*
|
||||
* The element will have an id like: "password-$name"
|
||||
*
|
||||
* @param string $name Input name.
|
||||
* @param string $value Input value.
|
||||
* @param string $alt Alternative HTML string (optional).
|
||||
* @param integer $size Size of the input (optional).
|
||||
* @param integer $maxlength Maximum length allowed (optional).
|
||||
* @param boolean $return Whether to return an output string or echo now (optional, echo by default).
|
||||
* @param boolean $disabled Disable the button (optional, button enabled by default).
|
||||
* @param string $name Input name.
|
||||
* @param string $value Input value.
|
||||
* @param string $alt Alternative HTML string (optional).
|
||||
* @param integer $size Size of the input (optional).
|
||||
* @param integer $maxlength Maximum length allowed (optional).
|
||||
* @param boolean $return Whether to return an output string or echo now (optional, echo by default).
|
||||
* @param boolean $disabled Disable the button (optional, button enabled by default).
|
||||
* @param boolean $required Whether the input is required (optional, not required by default).
|
||||
* @param string $class Additional CSS classes for the input (optional).
|
||||
* @param string $autocomplete Autocomplete attribute value (optional, off by default).
|
||||
* @param boolean $hide_div_eye Whether to hide the div with the eye icon (optional, false by default).
|
||||
* @param string $div_class Additional CSS classes for the div (optional).
|
||||
* @param boolean $not_show_value Whether to not show the value in the input (optional, false by default), FOR USE THIS VALUE YOU NEED CONTROL THE INPUT 'password_changed'.
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
|
@ -3488,7 +3518,8 @@ function html_print_input_password(
|
|||
$class='',
|
||||
$autocomplete='off',
|
||||
$hide_div_eye=false,
|
||||
$div_class=''
|
||||
$div_class='',
|
||||
$not_show_value=false,
|
||||
) {
|
||||
if ($maxlength == 0) {
|
||||
$maxlength = 255;
|
||||
|
@ -3519,7 +3550,40 @@ function html_print_input_password(
|
|||
}
|
||||
}
|
||||
|
||||
return '<div class="relative container-div-input-password '.$div_class.'">'.html_print_input_text_extended($name, $value, 'password-'.$name, $alt, $size, $maxlength, $disabled, '', $attr, $return, true, '', $autocomplete, false, $hide_div_eye).'</div>';
|
||||
$extra_output = '';
|
||||
if ($not_show_value === true) {
|
||||
$unique_id = 'flag_password_'.uniqid();
|
||||
$extra_output = html_print_input_hidden($name.'_password_changed', 0, true, false, false, $unique_id);
|
||||
$attr['class'] .= ' bg-image-none';
|
||||
$extra_output .= '<script>
|
||||
$("#show-hide-password-'.$name.'").hide();
|
||||
const exist_'.$unique_id.' = '.((empty($value) === false) ? 'true' : 'false').';
|
||||
$("#password-'.$name.'").on("focus", function(e) {
|
||||
if ($("#'.$unique_id.'").val() === "0") {
|
||||
$(this).val("");
|
||||
}
|
||||
});
|
||||
|
||||
$("#password-'.$name.'").on("focusout", function(e) {
|
||||
if ($("#'.$unique_id.'").val() === "0" && $(this).val() === "" && exist_'.$unique_id.' === true) {
|
||||
$(this).val("*****");
|
||||
}
|
||||
});
|
||||
|
||||
$("#password-'.$name.'").on("keyup", function(e) {
|
||||
$("#'.$unique_id.'").val(1);
|
||||
if ($(this).val() === "") {
|
||||
$(this).addClass("bg-image-none");
|
||||
$("#show-hide-password-'.$name.'").hide();
|
||||
} else {
|
||||
$(this).removeClass("bg-image-none");
|
||||
$("#show-hide-password-'.$name.'").show();
|
||||
}
|
||||
});
|
||||
</script>';
|
||||
}
|
||||
|
||||
return '<div class="relative container-div-input-password '.$div_class.'">'.html_print_input_text_extended($name, $value, 'password-'.$name, $alt, $size, $maxlength, $disabled, '', $attr, $return, true, '', $autocomplete, false, $hide_div_eye).'</div>'.$extra_output;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -418,12 +418,10 @@ function inventory_get_data(
|
|||
|
||||
// Setting for link the agent with the proper server.
|
||||
if (is_metaconsole() === true && empty($node) === false) {
|
||||
$loginHash = metaconsole_get_servers_url_hash($node);
|
||||
$urlToAgent = sprintf(
|
||||
'%sindex.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=%s%s',
|
||||
'%sindex.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=%s',
|
||||
$node['server_url'],
|
||||
$row['id_agente'],
|
||||
$loginHash
|
||||
$row['id_agente']
|
||||
);
|
||||
} else {
|
||||
$urlToAgent = sprintf(
|
||||
|
@ -440,8 +438,9 @@ function inventory_get_data(
|
|||
|
||||
$table->data[$rowTable][0] = html_print_anchor(
|
||||
[
|
||||
'href' => $urlToAgent,
|
||||
'href' => (is_metaconsole() === true) ? '#' : $urlToAgent,
|
||||
'content' => '<strong>'.$agent_name.'</strong>',
|
||||
'onClick' => (is_metaconsole() === true) ? 'redirectNode(\''.$urlToAgent.'\')' : '',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -1196,7 +1195,7 @@ function get_inventory_basic_info_sql($params, $count=false)
|
|||
$result = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,6 +169,10 @@ function menu_print_menu(&$menu)
|
|||
$sec2 = 'godmode/users/profile_list';
|
||||
} else if ($sec2 === 'godmode/users/configure_token') {
|
||||
$sec2 = 'godmode/users/token_list';
|
||||
} else if ($sec2 === 'godmode/servers/modificar_server' && check_acl($config['id_user'], 0, 'AW') && (bool) check_acl($config['id_user'], 0, 'PM') === false) {
|
||||
$sec2 = 'enterprise/godmode/servers/list_satellite';
|
||||
} else if ($sec2 === 'enterprise/godmode/snmpconsole/snmp_trap_editor_form') {
|
||||
$sec2 = 'enterprise/godmode/snmpconsole/snmp_trap_editor';
|
||||
} else {
|
||||
$sec2 = (string) get_parameter('sec2');
|
||||
}
|
||||
|
|
|
@ -1148,12 +1148,12 @@ function modules_get_table_data(?int $id_agent_module, ?int $id_type)
|
|||
}
|
||||
|
||||
|
||||
function modules_get_raw_data($id_agent_module, $date_init, $date_end)
|
||||
function modules_get_raw_data($id_agent_module, $date_init, $date_end, $search_in_history_db=true)
|
||||
{
|
||||
$table = modules_get_table_data($id_agent_module, null);
|
||||
|
||||
$datelimit = ($date_init - $date_end);
|
||||
$search_in_history_db = db_search_in_history_db($datelimit);
|
||||
$search_in_history_db = (($search_in_history_db === true) ? db_search_in_history_db($datelimit) : false);
|
||||
|
||||
$data = db_get_all_rows_sql(
|
||||
'
|
||||
|
|
|
@ -773,13 +773,11 @@ function networkmap_create_agent_node(
|
|||
if (empty($server_data) === true) {
|
||||
$server_name = '';
|
||||
$server_id = '';
|
||||
$url_hash = '';
|
||||
$console_url = '';
|
||||
} else {
|
||||
$server_name = $server_data['server_name'];
|
||||
$server_id = $server_data['id'];
|
||||
$console_url = $server_data['server_url'].'/';
|
||||
$url_hash = metaconsole_get_servers_url_hash($server_data);
|
||||
}
|
||||
|
||||
// Set node status.
|
||||
|
@ -870,7 +868,7 @@ function networkmap_create_agent_node(
|
|||
}
|
||||
|
||||
if (can_user_access_node()) {
|
||||
$url_node_link = ', URL="'.$console_url.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].$url_hash.'"';
|
||||
$url_node_link = ', URL="'.$console_url.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'].'"';
|
||||
} else {
|
||||
$url_node_link = '';
|
||||
}
|
||||
|
|
|
@ -2736,7 +2736,8 @@ function reporting_event_report_module(
|
|||
$ttl,
|
||||
$id_server,
|
||||
$metaconsole_dbtable,
|
||||
$filter_event_filter_exclude
|
||||
$filter_event_filter_exclude,
|
||||
$content['id_agent_module']
|
||||
);
|
||||
|
||||
if (empty($data)) {
|
||||
|
@ -11728,7 +11729,8 @@ function reporting_get_module_detailed_event(
|
|||
$ttl=1,
|
||||
$id_server=false,
|
||||
$metaconsole_dbtable=false,
|
||||
$filter_event_filter_exclude=false
|
||||
$filter_event_filter_exclude=false,
|
||||
$id_agent=false
|
||||
) {
|
||||
global $config;
|
||||
|
||||
|
@ -11751,7 +11753,7 @@ function reporting_get_module_detailed_event(
|
|||
|
||||
foreach ($id_modules as $id_module) {
|
||||
$event['data'] = events_get_agent(
|
||||
false,
|
||||
$id_agent,
|
||||
(int) $period,
|
||||
(int) $date,
|
||||
$history,
|
||||
|
|
|
@ -4107,7 +4107,7 @@ function reporting_html_historical_data($table, $item, $pdf=0)
|
|||
|
||||
// Center every row
|
||||
foreach ($table1->data[0] as $k => $v) {
|
||||
for ($i = 0; $i < count($table1->data); $i++){
|
||||
for ($i = 0; $i < count($table1->data); $i++) {
|
||||
$table1->cellstyle[$i][$k] = 'text-align: center;';
|
||||
}
|
||||
}
|
||||
|
@ -4190,7 +4190,7 @@ function reporting_html_database_serialized($table, $item, $pdf=0)
|
|||
|
||||
// Center every row
|
||||
foreach ($table1->data[0] as $k => $v) {
|
||||
for ($i = 0; $i < count($table1->data); $i++){
|
||||
for ($i = 0; $i < count($table1->data); $i++) {
|
||||
$table1->cellstyle[$i][$k] = 'text-align: center;';
|
||||
}
|
||||
}
|
||||
|
@ -6435,7 +6435,7 @@ function reporting_html_sql($table, $item, $pdf=0)
|
|||
|
||||
// Center every row
|
||||
foreach ($table2->data[0] as $k => $v) {
|
||||
for ($i = 0; $i < count($table2->data); $i++){
|
||||
for ($i = 0; $i < count($table2->data); $i++) {
|
||||
$table2->cellstyle[$i][$k] = 'text-align: center;';
|
||||
}
|
||||
}
|
||||
|
@ -7886,6 +7886,12 @@ function reporting_html_ncm_list($table, $item, $pdf=0)
|
|||
*/
|
||||
function reporting_html_ncm_backups($table, $item, $pdf=0)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if ($config['style'] === 'pandora_black') {
|
||||
ui_require_css_file('pandora_black');
|
||||
}
|
||||
|
||||
ui_require_css_file('diff2html.min');
|
||||
ui_require_css_file('highlight.min');
|
||||
ui_require_css_file('highlight/vs.min');
|
||||
|
|
|
@ -18,13 +18,11 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
|
|||
if (empty($server_data)) {
|
||||
$server_name = '';
|
||||
$server_id = '';
|
||||
$url_hash = '';
|
||||
$console_url = ui_get_full_url('/');
|
||||
} else {
|
||||
$server_name = $server_data['server_name'];
|
||||
$server_id = $server_data['id'];
|
||||
$console_url = $server_data['server_url'].'/';
|
||||
$url_hash = metaconsole_get_servers_url_hash($server_data);
|
||||
}
|
||||
|
||||
include_once $config['homedir'].'/include/functions_agents.php';
|
||||
|
@ -69,10 +67,11 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
|
|||
$row['title'] = __('Name');
|
||||
$row['data'] = html_print_anchor(
|
||||
[
|
||||
'href' => $console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].$url_hash,
|
||||
'href' => '#',
|
||||
'title' => __('Click here for view this module'),
|
||||
'class' => 'font_11',
|
||||
'content' => $cellName,
|
||||
'onClick' => 'redirectNode(\''.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].'\');',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -325,45 +324,9 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
|
|||
echo '<div class="actions_treeview flex flex-evenly">';
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
echo "<form id='module-table-redirection' method='POST' action='".$console_url."index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module'>";
|
||||
|
||||
parse_str($url_hash, $url_hash_array);
|
||||
|
||||
html_print_input_hidden(
|
||||
'id_agente',
|
||||
$module['id_agente'],
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'edit_module',
|
||||
1,
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'id_agent_module',
|
||||
$module['id_agente_modulo'],
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'loginhash',
|
||||
$url_hash_array['loginhash'],
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'loginhash_data',
|
||||
$url_hash_array['loginhash_data'],
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'loginhash_user',
|
||||
$url_hash_array['loginhash_user'],
|
||||
false
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
echo "<a target=_blank onclick='event.preventDefault(); document.getElementById(\"module-table-redirection\").submit();' href='#'>";
|
||||
echo '<a target=_blank onclick="redirectNode(\''.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&edit_module=1&id_agente='.$module['id_agente'].'&id_agent_module='.$module['id_agente_modulo'].'\')" href="#">';
|
||||
} else {
|
||||
echo '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].$url_hash.'">';
|
||||
echo '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].'">';
|
||||
}
|
||||
|
||||
html_print_submit_button(
|
||||
|
@ -399,13 +362,11 @@ function treeview_printAlertsTable($id_module, $server_data=[], $no_head=false)
|
|||
if (empty($server_data)) {
|
||||
$server_name = '';
|
||||
$server_id = '';
|
||||
$url_hash = '';
|
||||
$console_url = '';
|
||||
} else {
|
||||
$server_name = $server_data['server_name'];
|
||||
$server_id = $server_data['id'];
|
||||
$console_url = $server_data['server_url'].'/';
|
||||
$url_hash = metaconsole_get_servers_url_hash($server_data);
|
||||
}
|
||||
|
||||
$user_access_node = can_user_access_node();
|
||||
|
@ -512,7 +473,7 @@ function treeview_printAlertsTable($id_module, $server_data=[], $no_head=false)
|
|||
__('Go to alerts edition'),
|
||||
'upd_button',
|
||||
false,
|
||||
'window.location.assign("'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name='.$module_name.'&id_agente='.$agent_id.$url_hash.'")',
|
||||
'redirectNode("'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name='.$module_name.'&id_agente='.$agent_id.'")',
|
||||
['icon' => 'alert'],
|
||||
true
|
||||
),
|
||||
|
@ -533,15 +494,11 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
global $config;
|
||||
|
||||
if (empty($server_data)) {
|
||||
$server_name = '';
|
||||
$server_id = '';
|
||||
$url_hash = '';
|
||||
$console_url = ui_get_full_url('/');
|
||||
} else {
|
||||
$server_name = $server_data['server_name'];
|
||||
$server_id = $server_data['id'];
|
||||
$console_url = $server_data['server_url'].'/';
|
||||
$url_hash = metaconsole_get_servers_url_hash($server_data);
|
||||
}
|
||||
|
||||
include_once $config['homedir'].'/include/functions_agents.php';
|
||||
|
@ -623,15 +580,6 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
$cellName = ((bool) $agent['disabled'] === true) ? '<em>' : '';
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$pwd = $server_data['auth_token'];
|
||||
// Create HASH login info.
|
||||
$user = $config['id_user'];
|
||||
|
||||
// Extract auth token from serialized field.
|
||||
$pwd_deserialiced = json_decode($pwd, true);
|
||||
$hashdata = $user.$pwd_deserialiced['auth_token'];
|
||||
|
||||
$hashdata = md5($hashdata);
|
||||
if ((bool) $grants_on_node === true && (bool) $user_access_node !== false) {
|
||||
$urlAgent = $server_data['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'];
|
||||
} else {
|
||||
|
@ -657,7 +605,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
'title' => __('Click here for view this agent'),
|
||||
'class' => 'font_11',
|
||||
'content' => $cellName,
|
||||
'onClick' => "sendHash('".$urlAgent."')",
|
||||
'onClick' => "redirectNode('".$urlAgent."')",
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -998,7 +946,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
$cluster = PandoraFMS\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
);
|
||||
$buttons_act .= '<a target=_blank href="'.$console_url.'index.php?sec=reporting&sec2=operation/cluster/cluster&op=update&id='.$cluster->id().'">';
|
||||
$buttons_act .= '<a target=_blank href="#" onclick="redirectNode(\''.$console_url.'index.php?sec=reporting&sec2=operation/cluster/cluster&op=update&id='.$cluster->id().'\')">';
|
||||
$buttons_act .= html_print_submit_button(
|
||||
__('Go to cluster edition'),
|
||||
'upd_button',
|
||||
|
@ -1007,7 +955,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
true
|
||||
);
|
||||
} else {
|
||||
$buttons_act .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$ent.'&tab=module&show_dialog_create=1">';
|
||||
$buttons_act .= '<a target=_blank href="#" onclick="redirectNode(\''.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&show_dialog_create=1\')">';
|
||||
$buttons_act .= html_print_submit_button(
|
||||
__('Go to module creation'),
|
||||
'upd_button',
|
||||
|
@ -1016,7 +964,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
true
|
||||
);
|
||||
|
||||
$buttons_act .= '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.$ent.'">';
|
||||
$buttons_act .= '<a target=_blank href="#" onclick="redirectNode(\''.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'\')">';
|
||||
$buttons_act .= html_print_submit_button(
|
||||
__('Go to agent edition'),
|
||||
'upd_button',
|
||||
|
@ -1038,11 +986,6 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
|
||||
echo "
|
||||
<script>
|
||||
function sendHash(url) {
|
||||
window.open(url+'&loginhash=auto&loginhash_data=".$hashdata.'&loginhash_user='.str_rot13(($user ?? ''))."', '_blank');
|
||||
|
||||
}
|
||||
|
||||
$('.max-graph-tree-view').ready(function() {
|
||||
widthGraph();
|
||||
});
|
||||
|
|
|
@ -301,8 +301,7 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t
|
|||
|
||||
if (empty($message['no_close']) === false) {
|
||||
// Workaround.
|
||||
$no_close_bool = false;
|
||||
// $no_close_bool = (bool) $message['no_close'];
|
||||
$no_close_bool = (bool) $message['no_close'];
|
||||
}
|
||||
|
||||
if (empty($message['force_style']) === false) {
|
||||
|
@ -1165,16 +1164,10 @@ function ui_format_alert_row(
|
|||
global $config;
|
||||
|
||||
if (!isset($alert['server_data'])) {
|
||||
$server_name = '';
|
||||
$server_id = '';
|
||||
$url_hash = '';
|
||||
$console_url = '';
|
||||
} else {
|
||||
$server_data = $alert['server_data'];
|
||||
$server_name = $server_data['server_name'];
|
||||
$server_id = $server_data['id'];
|
||||
$console_url = $server_data['server_url'].'/';
|
||||
$url_hash = metaconsole_get_servers_url_hash($server_data);
|
||||
}
|
||||
|
||||
$actionText = '';
|
||||
|
@ -1445,13 +1438,13 @@ function ui_format_alert_row(
|
|||
if (is_metaconsole() === true) {
|
||||
// Do not show link if user cannot access node
|
||||
if ((bool) can_user_access_node() === true) {
|
||||
$hashdata = metaconsole_get_server_hashdata($server);
|
||||
$url = $server['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&loginhash=auto&loginhash_data='.$hashdata.'&loginhash_user='.str_rot13($config['id_user']).'&id_agente='.$agente['id_agente'];
|
||||
$url = $server['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&&id_agente='.$agente['id_agente'];
|
||||
$data[$index['agent_name']] .= html_print_anchor(
|
||||
[
|
||||
'href' => $url,
|
||||
'href' => '#',
|
||||
'content' => '<span class="bolder" title="'.$agente['nombre'].'">'.$agente['alias'].'</span>',
|
||||
'target' => '_blank',
|
||||
'onClick' => 'redirectNode(\''.$url.'\');',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
|
|
@ -1664,7 +1664,7 @@ function visual_map_print_item(
|
|||
echo '<div id="'.$id.'" class="'.$class.'" '.'style="z-index: '.$z_index.';'.'position: absolute; '.'top: '.$top.'px; '.'left: '.$left.'px;'.'display: inline-block; '.$sizeStyle.'">';
|
||||
|
||||
if ($link) {
|
||||
echo "<a href=\"$url\">";
|
||||
echo '<a href="#" onClick="redirectNode(\''.$url.'\')">';
|
||||
}
|
||||
|
||||
// for clean link text from bbdd only edit_visualmap
|
||||
|
|
|
@ -547,6 +547,7 @@ function line_graph(
|
|||
function get_build_setup_charts($type, $options, $data)
|
||||
{
|
||||
global $config;
|
||||
$user_info = get_user_info($config['id_user']);
|
||||
|
||||
$factory = new Factory();
|
||||
|
||||
|
@ -1294,6 +1295,10 @@ function get_build_setup_charts($type, $options, $data)
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($user_info['id_skin']) === true) {
|
||||
$chart->options()->setTheme($user_info['id_skin']);
|
||||
}
|
||||
|
||||
// Add Datasets.
|
||||
$setData = $chart->createDataSet();
|
||||
switch ($type) {
|
||||
|
|
|
@ -12,12 +12,11 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
|
||||
/**
|
||||
* @package Include
|
||||
* @subpackage Clippy
|
||||
*/
|
||||
|
||||
|
||||
function clippy_agent_module_interval()
|
||||
{
|
||||
$return_tours = [];
|
||||
|
|
|
@ -12,12 +12,11 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
|
||||
/**
|
||||
* @package Include
|
||||
* @subpackage Clippy
|
||||
*/
|
||||
|
||||
|
||||
function clippy_data_configuration_module()
|
||||
{
|
||||
$return_tours = [];
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
|
@ -26,8 +28,6 @@
|
|||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
|
||||
function clippy_modules_not_learning_mode()
|
||||
{
|
||||
$return_tours = [];
|
||||
|
|
|
@ -216,7 +216,7 @@ $(document).ready(function() {
|
|||
});
|
||||
|
||||
$("#ok_buttom").click(function() {
|
||||
$("#license_error_msg_dialog").dialog("close");
|
||||
$(".ui-dialog-content").dialog("close");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ function fmAgentChange(uniqId) {
|
|||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function fmModuleChange(uniqId, isMeta) {
|
||||
function fmModuleChange(uniqId, isMeta, valueID = false) {
|
||||
var idModuleGroup = $("#filtered-module-module-group-" + uniqId).val();
|
||||
var idAgents = $("#filtered-module-agents-" + uniqId).val();
|
||||
var commonSelectorType = $(
|
||||
|
@ -253,7 +253,7 @@ function fmModuleChange(uniqId, isMeta) {
|
|||
.html(value["nombre"]);
|
||||
} else {
|
||||
option
|
||||
.attr("value", id)
|
||||
.attr("value", valueID === false ? value : id)
|
||||
.attr("title", value)
|
||||
.html(value);
|
||||
}
|
||||
|
|
|
@ -2679,7 +2679,6 @@ function perform_email_test() {
|
|||
$("#email_test_sent_message").show();
|
||||
$("#email_test_failure_message").hide();
|
||||
} else {
|
||||
console.log($("#email_test_failure_message"));
|
||||
$("#email_test_failure_message").show();
|
||||
$("#email_test_sent_message").hide();
|
||||
}
|
||||
|
@ -2753,3 +2752,53 @@ function closeAboutModal() {
|
|||
$("#icon_about").removeClass("selected");
|
||||
$("#icon_about_div").removeClass("selected");
|
||||
}
|
||||
|
||||
function redirectNode(url, target = "_blank") {
|
||||
if (
|
||||
typeof event !== "undefined" &&
|
||||
typeof event.preventDefault === "function"
|
||||
) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
let pathAjax = "";
|
||||
|
||||
// Detect if view is phone.
|
||||
if (window.configHomeUrl && window.settings && !window.settings.mobile) {
|
||||
pathAjax += window.configHomeUrl;
|
||||
} else if (window.settings && window.settings.mobile) {
|
||||
pathAjax += "../";
|
||||
} else {
|
||||
pathAjax += "../../";
|
||||
}
|
||||
|
||||
pathAjax += "ajax.php";
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: pathAjax,
|
||||
dataType: "json",
|
||||
data: {
|
||||
page: "include/ajax/token",
|
||||
get_jwt_for_login: 1
|
||||
},
|
||||
success: function(data) {
|
||||
const unique_id = "token_form_" + uniqId();
|
||||
var $form = $(
|
||||
`<form class="invisible" id="${unique_id}" target="${target}"></form>`
|
||||
);
|
||||
$form.attr("method", "post");
|
||||
$form.attr("action", url);
|
||||
if (data.success) {
|
||||
var $input = $("<input>")
|
||||
.attr("type", "hidden")
|
||||
.attr("name", "auth_token")
|
||||
.val(data.data);
|
||||
$form.append($input);
|
||||
}
|
||||
|
||||
$("body").append($form);
|
||||
$form.submit();
|
||||
$("#" + unique_id).remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -625,6 +625,10 @@ var TreeController = {
|
|||
$("#fixed-bottom-box-head-title").html(
|
||||
$("#fixedBottomHeadTitle").html()
|
||||
);
|
||||
|
||||
$("#fixed-bottom-box-head-title")
|
||||
.closest(".fixed-bottom-box")
|
||||
.addClass("tree-view-bottom-modal");
|
||||
},
|
||||
error: function(xhr, textStatus, errorThrown) {
|
||||
callback(errorThrown);
|
||||
|
@ -1543,7 +1547,7 @@ var TreeController = {
|
|||
} else if (controller.tree.length == 0) {
|
||||
controller.recipient.empty();
|
||||
controller.recipient.html(
|
||||
"<div>" + controller.emptyMessage + "</div>"
|
||||
"<div class='recipent'>" + controller.emptyMessage + "</div>"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -363,6 +363,27 @@ class Manager implements PublicLogin
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates a hash to authenticate in public dashboards with user form url.
|
||||
*
|
||||
* @param string|null $other_secret To authenticate some parts
|
||||
* of public dashboards (like visual consoles or wux widgets)
|
||||
* another hash is needed. Other secret avoid
|
||||
* to reuse the main hash to view other components.
|
||||
*
|
||||
* @return string Returns a hash with the authenticaction.
|
||||
*/
|
||||
public static function generatePublicHashUser(?string $other_secret='', $id_user=''):string
|
||||
{
|
||||
global $config;
|
||||
|
||||
$str = $config['dbpass'];
|
||||
$str .= ($id_user ?? $config['id_user']);
|
||||
$str .= $other_secret;
|
||||
return hash('sha256', $str);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validates a hash to authenticate in public dashboards.
|
||||
*
|
||||
|
@ -1040,6 +1061,17 @@ class Manager implements PublicLogin
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->dashboardId) === true) {
|
||||
$id_user_url = get_parameter('id_user', $config['id_user']);
|
||||
foreach ($dashboards as $key => $layout) {
|
||||
$hash_compare = self::generatePublicHashUser($key, $id_user_url);
|
||||
if (hash_equals($hash_aux, $hash_compare)) {
|
||||
$this->dashboardId = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->dashboardId === 0
|
||||
|
|
|
@ -447,25 +447,18 @@ class ModuleValueWidget extends Widget
|
|||
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 40;
|
||||
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 40;
|
||||
|
||||
$sql = 'SELECT min_warning,
|
||||
max_warning,
|
||||
min_critical,
|
||||
max_critical,
|
||||
str_warning,
|
||||
str_critical
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = '.(int) $this->values['moduleId'];
|
||||
$sql_data = db_get_row_sql($sql);
|
||||
|
||||
$last = modules_get_last_value($this->values['moduleId']);
|
||||
|
||||
if (($last >= $sql_data['min_warning']) && ($last < $sql_data['max_warning'])) {
|
||||
$color = COL_WARNING;
|
||||
}
|
||||
|
||||
if ($last >= $sql_data['max_warning']) {
|
||||
$color = COL_CRITICAL;
|
||||
}
|
||||
$db_status = modules_get_agentmodule_status($this->values['moduleId']);
|
||||
$module_value = modules_get_last_value($this->values['moduleId']);
|
||||
$status = 0;
|
||||
$title = '';
|
||||
modules_get_status($this->values['moduleId'], $db_status, $module_value, $status, $title);
|
||||
$color = match ($status) {
|
||||
STATUS_MODULE_NO_DATA => COL_NOTINIT,
|
||||
STATUS_MODULE_CRITICAL => COL_CRITICAL,
|
||||
STATUS_MODULE_WARNING => COL_WARNING,
|
||||
STATUS_MODULE_OK => COL_NORMAL,
|
||||
STATUS_MODULE_UNKNOWN => COL_UNKNOWN,
|
||||
};
|
||||
|
||||
$uuid = uniqid();
|
||||
$output .= '<div class="container-center" id="container-'.$uuid.'">';
|
||||
|
|
|
@ -684,7 +684,7 @@ class TreeViewWidget extends Widget
|
|||
'dateFormat' => DATE_FORMAT_JS,
|
||||
'userLanguage' => get_user_language(),
|
||||
'translate' => [
|
||||
'emptyMessage' => __('No data found'),
|
||||
'emptyMessage' => ui_print_info_message(['no_close' => true, 'message' => __('No data found.')], '', true),
|
||||
'foundMessage' => $foundMessage,
|
||||
'total' => [
|
||||
'agents' => __('Total agents'),
|
||||
|
|
|
@ -236,6 +236,25 @@ class User extends Entity implements PublicLogin
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates a hash to authenticate in public views with user from url.
|
||||
*
|
||||
* @param string|null $other_secret If you need to authenticate using a
|
||||
* varable string, use this 'other_secret' to customize the hash.
|
||||
*
|
||||
* @return string Returns a hash with the authenticaction.
|
||||
*/
|
||||
public static function generatePublicHashUser(?string $other_secret='', $id_user_url=''): string
|
||||
{
|
||||
global $config;
|
||||
|
||||
$str = $config['dbpass'];
|
||||
$str .= ($id_user_url ?? $config['id_user']);
|
||||
$str .= $other_secret;
|
||||
return hash('sha256', $str);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Validates a hash to authenticate in public view.
|
||||
*
|
||||
|
|
|
@ -139,7 +139,7 @@ class View extends \HTML
|
|||
});
|
||||
ui.jqXHR.fail(function () {
|
||||
ui.panel.html(
|
||||
"Couldn\'t load Data. Plz Reload Page or Try Again Later."
|
||||
"'.__('The data could not be loaded. Please reload the page or try again later.').'"
|
||||
);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -954,6 +954,7 @@ input.resize_button {
|
|||
right: 6%;
|
||||
}
|
||||
|
||||
.recipent > div > table,
|
||||
.new-widget-message > div > table,
|
||||
.container-center > div > table {
|
||||
display: flex;
|
||||
|
@ -961,6 +962,7 @@ input.resize_button {
|
|||
align-items: center;
|
||||
}
|
||||
|
||||
.recipent > div > table tr td > div,
|
||||
.new-widget-message > div > table tr td > div,
|
||||
.container-center > div > table tr td > div {
|
||||
position: absolute;
|
||||
|
@ -1021,3 +1023,12 @@ ul.select2-selection__rendered > li.select2-selection__choice {
|
|||
#period_manual > input[type="text"] {
|
||||
box-sizing: border-box !important;
|
||||
}
|
||||
|
||||
.recipent {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
|
|
@ -14222,14 +14222,6 @@ button.ui-button-text-only.ui-widget.sub:hover,
|
|||
box-shadow: none;
|
||||
}
|
||||
|
||||
.black-and-white {
|
||||
filter: saturate(0);
|
||||
}
|
||||
|
||||
.invert_filter.black-and-white {
|
||||
filter: invert(1) saturate(0) !important;
|
||||
}
|
||||
|
||||
div.tox .tox-editor-header {
|
||||
z-index: 1;
|
||||
}
|
||||
|
@ -14272,3 +14264,50 @@ table.filter-table-adv td > div.row-flex label.custom_checkbox {
|
|||
table.filter-table-adv td > div.row-flex input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.fixed-bottom-box.tree-view-bottom-modal {
|
||||
z-index: 1;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.custom-graph-editor
|
||||
#select_multiple_modules_filtered
|
||||
> div.agents-modules-multiple-search-bar
|
||||
> div {
|
||||
width: 37%;
|
||||
}
|
||||
|
||||
.custom-graph-editor
|
||||
#select_multiple_modules_filtered
|
||||
> div.agents-modules-multiple-search-bar
|
||||
> div
|
||||
> div
|
||||
> input {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.custom-graph-editor
|
||||
#select_multiple_modules_filtered
|
||||
> div.agents-modules-multiple-search-bar
|
||||
> div
|
||||
> div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.custom-graph-editor-agents-module-filter {
|
||||
margin-top: -69px;
|
||||
}
|
||||
|
||||
.custom-graph-editor-agents-module-filter > span.select2.select2-container {
|
||||
height: 189px;
|
||||
}
|
||||
|
||||
.bg-image-none {
|
||||
background-image: none !important;
|
||||
}
|
||||
|
|
|
@ -1136,6 +1136,7 @@ select,
|
|||
.white_table_graph_header {
|
||||
color: var(--text-color) !important;
|
||||
border-radius: 0;
|
||||
background-color: var(--secondary-color) !important;
|
||||
}
|
||||
|
||||
.white_table_graph {
|
||||
|
@ -1477,6 +1478,7 @@ select[multiple] option:checked,
|
|||
select[multiple] option:active,
|
||||
select[multiple] option:hover {
|
||||
background: #008d86 !important;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.select2-search.select2-search--dropdown,
|
||||
|
@ -2095,6 +2097,12 @@ select option:checked {
|
|||
filter: invert(1);
|
||||
}
|
||||
|
||||
.d2h-file-list-header,
|
||||
.d2h-file-name-wrapper,
|
||||
.d2h-file-collapse {
|
||||
color: #333 !important;
|
||||
}
|
||||
|
||||
.grid-stack-item-content {
|
||||
background-color: var(--secondary-color);
|
||||
}
|
||||
|
@ -2103,6 +2111,18 @@ select option:checked {
|
|||
background-color: var(--secondary-color);
|
||||
}
|
||||
|
||||
.color_666 {
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.black-and-white {
|
||||
filter: saturate(0);
|
||||
}
|
||||
|
||||
.invert_filter.black-and-white {
|
||||
filter: invert(1) saturate(0) !important;
|
||||
}
|
||||
|
||||
.content-widget .legend_background,
|
||||
.content-widget .flot-base {
|
||||
background-color: unset;
|
||||
|
|
|
@ -756,24 +756,19 @@ if (isset($config['id_user']) === false) {
|
|||
header('Location: '.ui_get_full_url('index.php'.$redirect_url));
|
||||
exit;
|
||||
// Always exit after sending location headers.
|
||||
} else if (isset($_GET['loginhash']) === true || isset($_POST['loginhash']) === true) {
|
||||
// Hash login process.
|
||||
$loginhash_data = get_parameter('loginhash_data', '');
|
||||
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
|
||||
|
||||
if ($config['loginhash_pwd'] != ''
|
||||
&& $loginhash_data == md5(
|
||||
$loginhash_user.io_output_password($config['loginhash_pwd'])
|
||||
)
|
||||
) {
|
||||
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
||||
$_SESSION['id_usuario'] = $loginhash_user;
|
||||
$config['id_user'] = $loginhash_user;
|
||||
} else if (isset($_POST['auth_token']) === true && (bool) $config['JWT_signature'] !== false) {
|
||||
include_once $config['homedir'].'/include/class/JWTRepository.class.php';
|
||||
$jwt = new JWTRepository($config['JWT_signature']);
|
||||
if ($jwt->setToken($_POST['auth_token']) && $jwt->validate()) {
|
||||
$id_user = $jwt->payload()->get('id_user');
|
||||
db_logon($id_user, $_SERVER['REMOTE_ADDR']);
|
||||
$_SESSION['id_usuario'] = $id_user;
|
||||
$config['id_user'] = $id_user;
|
||||
} else {
|
||||
include_once 'general/login_page.php';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_REGISTRATION,
|
||||
'Loginhash failed',
|
||||
'Login token failed',
|
||||
'system'
|
||||
);
|
||||
while (ob_get_length() > 0) {
|
||||
|
@ -962,33 +957,17 @@ if (isset($config['id_user']) === false) {
|
|||
exit('</html>');
|
||||
}
|
||||
} else {
|
||||
if (isset($_GET['loginhash_data'])) {
|
||||
$loginhash_data = get_parameter('loginhash_data', '');
|
||||
$loginhash_user = str_rot13(get_parameter('loginhash_user', ''));
|
||||
$iduser = $_SESSION['id_usuario'];
|
||||
unset($_SESSION['id_usuario']);
|
||||
unset($iduser);
|
||||
|
||||
if ($config['loginhash_pwd'] != ''
|
||||
&& $loginhash_data == md5(
|
||||
$loginhash_user.io_output_password($config['loginhash_pwd'])
|
||||
)
|
||||
) {
|
||||
db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']);
|
||||
$_SESSION['id_usuario'] = $loginhash_user;
|
||||
$config['id_user'] = $loginhash_user;
|
||||
} else {
|
||||
include_once 'general/login_page.php';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_REGISTRATION,
|
||||
'Loginhash failed',
|
||||
'system'
|
||||
);
|
||||
while (ob_get_length() > 0) {
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
exit('</html>');
|
||||
if (isset($_POST['auth_token']) === true && (bool) $config['JWT_signature'] !== false) {
|
||||
include_once $config['homedir'].'/include/class/JWTRepository.class.php';
|
||||
$jwt = new JWTRepository($config['JWT_signature']);
|
||||
if ($jwt->setToken($_POST['auth_token']) && $jwt->validate()) {
|
||||
$iduser = $_SESSION['id_usuario'];
|
||||
unset($_SESSION['id_usuario']);
|
||||
unset($iduser);
|
||||
$id_user = $jwt->payload()->get('id_user');
|
||||
db_logon($id_user, $_SERVER['REMOTE_ADDR']);
|
||||
$_SESSION['id_usuario'] = $id_user;
|
||||
$config['id_user'] = $id_user;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@
|
|||
<div style='padding-bottom: 50px'>
|
||||
<?php
|
||||
$version = '7.0NG.776';
|
||||
$build = '240425';
|
||||
$build = '240430';
|
||||
$banner = "v$version Build $build";
|
||||
error_reporting(0);
|
||||
|
||||
|
|
|
@ -83,55 +83,37 @@ class User
|
|||
{
|
||||
$system = System::getInstance();
|
||||
|
||||
$loginhash = $system->getRequest('loginhash', null);
|
||||
$autologin = $system->getRequest('autologin', false);
|
||||
$auth_token = $_POST['auth_token'];
|
||||
if ($autologin !== false) {
|
||||
$user = $system->getRequest('user', null);
|
||||
$password = $system->getRequest('password', null);
|
||||
$this->login($user, $password);
|
||||
} else {
|
||||
if (empty($loginhash) === false) {
|
||||
// Hash login process.
|
||||
$loginhash_data = $system->getRequest('loginhash_data', null);
|
||||
$loginhash_user = str_rot13($system->getRequest('loginhash_user', null));
|
||||
$this->login($loginhash_user, null, $loginhash_data);
|
||||
}
|
||||
} else if (empty($auth_token) === false) {
|
||||
$this->login(null, null, $auth_token);
|
||||
}
|
||||
|
||||
return $this->logged;
|
||||
}
|
||||
|
||||
|
||||
public function login($user=null, $password=null, $loginhash_data='')
|
||||
public function login($user=null, $password=null, $auth_token='')
|
||||
{
|
||||
global $config;
|
||||
$system = System::getInstance();
|
||||
|
||||
if (empty($loginhash_data) === false) {
|
||||
if ($config['loginhash_pwd'] != ''
|
||||
&& $loginhash_data == md5(
|
||||
$user.io_output_password(
|
||||
$config['loginhash_pwd']
|
||||
)
|
||||
)
|
||||
if (empty($auth_token) === false && (bool) $config['JWT_signature'] !== false) {
|
||||
$jwt = new JWTRepository($config['JWT_signature']);
|
||||
if ($jwt->setToken($auth_token)
|
||||
&& $jwt->validate()
|
||||
) {
|
||||
$this->logged = true;
|
||||
$this->user = $user;
|
||||
$this->user = $jwt->payload()->get('id_user');
|
||||
$this->loginTime = time();
|
||||
$this->errorLogin = false;
|
||||
$this->saveLogin();
|
||||
} else {
|
||||
include_once 'general/login_page.php';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_REGISTRATION,
|
||||
'Loginhash failed',
|
||||
'system'
|
||||
);
|
||||
while (ob_get_length() > 0) {
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
exit('</html>');
|
||||
$this->logged = false;
|
||||
$this->errorLogin = __('Token invalid');
|
||||
}
|
||||
|
||||
return $this->logged;
|
||||
|
|
|
@ -31,6 +31,7 @@ require_once 'include/user.class.php';
|
|||
* serializing objects stored into the session.
|
||||
*/
|
||||
require_once '../include/config.php';
|
||||
require_once '../include/class/JWTRepository.class.php';
|
||||
|
||||
require_once 'operation/home.php';
|
||||
require_once 'operation/tactical.php';
|
||||
|
|
|
@ -338,7 +338,7 @@ class Services
|
|||
$name .= '<strong class="no-data">'.__('Nonexistent. This element should be deleted').'</strong>';
|
||||
} else {
|
||||
$url = ui_get_full_url('mobile/index.php?page=agent&id='.$item->agent()->id_agente());
|
||||
$name = '<a href="'.$url.'">';
|
||||
$name = '<a href="#" onClick="redirectNode(\''.$url.'\')">';
|
||||
|
||||
if (((bool) $item->module()->disabled()) === true) {
|
||||
$disabled_element = true;
|
||||
|
|
|
@ -374,111 +374,6 @@ for ($i = 0; $i < $custom_fields_count; $i++) {
|
|||
|
||||
/*
|
||||
* END: TABLE DATA BUILD
|
||||
*/
|
||||
|
||||
/*
|
||||
* START: TABLE INTERFACES
|
||||
*/
|
||||
|
||||
$network_interfaces_by_agents = agents_get_network_interfaces([$agent]);
|
||||
|
||||
$network_interfaces = [];
|
||||
if (empty($network_interfaces_by_agents) === false && empty($network_interfaces_by_agents[$id_agente]) === false) {
|
||||
$network_interfaces = $network_interfaces_by_agents[$id_agente]['interfaces'];
|
||||
}
|
||||
|
||||
if (empty($network_interfaces) === false) {
|
||||
$table_interface = new stdClass();
|
||||
$table_interface->id = 'agent_interface_info';
|
||||
$table_interface->class = 'info_table';
|
||||
$table_interface->width = '100%';
|
||||
$table_interface->style = [];
|
||||
$table_interface->style['interface_event_graph'] = 'width: 35%;';
|
||||
|
||||
$table_interface->head = [];
|
||||
$options = [
|
||||
'class' => 'closed',
|
||||
'style' => 'cursor:pointer;',
|
||||
];
|
||||
$table_interface->data = [];
|
||||
$event_text_cont = 0;
|
||||
|
||||
foreach ($network_interfaces as $interface_name => $interface) {
|
||||
if (empty($interface['traffic']) === false) {
|
||||
$permission = check_acl_one_of_groups($config['id_user'], $all_groups, 'RR');
|
||||
|
||||
if ($permission) {
|
||||
$params = [
|
||||
'interface_name' => $interface_name,
|
||||
'agent_id' => $id_agente,
|
||||
'traffic_module_in' => $interface['traffic']['in'],
|
||||
'traffic_module_out' => $interface['traffic']['out'],
|
||||
];
|
||||
$params_json = json_encode($params);
|
||||
$params_encoded = base64_encode($params_json);
|
||||
$win_handle = dechex(crc32($interface['status_module_id'].$interface_name));
|
||||
$graph_link = "<a href=\"javascript:winopeng_var('operation/agentes/interface_traffic_graph_win.php?params=";
|
||||
$graph_link .= $params_encoded."','";
|
||||
$graph_link .= $win_handle."', 800, 480)\">";
|
||||
$graph_link .= html_print_image(
|
||||
'images/chart.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Interface traffic'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
} else {
|
||||
$graph_link = '';
|
||||
}
|
||||
} else {
|
||||
$graph_link = '';
|
||||
}
|
||||
|
||||
$content = [
|
||||
'id_agent_module' => $interface['status_module_id'],
|
||||
'id_group' => $id_group,
|
||||
'period' => SECONDS_1DAY,
|
||||
'time_from' => '00:00:00',
|
||||
'time_to' => '00:00:00',
|
||||
'sizeForTicks' => 250,
|
||||
'height_graph' => 40,
|
||||
[
|
||||
['id_agent_module' => $interface['status_module_id']],
|
||||
]
|
||||
];
|
||||
|
||||
$e_graph = \reporting_module_histogram_graph(
|
||||
['datetime' => time()],
|
||||
$content
|
||||
);
|
||||
|
||||
$sqlLast_contact = sprintf(
|
||||
'
|
||||
SELECT timestamp
|
||||
FROM tagente_estado
|
||||
WHERE id_agente_modulo = '.$interface['status_module_id']
|
||||
);
|
||||
|
||||
$last_contact = db_get_all_rows_sql($sqlLast_contact);
|
||||
$last_contact = array_shift($last_contact);
|
||||
$last_contact = array_shift($last_contact);
|
||||
|
||||
$data = [];
|
||||
$data['interface_name'] = '<strong>'.$interface_name.'</strong>';
|
||||
$data['interface_status'] = $interface['status_image'];
|
||||
$data['interface_graph'] = $graph_link;
|
||||
$data['interface_ip'] = $interface['ip'];
|
||||
$data['interface_mac'] = $interface['mac'];
|
||||
$data['last_contact'] = __('Last contact: ').$last_contact;
|
||||
$data['interface_event_graph'] = $e_graph['chart'];
|
||||
|
||||
$table_interface->data[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* END: TABLE INTERFACES
|
||||
*/
|
||||
|
||||
// This javascript piece of code is used to make expandible
|
||||
|
@ -651,16 +546,23 @@ if (empty($agentIncidents) === false) {
|
|||
);
|
||||
}
|
||||
|
||||
if (isset($table_interface) === true) {
|
||||
$count_network_incerfaces = agents_get_network_interfaces([$agent], false, false, 0, true);
|
||||
if ($count_network_incerfaces > 0) {
|
||||
ui_toggle(
|
||||
html_print_table($table_interface, true),
|
||||
html_print_div(
|
||||
[
|
||||
'id' => 'agent_interface_info',
|
||||
'content' => '',
|
||||
'class' => 'w100p',
|
||||
],
|
||||
true
|
||||
),
|
||||
'<b>'.__('Interface information (SNMP)').'</b>',
|
||||
'',
|
||||
'interface-table-status-agent',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -678,5 +580,45 @@ if (isset($table_interface) === true) {
|
|||
$('#deploy_sec_ips_down').css('display', 'none');
|
||||
$('#deploy_sec_ips_up').css('display', '');
|
||||
});
|
||||
<?php if ($count_network_incerfaces > 0) { ?>
|
||||
load_list_snmp();
|
||||
<?php } ?>
|
||||
});
|
||||
|
||||
function load_list_snmp() {
|
||||
var parameters = {};
|
||||
parameters['list_snmp_modules'] = 1;
|
||||
parameters['agent'] = <?php echo $id_agente; ?>;
|
||||
parameters['page'] = 'include/ajax/module';
|
||||
$('#agent_interface_info').empty();
|
||||
jQuery.ajax ({
|
||||
data: parameters,
|
||||
type: 'POST',
|
||||
url: "ajax.php",
|
||||
dataType: 'html',
|
||||
success: function (data) {
|
||||
$('#agent_interface_info').empty();
|
||||
$('#agent_interface_info').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function change_page_snmp(offset) {
|
||||
var parameters = {};
|
||||
parameters['list_snmp_modules'] = 1;
|
||||
parameters["offset"] = offset;
|
||||
parameters['agent'] = <?php echo $id_agente; ?>;
|
||||
parameters['page'] = 'include/ajax/module';
|
||||
$('#agent_interface_info').empty();
|
||||
jQuery.ajax ({
|
||||
data: parameters,
|
||||
type: 'POST',
|
||||
url: "ajax.php",
|
||||
dataType: 'html',
|
||||
success: function (data) {
|
||||
$('#agent_interface_info').empty();
|
||||
$('#agent_interface_info').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1026,11 +1026,18 @@ if (is_ajax() === true) {
|
|||
return;
|
||||
}
|
||||
|
||||
$data = networkmap_refresh_holding_area($networkmap_id, $x, $y);
|
||||
$filter = db_get_value('filter', 'tmap', 'id', $networkmap_id);
|
||||
$filter = json_decode($filter, true);
|
||||
|
||||
if (!empty($data)) {
|
||||
$return['correct'] = true;
|
||||
$return['holding_area'] = $data;
|
||||
if (isset($filter['empty_map']) === false
|
||||
|| (isset($filter['empty_map']) === true && $filter['empty_map'] !== 1)
|
||||
) {
|
||||
$data = networkmap_refresh_holding_area($networkmap_id, $x, $y);
|
||||
|
||||
if (!empty($data)) {
|
||||
$return['correct'] = true;
|
||||
$return['holding_area'] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
ob_end_clean();
|
||||
|
|
|
@ -1721,26 +1721,8 @@ if (empty($result) === false) {
|
|||
if (in_array('agent', $show_fields) || is_metaconsole()) {
|
||||
$agent_alias = !empty($row['agent_alias']) ? $row['agent_alias'] : $row['agent_name'];
|
||||
|
||||
// TODO: Calculate hash access before to use it more simply like other sections. I.E. Events view
|
||||
if (is_metaconsole() === true) {
|
||||
echo "<form id='agent-redirection-".$inc_id."' method='POST' target='_blank' action='".$row['server_url'].'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agent']."'>";
|
||||
html_print_input_hidden(
|
||||
'loginhash',
|
||||
'auto',
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'loginhash_data',
|
||||
$row['hashdata'],
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'loginhash_user',
|
||||
str_rot13($row['user']),
|
||||
false
|
||||
);
|
||||
echo '</form>';
|
||||
$agent_link = "<a target='_blank' href='".$row['server_url'].'index.php?sec=estado&sec2=operation/agentes/ver_agente&loginhash=auto&loginhash_data='.$row['hashdata'].'&loginhash_user='.str_rot13($row['user']).'&id_agente='.$row['id_agent']."'>";
|
||||
$agent_link = '<a target="_blank" href="#" onclick="redirectNode(\''.$row['server_url'].'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agent'].'\',\'_self\')">';
|
||||
|
||||
$agent_alias = ui_print_truncate_text(
|
||||
$agent_alias,
|
||||
|
@ -1773,18 +1755,20 @@ if (empty($result) === false) {
|
|||
$show_edit_icon = false;
|
||||
}
|
||||
|
||||
$url_edit_module = $row['server_url'].'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$row['id_agent'].'&'.'tab=module&'.'id_agent_module='.$row['id_agente_modulo'].'&'.'edit_module=1'.'&loginhash=auto&loginhash_data='.$row['hashdata'].'&loginhash_user='.str_rot13($row['user']);
|
||||
$url_edit_module = $row['server_url'].'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$row['id_agent'].'&'.'tab=module&'.'id_agent_module='.$row['id_agente_modulo'].'&'.'edit_module=1';
|
||||
} else {
|
||||
$url_edit_module = 'index.php?'.'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$row['id_agent'].'&'.'tab=module&'.'id_agent_module='.$row['id_agente_modulo'].'&'.'edit_module=1';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$url_edit_module = ($url_edit_module ?? '#');
|
||||
if (in_array('module_name', $show_fields) === true || is_metaconsole() === true) {
|
||||
$data[3] = html_print_anchor(
|
||||
[
|
||||
'target' => '_blank',
|
||||
'href' => ($url_edit_module ?? '#'),
|
||||
'href' => '#',
|
||||
'onClick' => ((is_metaconsole() === true) ? 'redirectNode(\''.$url_edit_module.'\',\'_self\')' : ''),
|
||||
'content' => ui_print_truncate_text($row['module_name'], 'module_small', false, true, true),
|
||||
],
|
||||
true
|
||||
|
@ -2273,43 +2257,12 @@ if (empty($result) === false) {
|
|||
$table->cellclass[][12] = 'table_action_buttons';
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
echo "<form id='agent-edit-redirection-".$inc_id."' target='_blank' method='POST' action='".$row['server_url']."index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&edit_module=1'>";
|
||||
html_print_input_hidden(
|
||||
'id_agente',
|
||||
$row['id_agent'],
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'id_agent_module',
|
||||
$row['id_agente_modulo'],
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'loginhash',
|
||||
'auto',
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'loginhash_data',
|
||||
$row['hashdata'],
|
||||
false
|
||||
);
|
||||
html_print_input_hidden(
|
||||
'loginhash_user',
|
||||
str_rot13($row['user']),
|
||||
false
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
$url_edit_module = $row['server_url'];
|
||||
$url_edit_module .= 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&';
|
||||
$url_edit_module .= '&id_agente='.$row['id_agent'];
|
||||
$url_edit_module .= '&tab=module&id_agent_module='.$row['id_agente_modulo'].'&edit_module=1';
|
||||
$url_edit_module .= '&loginhash=auto&loginhash_data='.$row['hashdata'];
|
||||
$url_edit_module .= '&loginhash_user='.str_rot13($row['user']);
|
||||
|
||||
$agent_link = "<a href='".$url_edit_module."'>";
|
||||
$agent_link = '<a href="#" onclick="redirectNode(\''.$url_edit_module.'\',\'_self\')">';
|
||||
|
||||
$agent_alias = ui_print_truncate_text(
|
||||
$agent_alias,
|
||||
|
@ -2387,7 +2340,11 @@ if (empty($result) === false) {
|
|||
$tablePagination = ui_pagination($count_modules, false, $offset, 0, true, 'offset', $show_count);
|
||||
}
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('Please apply a filter to display the data')]);
|
||||
if (get_parameter('ag_group', false) !== false) {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no monitors with these features or status')]);
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('Please apply a filter to display the data')]);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($tablePagination) === false) {
|
||||
|
|
|
@ -483,7 +483,6 @@ if (is_ajax() === true) {
|
|||
}
|
||||
|
||||
if (empty($events) === false) {
|
||||
$redirection_form_id = 0;
|
||||
if ((int) $filter['group_rep'] > 0) {
|
||||
$events_comments = [];
|
||||
} else {
|
||||
|
@ -492,7 +491,7 @@ if (is_ajax() === true) {
|
|||
|
||||
$data = array_reduce(
|
||||
$events,
|
||||
function ($carry, $item) use ($table_id, &$redirection_form_id, $filter, $compact_date, $external_url, $compact_name_event, $regex, $events_comments) {
|
||||
function ($carry, $item) use ($table_id, $filter, $compact_date, $external_url, $compact_name_event, $regex, $events_comments) {
|
||||
global $config;
|
||||
|
||||
$tmp = (object) $item;
|
||||
|
@ -500,7 +499,6 @@ if (is_ajax() === true) {
|
|||
|
||||
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
$server_url = '';
|
||||
$hashdata = '';
|
||||
if ($tmp->meta === true) {
|
||||
if ($tmp->server_name !== null) {
|
||||
$data_server = metaconsole_get_servers(
|
||||
|
@ -512,9 +510,6 @@ if (is_ajax() === true) {
|
|||
&& $data_server !== false
|
||||
) {
|
||||
$server_url = $data_server['server_url'];
|
||||
$hashdata = metaconsole_get_servers_url_hash(
|
||||
$data_server
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1166,40 +1161,18 @@ if (is_ajax() === true) {
|
|||
$url_link = ui_get_full_url(
|
||||
'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='
|
||||
);
|
||||
$url_link_hash = '';
|
||||
|
||||
if ($tmp->meta === true) {
|
||||
$url_link = $server_url;
|
||||
$url_link .= '/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=';
|
||||
$url_link_hash = $hashdata;
|
||||
|
||||
parse_str($url_link_hash, $url_hash_array);
|
||||
|
||||
$redirection_form = "<form id='agent-table-redirection-".$redirection_form_id."' class='invisible' method='POST' action='".$url_link.$tmp->id_agente."'>";
|
||||
$redirection_form .= html_print_input_hidden(
|
||||
'loginhash',
|
||||
$url_hash_array['loginhash'],
|
||||
true
|
||||
);
|
||||
$redirection_form .= html_print_input_hidden(
|
||||
'loginhash_data',
|
||||
$url_hash_array['loginhash_data'],
|
||||
true
|
||||
);
|
||||
$redirection_form .= html_print_input_hidden(
|
||||
'loginhash_user',
|
||||
$url_hash_array['loginhash_user'],
|
||||
true
|
||||
);
|
||||
$redirection_form .= '</form>';
|
||||
}
|
||||
|
||||
// Agent name link.
|
||||
if ($tmp->id_agente > 0) {
|
||||
if ($tmp->meta === true) {
|
||||
$draw_agent_name = $redirection_form;
|
||||
$draw_agent_name .= "<a target=_blank onclick='event.preventDefault(); document.getElementById(\"agent-table-redirection-".$redirection_form_id."\").submit();' href='#'>";
|
||||
$draw_agent_name = '<a target=_blank onclick="redirectNode(\''.$url_link.$tmp->id_agente.'\')" href="#">';
|
||||
} else {
|
||||
$draw_agent_name = '<a href="'.$url_link.$tmp->id_agente.$url_link_hash.'">';
|
||||
$draw_agent_name = '<a href="'.$url_link.$tmp->id_agente.'">';
|
||||
}
|
||||
|
||||
$draw_agent_name .= $tmp->agent_name;
|
||||
|
@ -1212,10 +1185,9 @@ if (is_ajax() === true) {
|
|||
// Agent ID link.
|
||||
if ($tmp->id_agente > 0) {
|
||||
if ($tmp->meta === true) {
|
||||
$draw_agent_id = "<a target=_blank onclick='event.preventDefault(); document.getElementById(\"agent-table-redirection-".$redirection_form_id."\").submit();' href='#'>";
|
||||
$redirection_form_id++;
|
||||
$draw_agent_id = '<a target=_blank onclick="redirectNode(\''.$url_link.$tmp->id_agente.'\')" href="#">';
|
||||
} else {
|
||||
$draw_agent_id = '<a href="'.$url_link.$tmp->id_agente.$url_link_hash.'">';
|
||||
$draw_agent_id = '<a href="'.$url_link.$tmp->id_agente.'">';
|
||||
}
|
||||
|
||||
$draw_agent_id .= $tmp->id_agente;
|
||||
|
|
|
@ -200,7 +200,8 @@ if (is_ajax() === true) {
|
|||
'status' => $status_agent,
|
||||
];
|
||||
|
||||
$data = get_inventory_basic_info_sql($params); // Aca se retorna
|
||||
$data = get_inventory_basic_info_sql($params);
|
||||
// Aca se retorna
|
||||
$count = get_inventory_basic_info_sql($params, true);
|
||||
|
||||
try {
|
||||
|
|
|
@ -53,6 +53,8 @@ $time_start = date('H:i:s', $date_params['date_init']);
|
|||
$date_init = date('Y/m/d', $date_params['date_init']);
|
||||
$time_init = date('H:i:s', $date_params['date_init']);
|
||||
|
||||
$time = $time_end;
|
||||
|
||||
$custom_date_end = date('Y/m/d H:i:s', $date_params['date_end']);
|
||||
|
||||
$period = $date_params['period'];
|
||||
|
|
|
@ -133,16 +133,16 @@ $table->data[0][3] = "<a href='index.php?search_category=modules&keywords=".$con
|
|||
// ~ $table->data[0][5] = "<a href='index.php?search_category=alerts&keywords=" . $config['search_keywords'] . "&head_search_keywords=Search'>" .
|
||||
// ~ sprintf(__("%s Found"), $totalAlerts) . "</a>";
|
||||
// ---------------------------------------------------------------------
|
||||
$table->data[0][6] = html_print_image('images/input_user.png', true, ['title' => __('Users found'), 'class' => 'invert_filter']);
|
||||
$table->data[0][6] = html_print_image('images/input_user.png', true, ['title' => __('Users found')]);
|
||||
$table->data[0][7] = "<a href='index.php?search_category=users&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalUsers).'</a>';
|
||||
$table->data[0][8] = html_print_image('images/chart_curve.png', true, ['title' => __('Graphs found'), 'class' => 'invert_filter']);
|
||||
$table->data[0][9] = "<a href='index.php?search_category=graphs&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalGraphs).'</a>';
|
||||
$table->data[0][10] = html_print_image('images/reporting.png', true, ['title' => __('Reports found'), 'class' => 'invert_filter']);
|
||||
$table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalReports).'</a>';
|
||||
$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Visual consoles')]);
|
||||
$table->data[0][12] = html_print_image('images/visual_console_green.png', true, ['title' => __('Visual consoles'), 'class' => 'main_menu_icon invert_filter']);
|
||||
$table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalMaps).'</a>';
|
||||
if (enterprise_installed()) {
|
||||
$table->data[0][14] = html_print_image('images/policy@svg.svg', true, ['title' => __('Policies'), 'class' => 'main_menu_icon']);
|
||||
$table->data[0][14] = html_print_image('images/policy@svg.svg', true, ['title' => __('Policies'), 'class' => 'main_menu_icon invert_filter']);
|
||||
$table->data[0][15] = "<a href='index.php?search_category=policies&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".sprintf(__('%s Found'), $totalPolicies).'</a>';
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,10 @@ if ($searchMain) {
|
|||
'text' => "<a href='index.php?search_category=main&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
||||
'images/zoom_mc.png',
|
||||
true,
|
||||
['title' => __('Global search')]
|
||||
[
|
||||
'title' => __('Global search'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $searchTab == 'main',
|
||||
];
|
||||
|
@ -79,7 +82,10 @@ if ($searchAgents) {
|
|||
'text' => "<a href='index.php?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
||||
'images/op_monitoring.png',
|
||||
true,
|
||||
['title' => __('Agents')]
|
||||
[
|
||||
'title' => __('Agents'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $searchTab == 'agents',
|
||||
];
|
||||
|
@ -92,7 +98,10 @@ if ($searchUsers) {
|
|||
'text' => "<a href='index.php?search_category=users&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
||||
'images/op_workspace.png',
|
||||
true,
|
||||
['title' => __('Users')]
|
||||
[
|
||||
'title' => __('Users'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $searchTab == 'users',
|
||||
];
|
||||
|
@ -105,7 +114,10 @@ if ($searchAlerts) {
|
|||
'text' => "<a href='index.php?search_category=alerts&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
||||
'images/op_alerts.png',
|
||||
true,
|
||||
['title' => __('Alerts')]
|
||||
[
|
||||
'title' => __('Alerts'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $searchTab == 'alerts',
|
||||
];
|
||||
|
@ -118,7 +130,10 @@ if ($searchGraphs) {
|
|||
'text' => "<a href='index.php?search_category=graphs&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
||||
'images/chart.png',
|
||||
true,
|
||||
['title' => __('Graphs')]
|
||||
[
|
||||
'title' => __('Graphs'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $searchTab == 'graphs',
|
||||
];
|
||||
|
@ -131,7 +146,10 @@ if ($searchReports) {
|
|||
'text' => "<a href='index.php?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
||||
'images/op_reporting.png',
|
||||
true,
|
||||
['title' => __('Reports')]
|
||||
[
|
||||
'title' => __('Reports'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $searchTab == 'reports',
|
||||
];
|
||||
|
@ -144,7 +162,10 @@ if ($searchMaps) {
|
|||
'text' => "<a href='index.php?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
||||
'images/visual_console.png',
|
||||
true,
|
||||
['title' => __('Visual consoles')]
|
||||
[
|
||||
'title' => __('Visual consoles'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $searchTab == 'maps',
|
||||
];
|
||||
|
@ -157,7 +178,10 @@ if ($searchModules) {
|
|||
'text' => "<a href='index.php?search_category=modules&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(
|
||||
'images/brick.png',
|
||||
true,
|
||||
['title' => __('Modules')]
|
||||
[
|
||||
'title' => __('Modules'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $searchTab == 'modules',
|
||||
];
|
||||
|
@ -172,7 +196,7 @@ if ($searchPolicies) {
|
|||
true,
|
||||
[
|
||||
'title' => __('Policies'),
|
||||
'class' => 'main_menu_icon',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
'active' => $searchTab == 'policies',
|
||||
|
|
|
@ -79,6 +79,17 @@ foreach ($vcs as $key => $data) {
|
|||
}
|
||||
}
|
||||
|
||||
$id_user_url = get_parameter('id_user', $config['id_user']);
|
||||
if (empty($visualConsoleId) === true) {
|
||||
foreach ($vcs as $key => $data) {
|
||||
$hash_compare = User::generatePublicHashUser($key, $id_user_url);
|
||||
if (hash_equals($hash_compare, $hash)) {
|
||||
$visualConsoleId = (int) $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($visualConsoleId) === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
%define debug_package %{nil}
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.776
|
||||
%define release 240425
|
||||
%define release 240430
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
%define debug_package %{nil}
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.776
|
||||
%define release 240425
|
||||
%define release 240430
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.776
|
||||
%define release 240425
|
||||
%define release 240430
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -71,7 +71,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
|
|||
('trap2agent', '0'),
|
||||
('date_format', 'F j, Y, g:i a'),
|
||||
('event_view_hr', 8),
|
||||
('loginhash_pwd', ''),
|
||||
('JWT_signature', 1),
|
||||
('trap2agent', 0),
|
||||
('prominent_time', 'comparation'),
|
||||
('timesource', 'system'),
|
||||
|
@ -2863,7 +2863,7 @@ SET @short_name = 'pandorafms.vmware';
|
|||
SET @name = 'VMware';
|
||||
SET @section = 'app';
|
||||
SET @description = 'Monitor ESXi hosts, datastores and VMs from a specific datacenter';
|
||||
SET @version = '1.4';
|
||||
SET @version = '1.5';
|
||||
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
|
||||
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;
|
||||
|
||||
|
@ -2947,7 +2947,7 @@ SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_na
|
|||
INSERT IGNORE INTO `tdiscovery_apps_scripts` (`id_app`, `macro`, `value`) VALUES (@id_app, '_exec1_', 'bin/pandora_proxmox');
|
||||
|
||||
-- Insert into tdiscovery_apps_executions
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' -g '__taskGroup__' --host '_host_' --port '_port_' --user '_user_' --password '_password_' --vm '_scanVM_' --lxc '_scanLXC_' --backups '_scanBackups_' --nodes '_scanNodes_' --transfer_mode tentacle --tentacle_address '_tentacleIP_' --tentacle_port '_tentaclePort_' --as_discovery_plugin 1');
|
||||
INSERT IGNORE INTO `tdiscovery_apps_executions` (`id`, `id_app`, `execution`) VALUES (1, @id_app, ''_exec1_' --conf '_tempfileProxmox_'');
|
||||
|
||||
-- Insert new SAP APP
|
||||
SET @short_name = 'pandorafms.sap.deset';
|
||||
|
|
|
@ -92,6 +92,11 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
|
|||
*/
|
||||
protected $indexAxis;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $theme;
|
||||
|
||||
|
||||
/**
|
||||
* @return Layout
|
||||
|
@ -194,7 +199,7 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
|
|||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return boolean
|
||||
*/
|
||||
public function disableAnimation()
|
||||
{
|
||||
|
@ -323,6 +328,32 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get font color.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTheme()
|
||||
{
|
||||
return $this->theme;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set font color.
|
||||
*
|
||||
* @param string $Theme Global font color.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTheme($theme)
|
||||
{
|
||||
$this->theme = $theme;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -30,7 +30,7 @@ class JavaScript extends Renderer
|
|||
|
||||
// Watermark.
|
||||
if (empty($this->chart->defaults()->getWatermark()) === false) {
|
||||
$script[] = 'const chart_watermark_'.$this->chart->getId().' = {
|
||||
$script[] = 'const chart_watermark_'.$this->chart->getId().' = {
|
||||
id: "chart_watermark_'.$this->chart->getId().'",
|
||||
beforeDraw: (chart) => {
|
||||
if (Object.prototype.hasOwnProperty.call(chart, "config") &&
|
||||
|
@ -128,11 +128,9 @@ class JavaScript extends Renderer
|
|||
}
|
||||
}
|
||||
};';
|
||||
$script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');';
|
||||
$script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Create chart.
|
||||
$script[] = 'try {';
|
||||
$script[] = " var chart = new Chart( ctx, {$json} );";
|
||||
|
@ -143,6 +141,32 @@ class JavaScript extends Renderer
|
|||
$script[] = ' Chart.defaults.font.style = "'.($this->chart->defaults()->getFonts()->getStyle() ?? 'normal').'";';
|
||||
$script[] = ' Chart.defaults.font.weight = "'.($this->chart->defaults()->getFonts()->getWeight() ?? '').'";';
|
||||
|
||||
if ($this->chart->options()->getTheme() !== null) {
|
||||
if ((int) $this->chart->options()->getTheme() === 2) {
|
||||
$script[] = ' Chart.defaults.color = "#ffffff";';
|
||||
|
||||
$script[] = '
|
||||
if (chart.config.options.scales !== undefined
|
||||
&& chart.config.options.scales.x !== undefined
|
||||
&& chart.config.options.scales.x.ticks !== undefined
|
||||
) {
|
||||
chart.config.options.scales.x.ticks.color = "#ffffff";
|
||||
}
|
||||
|
||||
if (chart.config.options.scales !== undefined &&
|
||||
chart.config.options.scales.y !== undefined &&
|
||||
chart.config.options.scales.y.ticks !== undefined
|
||||
) {
|
||||
chart.config.options.scales.y.ticks.color = "#ffffff";
|
||||
}
|
||||
|
||||
if (chart.config.options.title !== undefined ) {
|
||||
chart.config.options.title.fontColor = "#ffffff";
|
||||
}
|
||||
';
|
||||
}
|
||||
}
|
||||
|
||||
$script[] = '} catch (error) {';
|
||||
$script[] = ' console.error(error);';
|
||||
$script[] = '}';
|
||||
|
|
|
@ -2,24 +2,6 @@
|
|||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit94a17e624d873685991e8ae888e00eb9::getLoader();
|
||||
|
|
|
@ -42,9 +42,6 @@ namespace Composer\Autoload;
|
|||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var ?string */
|
||||
private $vendorDir;
|
||||
|
||||
|
@ -109,7 +106,6 @@ class ClassLoader
|
|||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -429,8 +425,7 @@ class ClassLoader
|
|||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
includeFile($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -560,26 +555,18 @@ class ClassLoader
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
* @private
|
||||
*/
|
||||
function includeFile($file)
|
||||
{
|
||||
include $file;
|
||||
}
|
||||
|
|
|
@ -21,14 +21,12 @@ use Composer\Semver\VersionParser;
|
|||
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
||||
*
|
||||
* To require its presence, you can require `composer-runtime-api ^2.0`
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InstalledVersions
|
||||
{
|
||||
/**
|
||||
* @var mixed[]|null
|
||||
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
|
||||
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
||||
*/
|
||||
private static $installed;
|
||||
|
||||
|
@ -39,7 +37,7 @@ class InstalledVersions
|
|||
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||
*/
|
||||
private static $installedByVendor = array();
|
||||
|
||||
|
@ -98,7 +96,7 @@ class InstalledVersions
|
|||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,7 +117,7 @@ class InstalledVersions
|
|||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
|
@ -243,7 +241,7 @@ class InstalledVersions
|
|||
|
||||
/**
|
||||
* @return array
|
||||
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
|
||||
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
||||
*/
|
||||
public static function getRootPackage()
|
||||
{
|
||||
|
@ -257,7 +255,7 @@ class InstalledVersions
|
|||
*
|
||||
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
||||
* @return array[]
|
||||
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
|
||||
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
||||
*/
|
||||
public static function getRawData()
|
||||
{
|
||||
|
@ -266,7 +264,7 @@ class InstalledVersions
|
|||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C' && is_file(__DIR__ . '/installed.php')) {
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = include __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
|
@ -280,7 +278,7 @@ class InstalledVersions
|
|||
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
||||
*
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||
*/
|
||||
public static function getAllRawData()
|
||||
{
|
||||
|
@ -303,7 +301,7 @@ class InstalledVersions
|
|||
* @param array[] $data A vendor/composer/installed.php data set
|
||||
* @return void
|
||||
*
|
||||
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
|
||||
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
||||
*/
|
||||
public static function reload($data)
|
||||
{
|
||||
|
@ -313,7 +311,7 @@ class InstalledVersions
|
|||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
|
||||
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
||||
*/
|
||||
private static function getInstalled()
|
||||
{
|
||||
|
@ -328,9 +326,7 @@ class InstalledVersions
|
|||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
|
@ -341,18 +337,13 @@ class InstalledVersions
|
|||
if (null === self::$installed) {
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C' && is_file(__DIR__ . '/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
self::$installed = require __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
|
|
|
@ -2,33 +2,28 @@
|
|||
|
||||
// autoload_files.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'e8aa6e4b5a1db2f56ae794f1505391a8' => $vendorDir . '/amphp/amp/lib/functions.php',
|
||||
'76cd0796156622033397994f25b0d8fc' => $vendorDir . '/amphp/amp/lib/Internal/functions.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'6cd5651c4fef5ed6b63e8d8b8ffbf3cc' => $vendorDir . '/amphp/byte-stream/lib/functions.php',
|
||||
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'6cd5651c4fef5ed6b63e8d8b8ffbf3cc' => $vendorDir . '/amphp/byte-stream/lib/functions.php',
|
||||
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
|
||||
'3da389f428d8ee50333e4391c3f45046' => $vendorDir . '/amphp/serialization/src/functions.php',
|
||||
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
|
||||
'8dc56fe697ca93c4b40d876df1c94584' => $vendorDir . '/amphp/process/lib/functions.php',
|
||||
'bcb7d4fc55f4b1a7e10f5806723e9892' => $vendorDir . '/amphp/sync/src/functions.php',
|
||||
'e187e371b30897d6dc51cac6a8c94ff6' => $vendorDir . '/amphp/sync/src/ConcurrentIterator/functions.php',
|
||||
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
|
||||
'430de19db8b7ee88fdbe5c545d82d33d' => $vendorDir . '/amphp/parallel/lib/Context/functions.php',
|
||||
'888e1afeed2e8d13ef5a662692091e6e' => $vendorDir . '/amphp/parallel/lib/Sync/functions.php',
|
||||
'384cf4f2eb4d2f896db72315a76066ad' => $vendorDir . '/amphp/parallel/lib/Worker/functions.php',
|
||||
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
||||
'253c157292f75eb38082b5acb06f3f01' => $vendorDir . '/nikic/fast-route/src/functions.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'861372841bb4b8ba9fdd215894666f40' => $vendorDir . '/amphp/parallel-functions/src/functions.php',
|
||||
'07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php',
|
||||
'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php',
|
||||
'3d97c8dcdfba8cb85d3b34f116bb248b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php',
|
||||
|
@ -36,6 +31,11 @@ return array(
|
|||
'de95e0ac670b27c84ef8c5ac41fc1b34' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.php',
|
||||
'b6c2870932b0250c10334a86dcb33c7f' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php',
|
||||
'd02cf21124526632320d6f20b1bbf905' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.php',
|
||||
'6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php',
|
||||
'253c157292f75eb38082b5acb06f3f01' => $vendorDir . '/nikic/fast-route/src/functions.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php',
|
||||
'861372841bb4b8ba9fdd215894666f40' => $vendorDir . '/amphp/parallel-functions/src/functions.php',
|
||||
'db356362850385d08a5381de2638b5fd' => $vendorDir . '/mpdf/mpdf/src/functions.php',
|
||||
'b33e3d135e5d9e47d845c576147bda89' => $vendorDir . '/php-di/php-di/src/functions.php',
|
||||
'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php',
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
|
@ -31,6 +31,7 @@ return array(
|
|||
'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-handler/src', $vendorDir . '/psr/http-server-middleware/src'),
|
||||
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
|
||||
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
||||
'Psr\\Clock\\' => array($vendorDir . '/psr/clock/src'),
|
||||
'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'),
|
||||
'PandoraFMS\\Enterprise\\' => array($baseDir . '/enterprise/include/lib'),
|
||||
'PandoraFMS\\' => array($baseDir . '/include/lib'),
|
||||
|
@ -42,6 +43,8 @@ return array(
|
|||
'Mpdf\\' => array($vendorDir . '/mpdf/mpdf/src'),
|
||||
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
|
||||
'Models\\' => array($baseDir . '/include/rest-api/models'),
|
||||
'Lcobucci\\JWT\\' => array($vendorDir . '/lcobucci/jwt/src'),
|
||||
'Lcobucci\\Clock\\' => array($vendorDir . '/lcobucci/clock/src'),
|
||||
'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'),
|
||||
'Laminas\\Json\\' => array($vendorDir . '/laminas/laminas-json/src'),
|
||||
'Laminas\\Diactoros\\' => array($vendorDir . '/laminas/laminas-diactoros/src'),
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue