Merge branch 'develop' into 'ent-7804-modificar-comportamiento-file-manager'
# Conflicts: # pandora_console/include/functions_filemanager.php
This commit is contained in:
commit
6b90b33a26
|
@ -151,7 +151,7 @@ execute_cmd "yum install -y $extra_repos" "Installing extra repositories"
|
|||
execute_cmd "yum-config-manager --enable remi-php73" "Configuring PHP"
|
||||
|
||||
# Install percona Database
|
||||
[ -f /etc/resolv.conf ] && rm -rf /etc/my.cnf
|
||||
[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf
|
||||
execute_cmd "yum install -y Percona-Server-server-57" "Installing Percona Server"
|
||||
|
||||
# Console dependencies
|
||||
|
@ -429,6 +429,7 @@ sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini
|
|||
sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini
|
||||
sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini
|
||||
sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini
|
||||
sed -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini
|
||||
|
||||
cat > /var/www/html/index.html << EOF_INDEX
|
||||
<meta HTTP-EQUIV="REFRESH" content="0; url=/pandora_console/">
|
||||
|
|
|
@ -149,6 +149,7 @@ EOF_INDEX
|
|||
sed -i -e "s/^max_execution_time.*/max_execution_time = 0/g" /etc/php.ini
|
||||
sed -i -e "s/^upload_max_filesize.*/upload_max_filesize = 800M/g" /etc/php.ini
|
||||
sed -i -e "s/^memory_limit.*/memory_limit = 800M/g" /etc/php.ini
|
||||
sed -i -e "s/.*post_max_size =.*/post_max_size = 800M/" /etc/php.ini
|
||||
|
||||
echo "- Setting Public URL: $PUBLICURL"
|
||||
q=$(mysql -u$DBUSER -p$DBPASS $DBNAME -h$DBHOST -sNe "select token from tconfig;" | grep public_url)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, AIX version
|
||||
# Version 7.0NG.756, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, FreeBSD Version
|
||||
# Version 7.0NG.756, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, HP-UX Version
|
||||
# Version 7.0NG.756, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Version 7.0NG.756, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Version 7.0NG.756, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, Solaris Version
|
||||
# Version 7.0NG.756, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.755
|
||||
# Version 7.0NG.756
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.755, AIX version
|
||||
# Version 7.0NG.756, AIX version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.755
|
||||
# Version 7.0NG.756
|
||||
# FreeBSD/IPSO version
|
||||
# Licenced under GPL licence, 2003-2007 Sancho Lerena
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.755, HPUX Version
|
||||
# Version 7.0NG.756, HPUX Version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755
|
||||
# Version 7.0NG.756
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755
|
||||
# Version 7.0NG.756
|
||||
# Licensed under GPL license v2,
|
||||
# (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755
|
||||
# Version 7.0NG.756
|
||||
# Licensed under GPL license v2,
|
||||
# please visit http://pandora.sourceforge.net
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Fichero de configuracion base de agentes de Pandora
|
||||
# Base config file for Pandora agents
|
||||
# Version 7.0NG.755, Solaris version
|
||||
# Version 7.0NG.756, Solaris version
|
||||
|
||||
# General Parameters
|
||||
# ==================
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, AIX version
|
||||
# Version 7.0NG.756, AIX version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.755-210716
|
||||
Version: 7.0NG.756-210901
|
||||
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.755-210716"
|
||||
pandora_version="7.0NG.756-210901"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -31,7 +31,7 @@ fi
|
|||
if [ "$#" -ge 2 ]; then
|
||||
VERSION="$2"
|
||||
else
|
||||
VERSION="7.0NG.755"
|
||||
VERSION="7.0NG.756"
|
||||
fi
|
||||
|
||||
# Path for the generated DMG file
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
<choice id="com.pandorafms.pandorafms_src" visible="false">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.755" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.756" onConclusion="none">pandorafms_src.pdk</pkg-ref>
|
||||
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
|
||||
</choice>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.755" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.756" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
|
||||
<!-- <installation-check script="check()" />
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
|
||||
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
|
||||
|
||||
<key>CFBundleVersion</key> <string>7.0NG.755</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.755 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.755</string>
|
||||
<key>CFBundleVersion</key> <string>7.0NG.756</string>
|
||||
<key>CFBundleGetInfoString</key> <string>7.0NG.756 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
|
||||
<key>CFBundleShortVersionString</key> <string>7.0NG.756</string>
|
||||
|
||||
<key>NSPrincipalClass</key><string>NSApplication</string>
|
||||
<key>NSMainNibFile</key><string>MainMenu</string>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Version 7.0NG.756, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, FreeBSD Version
|
||||
# Version 7.0NG.756, FreeBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, HP-UX Version
|
||||
# Version 7.0NG.756, HP-UX Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Version 7.0NG.756, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, GNU/Linux
|
||||
# Version 7.0NG.756, GNU/Linux
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, NetBSD Version
|
||||
# Version 7.0NG.756, NetBSD Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Base config file for Pandora FMS agents
|
||||
# Version 7.0NG.755, Solaris Version
|
||||
# Version 7.0NG.756, Solaris Version
|
||||
# Licensed under GPL license v2,
|
||||
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
|
||||
# http://www.pandorafms.com
|
||||
|
|
|
@ -1014,8 +1014,8 @@ my $Sem = undef;
|
|||
# Semaphore used to control the number of threads
|
||||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.755';
|
||||
use constant AGENT_BUILD => '210716';
|
||||
use constant AGENT_VERSION => '7.0NG.756';
|
||||
use constant AGENT_BUILD => '210901';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.755
|
||||
%define release 210716
|
||||
%define version 7.0NG.756
|
||||
%define release 210901
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
#Pandora FMS Linux Agent
|
||||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.755
|
||||
%define release 210716
|
||||
%define version 7.0NG.756
|
||||
%define release 210901
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
|
||||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.755"
|
||||
PI_BUILD="210716"
|
||||
PI_VERSION="7.0NG.756"
|
||||
PI_BUILD="210901"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Base config file for Pandora FMS Windows Agent
|
||||
# (c) 2006-2021 Artica Soluciones Tecnologicas
|
||||
# Version 7.0NG.755
|
||||
# Version 7.0NG.756
|
||||
# This program is Free Software, you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public Licence as published by the Free Software
|
||||
# Foundation; either version 2 of the Licence or any later version
|
||||
|
|
|
@ -3,7 +3,7 @@ AllowLanguageSelection
|
|||
{Yes}
|
||||
|
||||
AppName
|
||||
{Pandora FMS Windows Agent v7.0NG.755}
|
||||
{Pandora FMS Windows Agent v7.0NG.756}
|
||||
|
||||
ApplicationID
|
||||
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
|
||||
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{210716}
|
||||
{210901}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.755 Build 210716")
|
||||
#define PANDORA_VERSION ("7.0NG.756 Build 210901")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.755(Build 210716))"
|
||||
VALUE "ProductVersion", "(7.0NG.756(Build 210901))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.755-210716
|
||||
Version: 7.0NG.756-210901
|
||||
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.755-210716"
|
||||
pandora_version="7.0NG.756-210901"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -33,10 +33,19 @@ function users_extension_main_god($god=true)
|
|||
$image = 'images/user.png';
|
||||
}
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
ui_print_page_header(__('Users connected'), $image, false, '', $god);
|
||||
|
||||
// Get groups user has permission
|
||||
$check_profile = db_get_row('tusuario_perfil', 'id_usuario', $config['id_user'], 'id_up');
|
||||
if ($check_profile === false && !users_is_admin()) {
|
||||
return ui_print_error_message(
|
||||
__('This user does not have any associated profile'),
|
||||
'',
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
// Get groups user has permission.
|
||||
$group_um = users_get_groups_UM($config['id_user']);
|
||||
// Is admin or has group permissions all.
|
||||
$groups = implode(',', array_keys($group_um, 1));
|
||||
|
@ -44,51 +53,85 @@ function users_extension_main_god($god=true)
|
|||
// Get user conected last 5 minutes.Show only those on which the user has permission.
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$sql = sprintf(
|
||||
'SELECT tusuario.id_user, tusuario.last_connect
|
||||
FROM tusuario
|
||||
INNER JOIN tusuario_perfil ON tusuario_perfil.id_usuario = tusuario.id_user
|
||||
AND tusuario_perfil.id_grupo IN (%s)
|
||||
WHERE last_connect > (UNIX_TIMESTAMP(NOW()) - '.SECONDS_5MINUTES.')
|
||||
GROUP BY tusuario.id_user
|
||||
ORDER BY last_connect DESC',
|
||||
$groups
|
||||
);
|
||||
if (users_is_admin()) {
|
||||
$sql = sprintf(
|
||||
'SELECT tusuario.id_user, tusuario.last_connect
|
||||
FROM tusuario
|
||||
WHERE last_connect > (UNIX_TIMESTAMP(NOW()) - '.SECONDS_5MINUTES.')
|
||||
GROUP BY tusuario.id_user
|
||||
ORDER BY last_connect DESC'
|
||||
);
|
||||
} else {
|
||||
$sql = sprintf(
|
||||
'SELECT tusuario.id_user, tusuario.last_connect
|
||||
FROM tusuario
|
||||
INNER JOIN tusuario_perfil ON tusuario_perfil.id_usuario = tusuario.id_user
|
||||
AND tusuario_perfil.id_grupo IN (%s)
|
||||
WHERE last_connect > (UNIX_TIMESTAMP(NOW()) - '.SECONDS_5MINUTES.')
|
||||
GROUP BY tusuario.id_user
|
||||
ORDER BY last_connect DESC',
|
||||
$groups
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$sql = sprintf(
|
||||
"SELECT tusuario.id_user, tusuario.last_connect
|
||||
FROM tusuario
|
||||
INNER JOIN tusuario_perfil ON tusuario_perfil.id_usuario = tusuario.id_user
|
||||
AND tusuario_perfil.id_grupo IN (%s)
|
||||
WHERE last_connect > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_5MINUTES.')
|
||||
GROUP BY tusuario.id_user
|
||||
ORDER BY last_connect DESC',
|
||||
$groups
|
||||
);
|
||||
if (users_is_admin()) {
|
||||
$sql = sprintf(
|
||||
"SELECT tusuario.id_user, tusuario.last_connect
|
||||
FROM tusuario
|
||||
WHERE last_connect > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_5MINUTES.')
|
||||
GROUP BY tusuario.id_user
|
||||
ORDER BY last_connect DESC'
|
||||
);
|
||||
} else {
|
||||
$sql = sprintf(
|
||||
"SELECT tusuario.id_user, tusuario.last_connect
|
||||
FROM tusuario
|
||||
INNER JOIN tusuario_perfil ON tusuario_perfil.id_usuario = tusuario.id_user
|
||||
AND tusuario_perfil.id_grupo IN (%s)
|
||||
WHERE last_connect > (ceil(date_part('epoch', CURRENT_TIMESTAMP)) - ".SECONDS_5MINUTES.')
|
||||
GROUP BY tusuario.id_user
|
||||
ORDER BY last_connect DESC',
|
||||
$groups
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$sql = sprintf(
|
||||
"SELECT tusuario.id_user, tusuario.last_connect
|
||||
FROM tusuario
|
||||
INNER JOIN tusuario_perfil ON tusuario_perfil.id_usuario = tusuario.id_user
|
||||
AND tusuario_perfil.id_grupo IN (%s)
|
||||
WHERE last_connect > (ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_5MINUTES.')
|
||||
GROUP BY tusuario.id_user
|
||||
ORDER BY last_connect DESC',
|
||||
$groups
|
||||
);
|
||||
if (users_is_admin()) {
|
||||
$sql = sprintf(
|
||||
"SELECT tusuario.id_user, tusuario.last_connect
|
||||
FROM tusuario
|
||||
WHERE last_connect > (ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_5MINUTES.')
|
||||
GROUP BY tusuario.id_user
|
||||
ORDER BY last_connect DESC'
|
||||
);
|
||||
} else {
|
||||
$sql = sprintf(
|
||||
"SELECT tusuario.id_user, tusuario.last_connect
|
||||
FROM tusuario
|
||||
INNER JOIN tusuario_perfil ON tusuario_perfil.id_usuario = tusuario.id_user
|
||||
AND tusuario_perfil.id_grupo IN (%s)
|
||||
WHERE last_connect > (ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) - '.SECONDS_5MINUTES.')
|
||||
GROUP BY tusuario.id_user
|
||||
ORDER BY last_connect DESC',
|
||||
$groups
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
|
||||
$rows = db_get_all_rows_sql($sql);
|
||||
|
||||
if (empty($rows)) {
|
||||
$rows = [];
|
||||
echo "<div class='nf'>".__('No other users connected').'</div>';
|
||||
} else {
|
||||
$table = new StdClass();
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->width = '100%';
|
||||
|
@ -105,7 +148,7 @@ function users_extension_main_god($god=true)
|
|||
$rowPair = true;
|
||||
$iterator = 0;
|
||||
|
||||
// Get data
|
||||
// Get data.
|
||||
foreach ($rows as $row) {
|
||||
// Get data of user's last login.
|
||||
switch ($config['dbtype']) {
|
||||
|
@ -135,6 +178,10 @@ function users_extension_main_god($god=true)
|
|||
)
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
|
||||
if ($rowPair) {
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
|
||||
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
|
||||
ALTER TABLE `tmetaconsole_setup` ADD COLUMN `unified` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
|
||||
ALTER TABLE `tlayout` ADD COLUMN `auto_adjust` INTEGER UNSIGNED NOT NULL default 0;
|
||||
ALTER TABLE `tlayout_data` ADD COLUMN `title` TEXT default '';
|
||||
|
||||
|
@ -24,11 +27,9 @@ CREATE TABLE IF NOT EXISTS `tsync_queue` (
|
|||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
SOURCE './procedures/updateSnmpAlerts.sql';
|
||||
|
||||
UPDATE `tlink` SET `link` = 'https://pandorafms.com/manual/' WHERE `id_link` = 0000000001;
|
||||
|
||||
UPDATE pandora.tuser_task
|
||||
UPDATE `tuser_task`
|
||||
SET parameters='a:7:{i:0;a:7:{s:11:"description";s:30:"Template pending to be created";s:5:"table";s:16:"treport_template";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:8:"required";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:7:{s:11:"description";s:6:"Agents";s:5:"table";s:7:"tagente";s:8:"field_id";s:9:"id_agente";s:10:"field_name";s:6:"nombre";s:8:"multiple";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_grupo";}i:2;a:2:{s:11:"description";s:16:"Report per agent";s:10:"select_two";b:1;}i:3;a:2:{s:11:"description";s:11:"Report name";s:4:"type";s:6:"string";}i:4;a:2:{s:11:"description";s:47:"Send to e-mail addresses (separated by a comma)";s:4:"type";s:4:"text";}i:5;a:2:{s:11:"description";s:7:"Subject";s:8:"optional";i:1;}i:6;a:3:{s:11:"description";s:7:"Message";s:4:"type";s:4:"text";s:8:"optional";i:1;}}i:7;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}'
|
||||
WHERE id=2;
|
||||
|
||||
|
@ -37,7 +38,7 @@ UPDATE `tuser_task_scheduled` SET
|
|||
`args`= REPLACE(`args`, 's:15:"first_execution"', 'i:2;s:0:"";i:7;s:3:"PDF";s:15:"first_execution"')
|
||||
WHERE `id_user_task` = 2;
|
||||
|
||||
UPDATE `tconfig` SET `value` = 0 WHERE `token` = `centralized_management`;
|
||||
UPDATE `tconfig` SET `value` = 0 WHERE `token` = 'centralized_management';
|
||||
|
||||
DELETE ta FROM `tagente` ta LEFT JOIN `tgrupo` tg on ta.`id_grupo` = tg.`id_grupo` WHERE tg.`id_grupo` IS NULL;
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
START TRANSACTION;
|
||||
|
||||
UPDATE `tconfig` set value = 'Lato-Regular.ttf' WHERE token LIKE 'custom_report_front_font';
|
||||
UPDATE `tconfig` set value = 'Lato-Regular.ttf' WHERE token LIKE 'fontpath';
|
||||
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';
|
||||
|
||||
COMMIT;
|
|
@ -1,39 +0,0 @@
|
|||
DELIMITER //
|
||||
CREATE PROCEDURE updateSnmpAlerts()
|
||||
BEGIN
|
||||
DECLARE tokenId INT DEFAULT 0;
|
||||
DECLARE procedureRun INT DEFAULT 0;
|
||||
DECLARE done BOOLEAN DEFAULT FALSE;
|
||||
DECLARE a, b INT DEFAULT 0;
|
||||
DECLARE alertsCur CURSOR FOR SELECT id, id_alert_command FROM talert_actions;
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
|
||||
|
||||
SELECT id_config, value INTO tokenId, procedureRun FROM tconfig WHERE token = 'update_snmp_alerts_procedure_already_run' LIMIT 1;
|
||||
|
||||
IF procedureRun < 1 THEN
|
||||
SET done = FALSE;
|
||||
|
||||
OPEN alertsCur;
|
||||
|
||||
read_loop: LOOP
|
||||
FETCH alertsCur INTO a, b;
|
||||
IF done THEN
|
||||
LEAVE read_loop;
|
||||
END IF;
|
||||
|
||||
UPDATE talert_snmp SET id_alert = b WHERE id_alert = a;
|
||||
UPDATE talert_snmp_action SET alert_type = b WHERE alert_type = a;
|
||||
END LOOP;
|
||||
|
||||
CLOSE alertsCur;
|
||||
|
||||
IF tokenId < 1 THEN
|
||||
INSERT INTO tconfig (id_config, token, value) VALUES ('', 'update_snmp_alerts_procedure_already_run', '1');
|
||||
ELSE
|
||||
UPDATE tconfig SET value = 1 WHERE token = 'update_snmp_alerts_procedure_already_run';
|
||||
END IF;
|
||||
END IF;
|
||||
END//
|
||||
DELIMITER ;
|
||||
CALL updateSnmpAlerts();
|
||||
DROP PROCEDURE updateSnmpAlerts;
|
|
@ -418,6 +418,8 @@ ALTER TABLE `tmetaconsole_setup` MODIFY COLUMN `meta_dbuser` text NULL,
|
|||
|
||||
ALTER TABLE `tmetaconsole_setup` ADD COLUMN `server_uid` TEXT NOT NULL default '';
|
||||
|
||||
ALTER TABLE `tmetaconsole_setup` ADD COLUMN `unified` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tprofile_view`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -1026,6 +1028,7 @@ ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`);
|
|||
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`);
|
||||
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`);
|
||||
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`);
|
||||
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmetaconsole_event_history`
|
||||
|
@ -2348,6 +2351,8 @@ ALTER TABLE `tevento` ADD COLUMN `data` double(50,5) default NULL;
|
|||
|
||||
ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0';
|
||||
|
||||
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tevent_extended`
|
||||
-- ---------------------------------------------------------------------
|
||||
|
@ -2565,7 +2570,7 @@ ALTER TABLE `tnetflow_filter` MODIFY COLUMN `router_ip` text NOT NULL;
|
|||
UPDATE tuser_task set parameters = 'a:5:{i:0;a:6:{s:11:\"description\";s:28:\"Report pending to be created\";s:5:\"table\";s:7:\"treport\";s:8:\"field_id\";s:9:\"id_report\";s:10:\"field_name\";s:4:\"name\";s:4:\"type\";s:3:\"int\";s:9:\"acl_group\";s:8:\"id_group\";}i:1;a:2:{s:11:\"description\";s:46:\"Send to email addresses (separated by a comma)\";s:4:\"type\";s:4:\"text\";}i:2;a:2:{s:11:\"description\";s:7:\"Subject\";s:8:\"optional\";i:1;}i:3;a:3:{s:11:\"description\";s:7:\"Message\";s:4:\"type\";s:4:\"text\";s:8:\"optional\";i:1;}i:4;a:2:{s:11:\"description\";s:11:\"Report Type\";s:4:\"type\";s:11:\"report_type\";}}' where function_name = "cron_task_generate_report";
|
||||
INSERT IGNORE INTO tuser_task VALUES (8, 'cron_task_generate_csv_log', 'a:1:{i:0;a:2:{s:11:"description";s:14:"Send to e-mail";s:4:"type";s:4:"text";}}', 'Send csv log');
|
||||
UPDATE `tuser_task` SET `parameters`='a:4:{i:0;a:6:{s:11:"description";s:28:"Report pending to be created";s:5:"table";s:7:"treport";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:2:{s:11:"description";s:426:"Save to disk in path<a href="javascript:" class="tip" style="" ><img src="http://172.16.0.2/pandora_console/images/tip_help.png" data-title="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" data-use_title_for_force_title="1" class="forced_title" alt="The Apache user should have read-write access on this folder. E.g. /var/www/html/pandora_console/attachment" /></a>";s:4:"type";s:6:"string";}i:2;a:2:{s:11:"description";s:16:"File nane prefix";s:4:"type";s:6:"string";}i:3;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}' WHERE `id`=3;
|
||||
UPDATE pandora.tuser_task
|
||||
UPDATE `tuser_task`
|
||||
SET parameters='a:7:{i:0;a:7:{s:11:"description";s:30:"Template pending to be created";s:5:"table";s:16:"treport_template";s:8:"field_id";s:9:"id_report";s:10:"field_name";s:4:"name";s:8:"required";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_group";}i:1;a:7:{s:11:"description";s:6:"Agents";s:5:"table";s:7:"tagente";s:8:"field_id";s:9:"id_agente";s:10:"field_name";s:6:"nombre";s:8:"multiple";b:1;s:4:"type";s:3:"int";s:9:"acl_group";s:8:"id_grupo";}i:2;a:2:{s:11:"description";s:16:"Report per agent";s:10:"select_two";b:1;}i:3;a:2:{s:11:"description";s:11:"Report name";s:4:"type";s:6:"string";}i:4;a:2:{s:11:"description";s:47:"Send to e-mail addresses (separated by a comma)";s:4:"type";s:4:"text";}i:5;a:2:{s:11:"description";s:7:"Subject";s:8:"optional";i:1;}i:6;a:3:{s:11:"description";s:7:"Message";s:4:"type";s:4:"text";s:8:"optional";i:1;}}i:7;a:2:{s:11:"description";s:11:"Report Type";s:4:"type";s:11:"report_type";}}' WHERE id=2;
|
||||
DELETE FROM `tuser_task` WHERE id = 6;
|
||||
|
||||
|
@ -4073,3 +4078,5 @@ CREATE TABLE IF NOT EXISTS `talert_execution_queue` (
|
|||
`utimestamp` bigint(20) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
UPDATE `tlanguage` SET `name` = 'Deutsch' WHERE `id_language` = 'de';
|
|
@ -23,13 +23,8 @@ ui_require_css_file('order_interpreter');
|
|||
// Global errors/warnings checking.
|
||||
config_check();
|
||||
|
||||
echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
|
||||
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo '<div id="header_table" class="header_table_classic">';
|
||||
} else {
|
||||
echo '<div id="header_table" class="header_table_collapsed">';
|
||||
}
|
||||
?>
|
||||
<div id="header_table_inner">
|
||||
<?php
|
||||
|
|
|
@ -63,6 +63,7 @@ switch ($login_screen) {
|
|||
case 'error_perms':
|
||||
case 'homedir_bad_defined':
|
||||
case 'homeurl_bad_defined':
|
||||
case 'disabled_access_node':
|
||||
$logo_link = 'index.php';
|
||||
$logo_title = __('Go to Login');
|
||||
break;
|
||||
|
@ -208,6 +209,7 @@ if (is_metaconsole() === true) {
|
|||
switch ($login_screen) {
|
||||
case 'logout':
|
||||
case 'login':
|
||||
case 'disabled_access_node':
|
||||
if (!empty($page) && !empty($sec)) {
|
||||
foreach ($_POST as $key => $value) {
|
||||
html_print_input_hidden(io_safe_input($key), io_safe_input($value));
|
||||
|
@ -508,9 +510,29 @@ if ($login_screen == 'logout') {
|
|||
echo '</div>';
|
||||
}
|
||||
|
||||
if ($login_screen === 'disabled_access_node') {
|
||||
echo '<div id="disabled_access_node" title="'.__('User node access not enabled').'">';
|
||||
echo '<div class="content_alert">';
|
||||
echo '<div class="icon_message_alert">';
|
||||
echo html_print_image('images/icono_logo_pandora.png', true, ['alt' => __('Centralized user in metaconsole'), 'border' => 0]);
|
||||
echo '</div>';
|
||||
echo '<div class="content_message_alert">';
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<h1>'.__('Centralized user in metaconsole').'</h1>';
|
||||
echo '<p>'.__('This user does not have access on node, please enable node access on this user from metaconsole.').'</p>';
|
||||
echo '</div>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'hide-login-logout', false);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
switch ($login_screen) {
|
||||
case 'error_dbconfig':
|
||||
case 'error_authconfig':
|
||||
case 'disabled_node_access':
|
||||
if (!isset($config['rb_product_name_alt'])) {
|
||||
$title = __('Problem with %s database', get_product_name());
|
||||
} else {
|
||||
|
@ -694,6 +716,29 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
});
|
||||
break;
|
||||
|
||||
case 'disabled_access_node':
|
||||
$(document).ready (function () {
|
||||
$(function() {
|
||||
$("#disabled_access_node").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 220,
|
||||
width: 528,
|
||||
clickOutside: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#submit-hide-login-logout").click (function () {
|
||||
document.location = "<?php echo ui_get_full_url('index.php'); ?>";
|
||||
});
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
$(document).ready (function () {
|
||||
// IE9- modal warning window
|
||||
|
|
|
@ -1,17 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* Lateral Main Menu.
|
||||
*
|
||||
* @category Main Menu.
|
||||
* @package Pandora FMS.
|
||||
* @subpackage OpenSource.
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
if (! isset($config['id_user'])) {
|
||||
// Begin.
|
||||
if (isset($config['id_user']) === false) {
|
||||
include 'general/login_page.php';
|
||||
exit();
|
||||
}
|
||||
|
@ -20,9 +36,9 @@ if (! isset($config['id_user'])) {
|
|||
<script type="text/javascript" language="javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
var menuType_value = "<?php echo $config['menu_type']; ?>";
|
||||
var menuType_value = "<?php echo $_SESSION['menu_type']; ?>";
|
||||
|
||||
if (menuType_value == 'classic') {
|
||||
if (menuType_value === '' || menuType_value === 'classic') {
|
||||
$('ul.submenu').css('left', '214px');
|
||||
}
|
||||
else{
|
||||
|
@ -34,26 +50,22 @@ $(document).ready(function(){
|
|||
<?php
|
||||
$autohidden_menu = 0;
|
||||
|
||||
if (isset($config['autohidden_menu']) && $config['autohidden_menu']) {
|
||||
if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_menu'] === true) {
|
||||
$autohidden_menu = 1;
|
||||
}
|
||||
|
||||
// Menu container prepared to autohide menu
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo '<div id="menu_full" class="menu_full_classic">';
|
||||
} else {
|
||||
echo '<div id="menu_full" class="menu_full_collapsed">';
|
||||
}
|
||||
// Start of full lateral menu.
|
||||
echo sprintf('<div id="menu_full" class="menu_full_%s">', $menuTypeClass);
|
||||
|
||||
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
|
||||
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
|
||||
|
||||
if (!defined('PANDORA_ENTERPRISE')) {
|
||||
if (defined('PANDORA_ENTERPRISE') === false) {
|
||||
$logo_title = get_product_name().' Opensource';
|
||||
$custom_logo = 'images/custom_logo/pandora_logo_head_3.png';
|
||||
$custom_logo_collapsed = 'images/custom_logo/pandora_logo_green_collapsed.png';
|
||||
} else {
|
||||
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo)) {
|
||||
if (file_exists(ENTERPRISE_DIR.'/'.$custom_logo) === true) {
|
||||
$custom_logo = ENTERPRISE_DIR.'/'.$custom_logo;
|
||||
}
|
||||
|
||||
|
@ -61,54 +73,48 @@ if (!defined('PANDORA_ENTERPRISE')) {
|
|||
}
|
||||
|
||||
echo '<div class="logo_green"><a href="index.php?sec=main">';
|
||||
if (isset($config['custom_logo'])) {
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:block']);
|
||||
} else {
|
||||
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:none']);
|
||||
}
|
||||
|
||||
if (isset($config['custom_logo']) === true) {
|
||||
echo html_print_image(
|
||||
$custom_logo,
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'width' => '215',
|
||||
'alt' => $logo_title,
|
||||
'class' => 'logo_full',
|
||||
'style' => ($menuCollapsed === true) ? 'display:none' : 'display:block',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($config['custom_logo_collapsed'])) {
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:none']);
|
||||
} else {
|
||||
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:block']);
|
||||
}
|
||||
if (isset($config['custom_logo_collapsed']) === true) {
|
||||
echo html_print_image(
|
||||
$custom_logo_collapsed,
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'width' => '60',
|
||||
'alt' => $logo_title,
|
||||
'class' => 'logo_icon',
|
||||
'style' => ($menuCollapsed === true) ? 'display:block' : 'display:none',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
echo '</a></div>';
|
||||
|
||||
// echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
|
||||
require 'operation/menu.php';
|
||||
|
||||
// Check all enterprise ACL used in godmenu items to print menu headers
|
||||
if (check_acl($config['id_user'], 0, 'AW')
|
||||
|| check_acl($config['id_user'], 0, 'PM')
|
||||
|| check_acl($config['id_user'], 0, 'LM')
|
||||
|| check_acl($config['id_user'], 0, 'UM')
|
||||
|| check_acl($config['id_user'], 0, 'LW')
|
||||
|| check_acl($config['id_user'], 0, 'EW')
|
||||
|| check_acl($config['id_user'], 0, 'DW')
|
||||
) {
|
||||
// echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
|
||||
}
|
||||
|
||||
require 'godmode/menu.php';
|
||||
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo '<div id="button_collapse" class="button_classic button_collapse"></div>';
|
||||
} else {
|
||||
echo '<div id="button_collapse" class="button_collapsed button_collapse"></div>';
|
||||
}
|
||||
echo sprintf('<div id="button_collapse" class="button_%s button_collapse"></div>', $menuTypeClass);
|
||||
|
||||
// require ("links_menu.php");
|
||||
echo '</div>';
|
||||
// menu_container
|
||||
// Menu_container.
|
||||
ui_require_jquery_file('cookie');
|
||||
|
||||
$config_fixed_header = false;
|
||||
if (isset($config['fixed_header'])) {
|
||||
if (isset($config['fixed_header']) === true) {
|
||||
$config_fixed_header = $config['fixed_header'];
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
/**
|
||||
* Static page to lock access to console
|
||||
*
|
||||
* @category Wizard
|
||||
* @package Pandora FMS
|
||||
* @subpackage Applications.VMware
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
ui_require_css_file('maintenance');
|
||||
?>
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<div class="responsive center padding-6">
|
||||
<p><?php echo __('You cannot use this node until system is unified'); ?></p>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
html_print_image(
|
||||
'images/maintenance.png',
|
||||
false,
|
||||
[
|
||||
'class' => 'responsive',
|
||||
'width' => 800,
|
||||
]
|
||||
);
|
||||
?>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<p>
|
||||
<?php
|
||||
echo __(
|
||||
'Please navigate to %s to unify system',
|
||||
'<a href="'.ui_get_meta_url(
|
||||
'index.php?sec=advanced&sec2=advanced/command_center'
|
||||
).'" target="_new">'.__('command center').'</a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<br>
|
||||
<p><?php echo __('You will be automatically redirected when all tasks finish'); ?></p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
setTimeout(
|
||||
function() {
|
||||
location.reload();
|
||||
},
|
||||
10000
|
||||
);
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
|
@ -349,7 +349,14 @@ if (isset($groups[$grupo]) || $new_agent) {
|
|||
}
|
||||
|
||||
$table_primary_group .= '<div class="label_select_child_icons"><span id="group_preview">';
|
||||
$table_primary_group .= ui_print_group_icon($grupo, true);
|
||||
if ($id_agente === 0) {
|
||||
$hidden = 'display: none;';
|
||||
} else {
|
||||
$hidden = '';
|
||||
}
|
||||
|
||||
$table_primary_group .= ui_print_group_icon($grupo, true, 'groups_small', $hidden);
|
||||
|
||||
$table_primary_group .= '</span></div></div></div>';
|
||||
|
||||
$table_interval = '<div class="label_select"><p class="input_label">'.__('Interval').'</p>';
|
||||
|
@ -500,7 +507,10 @@ if (enterprise_installed()) {
|
|||
false,
|
||||
// Delete_groups.
|
||||
// Do not show the primary group in this selection.
|
||||
array_merge(($secondary_groups_selected['plain'] ?? []), [$agent['id_grupo']])
|
||||
array_merge(
|
||||
(empty($secondary_groups_selected['plain']) === false) ? $secondary_groups_selected['plain'] : [],
|
||||
[$agent['id_grupo']]
|
||||
)
|
||||
// Include_groups.
|
||||
// Size.
|
||||
// Simple_multiple_options.
|
||||
|
@ -1243,6 +1253,9 @@ ui_require_jquery_file('bgiframe');
|
|||
});
|
||||
|
||||
$("select#id_os").pandoraSelectOS ();
|
||||
$('select#grupo').pandoraSelectGroupIcon ();
|
||||
|
||||
|
||||
|
||||
var checked = $("#checkbox-cascade_protection").is(":checked");
|
||||
if (checked) {
|
||||
|
|
|
@ -2368,7 +2368,7 @@ switch ($tab) {
|
|||
|
||||
var aget_id_os = '<?php echo agents_get_os(modules_get_agentmodule_agent(get_parameter('id_agent_module'))); ?>';
|
||||
|
||||
if('<?php echo html_entity_decode(modules_get_agentmodule_name(get_parameter('id_agent_module'))); ?>' != $('#text-name').val() &&
|
||||
if('<?php echo modules_get_agentmodule_name(get_parameter('id_agent_module')); ?>' != $('#text-name').val() &&
|
||||
'<?php echo agents_get_os(modules_get_agentmodule_agent(get_parameter('id_agent_module'))); ?>' == 19){
|
||||
|
||||
event.preventDefault();
|
||||
|
@ -2402,7 +2402,7 @@ switch ($tab) {
|
|||
|
||||
var module_type_snmp = '<?php echo modules_get_agentmodule_type(get_parameter('id_agent_module')); ?>';
|
||||
|
||||
if('<?php echo html_entity_decode(modules_get_agentmodule_name(get_parameter('id_agent_module'))); ?>' != $('#text-name').val() && (
|
||||
if('<?php echo modules_get_agentmodule_name(get_parameter('id_agent_module')); ?>' != $('#text-name').val() && (
|
||||
module_type_snmp == 15 || module_type_snmp == 16 || module_type_snmp == 17 || module_type_snmp == 18)){
|
||||
|
||||
event.preventDefault();
|
||||
|
|
|
@ -215,7 +215,7 @@ $table_simple->colspan[3][1] = 3;
|
|||
$table_simple->data[0][0] = __('Name');
|
||||
$table_simple->data[0][1] = html_print_input_text_extended(
|
||||
'name',
|
||||
io_safe_input(html_entity_decode($name, ENT_QUOTES, 'UTF-8')),
|
||||
$name,
|
||||
'text-name',
|
||||
'',
|
||||
45,
|
||||
|
|
|
@ -577,12 +577,7 @@ $(document).ready (function () {
|
|||
$('#text-ip_target').keyup(function() {
|
||||
$('#text-target_ip').val($(this).val());
|
||||
});
|
||||
$('#text-target_ip').keyup(function() {
|
||||
$('#text-ip_target').val($(this).val());
|
||||
});
|
||||
$('#text-community').keyup(function() {
|
||||
$('#text-snmp_community').val($(this).val());
|
||||
});
|
||||
|
||||
$('#text-snmp_community').keyup(function() {
|
||||
$('#text-community').val($(this).val());
|
||||
});
|
||||
|
@ -591,61 +586,25 @@ $(document).ready (function () {
|
|||
// Display or collapse the SNMP browser's v3 options
|
||||
checkSNMPVersion ();
|
||||
});
|
||||
$('#snmp_browser_version').change(function() {
|
||||
$('#snmp_version').val($(this).val());
|
||||
|
||||
// Display or collapse the SNMP v3 options in the main window
|
||||
if ($(this).val() == "3") {
|
||||
$("#simple-field_snmpv3_row1").attr("style", "");
|
||||
$("#simple-field_snmpv3_row2").attr("style", "");
|
||||
$("#simple-field_snmpv3_row3").attr("style", "");
|
||||
$("input[name=active_snmp_v3]").val(1);
|
||||
$("input[name=snmp_community]").attr("disabled", true);
|
||||
}
|
||||
else {
|
||||
$("#simple-field_snmpv3_row1").css("display", "none");
|
||||
$("#simple-field_snmpv3_row2").css("display", "none");
|
||||
$("#simple-field_snmpv3_row3").css("display", "none");
|
||||
$("input[name=active_snmp_v3]").val(0);
|
||||
$("input[name=snmp_community]").removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
$('#snmp3_auth_user').keyup(function() {
|
||||
$('#snmp3_browser_auth_user').val($(this).val());
|
||||
});
|
||||
$('#snmp3_browser_auth_user').keyup(function() {
|
||||
$('#snmp3_auth_user').val($(this).val());
|
||||
});
|
||||
$('#snmp3_security_level').change(function() {
|
||||
$('#snmp3_browser_security_level').val($(this).val());
|
||||
});
|
||||
$('#snmp3_browser_security_level').change(function() {
|
||||
$('#snmp3_security_level').val($(this).val());
|
||||
});
|
||||
$('#snmp3_auth_method').change(function() {
|
||||
$('#snmp3_browser_auth_method').val($(this).val());
|
||||
});
|
||||
$('#snmp3_browser_auth_method').change(function() {
|
||||
$('#snmp3_auth_method').val($(this).val());
|
||||
});
|
||||
$('#snmp3_auth_pass').keyup(function() {
|
||||
$('#snmp3_browser_auth_pass').val($(this).val());
|
||||
});
|
||||
$('#snmp3_browser_auth_pass').keyup(function() {
|
||||
$('#snmp3_auth_pass').val($(this).val());
|
||||
});
|
||||
$('#snmp3_privacy_method').change(function() {
|
||||
$('#snmp3_browser_privacy_method').val($(this).val());
|
||||
});
|
||||
$('#snmp3_browser_privacy_method').change(function() {
|
||||
$('#snmp3_privacy_method').val($(this).val());
|
||||
});
|
||||
$('#snmp3_privacy_pass').keyup(function() {
|
||||
$('#snmp3_browser_privacy_pass').val($(this).val());
|
||||
});
|
||||
$('#snmp3_browser_privacy_pass').keyup(function() {
|
||||
$('#snmp3_privacy_pass').val($(this).val());
|
||||
});
|
||||
|
||||
var custom_ip_target = "<?php echo $custom_ip_target; ?>";
|
||||
if(custom_ip_target == ''){
|
||||
$("#text-custom_ip_target").hide();
|
||||
|
|
|
@ -708,7 +708,7 @@ foreach ($simple_alerts as $alert) {
|
|||
|
||||
$data[3] .= '<div id="add_action-div-'.$alert['id'].'" class="invisible left">';
|
||||
$data[3] .= '<form id="add_action_form-'.$alert['id'].'" method="post">';
|
||||
$data[3] .= '<table class="databox_color w100p">';
|
||||
$data[3] .= '<table class="databox_color w100p bg_color222">';
|
||||
$data[3] .= html_print_input_hidden('add_action', 1, true);
|
||||
$data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true);
|
||||
|
||||
|
@ -1120,6 +1120,12 @@ function show_add_action(id_alert) {
|
|||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
open: function() {
|
||||
$("#action_select, #action_select").select2({
|
||||
tags: true,
|
||||
dropdownParent: $("#add_action-div-" + id_alert)
|
||||
});
|
||||
},
|
||||
width: 500,
|
||||
height: 300
|
||||
})
|
||||
|
@ -1150,6 +1156,12 @@ function show_display_update_action(id_module_action, alert_id, alert_id_agent_m
|
|||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
open: function() {
|
||||
$("#action_select_ajax, #action_select_ajax").select2({
|
||||
tags: true,
|
||||
dropdownParent: $("#update_action-div")
|
||||
});
|
||||
},
|
||||
width: 500,
|
||||
height: 300
|
||||
})
|
||||
|
|
|
@ -135,6 +135,10 @@ if ($id) {
|
|||
$create_wu_integria = $action['create_wu_integria'];
|
||||
}
|
||||
|
||||
if (users_can_manage_group_all('LW') === false && !$id) {
|
||||
$group = users_get_first_group(false, 'LW', false);
|
||||
}
|
||||
|
||||
// Hidden div with help hint to fill with javascript.
|
||||
html_print_div(
|
||||
[
|
||||
|
@ -623,9 +627,6 @@ $(document).ready (function () {
|
|||
$("#group option").each(function(index, value) {
|
||||
var current_group = $(value).val();
|
||||
});
|
||||
if (data.id_group != 0 && $("#group").val() != data.id_group) {
|
||||
$("#group").val(0);
|
||||
}
|
||||
|
||||
var integria_custom_fields_values = [];
|
||||
var integria_custom_fields_rvalues = [];
|
||||
|
|
|
@ -105,6 +105,7 @@ if ($update_command) {
|
|||
$alert['command'] = $command;
|
||||
$alert['description'] = $description;
|
||||
$alert['id_group'] = $id_group;
|
||||
$alert['fields_hidden'] = io_json_mb_encode($fields_hidden);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,6 +95,7 @@ $fields_available['id_evento'] = __('Event Id');
|
|||
$fields_available['evento'] = __('Event Name');
|
||||
$fields_available['id_agente'] = __('Agent ID');
|
||||
$fields_available['agent_name'] = __('Agent Name');
|
||||
$fields_available['direccion'] = __('Agent IP');
|
||||
$fields_available['id_usuario'] = __('User');
|
||||
$fields_available['id_grupo'] = __('Group');
|
||||
$fields_available['estado'] = __('Status');
|
||||
|
|
|
@ -404,7 +404,8 @@ $(document).ready (function () {
|
|||
"get_agent_modules_json" : 1,
|
||||
"get_id_and_name" : 1,
|
||||
"disabled" : 0,
|
||||
"id_agent" : id_agent
|
||||
"id_agent" : id_agent,
|
||||
"safe_name": 1,
|
||||
};
|
||||
|
||||
var tags_to_search = $('#tags').val();
|
||||
|
@ -434,7 +435,7 @@ $(document).ready (function () {
|
|||
jQuery.each (data, function (i, val) {
|
||||
option = $("<option></option>")
|
||||
.attr ("value", val["id_agente_modulo"])
|
||||
.append (val["nombre"]);
|
||||
.append (val["safe_name"]);
|
||||
$("#target_modules").append (option);
|
||||
});
|
||||
|
||||
|
|
|
@ -685,7 +685,8 @@ $(document).ready (function () {
|
|||
"get_agent_modules_json" : 1,
|
||||
"get_distinct_name" : 1,
|
||||
"indexed" : 0,
|
||||
"privilege" : "AW"
|
||||
"privilege" : "AW",
|
||||
"safe_name": 1
|
||||
};
|
||||
|
||||
if (this.value != '0')
|
||||
|
@ -712,7 +713,7 @@ $(document).ready (function () {
|
|||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>")
|
||||
.attr("value", value["nombre"])
|
||||
.html(value["nombre"]);
|
||||
.html(value["safe_name"]);
|
||||
$("#module_name").append (option);
|
||||
});
|
||||
hideSpinner();
|
||||
|
|
|
@ -1326,12 +1326,13 @@ $(document).ready (function () {
|
|||
"page" : "operation/agentes/ver_agente",
|
||||
"get_agent_modules_json" : 1,
|
||||
"get_distinct_name" : 1,
|
||||
"indexed" : 0
|
||||
"indexed" : 0,
|
||||
"safe_name" : 1
|
||||
};
|
||||
|
||||
|
||||
if (this.value != '0')
|
||||
params['id_tipo_modulo'] = this.value;
|
||||
|
||||
|
||||
var status_module = $('#status_module').val();
|
||||
if (status_module != '-1')
|
||||
params['status_module'] = status_module;
|
||||
|
@ -1342,16 +1343,16 @@ $(document).ready (function () {
|
|||
params['tags'] = tags_to_search;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
showSpinner();
|
||||
$("tr#delete_table-edit1, tr#delete_table-edit0, tr#delete_table-edit2").hide ();
|
||||
$("#module_name").attr ("disabled", "disabled")
|
||||
$("#module_name option[value!=0]").remove ();
|
||||
$("#module_name option[value!=0]").remove();
|
||||
jQuery.post ("ajax.php",
|
||||
params,
|
||||
function (data, status) {
|
||||
jQuery.each (data, function (id, value) {
|
||||
option = $("<option></option>").attr ("value", value["nombre"]).html (value["nombre"]);
|
||||
option = $("<option></option>").attr("value", value["nombre"]).html(value["safe_name"]);
|
||||
$("#module_name").append (option);
|
||||
});
|
||||
hideSpinner();
|
||||
|
|
|
@ -525,10 +525,8 @@ if (check_acl($config['id_user'], 0, 'PM') && $config['enable_update_manager'])
|
|||
$menu_godmode['messages']['id'] = 'god-um_messages';
|
||||
|
||||
$sub = [];
|
||||
if ($config['enterprise_installed']) {
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline';
|
||||
}
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['text'] = __('Update Manager offline');
|
||||
$sub['godmode/update_manager/update_manager&tab=offline']['id'] = 'Offline';
|
||||
|
||||
$sub['godmode/update_manager/update_manager&tab=online']['text'] = __('Update Manager online');
|
||||
$sub['godmode/update_manager/update_manager&tab=online']['id'] = 'Online';
|
||||
|
|
|
@ -182,6 +182,7 @@ if (isset($id)) {
|
|||
$snmp3_privacy_pass = io_output_password(
|
||||
$component['custom_string_2']
|
||||
);
|
||||
unset($tcp_send);
|
||||
$snmp3_security_level = $component['custom_string_3'];
|
||||
} else if ($type >= MODULE_TYPE_REMOTE_CMD && $type <= MODULE_TYPE_REMOTE_CMD_INC) {
|
||||
$command_text = $component['tcp_send'];
|
||||
|
|
|
@ -331,9 +331,9 @@ echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting
|
|||
|
||||
echo "<table width='100%' cellpadding='4' cellpadding='4' class='databox filters'>";
|
||||
echo '<tr>';
|
||||
echo "<td colspan='3'>".__('Filter group').'</td>';
|
||||
echo "<td colspan='1'>".__('Filter group').'</td>';
|
||||
echo '</tr><tr>';
|
||||
echo "<td colspan='3'>".html_print_select_groups(
|
||||
echo "<td colspan='1'>".html_print_select_groups(
|
||||
$config['id_user'],
|
||||
($report_w == true) ? 'RW' : (($report_m == true) ? 'RM' : 'RW'),
|
||||
true,
|
||||
|
|
|
@ -748,6 +748,7 @@ switch ($action) {
|
|||
$selected_agent_group_filter = $es['agent_group_filter'];
|
||||
$selected_agents_inventory_display_options = $es['agents_inventory_display_options'];
|
||||
$selected_agent_os_filter = $es['agent_os_filter'];
|
||||
$selected_agent_custom_fields = $es['agent_custom_fields'];
|
||||
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
|
||||
$selected_agent_status_filter = $es['agent_status_filter'];
|
||||
$selected_agent_module_search_filter = $es['agent_module_search_filter'];
|
||||
|
@ -3080,14 +3081,15 @@ $class = 'databox filters';
|
|||
</tr>
|
||||
|
||||
<?php
|
||||
$server_fields = [];
|
||||
if (is_metaconsole()) {
|
||||
$server_fields = [];
|
||||
$server_fields[0] = __('All');
|
||||
|
||||
$servers = metaconsole_get_servers();
|
||||
|
||||
foreach ($servers as $key => $server) {
|
||||
$server_fields[$key] = $server['server_name'];
|
||||
}
|
||||
foreach ($servers as $key => $server) {
|
||||
$server_fields[$key] = $server['server_name'];
|
||||
}
|
||||
|
||||
$server_filter_markup = '
|
||||
<tr id="row_agent_server_filter" class="datos">
|
||||
|
@ -3106,10 +3108,9 @@ $class = 'databox filters';
|
|||
'min-width: 180px'
|
||||
).'</td></tr>';
|
||||
|
||||
if (is_metaconsole()) {
|
||||
echo $server_filter_markup;
|
||||
}
|
||||
?>
|
||||
echo $server_filter_markup;
|
||||
}
|
||||
?>
|
||||
|
||||
<tr id="row_agent_group_filter" class="datos">
|
||||
<td class="bolder">
|
||||
|
@ -3158,6 +3159,28 @@ $class = 'databox filters';
|
|||
</tr>
|
||||
|
||||
<tr id="row_custom_field" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Agent custom field');
|
||||
?>
|
||||
</td>
|
||||
<td >
|
||||
<?php
|
||||
html_print_select_from_sql(
|
||||
'SELECT id_field, name FROM tagent_custom_fields',
|
||||
'agent_custom_fields[]',
|
||||
$selected_agent_custom_fields,
|
||||
'',
|
||||
__('All'),
|
||||
'0',
|
||||
false,
|
||||
true
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_custom_field_filter" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Agent custom field filter');
|
||||
|
@ -5159,7 +5182,6 @@ function addSLARow() {
|
|||
$("input[name=id_agent_failover]").val('');
|
||||
$("input[name=id_server]").val('');
|
||||
$("input[name=agent_sla]").val('');
|
||||
$("input[name=agent_sla]").css("background","url('<?php echo $autocompleteImage; ?>') right center no-repeat")
|
||||
$("input[name=agent_failover]").val('');
|
||||
$("#id_agent_module_sla").empty();
|
||||
$("#id_agent_module_sla").attr('disabled', 'true');
|
||||
|
@ -5486,6 +5508,7 @@ function chooseType() {
|
|||
$("#row_agent_server_filter").hide();
|
||||
$("#row_agent_group_filter").hide();
|
||||
$("#row_os").hide();
|
||||
$("#row_custom_field_filter").hide();
|
||||
$("#row_custom_field").hide();
|
||||
$("#row_agent_status").hide();
|
||||
$("#row_agent_version").hide();
|
||||
|
@ -6039,11 +6062,26 @@ function chooseType() {
|
|||
$("#row_group").show();
|
||||
$("#row_os").show();
|
||||
$("#row_custom_field").show();
|
||||
$("#row_custom_field_filter").show();
|
||||
$("#row_agent_status").show();
|
||||
$("#row_agent_version").show();
|
||||
$("#row_agent_remote_conf").show();
|
||||
$("#row_module_free_search").show();
|
||||
|
||||
if ($('#agent_custom_fields :selected').length > 0) {
|
||||
$('#text-agent_custom_field_filter').removeAttr('disabled');
|
||||
} else {
|
||||
$('#text-agent_custom_field_filter').prop('disabled', true);
|
||||
}
|
||||
|
||||
$("#agent_custom_fields").change(function(e) {
|
||||
if ($('#agent_custom_fields :selected').length > 0) {
|
||||
$('#text-agent_custom_field_filter').removeAttr('disabled');
|
||||
} else {
|
||||
$('#text-agent_custom_field_filter').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
case 'inventory':
|
||||
|
|
|
@ -2219,6 +2219,7 @@ switch ($action) {
|
|||
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['agent_os_filter'] = get_parameter('agent_os_filter');
|
||||
$es['agent_custom_fields'] = get_parameter('agent_custom_fields');
|
||||
$es['agent_status_filter'] = get_parameter('agent_status_filter');
|
||||
$es['agent_version_filter'] = get_parameter('agent_version_filter');
|
||||
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
|
||||
|
@ -2858,6 +2859,7 @@ switch ($action) {
|
|||
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['agent_os_filter'] = get_parameter('agent_os_filter');
|
||||
$es['agent_custom_fields'] = get_parameter('agent_custom_fields');
|
||||
$es['agent_status_filter'] = get_parameter('agent_status_filter');
|
||||
$es['agent_version_filter'] = get_parameter('agent_version_filter');
|
||||
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
|
||||
|
@ -3370,7 +3372,7 @@ $buttons['view'] = [
|
|||
$buttons[$activeTab]['active'] = true;
|
||||
|
||||
if ($idReport != 0) {
|
||||
$textReportName = $reportName;
|
||||
$textReportName = (empty($reportName) === false) ? $reportName : $report['name'];
|
||||
} else {
|
||||
$temp = $buttons['main'];
|
||||
$buttons = null;
|
||||
|
|
|
@ -47,16 +47,17 @@ if (isset($config['filemanager']['message']) === true) {
|
|||
$config['filemanager']['message'] = null;
|
||||
}
|
||||
|
||||
$directory = (string) get_parameter('directory');
|
||||
if (empty($directory) === true) {
|
||||
$directory = 'images';
|
||||
} else {
|
||||
$directory = str_replace('\\', '/', $directory);
|
||||
$directory = filemanager_safe_directory($directory, 'images');
|
||||
}
|
||||
|
||||
// Add custom directories here.
|
||||
$fallback_directory = 'images';
|
||||
// Get directory.
|
||||
$directory = (string) get_parameter('directory');
|
||||
if (empty($directory) === true) {
|
||||
$directory = $fallback_directory;
|
||||
} else {
|
||||
$directory = str_replace('\\', '/', $directory);
|
||||
$directory = filemanager_safe_directory($directory, $fallback_directory);
|
||||
}
|
||||
|
||||
// Banned directories.
|
||||
$banned_directories['include'] = true;
|
||||
$banned_directories['godmode'] = true;
|
||||
|
@ -76,7 +77,7 @@ echo '<h4>'.__('Index of %s', $directory).'</h4>';
|
|||
$upload_file_or_zip = (bool) get_parameter('upload_file_or_zip');
|
||||
$create_text_file = (bool) get_parameter('create_text_file');
|
||||
|
||||
$default_real_directory = realpath($config['homedir'].'/'.$fallback_directory);
|
||||
$default_real_directory = realpath($config['homedir'].'/');
|
||||
|
||||
if ($upload_file_or_zip === true) {
|
||||
upload_file($upload_file_or_zip, $default_real_directory);
|
||||
|
|
|
@ -986,12 +986,11 @@ if ($create_alert || $update_alert) {
|
|||
echo html_print_select(get_priorities(), 'priority', $priority, '', '', '0', false, false, false);
|
||||
echo '</td></tr>';
|
||||
|
||||
// Alert type (e-mail, event etc.)
|
||||
echo '<tr><td class="datos">'.__('Alert commands').'</td><td class="datos">';
|
||||
|
||||
// Alert type (e-mail, event etc.).
|
||||
echo '<tr><td class="datos">'.__('Alert action').'</td><td class="datos">';
|
||||
html_print_select_from_sql(
|
||||
'SELECT id, name
|
||||
FROM talert_commands
|
||||
FROM talert_actions
|
||||
ORDER BY name',
|
||||
'alert_type',
|
||||
$alert_type,
|
||||
|
@ -1481,7 +1480,7 @@ $(document).ready (function () {
|
|||
value: "1"
|
||||
});
|
||||
values.push ({
|
||||
name: "id",
|
||||
name: "id_action",
|
||||
value: this.value
|
||||
});
|
||||
values.push ({
|
||||
|
|
|
@ -70,6 +70,10 @@ if (empty($license) === true) {
|
|||
}
|
||||
|
||||
$mode_str = '';
|
||||
if (isset($mode) === false) {
|
||||
$mode = null;
|
||||
}
|
||||
|
||||
if ($mode === Manager::MODE_ONLINE) {
|
||||
$mode_str = 'online';
|
||||
} else if ($mode === Manager::MODE_OFFLINE) {
|
||||
|
@ -227,6 +231,21 @@ if (is_ajax() !== true) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
$PHPmemory_limit_min = config_return_in_bytes('800M');
|
||||
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
|
||||
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== -1) {
|
||||
$msg = __(
|
||||
'\'%s\' recommended value is %s or greater. Please, change it on your PHP configuration file (php.ini) or contact with administrator',
|
||||
'memory_limit',
|
||||
'800M'
|
||||
);
|
||||
if (function_exists('ui_print_warning_message') === true) {
|
||||
ui_print_warning_message($msg);
|
||||
} else {
|
||||
echo $msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Load styles.
|
||||
|
@ -308,6 +327,12 @@ if (is_array($config) === true) {
|
|||
) {
|
||||
ui_print_error_message(__('Update manager online requires registration.'));
|
||||
}
|
||||
|
||||
if ($mode === Manager::MODE_OFFLINE) {
|
||||
ui_print_warning_message(
|
||||
__('Applying offline patches may make your console unusable, we recommend to completely backup your files before applying any patch.')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$url_update_manager = $config['url_update_manager'];
|
||||
|
@ -362,19 +387,18 @@ if (is_array($config) === true) {
|
|||
}
|
||||
}
|
||||
|
||||
$PHPmemory_limit_min = config_return_in_bytes('800M');
|
||||
$PHPmemory_limit = config_return_in_bytes(ini_get('memory_limit'));
|
||||
if ($PHPmemory_limit < $PHPmemory_limit_min && $PHPmemory_limit !== '-1') {
|
||||
$msg = __(
|
||||
'\'%s\' recommended value is %s or greater. Please, change it on your PHP configuration file (php.ini) or contact with administrator',
|
||||
'memory_limit',
|
||||
'800M'
|
||||
);
|
||||
if (function_exists('ui_print_warning_message') === true) {
|
||||
ui_print_warning_message($msg);
|
||||
} else {
|
||||
echo $msg;
|
||||
}
|
||||
$proxy = null;
|
||||
if (empty($config['update_manager_proxy_server']) === false
|
||||
|| empty($config['update_manager_proxy_port']) === false
|
||||
|| empty($config['update_manager_proxy_user']) === false
|
||||
|| empty($config['update_manager_proxy_password']) === false
|
||||
) {
|
||||
$proxy = [
|
||||
'host' => $config['update_manager_proxy_server'],
|
||||
'port' => $config['update_manager_proxy_port'],
|
||||
'user' => $config['update_manager_proxy_user'],
|
||||
'password' => $config['update_manager_proxy_password'],
|
||||
];
|
||||
}
|
||||
|
||||
$ui = new Manager(
|
||||
|
@ -396,6 +420,7 @@ $ui = new Manager(
|
|||
'registration_code' => $puid,
|
||||
'remote_config' => $remote_config,
|
||||
'propagate_updates' => $is_metaconsole,
|
||||
'proxy' => $proxy,
|
||||
'set_maintenance_mode' => function () {
|
||||
if (function_exists('config_update_value') === true) {
|
||||
config_update_value('maintenance_mode', 1);
|
||||
|
|
|
@ -666,6 +666,7 @@ class Client
|
|||
$target = __('console update %d', $request['version']);
|
||||
}
|
||||
|
||||
// phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.Found
|
||||
curl_setopt(
|
||||
$ch,
|
||||
CURLOPT_PROGRESSFUNCTION,
|
||||
|
@ -941,6 +942,15 @@ class Client
|
|||
$queries = preg_split("/(;\n)|(;\n\r)/", $sql);
|
||||
foreach ($queries as $query) {
|
||||
if (empty($query) !== true) {
|
||||
if (preg_match('/^\s*SOURCE\s+(.*)$/i', $query, $matches) > 0) {
|
||||
$filepath = dirname($mr_file).'/'.$matches[1];
|
||||
if (file_exists($filepath) === true) {
|
||||
$query = file_get_contents($filepath);
|
||||
} else {
|
||||
throw new \Exception('Cannot load file: '.$filepath);
|
||||
}
|
||||
}
|
||||
|
||||
if ($dbh->query($query) === false) {
|
||||
// 1022: Duplicate key in table.
|
||||
// 1050: Table already defined.
|
||||
|
@ -1331,18 +1341,17 @@ class Client
|
|||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
set_error_handler(
|
||||
function ($errno, $errstr) {
|
||||
if (preg_match('/Undefined index/', $errstr) > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw new \Exception($errstr, $errno);
|
||||
}
|
||||
},
|
||||
(E_ALL ^ E_NOTICE)
|
||||
);
|
||||
|
||||
register_shutdown_function(
|
||||
function () {
|
||||
$error = error_get_last();
|
||||
if (null !== $error) {
|
||||
if (null !== $error
|
||||
&& $error['type'] === (E_ALL ^ E_NOTICE)
|
||||
) {
|
||||
echo __('Failed to analyze package: %s', $error['message']);
|
||||
}
|
||||
}
|
||||
|
@ -1425,7 +1434,8 @@ class Client
|
|||
set_error_handler(
|
||||
function ($errno, $errstr) {
|
||||
throw new \Exception($errstr, $errno);
|
||||
}
|
||||
},
|
||||
(E_ALL ^ E_NOTICE)
|
||||
);
|
||||
|
||||
if ($package === null) {
|
||||
|
@ -1664,7 +1674,7 @@ class Client
|
|||
);
|
||||
|
||||
$this->updateMR(
|
||||
$this->productPath.'/extras/mr/'.$mr,
|
||||
$this->extract_to.'/extras/mr/'.$mr,
|
||||
$this->dbhHistory,
|
||||
$historical_MR
|
||||
);
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<script type="text/javascript">
|
||||
if (typeof $ != "function") {
|
||||
// Dynamically include jquery if not added to this page.
|
||||
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery-3.3.1.min.js'); ?>"></'+'script>');
|
||||
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery.current.js'); ?>"></'+'script>');
|
||||
}
|
||||
</script>
|
||||
<script src="<?php $asset('resources/javascript/umc.js'); ?>" type="text/javascript"></script>
|
||||
|
|
|
@ -34,7 +34,7 @@ $product_name = get_product_name(); ?>
|
|||
<script type="text/javascript">
|
||||
if (typeof $ != "function") {
|
||||
// Dynamically include jquery if not added to this page.
|
||||
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery-3.3.1.min.js'); ?>"></'+'script>');
|
||||
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery.current.js'); ?>"></'+'script>');
|
||||
document.write('<script type="text/javascript" src="<?php echo $asset('resources/javascript/jquery-ui.min.js'); ?>"></'+'script>');
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -37,12 +37,10 @@ $buttons['setup'] = [
|
|||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup">'.html_print_image('images/gm_setup.png', true, ['title' => __('Options'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
if (enterprise_installed()) {
|
||||
$buttons['offline'] = [
|
||||
'active' => ($tab == 'offline') ? true : false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offline">'.html_print_image('images/box.png', true, ['title' => __('Offline update manager'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
}
|
||||
$buttons['offline'] = [
|
||||
'active' => ($tab == 'offline') ? true : false,
|
||||
'text' => '<a href="index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=offline">'.html_print_image('images/box.png', true, ['title' => __('Offline update manager'), 'class' => 'invert_filter']).'</a>',
|
||||
];
|
||||
|
||||
$buttons['online'] = [
|
||||
'active' => ($tab == 'online') ? true : false,
|
||||
|
@ -60,6 +58,7 @@ switch ($tab) {
|
|||
break;
|
||||
|
||||
case 'online':
|
||||
default:
|
||||
$title = __('Update manager » Online');
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
global $config;
|
||||
|
||||
require_once __DIR__.'/../../include/functions_users.php';
|
||||
require_once __DIR__.'/../../include/functions_update_manager.php';
|
||||
|
||||
check_login();
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ $update_profile = (bool) get_parameter('update_profile');
|
|||
$id_profile = (int) get_parameter('id');
|
||||
|
||||
$is_management_allowed = true;
|
||||
if (is_management_allowed() === false) {
|
||||
if (is_metaconsole() === false && is_management_allowed() === false) {
|
||||
$is_management_allowed = false;
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
|
|
|
@ -129,7 +129,7 @@ switch ($sortField) {
|
|||
break;
|
||||
|
||||
default:
|
||||
// Not possible.
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -153,7 +153,7 @@ switch ($sortField) {
|
|||
break;
|
||||
|
||||
default:
|
||||
// Not possible.
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -177,7 +177,7 @@ switch ($sortField) {
|
|||
break;
|
||||
|
||||
default:
|
||||
// Not possible.
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -395,7 +395,7 @@ $table->data[0][4] = html_print_submit_button(
|
|||
);
|
||||
|
||||
$is_management_allowed = true;
|
||||
if (is_management_allowed() === false) {
|
||||
if (is_metaconsole() === false && is_management_allowed() === false) {
|
||||
$is_management_allowed = false;
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
|
@ -585,11 +585,11 @@ foreach ($info as $user_id => $user_info) {
|
|||
$cont++;
|
||||
|
||||
// Manual pagination due the complicated process of the ACL data.
|
||||
if ($cont <= $offset) {
|
||||
if ($cont <= $offset && $search !== true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($cont > ($limit + $offset)) {
|
||||
if ($cont > ($limit + $offset) && $search !== true) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -820,6 +820,9 @@ foreach ($info as $user_id => $user_info) {
|
|||
$data[6] .= '';
|
||||
// Delete button not in this mode.
|
||||
}
|
||||
} else {
|
||||
$data[6] .= '';
|
||||
// Delete button not in this mode.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
|
@ -423,7 +423,7 @@ if ($show_update_action_menu) {
|
|||
);
|
||||
|
||||
$data .= '<form id="update_action-'.$alert['id'].'" method="post">';
|
||||
$data .= '<table class="databox_color w100p">';
|
||||
$data .= '<table class="databox_color w100p bg_color222">';
|
||||
$data .= html_print_input_hidden(
|
||||
'update_action',
|
||||
1,
|
||||
|
|
|
@ -1599,7 +1599,6 @@ if ($get_extended_event) {
|
|||
page: "include/ajax/events",
|
||||
get_comments: 1,
|
||||
event: '.json_encode($event).',
|
||||
filter: '.json_encode($filter).'
|
||||
},
|
||||
dataType : "html",
|
||||
success: function (data) {
|
||||
|
|
|
@ -319,7 +319,7 @@ function process_user_login_remote($login, $pass, $api=false)
|
|||
defined('METACONSOLE')
|
||||
);
|
||||
|
||||
if ($return === 'error_permissions') {
|
||||
if ($result === 'error_permissions') {
|
||||
$config['auth_error'] = __('Problems with configuration permissions. Please contact with Administrator');
|
||||
return false;
|
||||
}
|
||||
|
@ -735,7 +735,14 @@ function ldap_process_user_login($login, $password)
|
|||
}
|
||||
|
||||
// Connect to the LDAP server
|
||||
$ds = @ldap_connect($config['ldap_server'], $config['ldap_port']);
|
||||
if (stripos($config['ldap_server'], 'ldap://') !== false
|
||||
|| stripos($config['ldap_server'], 'ldaps://') !== false
|
||||
|| stripos($config['ldap_server'], 'ldapi://') !== false
|
||||
) {
|
||||
$ds = @ldap_connect($config['ldap_server'].':'.$config['ldap_port']);
|
||||
} else {
|
||||
$ds = @ldap_connect($config['ldap_server'], $config['ldap_port']);
|
||||
}
|
||||
|
||||
if (!$ds) {
|
||||
$config['auth_error'] = 'Error connecting to LDAP server';
|
||||
|
@ -1393,7 +1400,7 @@ function local_ldap_search($ldap_host, $ldap_port=389, $ldap_version=3, $dn, $ac
|
|||
}
|
||||
|
||||
if (!empty($ldap_admin_pass)) {
|
||||
$ldap_admin_pass = ' -w '.$ldap_admin_pass;
|
||||
$ldap_admin_pass = ' -w '.escapeshellarg($ldap_admin_pass);
|
||||
}
|
||||
|
||||
$dn = " -b '".$dn."'";
|
||||
|
|
|
@ -95,7 +95,7 @@ if (check_login(false) === false) {
|
|||
<link rel="stylesheet" href="styles/js/jquery-ui_custom.css" type="text/css" />
|
||||
<script language="javascript" type='text/javascript' src='javascript/pandora.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/pandora_ui.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/jquery-3.3.1.min.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/jquery.current.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Access is not granted</h1>
|
||||
|
@ -153,7 +153,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
|
|||
<link rel="stylesheet" href="styles/js/jquery-ui_custom.css" type="text/css" />
|
||||
<script language="javascript" type='text/javascript' src='javascript/pandora.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/pandora_ui.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/jquery-3.3.1.min.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/jquery.current.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/jquery.pandora.js'></script>
|
||||
<script language="javascript" type='text/javascript' src='javascript/jquery-ui.min.js'></script>
|
||||
<script language="javascript" type="text/javascript" src="graphs/flot/jquery.flot.js"></script>
|
||||
|
|
|
@ -810,7 +810,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.LICENSE.LIMITED',
|
||||
'title' => __('Limited mode.'),
|
||||
'message' => io_safe_output($config['limited_mode']),
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/license'),
|
||||
'url' => '__url__/index.php?sec=gsetup&sec2=godmode/setup/license',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -836,7 +836,7 @@ class ConsoleSupervisor
|
|||
$msg,
|
||||
$days_to_expiry
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/license'),
|
||||
'url' => '__url__/index.php?sec=gsetup&sec2=godmode/setup/license',
|
||||
]
|
||||
);
|
||||
} else if ($days_to_expiry < 0) {
|
||||
|
@ -854,7 +854,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.LICENSE.EXPIRATION',
|
||||
'title' => $title,
|
||||
'message' => $msg,
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/license'),
|
||||
'url' => '__url__/index.php?sec=gsetup&sec2=godmode/setup/license',
|
||||
]
|
||||
);
|
||||
return false;
|
||||
|
@ -931,7 +931,7 @@ class ConsoleSupervisor
|
|||
'Directory %s is not writable. Please, configure corresponding permissions.',
|
||||
$config['attachment_store']
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
]
|
||||
);
|
||||
return;
|
||||
|
@ -953,7 +953,7 @@ class ConsoleSupervisor
|
|||
'There are more than %d files in attachment, consider cleaning up attachment directory manually.',
|
||||
$config['num_files_attachment']
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -987,7 +987,7 @@ class ConsoleSupervisor
|
|||
'Remote configuration directory %s is not readable. Please, adjust configuration.',
|
||||
$remote_config_dir
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
]
|
||||
);
|
||||
return;
|
||||
|
@ -1006,7 +1006,7 @@ class ConsoleSupervisor
|
|||
'Remote configuration directory %s is not writable. Please, adjust configuration.',
|
||||
$remote_config_dir.'/conf'
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1024,7 +1024,7 @@ class ConsoleSupervisor
|
|||
'Collections directory %s is not writable. Please, adjust configuration.',
|
||||
$remote_config_dir.'/collections'
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1042,7 +1042,7 @@ class ConsoleSupervisor
|
|||
'MD5 directory %s is not writable. Please, adjust configuration.',
|
||||
$remote_config_dir.'/md5'
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=general',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1073,7 +1073,7 @@ class ConsoleSupervisor
|
|||
$MAX_FILES_DATA_IN,
|
||||
$remote_config_dir
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1096,7 +1096,7 @@ class ConsoleSupervisor
|
|||
$MAX_BADXML_FILES_DATA_IN,
|
||||
$remote_config_dir
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1188,7 +1188,7 @@ class ConsoleSupervisor
|
|||
$modules_queued,
|
||||
$queue['queued_modules']
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60'),
|
||||
'url' => '__url__/index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1324,7 +1324,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.SERVER.STATUS.'.$server['id_server'],
|
||||
'title' => $msg,
|
||||
'message' => $description,
|
||||
'url' => ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60'),
|
||||
'url' => '__url__/index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -1636,7 +1636,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.HISTORYDB',
|
||||
'title' => __('Historical database not available'),
|
||||
'message' => __('Historical database is enabled, though not accessible with the current configuration.'),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=hist_db'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=hist_db',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1683,7 +1683,7 @@ class ConsoleSupervisor
|
|||
'Your database hasn\'t been through maintenance for 48hrs. Please, check documentation on how to perform this maintenance process on %s and enable it as soon as possible.',
|
||||
io_safe_output(get_product_name())
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1743,7 +1743,7 @@ class ConsoleSupervisor
|
|||
'Historical database maintenance problem.'
|
||||
),
|
||||
'message' => __('Your historical database hasn\'t been through maintenance for 48hrs. Please, check documentation on how to perform this maintenance process on %s and enable it as soon as possible.', get_product_name()),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=perf'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1782,7 +1782,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.HISTORYDB.MR',
|
||||
'title' => __('Historical database MR mismatch'),
|
||||
'message' => __('Your historical database is not using the same schema as the main DB. This could produce anomalies while storing historical data.'),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=hist_db'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=hist_db',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1823,7 +1823,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.EXT.ELASTICSEARCH',
|
||||
'title' => __('Log collector cannot connect to ElasticSearch'),
|
||||
'message' => __('ElasticSearch is not available using current configuration.'),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=log'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=log',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -1893,7 +1893,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.METACONSOLE.DB_CONNECTION',
|
||||
'title' => __('Metaconsole DB is not available.'),
|
||||
'message' => __('Cannot connect with Metaconsole DB using current configuration.'),
|
||||
'url' => ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=enterprise'),
|
||||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=enterprise',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -1922,7 +1922,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.DOWNTIME',
|
||||
'title' => __('Scheduled downtime running.'),
|
||||
'message' => __('A scheduled downtime is running. Some monitoring data won\'t be available while downtime is taking place.'),
|
||||
'url' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list'),
|
||||
'url' => '__url__/index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list',
|
||||
]
|
||||
);
|
||||
return;
|
||||
|
@ -2083,7 +2083,7 @@ class ConsoleSupervisor
|
|||
date('M j, G:i:s ', $next_downtime_begin),
|
||||
date('M j, G:i:s ', $next_downtime_end)
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list'),
|
||||
'url' => '__url__/index.php?sec=gagente&sec2=godmode/agentes/planned_downtime.list',
|
||||
]
|
||||
);
|
||||
return;
|
||||
|
@ -2144,7 +2144,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.SECURITY.DEFAULT_PASSWORD',
|
||||
'title' => __('Default password for "Admin" user has not been changed'),
|
||||
'message' => __('Please, change the default password since it is a commonly reported vulnerability.'),
|
||||
'url' => ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list'),
|
||||
'url' => '__url__/index.php?sec=gusuarios&sec2=godmode/users/user_list',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -2180,7 +2180,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.MISC.FONTPATH',
|
||||
'title' => __('Default font doesn\'t exist'),
|
||||
'message' => __('Your defined font doesn\'t exist or is not defined. Please, check font parameters in your config'),
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=vis'),
|
||||
'url' => '__url__/index.php?sec=gsetup&sec2=godmode/setup/setup§ion=vis',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -2207,7 +2207,7 @@ class ConsoleSupervisor
|
|||
'Your %s has the "develop_bypass" mode enabled. This is a developer mode and should be disabled in a production environment. This value is located in the main index.php file',
|
||||
get_product_name()
|
||||
),
|
||||
'url' => ui_get_full_url('index.php'),
|
||||
'url' => '__url__/index.php',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -2230,7 +2230,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.MISC.EVENTSTORMPROTECTION',
|
||||
'title' => __('Event storm protection is enabled.'),
|
||||
'message' => __('Some events may get lost while this mode is enabled. The server must be restarted after altering this setting.'),
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=general'),
|
||||
'url' => '__url__/index.php?sec=gsetup&sec2=godmode/setup/setup§ion=general',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -2257,7 +2257,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.UPDATEMANAGER.OPENSETUP',
|
||||
'title' => __('Failed to retrieve updates, please configure utility'),
|
||||
'message' => $message,
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/setup/setup§ion=general'),
|
||||
'url' => '__url__/index.php?sec=gsetup&sec2=godmode/setup/setup§ion=general',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -2277,7 +2277,7 @@ class ConsoleSupervisor
|
|||
get_product_name()
|
||||
),
|
||||
'message' => __('There is a new update available. Please<a class="bolder" href="'.ui_get_full_url('index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online').'"> go to Administration:Setup:Update Manager</a> for more details.'),
|
||||
'url' => ui_get_full_url('index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online'),
|
||||
'url' => '__url__/index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -2315,7 +2315,7 @@ class ConsoleSupervisor
|
|||
'There is one or more minor releases available. <a id="aviable_updates" target="blank" href="%s">.About minor release update</a>.',
|
||||
$url
|
||||
),
|
||||
'url' => ui_get_full_url('index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online'),
|
||||
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -2336,7 +2336,7 @@ class ConsoleSupervisor
|
|||
|
||||
// Check if DiscoveryCronTasks is running. Warn user if not.
|
||||
if ($config['cron_last_run'] == 0
|
||||
|| (get_system_time() - $config['cron_last_run']) > 3600
|
||||
|| (get_system_time() - $config['cron_last_run']) > SECONDS_10MINUTES
|
||||
) {
|
||||
$message_conf_cron = __('DiscoveryConsoleTasks is not running properly');
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
|
||||
|
@ -2359,12 +2359,17 @@ class ConsoleSupervisor
|
|||
$message_conf_cron .= __('Please, make sure process is not locked.');
|
||||
}
|
||||
|
||||
$url = '__url__/index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist';
|
||||
if (is_metaconsole() === true) {
|
||||
$url = '__url__index.php?sec=extensions&sec2=enterprise/extensions/cron';
|
||||
}
|
||||
|
||||
$this->notify(
|
||||
[
|
||||
'type' => 'NOTIF.CRON.CONFIGURED',
|
||||
'title' => __('DiscoveryConsoleTasks is not configured.'),
|
||||
'message' => __($message_conf_cron),
|
||||
'url' => ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist'),
|
||||
'url' => $url,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -2468,7 +2473,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.SERVER.MISALIGNED',
|
||||
'title' => __($title_ver_misaligned),
|
||||
'message' => __($message_ver_misaligned),
|
||||
'url' => ui_get_full_url('index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online'),
|
||||
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -2513,7 +2518,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.ALLOWOVERRIDE.MESSAGE',
|
||||
'title' => __('AllowOverride is disabled'),
|
||||
'message' => __($message),
|
||||
'url' => ui_get_full_url('index.php'),
|
||||
'url' => '__url__/index.php',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -2559,7 +2564,7 @@ class ConsoleSupervisor
|
|||
'type' => 'NOTIF.HAMASTER.MESSAGE',
|
||||
'title' => __('Desynchronized operation on the node '.$node['host']),
|
||||
'message' => __($message),
|
||||
'url' => ui_get_full_url('index.php?sec=gservers&sec2=enterprise/godmode/servers/HA_cluster'),
|
||||
'url' => '__url__/index.php?sec=gservers&sec2=enterprise/godmode/servers/HA_cluster',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -3043,6 +3043,7 @@ class NetworkMap
|
|||
$table->data = [];
|
||||
$table->rowstyle['template_row'] = 'display: none;';
|
||||
$table->data['template_row']['node_source'] = '';
|
||||
// Inputs must be not select2, cause duplication make issues.
|
||||
$table->data['template_row']['interface_source'] = html_print_select(
|
||||
[],
|
||||
'interface_source',
|
||||
|
@ -3050,7 +3051,21 @@ class NetworkMap
|
|||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$table->data['template_row']['interface_target'] = html_print_select(
|
||||
[],
|
||||
|
@ -3059,7 +3074,21 @@ class NetworkMap
|
|||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
$table->data['template_row']['node_target'] = '';
|
||||
|
@ -3414,7 +3443,7 @@ class NetworkMap
|
|||
).'" />'."\n";
|
||||
|
||||
$output .= '<div id="simple_map" data-id="'.$this->idMap.'" ';
|
||||
$output .= 'class="border_1px_dd';
|
||||
$output .= 'class="border_1px_dd" style="';
|
||||
|
||||
if ($this->fullSize) {
|
||||
$output .= ' width:100%';
|
||||
|
|
|
@ -593,7 +593,7 @@ class Tree
|
|||
|
||||
$module['type'] = 'module';
|
||||
$module['id'] = (int) $module['id'];
|
||||
$module['name'] = io_safe_output($module['name']);
|
||||
$module['name'] = $module['name'];
|
||||
$module['id_module_type'] = (int) $module['id_tipo_modulo'];
|
||||
$module['server_type'] = (int) $module['id_modulo'];
|
||||
$module['status'] = $module['estado'];
|
||||
|
@ -1097,7 +1097,7 @@ class Tree
|
|||
|
||||
protected function getThirdLevelSql()
|
||||
{
|
||||
// Get the server id
|
||||
// Get the server id.
|
||||
$serverID = $this->serverID;
|
||||
|
||||
$group_acl = $this->getGroupAclCondition();
|
||||
|
|
|
@ -1,38 +1,54 @@
|
|||
<?php
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
/**
|
||||
* @package Include
|
||||
* @subpackage Config
|
||||
* Configuraton sample file.
|
||||
*
|
||||
* @category Config
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Default values
|
||||
// $config["dbname"]="pandora";
|
||||
// $config["dbuser"]="pandora";
|
||||
// $config["dbpass"]="pandora";
|
||||
// $config["dbhost"]="localhost";
|
||||
// This is used for reporting, please add "/" character at the end
|
||||
// $config["homedir"]="/var/www/pandora_console/";
|
||||
// $config["homeurl"]="/pandora_console/";
|
||||
// $config["auth"]["scheme"] = "mysql";
|
||||
|
||||
/**
|
||||
* Do not display any ERROR
|
||||
/*
|
||||
* Default values
|
||||
* $config["dbname"]="pandora";
|
||||
* $config["dbuser"]="pandora";
|
||||
* $config["dbpass"]="pandora";
|
||||
* $config["dbhost"]="localhost";
|
||||
*
|
||||
*
|
||||
* This is used for reporting, please add "/" character at the end
|
||||
* $config["homedir"]="/var/www/pandora_console/";
|
||||
* $config["homeurl"]="/pandora_console/";
|
||||
* $config["auth"]["scheme"] = "mysql";
|
||||
*/
|
||||
|
||||
// By default report any error but notices.
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
/*
|
||||
* Uncomment to display only critical errors.
|
||||
* error_reporting(E_ERROR);
|
||||
* Uncomment to display none errors.
|
||||
* error_reporting(0);
|
||||
*/
|
||||
error_reporting(E_ALL);
|
||||
|
||||
// Display ALL errors
|
||||
// error_reporting(E_ERROR);
|
||||
$ownDir = dirname(__FILE__).DIRECTORY_SEPARATOR;
|
||||
require $ownDir.'config_process.php';
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC210716';
|
||||
$pandora_version = 'v7.0NG.755';
|
||||
$build_version = 'PC210901';
|
||||
$pandora_version = 'v7.0NG.756';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
$script_tz = @date_default_timezone_get();
|
||||
|
@ -306,7 +306,7 @@ switch ($config['dbtype']) {
|
|||
|
||||
// ======================================================================
|
||||
// Menu display mode.
|
||||
if (isset($_SESSION['meny_type']) === true && $_SESSION['menu_type']) {
|
||||
if (isset($_SESSION['meny_type']) === true && empty($_SESSION['menu_type']) === false) {
|
||||
$config['menu_type'] = $_SESSION['menu_type'];
|
||||
} else {
|
||||
$config['menu_type'] = 'classic';
|
||||
|
|
|
@ -1585,7 +1585,7 @@ function enterprise_include($filename, $variables=[])
|
|||
extract($variables);
|
||||
}
|
||||
|
||||
include $filepath;
|
||||
include_once $filepath;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1752,11 +1752,27 @@ function has_metaconsole()
|
|||
* @return boolean
|
||||
*/
|
||||
function is_management_allowed($hkey='')
|
||||
{
|
||||
return ( (is_metaconsole() && is_centrallised())
|
||||
|| (!is_metaconsole() && !is_centrallised())
|
||||
|| (!is_metaconsole() && is_centrallised()) && $hkey == generate_hash_to_api());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return true if is a centrallised environment.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
function is_centrallised()
|
||||
{
|
||||
global $config;
|
||||
return ( (is_metaconsole() && $config['centralized_management'])
|
||||
|| (!is_metaconsole() && !$config['centralized_management'])
|
||||
|| (!is_metaconsole() && $config['centralized_management']) && $hkey == generate_hash_to_api());
|
||||
|
||||
if (isset($config['centralized_management']) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (bool) $config['centralized_management'];
|
||||
}
|
||||
|
||||
|
||||
|
@ -1768,8 +1784,7 @@ function is_management_allowed($hkey='')
|
|||
*/
|
||||
function is_central_policies()
|
||||
{
|
||||
global $config;
|
||||
return is_metaconsole() && $config['centralized_management'];
|
||||
return is_metaconsole() && is_centrallised();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3187,6 +3187,7 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
|
|||
$module_description = $module['descripcion'];
|
||||
$db_status = modules_get_agentmodule_status($module_id);
|
||||
$module_value = modules_get_last_value($module_id);
|
||||
$last_contact = modules_get_last_contact($module_id);
|
||||
modules_get_status($module_id, $db_status, $module_value, $status, $title);
|
||||
$status_image = ui_print_status_image($status, $title, true);
|
||||
|
||||
|
@ -3267,6 +3268,7 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false)
|
|||
$agent_interfaces[$interface_name]['status_module_name'] = $module_name;
|
||||
$agent_interfaces[$interface_name]['ip'] = $ip_target;
|
||||
$agent_interfaces[$interface_name]['mac'] = $mac;
|
||||
$agent_interfaces[$interface_name]['last_contact'] = $last_contact;
|
||||
|
||||
if ($interface_traffic_modules !== false) {
|
||||
$agent_interfaces[$interface_name]['traffic'] = [];
|
||||
|
|
|
@ -2825,8 +2825,9 @@ function alerts_ui_update_or_create_actions($update=true)
|
|||
$values['action_threshold'] = $action_threshold;
|
||||
$values['create_wu_integria'] = $create_wu_integria;
|
||||
|
||||
$name_check = db_get_value('name', 'talert_actions', 'name', $name);
|
||||
if ($name_check) {
|
||||
// If this alert has the same name, not valid.
|
||||
$name_check = db_get_row('talert_actions', 'name', $name);
|
||||
if (empty($name_check) === false && (int) $name_check['id'] !== (int) $id) {
|
||||
$result = '';
|
||||
} else {
|
||||
if ($update) {
|
||||
|
|
|
@ -14821,6 +14821,9 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
|
|||
|
||||
// Graph width (optional).
|
||||
$width = (!empty($other) && isset($other['data'][4]) && $other['data'][4]) ? $other['data'][4] : '';
|
||||
|
||||
// If recive value its from mail call.
|
||||
$graph_font_size = $other['data'][5];
|
||||
} else {
|
||||
// Fixed parameters for _modulegraph_nh_.
|
||||
$graph_seconds = $other['data'];
|
||||
|
@ -14857,6 +14860,7 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
|
|||
'fullscale' => false,
|
||||
'return_img_base_64' => true,
|
||||
'image_treshold' => $graph_threshold,
|
||||
'graph_font_size' => $graph_font_size,
|
||||
];
|
||||
|
||||
// Format MIME RFC 2045 (line break 76 chars).
|
||||
|
@ -17337,7 +17341,7 @@ function remove_agent_from_policy($id_policy, $use_agent_name, $params)
|
|||
$agent = db_get_row_filter('tmetaconsole_agent', ['id_tagente' => $id_agent, 'id_tmetaconsole_setup' => $id_node]);
|
||||
}
|
||||
|
||||
$policy = policies_get_policy($id_policy, false, false);
|
||||
$policy = policies_get_policy($id_policy);
|
||||
|
||||
$policy_agent = (is_metaconsole()) ? db_get_row_filter('tpolicy_agents', ['id_policy' => $id_policy, 'id_agent' => $id_agent, 'id_node' => $id_node]) : db_get_row_filter('tpolicy_agents', ['id_policy' => $id_policy, 'id_agent' => $id_agent]);
|
||||
|
||||
|
|
|
@ -2243,7 +2243,7 @@ function config_process_config()
|
|||
if (!isset($config['fontpath'])) {
|
||||
config_update_value(
|
||||
'fontpath',
|
||||
'lato.ttf'
|
||||
'Lato-Regular.ttf'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -3126,7 +3126,7 @@ function config_process_config()
|
|||
}
|
||||
|
||||
if (!isset($config['custom_report_front_font'])) {
|
||||
config_update_value('custom_report_front_font', 'lato.ttf');
|
||||
config_update_value('custom_report_front_font', 'Lato-Regular.ttf');
|
||||
}
|
||||
|
||||
if (!isset($config['custom_report_front_logo'])) {
|
||||
|
@ -3386,7 +3386,7 @@ function config_user_set_custom_config()
|
|||
}
|
||||
}
|
||||
|
||||
if ((isset($userinfo['id_skin']) && $userinfo['id_skin'] !== 0)) {
|
||||
if ((isset($userinfo['id_skin']) && (int) $userinfo['id_skin'] !== 0)) {
|
||||
if ((int) $userinfo['id_skin'] === 1) {
|
||||
$config['style'] = 'pandora';
|
||||
}
|
||||
|
@ -3402,12 +3402,10 @@ function config_user_set_custom_config()
|
|||
if ($sec2_aux != 'godmode/groups/group_list' && $skin !== false) {
|
||||
$id_user_aux = get_parameter('id');
|
||||
if ($id_user_aux == $config['id_user']) {
|
||||
if ((int) $skin === 1 || (int) $skin === 0) {
|
||||
$config['style'] = 'pandora';
|
||||
}
|
||||
|
||||
if ((int) $skin === 2) {
|
||||
if ($config['style'] === 'pandora_black' && (int) $skin === 0 || (int) $skin === 2) {
|
||||
$config['style'] = 'pandora_black';
|
||||
} else if ((int) $skin === 1 || (int) $skin === 0) {
|
||||
$config['style'] = 'pandora';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -305,6 +305,9 @@ function events_get_column_name($field, $table_alias=false)
|
|||
return __('Severity mini');
|
||||
}
|
||||
|
||||
case 'direccion':
|
||||
return __('Agent IP');
|
||||
|
||||
default:
|
||||
return __($field);
|
||||
}
|
||||
|
@ -1151,7 +1154,12 @@ function events_get_all(
|
|||
$tags_names[$id_tag] = tags_get_name($id_tag);
|
||||
}
|
||||
|
||||
$_tmp .= ' AND ( ';
|
||||
if ($tags[0] === $id_tag) {
|
||||
$_tmp .= ' AND ( ';
|
||||
} else {
|
||||
$_tmp .= ' OR ( ';
|
||||
}
|
||||
|
||||
$_tmp .= sprintf(
|
||||
' tags LIKE "%s" OR',
|
||||
$tags_names[$id_tag]
|
||||
|
@ -3576,7 +3584,12 @@ function events_page_responses($event, $childrens_ids=[])
|
|||
'',
|
||||
__('None'),
|
||||
-1,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 70%'
|
||||
);
|
||||
$data[2] .= html_print_button(
|
||||
__('Update'),
|
||||
|
@ -4843,7 +4856,7 @@ function events_page_general($event)
|
|||
if (isset($event['id_agente']) && $event['id_agente'] > 0) {
|
||||
enterprise_include_once('include/functions_agents.php');
|
||||
$secondary_groups_selected = enterprise_hook('agents_get_secondary_groups', [$event['id_agente'], is_metaconsole()]);
|
||||
if (!empty($secondary_groups_selected)) {
|
||||
if (empty($secondary_groups_selected['for_select']) === false) {
|
||||
$secondary_groups = implode(', ', $secondary_groups_selected['for_select']);
|
||||
}
|
||||
}
|
||||
|
@ -4867,6 +4880,14 @@ function events_page_general($event)
|
|||
$data[1] = '<span class="break_word">'.events_display_name($event['evento']).'</span>';
|
||||
$table_general->data[] = $data;
|
||||
|
||||
// Show server name in metaconsole.
|
||||
if (is_metaconsole() === true && $event['server_name'] !== '') {
|
||||
$data = [];
|
||||
$data[0] = __('Node');
|
||||
$data[1] = '<span class="break_word">'.$event['server_name'].'</span>';
|
||||
$table_general->data[] = $data;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Timestamp');
|
||||
|
||||
|
|
|
@ -164,21 +164,19 @@ function upload_file($upload_file_or_zip, $default_real_directory)
|
|||
if ($upload_file === true) {
|
||||
if (isset($_FILES['file']) === true && empty($_FILES['file']['name']) === false) {
|
||||
$filename = $_FILES['file']['name'];
|
||||
$filesize = $_FILES['file']['size'];
|
||||
$real_directory = filemanager_safe_directory((string) get_parameter('real_directory'));
|
||||
$directory = filemanager_safe_directory((string) get_parameter('directory'));
|
||||
$umask = io_safe_output((string) get_parameter('umask'));
|
||||
|
||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
||||
// Perform security check to determine whether received upload directory is part of the default path for caller uploader and user is not trying to access an external path (avoid execution of PHP files in directories that are not explicitly controlled by corresponding .htaccess).
|
||||
// Perform security check to determine whether received upload
|
||||
// directory is part of the default path for caller uploader and
|
||||
// user is not trying to access an external path (avoid
|
||||
// execution of PHP files in directories that are not explicitly
|
||||
// controlled by corresponding .htaccess).
|
||||
ui_print_error_message(__('Security error'));
|
||||
} else {
|
||||
// Copy file to directory and change name.
|
||||
if (empty($directory) === true) {
|
||||
$nombre_archivo = $real_directory.'/'.$filename;
|
||||
} else {
|
||||
$nombre_archivo = $default_real_directory.'/'.$directory.'/'.$filename;
|
||||
}
|
||||
$nombre_archivo = $real_directory.'/'.$filename;
|
||||
|
||||
if (! @copy($_FILES['file']['tmp_name'], $nombre_archivo)) {
|
||||
$config['filemanager']['message'] = ui_print_error_message(__('Upload error'));
|
||||
|
@ -203,10 +201,8 @@ function upload_file($upload_file_or_zip, $default_real_directory)
|
|||
&& empty($_FILES['file']['name']) === false
|
||||
) {
|
||||
$filename = $_FILES['file']['name'];
|
||||
$filesize = $_FILES['file']['size'];
|
||||
$filepath = $_FILES['file']['tmp_name'];
|
||||
$real_directory = filemanager_safe_directory((string) get_parameter('real_directory'));
|
||||
$directory = filemanager_safe_directory((string) get_parameter('directory'));
|
||||
|
||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
||||
// Perform security check to determine whether received upload
|
||||
|
@ -217,7 +213,7 @@ function upload_file($upload_file_or_zip, $default_real_directory)
|
|||
ui_print_error_message(__('Security error'));
|
||||
} else {
|
||||
if (PandoraFMS\Tools\Files::unzip($filepath, $real_directory) === false) {
|
||||
ui_print_error_message(__('No he podido descomprimir tu archivo de mierda'));
|
||||
ui_print_error_message(__('It was impossible to uncompress your file'));
|
||||
} else {
|
||||
unlink($_FILES['file']['tmp_name']);
|
||||
ui_print_success_message(__('Upload correct'));
|
||||
|
@ -258,33 +254,38 @@ function create_text_file($default_real_directory)
|
|||
|
||||
if (empty($filename) === false) {
|
||||
$real_directory = filemanager_safe_directory((string) get_parameter('real_directory'));
|
||||
$directory = filemanager_safe_directory((string) get_parameter('directory'));
|
||||
$umask = (string) get_parameter('umask');
|
||||
|
||||
if (strpos($real_directory, $default_real_directory) !== 0) {
|
||||
// Perform security check to determine whether received upload directory is part of the default path for caller uploader and user is not trying to access an external path (avoid execution of PHP files in directories that are not explicitly controlled by corresponding .htaccess).
|
||||
// Perform security check to determine whether received upload
|
||||
// directory is part of the default path for caller uploader and
|
||||
// user is not trying to access an external path (avoid execution
|
||||
// of PHP files in directories that are not explicitly controlled by
|
||||
// corresponding .htaccess).
|
||||
ui_print_error_message(__('Security error'));
|
||||
} else {
|
||||
if (empty($directory) === true) {
|
||||
$nombre_archivo = $real_directory.'/'.$filename;
|
||||
} else {
|
||||
$nombre_archivo = $default_real_directory.'/'.$directory.'/'.$filename;
|
||||
}
|
||||
$nombre_archivo = $real_directory.'/'.$filename;
|
||||
|
||||
if (! @touch($nombre_archivo)) {
|
||||
$config['filemanager']['message'] = ui_print_error_message(__('Error creating file'));
|
||||
} else {
|
||||
if ($umask !== '') {
|
||||
chmod($nombre_archivo, $umask);
|
||||
try {
|
||||
// Create the file.
|
||||
$result = touch($nombre_archivo);
|
||||
|
||||
if ($result === true) {
|
||||
if ($umask !== '') {
|
||||
chmod($nombre_archivo, $umask);
|
||||
}
|
||||
|
||||
ui_print_success_message(__('File created correctly'));
|
||||
$config['filemanager']['correct_upload_file'] = 1;
|
||||
} else {
|
||||
throw new Exception(__('Error creating file'));
|
||||
}
|
||||
|
||||
ui_print_success_message(__('Upload correct'));
|
||||
|
||||
$config['filemanager']['correct_upload_file'] = 1;
|
||||
} catch (Exception $ex) {
|
||||
$config['filemanager']['message'] = ui_print_error_message($ex->getMessage());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ui_print_error_message(__('Error creating file with empty name'));
|
||||
$config['filemanager']['message'] = ui_print_error_message(__('Error creating file with empty name'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,13 +295,18 @@ $create_dir = (bool) get_parameter('create_dir');
|
|||
if ($create_dir === true) {
|
||||
global $config;
|
||||
|
||||
$homedir_filemanager = io_safe_output($config['attachment_store']).'/collection';
|
||||
$sec2 = get_parameter('sec2');
|
||||
if ($sec2 === 'enterprise/godmode/agentes/collections' || $sec2 === 'advanced/collections') {
|
||||
$homedir_filemanager = io_safe_output($config['attachment_store']).'/collection';
|
||||
} else {
|
||||
$homedir_filemanager = io_safe_output($config['homedir']);
|
||||
}
|
||||
|
||||
$config['filemanager'] = [];
|
||||
$config['filemanager']['correct_create_dir'] = 0;
|
||||
$config['filemanager']['message'] = null;
|
||||
|
||||
$directory = filemanager_safe_directory((string) get_parameter('directory', '/'));
|
||||
$directory = filemanager_safe_directory((string) get_parameter('directory'));
|
||||
$hash = (string) get_parameter('hash');
|
||||
$testHash = md5($directory.$config['server_unique_identifier']);
|
||||
|
||||
|
@ -311,12 +317,23 @@ if ($create_dir === true) {
|
|||
|
||||
if (empty($dirname) === false) {
|
||||
// Create directory.
|
||||
@mkdir(
|
||||
$homedir_filemanager.'/'.$directory.'/'.$dirname
|
||||
);
|
||||
$config['filemanager']['message'] = ui_print_success_message(__('Directory created'), '', true);
|
||||
try {
|
||||
// If directory exists, add an slash at end.
|
||||
if (empty($directory) === false) {
|
||||
$directory .= '/';
|
||||
}
|
||||
|
||||
$config['filemanager']['correct_create_dir'] = 1;
|
||||
$result = mkdir($homedir_filemanager.'/'.$directory.$dirname);
|
||||
|
||||
if ($result === true) {
|
||||
$config['filemanager']['message'] = ui_print_success_message(__('Directory created'), '', true);
|
||||
$config['filemanager']['correct_create_dir'] = 1;
|
||||
} else {
|
||||
throw new Exception(__('Something gone wrong creating directory'));
|
||||
}
|
||||
} catch (Exception $ex) {
|
||||
$config['filemanager']['message'] = ui_print_error_message($ex->getMessage(), '', true);
|
||||
}
|
||||
} else {
|
||||
$config['filemanager']['message'] = ui_print_error_message(__('Error creating file with empty name'), '', true);
|
||||
}
|
||||
|
@ -366,7 +383,9 @@ if ($delete_file === true) {
|
|||
/**
|
||||
* Recursive delete directory and empty or not directory.
|
||||
*
|
||||
* @param string $dir The dir to deletete
|
||||
* @param string $dir The dir to deletete.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function filemanager_delete_directory($dir)
|
||||
{
|
||||
|
@ -396,8 +415,9 @@ function filemanager_delete_directory($dir)
|
|||
* Read a directory recursibly and return a array with the files with
|
||||
* the absolute path and relative
|
||||
*
|
||||
* @param string $dir absoute dir to scan
|
||||
* @param string $relative_path Relative path to scan, by default ''
|
||||
* @param string $dir Absoute dir to scan.
|
||||
* @param string $relative_path Relative path to scan, by default ''.
|
||||
* @param boolean $add_empty_dirs Add empty dirs.
|
||||
*
|
||||
* @return array The files in the dirs, empty array for empty dir of files.
|
||||
*/
|
||||
|
@ -405,14 +425,14 @@ function filemanager_read_recursive_dir($dir, $relative_path='', $add_empty_dirs
|
|||
{
|
||||
$return = [];
|
||||
|
||||
// Windows compatibility
|
||||
// Windows compatibility.
|
||||
$dir = str_replace('\\', '/', $dir);
|
||||
$relative_path = str_replace('\\', '/', $relative_path);
|
||||
|
||||
if ($handle = opendir($dir)) {
|
||||
while (false !== ($entry = readdir($handle))) {
|
||||
if (($entry != '.') && ($entry != '..')) {
|
||||
if (is_dir($dir.$entry)) {
|
||||
if (($entry !== '.') && ($entry !== '..')) {
|
||||
if (is_dir($dir.$entry) === true) {
|
||||
$return[] = [
|
||||
'relative' => $relative_path.$entry,
|
||||
'absolute' => $dir.$entry,
|
||||
|
@ -581,14 +601,8 @@ function filemanager_file_explorer(
|
|||
$table->width = '100%';
|
||||
$table->id = 'table_filemanager';
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$table->class = 'databox_tactical';
|
||||
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
|
||||
} else {
|
||||
$table->class = 'info_table';
|
||||
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
|
||||
}
|
||||
|
||||
$table->class = (is_metaconsole() === true) ? 'databox_tactical' : 'info_table';
|
||||
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
|
||||
$table->colspan = [];
|
||||
$table->data = [];
|
||||
$table->head = [];
|
||||
|
@ -610,10 +624,10 @@ function filemanager_file_explorer(
|
|||
$prev_dir = explode('/', $relative_directory);
|
||||
$count_prev_dir = count($prev_dir);
|
||||
$prev_dir_str = '';
|
||||
|
||||
for ($i = 0; $i < ($count_prev_dir - 1); $i++) {
|
||||
$prev_dir_count = count($prev_dir);
|
||||
for ($i = 0; $i < ($prev_dir_count - 1); $i++) {
|
||||
$prev_dir_str .= $prev_dir[$i];
|
||||
if ($i < ($count_prev_dir - 2)) {
|
||||
if ($i < ($prev_dir_count - 2)) {
|
||||
$prev_dir_str .= '/';
|
||||
}
|
||||
}
|
||||
|
@ -651,16 +665,16 @@ function filemanager_file_explorer(
|
|||
break;
|
||||
|
||||
case MIME_UNKNOWN:
|
||||
if ($fileinfo['size'] == 0) {
|
||||
if ((int) $fileinfo['size'] === 0) {
|
||||
if ((strstr($fileinfo['name'], '.txt') !== false) || (strstr($fileinfo['name'], '.conf') !== false) || (strstr($fileinfo['name'], '.sql') !== false) || (strstr($fileinfo['name'], '.pl') !== false)) {
|
||||
$fileinfo['mime'] = MIME_TEXT;
|
||||
$data[0] = html_print_image('images/mimetypes/text.png', true, ['title' => __('Text file'), 'class' => 'invert_filter']);
|
||||
} else {
|
||||
// unknow
|
||||
// Unknown.
|
||||
$data[0] = '';
|
||||
}
|
||||
} else {
|
||||
// pdf
|
||||
// Pdf.
|
||||
$data[0] = '';
|
||||
}
|
||||
break;
|
||||
|
@ -673,7 +687,7 @@ function filemanager_file_explorer(
|
|||
if ($fileinfo['is_dir']) {
|
||||
$data[1] = '<a href="'.$url.'&directory='.$relative_directory.'/'.$fileinfo['name'].'&hash2='.md5($relative_directory.'/'.$fileinfo['name'].$config['server_unique_identifier']).'">'.$fileinfo['name'].'</a>';
|
||||
} else if (empty($url_file) === false) {
|
||||
// Set the custom url file
|
||||
// Set the custom url file.
|
||||
$url_file_clean = str_replace('[FILE_FULLPATH]', $fileinfo['realpath'], $url_file);
|
||||
|
||||
$data[1] = '<a href="'.$url_file_clean.'">'.$fileinfo['name'].'</a>';
|
||||
|
@ -683,9 +697,9 @@ function filemanager_file_explorer(
|
|||
$data[1] = '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'">'.$fileinfo['name'].'</a>';
|
||||
}
|
||||
|
||||
// Notice that uploaded php files could be dangerous
|
||||
if (pathinfo($fileinfo['realpath'], PATHINFO_EXTENSION) == 'php'
|
||||
&& (is_readable($fileinfo['realpath']) || is_executable($fileinfo['realpath']))
|
||||
// Notice that uploaded php files could be dangerous.
|
||||
if (pathinfo($fileinfo['realpath'], PATHINFO_EXTENSION) === 'php'
|
||||
&& (is_readable($fileinfo['realpath']) === true || is_executable($fileinfo['realpath']) === true)
|
||||
) {
|
||||
$error_message = __('This file could be executed by any user');
|
||||
$error_message .= '. '.__('Make sure it can\'t perform dangerous tasks');
|
||||
|
@ -708,8 +722,9 @@ function filemanager_file_explorer(
|
|||
$data[4] = '';
|
||||
$data[4] .= '<span style="display: flex">';
|
||||
$typefile = array_pop(explode('.', $fileinfo['name']));
|
||||
if (is_writable($fileinfo['realpath'] === true)
|
||||
&& (is_dir($fileinfo['realpath'] === false) || count(scandir($fileinfo['realpath'])) < 3) && ($readOnly === false)
|
||||
if (is_writable($fileinfo['realpath']) === true
|
||||
&& (is_dir($fileinfo['realpath']) === false || count(scandir($fileinfo['realpath'])) < 3)
|
||||
&& ($readOnly === false)
|
||||
) {
|
||||
$data[4] .= '<form method="post" action="'.$url.'" style="">';
|
||||
$data[4] .= '<input type="image" class="invert_filter" src="images/cross.png" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
|
@ -730,8 +745,8 @@ function filemanager_file_explorer(
|
|||
$data[4] .= '</form>';
|
||||
|
||||
if (($editor) && ($readOnly === false)) {
|
||||
if (($typefile != 'bin') && ($typefile != 'pdf') && ($typefile != 'png') && ($typefile != 'jpg')
|
||||
&& ($typefile != 'iso') && ($typefile != 'docx') && ($typefile != 'doc') && ($fileinfo['mime'] != MIME_DIR)
|
||||
if (($typefile !== 'bin') && ($typefile !== 'pdf') && ($typefile !== 'png') && ($typefile !== 'jpg')
|
||||
&& ($typefile !== 'iso') && ($typefile !== 'docx') && ($typefile !== 'doc') && ($fileinfo['mime'] != MIME_DIR)
|
||||
) {
|
||||
$hash = md5($fileinfo['realpath'].$config['server_unique_identifier']);
|
||||
$data[4] .= "<a style='vertical-align: top;' href='$url&edit_file=1&hash=".$hash.'&location_file='.$fileinfo['realpath']."' style='float: left;'>".html_print_image('images/edit.png', true, ['style' => 'margin-top: 2px;', 'title' => __('Edit file'), 'class' => 'invert_filter']).'</a>';
|
||||
|
@ -742,7 +757,7 @@ function filemanager_file_explorer(
|
|||
if ((!$fileinfo['is_dir']) && ($download_button)) {
|
||||
$filename = base64_encode($fileinfo['name']);
|
||||
$hash = md5($filename.$config['server_unique_identifier']);
|
||||
$data[4] .= '<a href="include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'" style="vertical-align: 25%;">';
|
||||
$data[4] .= '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'" style="vertical-align: 25%;">';
|
||||
$data[4] .= html_print_image('images/file.png', true, ['class' => 'invert_filter']);
|
||||
$data[4] .= '</a>';
|
||||
}
|
||||
|
@ -763,9 +778,7 @@ function filemanager_file_explorer(
|
|||
if ($readOnly === false) {
|
||||
if (is_writable($real_directory) === true) {
|
||||
// The buttons to make actions.
|
||||
$tabs_dialog = '<ul id="file_table_modal">';
|
||||
|
||||
$tabs_dialog .= '
|
||||
$tabs_dialog = '<ul id="file_table_modal">
|
||||
<li class="create_folder">
|
||||
<a href="javascript: show_form_create_folder();">'.html_print_image(
|
||||
'images/create_directory.png',
|
||||
|
@ -871,18 +884,17 @@ function filemanager_file_explorer(
|
|||
/**
|
||||
* Check if a directory is writable.
|
||||
*
|
||||
* @param string Directory path to check.
|
||||
* @param bool If set, it will try to make the directory writeable if it's not.
|
||||
* @param string $filepath Directory path to check.
|
||||
*
|
||||
* @param bool Wheter the directory is writeable or not.
|
||||
* @return boolean Wheter the directory is writeable or not.
|
||||
*/
|
||||
function filemanager_get_file_info($filepath)
|
||||
function filemanager_get_file_info(string $filepath)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$realpath = realpath($filepath);
|
||||
$filepath = str_replace('\\', '/', $filepath);
|
||||
// Windows compatibility
|
||||
// Windows compatibility.
|
||||
$info = [
|
||||
'mime' => MIME_UNKNOWN,
|
||||
'mime_extend' => mime_content_type($filepath),
|
||||
|
@ -920,10 +932,9 @@ function filemanager_get_file_info($filepath)
|
|||
/**
|
||||
* Check if a directory is writable.
|
||||
*
|
||||
* @param string Directory path to check.
|
||||
* @param bool If set, it will try to make the directory writeable if it's not.
|
||||
* @param string $dirpath Directory path to check.
|
||||
*
|
||||
* @param bool Wheter the directory is writeable or not.
|
||||
* @return array List with files.
|
||||
*/
|
||||
function filemanager_list_dir($dirpath)
|
||||
{
|
||||
|
@ -933,8 +944,8 @@ function filemanager_list_dir($dirpath)
|
|||
$dirs = [];
|
||||
$dir = opendir($dirpath);
|
||||
while ($file = @readdir($dir)) {
|
||||
// Ignore hidden files
|
||||
if ($file[0] == '.') {
|
||||
// Ignore hidden files.
|
||||
if ($file[0] === '.') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -735,7 +735,7 @@ function grafico_modulo_sparse($params)
|
|||
$params['backgroundColor'] = 'white';
|
||||
}
|
||||
|
||||
if (isset($params['only_image']) === true) {
|
||||
if (isset($params['only_image']) === true && $params['vconsole'] !== true) {
|
||||
$params['backgroundColor'] = 'transparent';
|
||||
}
|
||||
|
||||
|
@ -829,7 +829,11 @@ function grafico_modulo_sparse($params)
|
|||
$params['stacked'] = 0;
|
||||
}
|
||||
|
||||
$font_size = $config['font_size'];
|
||||
if (isset($params['graph_font_size']) === true) {
|
||||
$font_size = $params['graph_font_size'];
|
||||
} else {
|
||||
$font_size = $config['font_size'];
|
||||
}
|
||||
|
||||
// If is metaconsole set 10pt size value.
|
||||
if (is_metaconsole()) {
|
||||
|
|
|
@ -436,6 +436,7 @@ function html_print_select_style($fields, $name, $selected='', $style='', $scrip
|
|||
* @param string $size Style, size (width) of element.
|
||||
* @param boolean $simple_multiple_options Discovery simple multiple inputs.
|
||||
* @param boolean $required Required input.
|
||||
* @param string $inverse Change All to None with inverse condition.
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
|
@ -462,7 +463,8 @@ function html_print_select_groups(
|
|||
$include_groups=false,
|
||||
$size=false,
|
||||
$simple_multiple_options=false,
|
||||
$required=false
|
||||
$required=false,
|
||||
$inverse=''
|
||||
) {
|
||||
$output = '';
|
||||
|
||||
|
@ -522,7 +524,11 @@ function html_print_select_groups(
|
|||
if (empty($selected) === false) {
|
||||
$fields = [ $selected => groups_get_name($selected) ];
|
||||
} else if ($returnAllGroup === true && $multiple === false) {
|
||||
$fields = [ $selected => groups_get_name(null, true) ];
|
||||
if ($selected === 0 && $inverse !== '') {
|
||||
$fields = [ $selected => 'None' ];
|
||||
} else {
|
||||
$fields = [ $selected => groups_get_name(null, true) ];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($selected as $k) {
|
||||
|
@ -595,7 +601,9 @@ function html_print_select_groups(
|
|||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('select[name="<?php echo $name; ?>"]').each(
|
||||
function() {
|
||||
$(this).select2({
|
||||
|
@ -625,6 +633,7 @@ function html_print_select_groups(
|
|||
inclusions: '<?php echo $json_inclusions; ?>',
|
||||
step: params.page || 1,
|
||||
strict: "<?php echo $strict_user; ?>",
|
||||
not_condition: $('#not_condition_switch').prop('checked'),
|
||||
returnAllGroup: <?php echo (int) $returnAllGroup; ?>
|
||||
}
|
||||
|
||||
|
@ -781,7 +790,7 @@ function html_print_select(
|
|||
$required = 'required';
|
||||
}
|
||||
|
||||
$output .= '<select '.$required.' id="'.$id.'" name="'.$name.'"'.$attributes.' '.$styleText.'>';
|
||||
$output .= '<select '.$required.' onclick="'.$script.'" id="'.$id.'" name="'.$name.'"'.$attributes.' '.$styleText.'>';
|
||||
|
||||
if ($nothing !== false) {
|
||||
if ($nothing != '' || empty($fields)) {
|
||||
|
@ -2365,12 +2374,13 @@ function html_print_div(
|
|||
/**
|
||||
* Render an anchor <a> html element.
|
||||
*
|
||||
* @param array $options Parameters
|
||||
* @param array $options Parameters.
|
||||
* - id: string.
|
||||
* - style: string.
|
||||
* - title: string.
|
||||
* - href: string.
|
||||
* - content: string.
|
||||
* - onClick: string.
|
||||
* @param boolean $return Return or echo flag.
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
|
@ -2387,6 +2397,7 @@ function html_print_anchor(
|
|||
'style',
|
||||
'class',
|
||||
'title',
|
||||
'onClick',
|
||||
];
|
||||
|
||||
$output .= (isset($options['href']) === true) ? 'href="'.io_safe_input_html($options['href']).'"' : ui_get_full_url();
|
||||
|
|
|
@ -199,7 +199,7 @@ function integria_api_call($api_hostname=null, $user=null, $user_pass=null, $api
|
|||
'user_pass' => $user_pass,
|
||||
'pass' => $api_pass,
|
||||
'op' => $operation,
|
||||
'params' => html_entity_decode($params),
|
||||
'params' => io_safe_output($params),
|
||||
];
|
||||
|
||||
if ($return_type !== '') {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
global $config;
|
||||
|
||||
// Set variable to store menu type (classic or collapsed).
|
||||
if (!empty(get_parameter('menuType'))) {
|
||||
if (is_ajax() === true && empty(get_parameter('menuType')) === false) {
|
||||
$_SESSION['menu_type'] = get_parameter('menuType', 'classic');
|
||||
return;
|
||||
}
|
||||
|
@ -39,11 +39,14 @@ if (!empty(get_parameter('menuType'))) {
|
|||
/**
|
||||
* Prints a complete menu structure.
|
||||
*
|
||||
* @param array Menu structure to print.
|
||||
* @param array $menu Menu structure to print.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function menu_print_menu(&$menu)
|
||||
{
|
||||
global $config;
|
||||
global $menuTypeClass;
|
||||
static $idcounter = 0;
|
||||
|
||||
echo '<div class="menu">';
|
||||
|
@ -108,7 +111,7 @@ function menu_print_menu(&$menu)
|
|||
|
||||
$submenu = false;
|
||||
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
if ($menuTypeClass === 'classic') {
|
||||
$classes = [
|
||||
'menu_icon',
|
||||
'no_hidden_menu',
|
||||
|
@ -120,12 +123,12 @@ function menu_print_menu(&$menu)
|
|||
];
|
||||
}
|
||||
|
||||
if (isset($main['sub'])) {
|
||||
if (isset($main['sub']) === true) {
|
||||
$classes[] = '';
|
||||
$submenu = true;
|
||||
}
|
||||
|
||||
if (!isset($main['refr'])) {
|
||||
if (isset($main['refr']) === false) {
|
||||
$main['refr'] = 0;
|
||||
}
|
||||
|
||||
|
@ -409,23 +412,14 @@ function menu_print_menu(&$menu)
|
|||
|
||||
// Print out the first level.
|
||||
$output .= '<li title="'.$main['text'].'" class="'.implode(' ', $classes).' '.$seleccionado.'" id="icon_'.$id.'">';
|
||||
// onclick="location.href=\'index.php?sec='.$mainsec.'&sec2='.$main["sec2"].($main["refr"] ? '&refr='.$main["refr"] : '').'\'">';
|
||||
$length = strlen(__($main['text']));
|
||||
$padding_top = ( $length >= 18) ? 6 : 12;
|
||||
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
$output .= '<div id="title_menu" class="title_menu_classic">'.$main['text'].'</div>';
|
||||
} else {
|
||||
$output .= '<div id="title_menu" class="title_menu_collapsed">'.$main['text'].'</div>';
|
||||
}
|
||||
$output .= sprintf('<div id="title_menu" class="title_menu_%s">%s</div>', $menuTypeClass, $main['text']);
|
||||
|
||||
// Add the notification ball if defined
|
||||
if (isset($main['notification'])) {
|
||||
// Add the notification ball if defined.
|
||||
if (isset($main['notification']) === true) {
|
||||
$output .= '<div class="notification_ball">'.$main['notification'].'</div>';
|
||||
}
|
||||
|
||||
$padding_top = 0;
|
||||
$length = 0;
|
||||
if ($submenu_output != '') {
|
||||
// WARNING: IN ORDER TO MODIFY THE VISIBILITY OF MENU'S AND SUBMENU'S (eg. with cookies) YOU HAVE TO ADD TO THIS ELSEIF. DON'T MODIFY THE CSS.
|
||||
if ($visible || in_array('selected', $classes)) {
|
||||
|
@ -436,10 +430,7 @@ function menu_print_menu(&$menu)
|
|||
$visible = false;
|
||||
}
|
||||
|
||||
// $output .= '<ul id="subicon_'.$id.'" class="submenu'.($visible ? '' : ' invisible').'">';
|
||||
$output .= '<ul id="subicon_'.$id.'" class="submenu">';
|
||||
$output .= $submenu_output;
|
||||
$output .= '</ul>';
|
||||
$output .= sprintf('<ul id="subicon_%s" class="submenu">%s</ul>', $id, $submenu_output);
|
||||
}
|
||||
|
||||
$config['count_main_menu']++;
|
||||
|
|
|
@ -662,7 +662,7 @@ function messages_get_url($message_id)
|
|||
|
||||
// Return URL stored if is set in database.
|
||||
if (isset($messages['url'])) {
|
||||
return $messages['url'];
|
||||
return str_replace('__url__', ui_get_full_url('/'), $messages['url']);
|
||||
}
|
||||
|
||||
// Return the message direction.
|
||||
|
|
|
@ -2295,17 +2295,19 @@ function modules_get_agentmodule_data(
|
|||
$search_in_history_db = db_search_in_history_db($datelimit);
|
||||
|
||||
switch ($module['id_tipo_modulo']) {
|
||||
// generic_data_string
|
||||
// Generic_data_string.
|
||||
case 3:
|
||||
// remote_tcp_string
|
||||
// Remote_tcp_string.
|
||||
case 10:
|
||||
// remote_snmp_string
|
||||
// Remote_snmp_string.
|
||||
case 17:
|
||||
// async_string
|
||||
// Async_string.
|
||||
case 36:
|
||||
// remote_cmd_string
|
||||
// Remote_cmd_string.
|
||||
case 23:
|
||||
// Free search is a json with value and exact modifier
|
||||
// Web content string.
|
||||
case 33:
|
||||
// Free search is a json with value and exact modifier.
|
||||
$freesearch = json_decode($freesearch, true);
|
||||
$freesearch_sql = '';
|
||||
if (isset($freesearch['value']) && !empty($freesearch['value'])) {
|
||||
|
|
|
@ -600,7 +600,7 @@ function netflow_get_stats(
|
|||
global $config, $nfdump_date_format;
|
||||
|
||||
// Requesting remote data.
|
||||
if (defined('METACONSOLE') && $connection_name != '') {
|
||||
if (is_metaconsole() === true && empty($connection_name) === false) {
|
||||
$data = metaconsole_call_remote_api($connection_name, 'netflow_get_stats', "$start_date|$end_date|".base64_encode(json_encode($filter))."|$aggregate|$max|$absolute|".(int) $address_resolution);
|
||||
return json_decode($data, true);
|
||||
}
|
||||
|
@ -612,7 +612,7 @@ function netflow_get_stats(
|
|||
// Execute nfdump.
|
||||
exec($command, $string);
|
||||
|
||||
if (! is_array($string)) {
|
||||
if (is_array($string) === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -1062,7 +1062,7 @@ function netflow_draw_item(
|
|||
) {
|
||||
$aggregate = $filter['aggregate'];
|
||||
$interval = ($end_date - $start_date);
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === true) {
|
||||
$width = 950;
|
||||
} else {
|
||||
$width = 850;
|
||||
|
@ -1084,12 +1084,13 @@ function netflow_draw_item(
|
|||
$connection_name,
|
||||
$address_resolution
|
||||
);
|
||||
if (empty($data)) {
|
||||
|
||||
if (empty($data) === true) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ($output == 'HTML' || $output == 'PDF') {
|
||||
$html .= graph_netflow_aggregate_area(
|
||||
if ($output === 'HTML' || $output === 'PDF') {
|
||||
return graph_netflow_aggregate_area(
|
||||
$data,
|
||||
$interval,
|
||||
$width,
|
||||
|
@ -1098,9 +1099,8 @@ function netflow_draw_item(
|
|||
($output === 'HTML'),
|
||||
$end_date
|
||||
);
|
||||
return $html;
|
||||
} else if ($output == 'XML') {
|
||||
$xml .= '<aggregate>'.$aggregate."</aggregate>\n";
|
||||
} else if ($output === 'XML') {
|
||||
$xml = '<aggregate>'.$aggregate."</aggregate>\n";
|
||||
$xml .= '<resolution>'.$interval_length."</resolution>\n";
|
||||
$xml .= netflow_aggregate_area_xml($data);
|
||||
return $xml;
|
||||
|
@ -1119,18 +1119,19 @@ function netflow_draw_item(
|
|||
$connection_name,
|
||||
$address_resolution
|
||||
);
|
||||
if (empty($data)) {
|
||||
|
||||
if (empty($data) === true) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ($output == 'HTML' || $output == 'PDF') {
|
||||
$html .= "<div class='w100p overflow'>";
|
||||
if ($output === 'HTML' || $output === 'PDF') {
|
||||
$html = "<div class='w100p overflow'>";
|
||||
$html .= netflow_data_table($data, $start_date, $end_date, $aggregate);
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
} else if ($output == 'XML') {
|
||||
$xml .= '<aggregate>'.$aggregate."</aggregate>\n";
|
||||
} else if ($output === 'XML') {
|
||||
$xml = '<aggregate>'.$aggregate."</aggregate>\n";
|
||||
$xml .= '<resolution>'.$interval_length."</resolution>\n";
|
||||
// Same as netflow_aggregate_area_xml.
|
||||
$xml .= netflow_aggregate_area_xml($data);
|
||||
|
@ -1159,7 +1160,8 @@ function netflow_draw_item(
|
|||
$connection_name,
|
||||
$address_resolution
|
||||
);
|
||||
if (empty($data_pie)) {
|
||||
|
||||
if (empty($data_pie) === true) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1222,51 +1224,56 @@ function netflow_draw_item(
|
|||
$connection_name,
|
||||
$address_resolution
|
||||
);
|
||||
switch ($aggregate) {
|
||||
case 'srcip':
|
||||
case 'srcport':
|
||||
$address_type = 'source_address';
|
||||
$port_type = 'source_port';
|
||||
$type = __('Sent');
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'dstip':
|
||||
case 'dstport':
|
||||
$address_type = 'destination_address';
|
||||
$port_type = 'destination_port';
|
||||
$type = __('Received');
|
||||
break;
|
||||
}
|
||||
if (empty($data_stats) === false) {
|
||||
switch ($aggregate) {
|
||||
case 'srcip':
|
||||
case 'srcport':
|
||||
$address_type = 'source_address';
|
||||
$port_type = 'source_port';
|
||||
$type = __('Sent');
|
||||
break;
|
||||
|
||||
$data_graph = [
|
||||
'name' => __('Host detailed traffic').': '.$type,
|
||||
'children' => [],
|
||||
];
|
||||
$id = -1;
|
||||
default:
|
||||
case 'dstip':
|
||||
case 'dstport':
|
||||
$address_type = 'destination_address';
|
||||
$port_type = 'destination_port';
|
||||
$type = __('Received');
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($data_stats as $sdata) {
|
||||
$data_graph['children'][] = [
|
||||
'id' => $i++,
|
||||
'name' => $sdata['agg'],
|
||||
'children' => [
|
||||
[
|
||||
'id' => $i++,
|
||||
'name' => $sdata['agg'],
|
||||
'value' => $sdata['data'],
|
||||
'tooltip_content' => network_format_bytes($sdata['data']),
|
||||
],
|
||||
],
|
||||
$data_graph = [
|
||||
'name' => __('Host detailed traffic').': '.$type,
|
||||
'children' => [],
|
||||
];
|
||||
$id = -1;
|
||||
|
||||
foreach ($data_stats as $sdata) {
|
||||
$data_graph['children'][] = [
|
||||
'id' => $id++,
|
||||
'name' => $sdata['agg'],
|
||||
'children' => [
|
||||
[
|
||||
'id' => $id++,
|
||||
'name' => $sdata['agg'],
|
||||
'value' => $sdata['data'],
|
||||
'tooltip_content' => network_format_bytes($sdata['data']),
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
return graph_netflow_host_traffic($data_graph, 'auto', 400);
|
||||
}
|
||||
return graph_netflow_host_traffic($data_graph, 'auto', 400);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
|
||||
if ($output == 'HTML' || $output == 'PDF') {
|
||||
if ($output === 'HTML' || $output === 'PDF') {
|
||||
return graph_nodata_image(300, 110, 'data');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -264,7 +264,19 @@ function show_configuration_wizard() {
|
|||
background: "black"
|
||||
},
|
||||
closeOnEscape: false,
|
||||
open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }
|
||||
open: function(event, ui) {
|
||||
$(".ui-dialog-titlebar-close").hide();
|
||||
if ($.ui && $.ui.dialog && $.ui.dialog.prototype._allowInteraction) {
|
||||
var ui_dialog_interaction = $.ui.dialog.prototype._allowInteraction;
|
||||
$.ui.dialog.prototype._allowInteraction = function(e) {
|
||||
if ($(e.target).closest('.select2-dropdown').length) return true;
|
||||
return ui_dialog_interaction.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
},
|
||||
_allowInteraction: function (event) {
|
||||
return !!$(event.target).is(".select2-input") || this._super(event);
|
||||
}
|
||||
});
|
||||
|
||||
default_language_displayed = $("#language").val();
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue