#12175 Resolve conflicts
This commit is contained in:
commit
fb2e433b5c
|
@ -184,14 +184,14 @@ if [[ $OS_RELEASE =~ 'rhel' ]] || [[ $OS_RELEASE =~ 'fedora' ]]; then
|
|||
echo -e "${cyan}Installing agent dependencies...${reset}" ${green}OK${reset}
|
||||
|
||||
# Insatall pandora agent
|
||||
[ "$PANDORA_AGENT_PACKAGE_EL" ] || PANDORA_AGENT_PACKAGE_EL="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm "
|
||||
[ "$PANDORA_AGENT_PACKAGE_EL" ] || PANDORA_AGENT_PACKAGE_EL="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm"
|
||||
execute_cmd "$package_manager_cmd install -y ${PANDORA_AGENT_PACKAGE_EL}" 'Installing Pandora FMS agent package'
|
||||
#[[ $PANDORA_AGENT_SSL ]] && execute_cmd "$package_manager_cmd install -y perl-IO-Socket-SSL" "Installing SSL libraries for encrypted connection"
|
||||
|
||||
fi
|
||||
|
||||
if [[ $OS_RELEASE == 'debian' ]]; then
|
||||
[ "$PANDORA_AGENT_PACKAGE_UBUNTU" ] || PANDORA_AGENT_PACKAGE_UBUNTU='https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG_x86_64.tar.gz'
|
||||
[ "$PANDORA_AGENT_PACKAGE_UBUNTU" ] || PANDORA_AGENT_PACKAGE_UBUNTU='https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.x86_64.tar.gz'
|
||||
execute_cmd "apt update" 'Updating repos'
|
||||
execute_cmd "apt install -y perl wget curl unzip procps python3 python3-pip" 'Installing agent dependencies'
|
||||
execute_cmd "curl --output pandorafms_agent_linux-7.0NG.tar.gz ${PANDORA_AGENT_PACKAGE_UBUNTU}" 'Downloading Pandora FMS agent package'
|
||||
|
|
|
@ -11,7 +11,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
|
|||
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
||||
|
||||
|
||||
S_VERSION='2023062901'
|
||||
S_VERSION='2023101101'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
|
||||
# define default variables
|
||||
|
@ -185,7 +185,7 @@ extra_repos=" \
|
|||
tar \
|
||||
yum-utils \
|
||||
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
|
||||
http://rpms.remirepo.net/enterprise/remi-release-7.rpm \
|
||||
https://rpms.remirepo.net/enterprise/remi-release-7.rpm \
|
||||
https://repo.percona.com/yum/percona-release-latest.noarch.rpm"
|
||||
|
||||
execute_cmd "yum install -y $extra_repos" "Installing extra repositories"
|
||||
|
@ -285,6 +285,7 @@ console_dependencies=" \
|
|||
mod_ssl \
|
||||
libzstd \
|
||||
openldap-clients \
|
||||
https://firefly.pandorafms.com/centos8/pandora_gotty-1.0-1.el8.x86_64.rpm \
|
||||
chromium"
|
||||
execute_cmd "yum install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
|
||||
|
||||
|
@ -312,7 +313,7 @@ server_dependencies=" \
|
|||
bind-utils \
|
||||
whois \
|
||||
cpanminus \
|
||||
http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos7/pandorawmic-1.0.0-1.x86_64.rpm"
|
||||
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
|
||||
|
||||
|
@ -322,13 +323,13 @@ execute_cmd "cpanm -i Thread::Semaphore" "Installing Thread::Semaphore"
|
|||
|
||||
# SDK VMware perl dependencies
|
||||
vmware_dependencies=" \
|
||||
http://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm \
|
||||
perl-JSON \
|
||||
perl-Archive-Zip \
|
||||
openssl-devel \
|
||||
perl-Crypt-CBC \
|
||||
perl-Digest-SHA \
|
||||
http://firefly.pandorafms.com/centos7/perl-Crypt-OpenSSL-AES-0.02-1.el7.x86_64.rpm"
|
||||
https://firefly.pandorafms.com/centos7/perl-Crypt-OpenSSL-AES-0.02-1.el7.x86_64.rpm"
|
||||
execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl dependencies"
|
||||
|
||||
# Instant client Oracle
|
||||
|
@ -410,7 +411,7 @@ skip-character-set-client-handshake
|
|||
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||
symbolic-links=0
|
||||
# Mysql optimizations for Pandora FMS
|
||||
# Please check the documentation in http://pandorafms.com for better results
|
||||
# Please check the documentation in https://pandorafms.com for better results
|
||||
|
||||
max_allowed_packet = 64M
|
||||
innodb_buffer_pool_size = $POOL_SIZE
|
||||
|
@ -461,20 +462,20 @@ export MYSQL_PWD=$DBPASS
|
|||
#Define packages
|
||||
#Define packages
|
||||
if [ "$PANDORA_LTS" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
elif [ "$PANDORA_LTS" -ne '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.x86_64.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.x86_64.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
fi
|
||||
|
||||
# if beta is enable
|
||||
if [ "$PANDORA_BETA" -eq '1' ] ; then
|
||||
PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
|
||||
PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.noarch.rpm"
|
||||
PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
|
||||
PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.x86_64.rpm"
|
||||
PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
fi
|
||||
|
||||
# Downloading Pandora Packages
|
||||
|
@ -710,8 +711,8 @@ systemctl enable tentacle_serverd &>> $LOGFILE
|
|||
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
|
||||
|
||||
# Enabling condole cron
|
||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||
## Enabling agent
|
||||
systemctl enable pandora_agent_daemon &>> $LOGFILE
|
||||
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
|
||||
|
@ -729,7 +730,7 @@ Welcome to Pandora FMS appliance on CentOS
|
|||
Go to Public http://$ipplublic/pandora_console to login web console
|
||||
$(ip addr | grep -w "inet" | grep -v "127.0.0.1" | grep -v "172.17.0.1" | awk '{print $2}' | awk -F '/' '{print "Go to Local http://"$1"/pandora_console to login web console"}')
|
||||
|
||||
You can find more information at http://pandorafms.com
|
||||
You can find more information at https://pandorafms.com
|
||||
|
||||
EOF_banner
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf
|
|||
PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf
|
||||
|
||||
|
||||
S_VERSION='2023062901'
|
||||
S_VERSION='2023101101'
|
||||
LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
|
||||
|
||||
# define default variables
|
||||
|
@ -264,7 +264,7 @@ if [ "$(grep -Ei 'Red Hat Enterprise' /etc/redhat-release)" ]; then
|
|||
tar \
|
||||
dnf-utils \
|
||||
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
|
||||
http://rpms.remirepo.net/enterprise/remi-release-8.rpm \
|
||||
https://rpms.remirepo.net/enterprise/remi-release-8.rpm \
|
||||
https://repo.percona.com/yum/percona-release-latest.noarch.rpm"
|
||||
|
||||
execute_cmd "dnf install -y $extra_repos" "Installing extra repositories"
|
||||
|
@ -275,7 +275,7 @@ else
|
|||
tar \
|
||||
dnf-utils \
|
||||
epel-release \
|
||||
http://rpms.remirepo.net/enterprise/remi-release-8.rpm \
|
||||
https://rpms.remirepo.net/enterprise/remi-release-8.rpm \
|
||||
https://repo.percona.com/yum/percona-release-latest.noarch.rpm"
|
||||
|
||||
execute_cmd "dnf install -y $extra_repos" "Installing extra repositories"
|
||||
|
@ -391,10 +391,12 @@ console_dependencies=" \
|
|||
mod_ssl \
|
||||
libzstd \
|
||||
openldap-clients \
|
||||
http://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \
|
||||
http://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \
|
||||
http://firefly.pandorafms.com/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
|
||||
http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm"
|
||||
https://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
|
||||
https://firefly.pandorafms.com/centos8/pandora_gotty-1.0-1.el8.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos8/pandorafms_made-0.1.0-1.el8.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm"
|
||||
execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
|
||||
|
||||
# Server dependencies
|
||||
|
@ -421,7 +423,7 @@ server_dependencies=" \
|
|||
bind-utils \
|
||||
whois \
|
||||
libnsl \
|
||||
http://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos7/wmic-1.4-1.el7.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos8/pandorawmic-1.0.0-1.x86_64.rpm"
|
||||
execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
|
||||
|
||||
|
@ -436,8 +438,8 @@ vmware_dependencies=" \
|
|||
perl-Math-Random-ISAAC \
|
||||
perl-JSON \
|
||||
perl-Crypt-SSLeay \
|
||||
http://firefly.pandorafms.com/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm \
|
||||
http://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm"
|
||||
https://firefly.pandorafms.com/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm \
|
||||
https://firefly.pandorafms.com/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm"
|
||||
execute_cmd "dnf install -y $vmware_dependencies" "Installing SDK VMware perl dependencies"
|
||||
|
||||
# Instant client Oracle
|
||||
|
@ -518,7 +520,7 @@ skip-character-set-client-handshake
|
|||
# Disabling symbolic-links is recommended to prevent assorted security risks
|
||||
symbolic-links=0
|
||||
# Mysql optimizations for Pandora FMS
|
||||
# Please check the documentation in http://pandorafms.com for better results
|
||||
# Please check the documentation in https://pandorafms.com for better results
|
||||
|
||||
max_allowed_packet = 64M
|
||||
innodb_buffer_pool_size = $POOL_SIZE
|
||||
|
@ -567,20 +569,20 @@ export MYSQL_PWD=$DBPASS
|
|||
|
||||
#Define packages
|
||||
if [ "$PANDORA_LTS" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/LTS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm"
|
||||
elif [ "$PANDORA_LTS" -ne '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.x86_64.rpm"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.x86_64.rpm"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm"
|
||||
fi
|
||||
|
||||
# if beta is enable
|
||||
if [ "$PANDORA_BETA" -eq '1' ] ; then
|
||||
PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
|
||||
PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.noarch.rpm"
|
||||
PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux-7.0NG.noarch.rpm"
|
||||
PANDORA_SERVER_PACKAGE="https://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.x86_64.rpm"
|
||||
PANDORA_CONSOLE_PACKAGE="https://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.x86_64.rpm"
|
||||
PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/RHEL_CentOS/pandorafms_agent_linux_bin-7.0NG.x86_64.rpm"
|
||||
fi
|
||||
|
||||
# Downloading Pandora Packages
|
||||
|
@ -828,8 +830,8 @@ systemctl enable tentacle_serverd &>> "$LOGFILE"
|
|||
execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
|
||||
|
||||
# Enabling condole cron
|
||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||
## Enabling agent
|
||||
systemctl enable pandora_agent_daemon &>> "$LOGFILE"
|
||||
execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent"
|
||||
|
|
|
@ -344,6 +344,14 @@ execute_cmd "apt install -y $server_dependencies" "Installing Pandora FMS Server
|
|||
|
||||
execute_cmd "installing_docker" "Installing Docker for debug"
|
||||
|
||||
# Installing pandora_gotty
|
||||
execute_cmd "curl --output pandora_gotty.deb https://firefly.pandorafms.com/ubuntu/pandora_gotty_1.0.0.deb" "Downloading pandora_gotty"
|
||||
execute_cmd "apt install -y ./pandora_gotty.deb" "Intalling pandora_gotty"
|
||||
|
||||
# Installing MADE
|
||||
execute_cmd "curl --output pandora_made.deb https://firefly.pandorafms.com/ubuntu/pandorafms-made_0.1.0-2_amd64.deb" "Downloading pandora MADE"
|
||||
execute_cmd "apt install -y ./pandora_made.deb" "Intalling pandora MADE"
|
||||
|
||||
# wmic and pandorawmic
|
||||
execute_cmd "curl -O https://firefly.pandorafms.com/pandorafms/utils/bin/wmic" "Downloading wmic"
|
||||
execute_cmd "curl -O https://firefly.pandorafms.com/pandorafms/utils/bin/pandorawmic" "Downloading pandorawmic"
|
||||
|
@ -514,17 +522,17 @@ execute_cmd "systemctl restart mysql" "Configuring and restarting database engin
|
|||
if [ "$PANDORA_LTS" -eq '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/LTS/pandorafms_server-7.0NG.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/LTS/pandorafms_console-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/LTS/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.x86_64.tar.gz"
|
||||
elif [ "$PANDORA_LTS" -ne '1' ] ; then
|
||||
[ "$PANDORA_SERVER_PACKAGE" ] || PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_server-7.0NG.tar.gz"
|
||||
[ "$PANDORA_CONSOLE_PACKAGE" ] || PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_console-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
[ "$PANDORA_AGENT_PACKAGE" ] || PANDORA_AGENT_PACKAGE=" https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.x86_64.tar.gz"
|
||||
fi
|
||||
|
||||
if [ "$PANDORA_BETA" -eq '1' ] ; then
|
||||
PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest_x86_64.tar.gz"
|
||||
PANDORA_SERVER_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_server-latest.tar.gz"
|
||||
PANDORA_CONSOLE_PACKAGE="http://firefly.pandorafms.com/pandora_enterprise_nightlies/pandorafms_console-latest.tar.gz"
|
||||
PANDORA_AGENT_PACKAGE="http://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.tar.gz"
|
||||
PANDORA_AGENT_PACKAGE="https://firefly.pandorafms.com/pandorafms/latest/Tarball/pandorafms_agent_linux-7.0NG.x86_64.tar.gz"
|
||||
fi
|
||||
|
||||
# Downloading Pandora Packages
|
||||
|
@ -819,8 +827,8 @@ execute_cmd "service tentacle_serverd start" "Starting Tentacle Server"
|
|||
systemctl enable tentacle_serverd &>> "$LOGFILE"
|
||||
|
||||
# Enabling console cron
|
||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/enterprise/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||
execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS Console cron"
|
||||
echo "* * * * * root wget -q -O - --no-check-certificate --load-cookies /tmp/cron-session-cookies --save-cookies /tmp/cron-session-cookies --keep-session-cookies http://127.0.0.1/pandora_console/cron.php >> $PANDORA_CONSOLE/log/cron.log" >> /etc/crontab
|
||||
|
||||
# Enabling pandoradb cron
|
||||
execute_cmd "echo 'enabling pandoradb cron' >> $PANDORA_CONSOLE/log/cron.log\" >> /etc/crontab" "Enabling Pandora FMS pandoradb cron"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Source: pandora_gotty
|
||||
Section: utils
|
||||
Version: 1.0.0
|
||||
Version: 1.1.0
|
||||
Priority: optional
|
||||
Maintainer: PandoraFMS
|
||||
Build-Depends: debhelper (>= 12)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%define name pandora_gotty
|
||||
%define version 1.0
|
||||
%define version 1.1
|
||||
%define release 1%{?dist}
|
||||
Summary: pandora_gptty for Pandora FMS
|
||||
Name: %{name}
|
||||
|
|
|
@ -74,7 +74,7 @@ def exec_ssh (user:str, add:str, port:int):
|
|||
try:
|
||||
print("> Starting SSH connection...")
|
||||
ssh_command = f"ssh {user}@{add} -p {port}"
|
||||
subprocess.run(ssh_command, shell=True)
|
||||
subprocess.run(ssh_command, shell=True, encoding='utf-8', text=True)
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise SystemExit(e)
|
||||
|
@ -88,7 +88,7 @@ def exec_telnet (add:str, port:int):
|
|||
try:
|
||||
print("> Starting Telnet connection...")
|
||||
ssh_command = f"telnet -E {add} {port}"
|
||||
subprocess.run(ssh_command, shell=True)
|
||||
subprocess.run(ssh_command, shell=True, encoding='utf-8', text=True)
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise SystemExit(e)
|
||||
|
|
|
@ -22,13 +22,16 @@ else
|
|||
fi
|
||||
SPEC_FILES="$CODEHOME/pandora_console/pandora_console.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
|
||||
$CODEHOME/pandora_server/pandora_server.spec \
|
||||
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec \
|
||||
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec \
|
||||
$CODEHOME/pandora_console/pandora_console.redhat.spec \
|
||||
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
|
||||
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
|
||||
$CODEHOME/pandora_server/pandora_server.redhat.spec \
|
||||
$PANDHOME_ENT/pandora_agents/pandora_agent.spec \
|
||||
$PANDHOME_ENT/pandora_server/pandora_server_enterprise.redhat.spec \
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.774
|
||||
Version: 7.0NG.774-231201
|
||||
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.774"
|
||||
pandora_version="7.0NG.774-231201"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -313,7 +313,7 @@ module_plugin autodiscover --default
|
|||
|
||||
#Hardening plugin for security compliance analysis. Enable to use it.
|
||||
#module_begin
|
||||
#module_plugin /usr/share/pandora_agent/plugins/pandora_sca -t 150
|
||||
#module_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150
|
||||
#module_absoluteinterval 7d
|
||||
#module_end
|
||||
|
||||
|
|
|
@ -1039,7 +1039,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.774';
|
||||
use constant AGENT_BUILD => '231102';
|
||||
use constant AGENT_BUILD => '231201';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.774
|
||||
%define release 1
|
||||
%define release 231201
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230919
|
||||
%define version 7.0NG.774
|
||||
%define release 231201
|
||||
%define debug_package %{nil}
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.773.3
|
||||
%define release 230919
|
||||
%define version 7.0NG.774
|
||||
%define release 231201
|
||||
%define debug_package %{nil}
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
%define name pandorafms_agent_linux_bin
|
||||
%define source_name pandorafms_agent_linux
|
||||
%define version 7.0NG.774
|
||||
%define release 1
|
||||
%define release 231201
|
||||
|
||||
Summary: Pandora FMS Linux agent, binary version
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.774
|
||||
%define release 1
|
||||
%define release 231201
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.774"
|
||||
PI_BUILD="231102"
|
||||
PI_BUILD="231201"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -526,7 +526,7 @@ module_plugin "%PROGRAMFILES%\Pandora_Agent\util\autodiscover.exe" --default
|
|||
|
||||
# Hardening plugin for security compliance analysis.
|
||||
#module_begin
|
||||
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_sca.exe -t 150"
|
||||
#module_plugin "%PROGRAMFILES%\Pandora_Agent\util\pandora_hardening.exe -t 150"
|
||||
#module_absoluteinterval 7d
|
||||
#module_end
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{231102}
|
||||
{231201}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
|
|||
{No}
|
||||
|
||||
Windows,Executable
|
||||
{<%AppName%>-Setup<%Ext%>}
|
||||
{<%AppName%>-<%Version%>-Setup<%Ext%>}
|
||||
|
||||
Windows,FileDescription
|
||||
{<%AppName%> <%Version%> Setup}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.774 Build 231102")
|
||||
#define PANDORA_VERSION ("7.0NG.774 Build 231201")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Pandora FMS"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.774(Build 231102))"
|
||||
VALUE "ProductVersion", "(7.0NG.774(Build 231201))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.774
|
||||
Version: 7.0NG.774-231201
|
||||
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.774"
|
||||
pandora_version="7.0NG.774-231201"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -27,17 +27,18 @@
|
|||
*/
|
||||
|
||||
global $config;
|
||||
if (true) {
|
||||
include_once '../include/config.php';
|
||||
include_once '../include/functions_agents.php';
|
||||
include_once '../include/functions_reporting.php';
|
||||
include_once '../include/functions_modules.php';
|
||||
include_once '../include/functions_users.php';
|
||||
if ((bool) $config['metaconsole']) {
|
||||
include_once $config['homedir'].'/include/config.php';
|
||||
include_once $config['homedir'].'/include/functions_agents.php';
|
||||
include_once $config['homedir'].'/include/functions_reporting.php';
|
||||
include_once $config['homedir'].'/include/functions_modules.php';
|
||||
include_once $config['homedir'].'/include/functions_users.php';
|
||||
} else {
|
||||
include_once '../include/config.php';
|
||||
include_once '../include/functions_agents.php';
|
||||
include_once '../include/functions_reporting.php';
|
||||
include_once '../include/functions_modules.php';
|
||||
include_once '../include/functions_users.php';
|
||||
}
|
||||
|
||||
|
||||
|
@ -106,7 +107,25 @@ if ($get_agents_module_csv === '1') {
|
|||
|
||||
foreach ($results as $result) {
|
||||
foreach ($result as $key => $value) {
|
||||
$out_csv .= io_safe_output($value).$divider;
|
||||
if (preg_match('/Linux/i', $_SERVER['HTTP_USER_AGENT'])) {
|
||||
$value = preg_replace(
|
||||
'/\s+/',
|
||||
' ',
|
||||
io_safe_output($value)
|
||||
);
|
||||
} else {
|
||||
$value = mb_convert_encoding(
|
||||
preg_replace(
|
||||
'/\s+/',
|
||||
'',
|
||||
io_safe_output($value)
|
||||
),
|
||||
'UTF-16LE',
|
||||
'UTF-8'
|
||||
);
|
||||
}
|
||||
|
||||
$out_csv .= $value.$divider;
|
||||
}
|
||||
|
||||
$out_csv .= "\n";
|
||||
|
|
|
@ -99,7 +99,7 @@ function api_execute(
|
|||
if (empty($token) === true) {
|
||||
$data['apipass'] = $apipass;
|
||||
$data['user'] = $user;
|
||||
$data['password'] = $password;
|
||||
$data['pass'] = $password;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ function dbmgr_extension_main()
|
|||
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
__('Database interface'),
|
||||
__('DB interface'),
|
||||
'images/gm_db.png',
|
||||
false,
|
||||
'',
|
||||
|
|
|
@ -223,6 +223,8 @@ function quickShell()
|
|||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
$responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
@ -541,6 +543,9 @@ if (is_ajax() === true) {
|
|||
// Maximum time to establish a connection.
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
|
||||
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
curl_exec($ch);
|
||||
$response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
|
|
|
@ -1718,3 +1718,5 @@ operation/incidents/list_integriaims_incidents.php
|
|||
include/functions_incidents.php
|
||||
include/functions_integriaims.php
|
||||
include/ajax/integria_incidents.ajax.php
|
||||
enterprise/operation/log/log_source.php
|
||||
enterprise/include/class/LogSource.class.php
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,45 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `tevento`
|
||||
ADD COLUMN `event_custom_id` TEXT NULL AFTER `module_status`;
|
||||
|
||||
-- Telegram and vonage default alerts
|
||||
UPDATE talert_actions
|
||||
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
|
||||
WHERE id=9;
|
||||
UPDATE talert_actions
|
||||
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
|
||||
WHERE id=11;
|
||||
-- Delete table tagent_access
|
||||
DROP TABLE tagent_access;
|
||||
|
||||
ALTER TABLE `tevent_rule` DROP COLUMN `user_comment`;
|
||||
ALTER TABLE `tevent_rule` DROP COLUMN `operator_user_comment`;
|
||||
|
||||
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
|
||||
|
||||
-- Update macros for plugin oracle
|
||||
|
||||
UPDATE `tdiscovery_apps` SET `version` = '1.1' WHERE `short_name` = 'pandorafms.oracle';
|
||||
|
||||
SET @id_app := (SELECT `id_app` FROM `tdiscovery_apps` WHERE `short_name` = 'pandorafms.oracle');
|
||||
|
||||
UPDATE `tdiscovery_apps_tasks_macros` SET `value` = 'agents_group_id=__taskGroupID__ interval=__taskInterval__ user=_dbuser_ password=_dbpass_ thick_mode=_thickMode_ client_path=_clientPath_ threads=_threads_ modules_prefix=_prefixModuleName_ execute_custom_queries=_executeCustomQueries_ analyze_connections=_checkConnections_ engine_uptime=_checkUptime_ query_stats=_queryStats_ cache_stats=_checkCache_ fragmentation_ratio=_checkFragmentation_ check_tablescpaces=_checkTablespaces_' WHERE `macro` = '_tempfileConf_' AND `id_task` IN (SELECT `id_rt` FROM `trecon_task` WHERE `id_app` = @id_app);
|
||||
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_thickMode_', 'custom', 0, 0 FROM `trecon_task` WHERE `id_app` = @id_app;
|
||||
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_clientPath_', 'custom', '', 0 FROM `trecon_task` WHERE `id_app` = @id_app;
|
||||
UPDATE `trecon_task` SET `setup_complete` = 1 WHERE `id_app` = @id_app;
|
||||
|
||||
ALTER TABLE `tdashboard`
|
||||
ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`,
|
||||
ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`,
|
||||
ADD COLUMN `date_to` INT NOT NULL DEFAULT 0 AFTER `date_from`;
|
||||
|
||||
SELECT @generic_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_data";
|
||||
SELECT @generic_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "generic_proc";
|
||||
SELECT @async_data := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_data";
|
||||
SELECT @async_proc := `id_tipo` FROM `ttipo_modulo` WHERE `nombre` = "async_proc";
|
||||
UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_data WHERE `tagente_modulo`.`id_tipo_modulo` = @async_data;
|
||||
UPDATE `tagente_modulo` INNER JOIN `tservice` ON `tagente_modulo`.`custom_integer_1` = `tservice`.`id` SET `tagente_modulo`.`id_tipo_modulo` = @generic_proc WHERE `tagente_modulo`.`id_tipo_modulo` = @async_proc;
|
||||
|
||||
COMMIT;
|
|
@ -418,7 +418,7 @@ switch ($login_screen) {
|
|||
}
|
||||
|
||||
if ($config['enterprise_installed']) {
|
||||
if ($config['reset_pass_option']) {
|
||||
if ($config['reset_pass_option'] && $config['auth'] === 'mysql') {
|
||||
$reset_pass_link = 'reset_pass.php';
|
||||
// Reset password link.
|
||||
echo '<div class="reset_password">';
|
||||
|
|
|
@ -922,6 +922,26 @@ $tableAdvancedAgent->data['safe_operation'][] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
$tableAdvancedAgent->data['vul_scan_enabled'][] = html_print_label_input_block(
|
||||
__('Vulnerability scanning'),
|
||||
html_print_select(
|
||||
[
|
||||
0 => __('Disabled'),
|
||||
1 => __('Enabled'),
|
||||
2 => __('Use global settings'),
|
||||
],
|
||||
'vul_scan_enabled',
|
||||
$vul_scan_enabled,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
ui_toggle(
|
||||
html_print_table($tableAdvancedAgent, true),
|
||||
'<span class="subsection_header_title">'.__('Advanced options').'</span>',
|
||||
|
|
|
@ -231,6 +231,7 @@ if ($create_agent) {
|
|||
$quiet = (int) get_parameter('quiet', 0);
|
||||
$cps = (int) get_parameter_switch('cps', -1);
|
||||
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
||||
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
||||
|
||||
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
|
||||
$fields = db_get_all_fields_in_table('tagent_custom_fields');
|
||||
|
@ -298,6 +299,7 @@ if ($create_agent) {
|
|||
'quiet' => $quiet,
|
||||
'cps' => $cps,
|
||||
'fixed_ip' => $fixed_ip,
|
||||
'vul_scan_enabled' => $vul_scan_enabled,
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
@ -610,6 +612,7 @@ if ($id_agente) {
|
|||
$agent_wizard['active'] = false;
|
||||
}
|
||||
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
|
||||
if ($has_remote_conf !== false) {
|
||||
$agent_name = agents_get_name($id_agente);
|
||||
|
@ -642,24 +645,26 @@ if ($id_agente) {
|
|||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'vulnerabilities' => $vulnerabilities,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
];
|
||||
} else {
|
||||
$onheader = [
|
||||
'view' => $viewtab,
|
||||
'separator' => '',
|
||||
'main' => $maintab,
|
||||
'module' => $moduletab,
|
||||
'ncm' => $ncm_tab,
|
||||
'alert' => $alerttab,
|
||||
'template' => $templatetab,
|
||||
'inventory' => $inventorytab,
|
||||
'pluginstab' => $pluginstab,
|
||||
'policy' => (enterprise_installed() === true) ? $policyTab : '',
|
||||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
'view' => $viewtab,
|
||||
'separator' => '',
|
||||
'main' => $maintab,
|
||||
'module' => $moduletab,
|
||||
'ncm' => $ncm_tab,
|
||||
'alert' => $alerttab,
|
||||
'template' => $templatetab,
|
||||
'inventory' => $inventorytab,
|
||||
'pluginstab' => $pluginstab,
|
||||
'policy' => (enterprise_installed() === true) ? $policyTab : '',
|
||||
'collection' => $collectiontab,
|
||||
'group' => $grouptab,
|
||||
'gis' => $gistab,
|
||||
'vulnerabilities' => $vulnerabilities,
|
||||
'agent_wizard' => $agent_wizard,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -760,6 +765,11 @@ if ($id_agente) {
|
|||
$help_header = 'gis_tab';
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
$tab_name = __('Vulnerabilities');
|
||||
$help_header = 'vulnerabilities_tab';
|
||||
break;
|
||||
|
||||
case 'incident':
|
||||
$tab_name = __('Incidents');
|
||||
break;
|
||||
|
@ -1004,6 +1014,7 @@ if ($update_agent) {
|
|||
$secondary_groups = (array) get_parameter('secondary_groups_selected', '');
|
||||
$satellite_server = (int) get_parameter('satellite_server', 0);
|
||||
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
|
||||
$vul_scan_enabled = (int) get_parameter_switch('vul_scan_enabled', 2);
|
||||
|
||||
if ($fields === false) {
|
||||
$fields = [];
|
||||
|
@ -1130,6 +1141,7 @@ if ($update_agent) {
|
|||
'safe_mode_module' => $safe_mode_module,
|
||||
'satellite_server' => $satellite_server,
|
||||
'fixed_ip' => $fixed_ip,
|
||||
'vul_scan_enabled' => $vul_scan_enabled,
|
||||
];
|
||||
|
||||
if ($config['metaconsole_agent_cache'] == 1) {
|
||||
|
@ -1287,6 +1299,7 @@ if ($id_agente) {
|
|||
$safe_mode = ($safe_mode_module) ? 1 : 0;
|
||||
$satellite_server = (int) $agent['satellite_server'];
|
||||
$fixed_ip = (int) $agent['fixed_ip'];
|
||||
$vul_scan_enabled = (int) $agent['vul_scan_enabled'];
|
||||
}
|
||||
|
||||
$update_module = (bool) get_parameter('update_module');
|
||||
|
@ -2425,6 +2438,10 @@ switch ($tab) {
|
|||
include 'agent_conf_gis.php';
|
||||
break;
|
||||
|
||||
case 'vulnerabilities':
|
||||
include enterprise_include('godmode/agentes/vulnerabilities_editor.php');
|
||||
break;
|
||||
|
||||
case 'incident':
|
||||
include 'agent_incidents.php';
|
||||
break;
|
||||
|
|
|
@ -217,6 +217,7 @@ foreach ($fields as $field) {
|
|||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
$tablePagination = '';
|
||||
if ($fields) {
|
||||
html_print_table($table);
|
||||
$tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false);
|
||||
|
@ -231,6 +232,9 @@ html_print_action_buttons(
|
|||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
['type' => 'form_action']
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'right_content' => $tablePagination,
|
||||
],
|
||||
);
|
||||
echo '</form>';
|
||||
|
|
|
@ -38,6 +38,7 @@ $isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
|
|||
require_once $config['homedir'].'/include/functions_modules.php';
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
require_once $config['homedir'].'/include/functions_servers.php';
|
||||
require_once $config['homedir'].'/include/functions_macros.php';
|
||||
|
||||
$search_string = get_parameter('search_string');
|
||||
|
||||
|
@ -949,7 +950,23 @@ if ($modules !== false) {
|
|||
);
|
||||
|
||||
if (strlen($module['ip_target']) !== 0) {
|
||||
$title .= '<br/>IP: '.$module['ip_target'];
|
||||
// Check if value is custom field.
|
||||
if ($module['ip_target'][0] == '_' && $module['ip_target'][(strlen($module['ip_target']) - 1)] == '_') {
|
||||
$custom_field_name = substr($module['ip_target'], 1, -1);
|
||||
$custom_value = agents_get_agent_custom_field($id_agente, $custom_field_name);
|
||||
if (isset($custom_value) && $custom_value !== false) {
|
||||
$title .= '<br/>IP: '.$custom_value;
|
||||
} else {
|
||||
$array_macros = return_agent_macros($id_agente);
|
||||
if (isset($array_macros[$module['ip_target']])) {
|
||||
$title .= '<br/>IP: '.$array_macros[$module['ip_target']];
|
||||
} else {
|
||||
$title .= '<br/>IP: '.$module['ip_target'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$title .= '<br/>IP: '.$module['ip_target'];
|
||||
}
|
||||
}
|
||||
|
||||
// This module is initialized ? (has real data).
|
||||
|
|
|
@ -1387,11 +1387,10 @@ $table_advanced->data['made_enabled'][0] = html_print_checkbox_switch(
|
|||
'made_enabled',
|
||||
1,
|
||||
(bool) $made_enabled,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'wp100 static'
|
||||
);
|
||||
|
||||
|
@ -2000,23 +1999,18 @@ ui_require_jquery_file('json');
|
|||
$('#' + thisLabel).prop('checked', true);
|
||||
$('#' + thisLabel).siblings().prop('checked', false);
|
||||
|
||||
if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) {
|
||||
var type_selected = $("#id_module_type").val();
|
||||
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
|
||||
var type_name_selected = type_names[type_selected];
|
||||
|
||||
if (($('#radius-percentage_warning').prop('checked') === true && $('#radius-percentage_critical').prop('checked') === true) || type_name_selected == 'generic_data_string') {
|
||||
paint_graph_values();
|
||||
$("#svg_dinamic").hide();
|
||||
} else {
|
||||
paint_graph_values();
|
||||
$("#svg_dinamic").show();
|
||||
}
|
||||
|
||||
if ($('#radius-percentage_warning').prop('checked') === true) {
|
||||
$('#radius-warning_inverse').hide();
|
||||
$('#label-radius-warning_inverse').hide();
|
||||
}
|
||||
|
||||
if ($('#radius-warning_inverse').prop('checked') === true) {
|
||||
$('#radius-percentage_warning').hide();
|
||||
$('#label-radius-percentage_warning').hide();
|
||||
}
|
||||
|
||||
if ($('#radius-normal_warning').prop('checked') === true) {
|
||||
$('#radius-warning_inverse').show();
|
||||
$('#label-radius-warning_inverse').show();
|
||||
|
@ -2024,17 +2018,6 @@ ui_require_jquery_file('json');
|
|||
$('#label-radius-percentage_warning').show();
|
||||
}
|
||||
|
||||
|
||||
if ($('#radius-percentage_critical').prop('checked') === true) {
|
||||
$('#radius-critical_inverse').hide();
|
||||
$('#label-radius-critical_inverse').hide();
|
||||
}
|
||||
|
||||
if ($('#radius-critical_inverse').prop('checked') === true) {
|
||||
$('#radius-percentage_critical').hide();
|
||||
$('#label-radius-percentage_critical').hide();
|
||||
}
|
||||
|
||||
if ($('#radius-normal_critical').prop('checked') === true) {
|
||||
$('#radius-critical_inverse').show();
|
||||
$('#label-radius-critical_inverse').show();
|
||||
|
@ -2351,30 +2334,48 @@ ui_require_jquery_file('json');
|
|||
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
|
||||
|
||||
//if haven't error
|
||||
if (max_w == 0 || max_w > min_w) {
|
||||
if (max_c == 0 || max_c > min_c) {
|
||||
paint_graph_status(
|
||||
min_w, max_w, min_c, max_c, inverse_w,
|
||||
inverse_c, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical
|
||||
);
|
||||
if (max_w == 0 || max_w > min_w || $('#radius-percentage_warning').is(':checked') === true) {
|
||||
if (max_c == 0 || max_c > min_c || $('#radius-percentage_critical').is(':checked') === true) {
|
||||
error_c = 0;
|
||||
error_w = 0;
|
||||
} else {
|
||||
error_c = 1;
|
||||
paint_graph_status(
|
||||
0, 0, 0, 0, 0, 0, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical
|
||||
);
|
||||
min_w = 0;
|
||||
max_w = 0;
|
||||
min_c = 0;
|
||||
max_c = 0;
|
||||
inverse_w = 0;
|
||||
inverse_c = 0;
|
||||
}
|
||||
} else {
|
||||
if (max_c !== 0 && max_c < min_c && $('#radius-percentage_critical').is(':checked') === false) {
|
||||
error_c = 2;
|
||||
}
|
||||
error_w = 1;
|
||||
paint_graph_status(
|
||||
0, 0, 0, 0, 0, 0, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical
|
||||
);
|
||||
min_w = 0;
|
||||
max_w = 0;
|
||||
min_c = 0;
|
||||
max_c = 0;
|
||||
inverse_w = 0;
|
||||
inverse_c = 0;
|
||||
}
|
||||
|
||||
if ($('#radius-percentage_warning').is(':checked') === true){
|
||||
min_w = 0;
|
||||
max_w = 0;
|
||||
}
|
||||
|
||||
if ($('#radius-percentage_critical').is(':checked') === true){
|
||||
min_c = 0;
|
||||
max_c = 0;
|
||||
}
|
||||
|
||||
paint_graph_status(
|
||||
min_w, max_w, min_c, max_c, inverse_w,
|
||||
inverse_c, error_w, error_c,
|
||||
legend_normal, legend_warning, legend_critical,
|
||||
message_error_warning, message_error_critical
|
||||
);
|
||||
}
|
||||
|
||||
/* ]]> */
|
||||
|
|
|
@ -131,9 +131,10 @@ if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
|
|||
}
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Agent');
|
||||
$data[1] = __('Module');
|
||||
$data[2] = __('Period');
|
||||
|
||||
$data[0] = __('Module');
|
||||
$data[1] = __('Period');
|
||||
|
||||
$table_simple->cellclass['caption_prediction_module'][0] = 'w33p';
|
||||
$table_simple->cellclass['caption_prediction_module'][1] = 'w33p';
|
||||
$table_simple->cellclass['caption_prediction_module'][2] = 'w33p';
|
||||
|
@ -163,34 +164,68 @@ $params['none_module_text'] = __('Select Module');
|
|||
$params['use_hidden_input_idagent'] = true;
|
||||
$params['input_style'] = 'width: 100%;';
|
||||
$params['hidden_input_idagent_id'] = 'hidden-id_agente_module_prediction';
|
||||
$data[0] = ui_print_agent_autocomplete_input($params);
|
||||
|
||||
if ($id_agente > 0) {
|
||||
$predictionModuleInput = html_print_select_from_sql(
|
||||
'SELECT id_agente_modulo, nombre
|
||||
FROM tagente_modulo
|
||||
WHERE delete_pending = 0
|
||||
AND history_data = 1
|
||||
AND id_agente = '.$id_agente_clean.'
|
||||
AND id_agente_modulo <> '.$id_agente_modulo,
|
||||
if (strstr($page, 'policy_modules') === false) {
|
||||
$modules = agents_get_modules($id_agente);
|
||||
|
||||
$predictionModuleInput = html_print_select(
|
||||
$modules,
|
||||
'prediction_module',
|
||||
$prediction_module,
|
||||
'',
|
||||
__('Select Module'),
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'pm'
|
||||
);
|
||||
} else {
|
||||
$predictionModuleInput = '<select id="prediction_module" name="custom_integer_1" disabled="disabled"><option value="0">Select an Agent first</option></select>';
|
||||
$modules = index_array(policies_get_modules($policy_id, false, ['id', 'name']));
|
||||
|
||||
$predictionModuleInput = html_print_select(
|
||||
$modules,
|
||||
'id_module_policy',
|
||||
$module['custom_integer_1'],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$data[1] = $predictionModuleInput;
|
||||
$data[2] = html_print_select([__('Weekly'), __('Monthly'), __('Daily')], 'custom_integer_2', $custom_integer_2, '', '', 0, true, false, true, '', false, 'width: 100%;');
|
||||
$data[2] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true);
|
||||
$data[0] = $predictionModuleInput;
|
||||
$data[1] = html_print_select([__('Weekly'), __('Monthly'), __('Daily')], 'custom_integer_2', $custom_integer_2, '', '', 0, true, false, true, '', false, 'width: 100%;');
|
||||
$data[1] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true);
|
||||
|
||||
$table_simple->cellclass['prediction_module'][0] = 'w33p';
|
||||
$table_simple->cellclass['prediction_module'][1] = 'w33p';
|
||||
$table_simple->cellclass['prediction_module'][2] = 'w33p';
|
||||
|
@ -264,7 +299,7 @@ if ($selector_form !== ENTERPRISE_NOT_HOOK) {
|
|||
}
|
||||
|
||||
// Synthetic modules are an Enterprise feature.
|
||||
$synthetic_module_form = enterprise_hook('get_synthetic_module_form');
|
||||
$synthetic_module_form = enterprise_hook('get_synthetic_module_form', [$policy_id]);
|
||||
if ($synthetic_module_form !== ENTERPRISE_NOT_HOOK) {
|
||||
$data = [];
|
||||
$data[0] = $synthetic_module_form;
|
||||
|
|
|
@ -31,13 +31,14 @@ if (is_ajax()) {
|
|||
return;
|
||||
}
|
||||
|
||||
echo '<h3>'.$template['name'].'</h3>';
|
||||
echo '<h3 style="background-color: #14524f">'.$template['name'].'</h3>';
|
||||
echo html_print_image('images/info.svg', true, ['class' => 'invert_filter']);
|
||||
echo ui_print_alert_template_example($template['id'], true, true, false);
|
||||
echo '<br />';
|
||||
echo '<br />';
|
||||
echo '<strong>'.__('Type').': </strong>';
|
||||
echo alerts_get_alert_templates_type_name($template['type']);
|
||||
|
||||
echo '<br />';
|
||||
echo ui_print_alert_template_example($template['id'], true);
|
||||
|
||||
echo '<br />';
|
||||
|
||||
if ($template['description'] != '') {
|
||||
|
|
|
@ -484,6 +484,7 @@ echo '</form>';
|
|||
|
||||
ui_require_javascript_file('pandora_alerts');
|
||||
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
|
||||
ui_require_javascript_file('alert');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -500,194 +501,6 @@ $(document).ready (function () {
|
|||
render_command_description(command_description);
|
||||
}
|
||||
|
||||
function ajax_get_integria_custom_fields(ticket_type_id, values, recovery_values) {
|
||||
var values = values || [];
|
||||
var recovery_values = recovery_values || [];
|
||||
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
|
||||
|
||||
if (ticket_type_id === null || ticket_type_id === '' || (Array.isArray(values) && values.length === 0 && Array.isArray(recovery_values) && recovery_values.length === 0)) {
|
||||
for (var i=8; i <= max_macro_fields; i++) {
|
||||
$('[name=field'+i+'_value\\[\\]').val('');
|
||||
$('[name=field'+i+'_recovery_value\\[\\]').val('');
|
||||
}
|
||||
}
|
||||
|
||||
// On ticket type change, hide all table rows and inputs corresponding to custom fields, regardless of what its type is.
|
||||
for (var i=8; i <= max_macro_fields; i++) {
|
||||
$('[name=field'+i+'_value\\[\\]').hide();
|
||||
$('[name=field'+i+'_recovery_value\\[\\]').hide();
|
||||
$('#table_macros-field'+i).hide();
|
||||
$('[name=field'+i+'_value_container').hide();
|
||||
$('[name=field'+i+'_recovery_value_container').hide();
|
||||
}
|
||||
|
||||
jQuery.post(
|
||||
"ajax.php",
|
||||
{
|
||||
page: "godmode/alerts/configure_alert_action",
|
||||
get_integria_ticket_custom_types: 1,
|
||||
ticket_type_id: ticket_type_id
|
||||
},
|
||||
function(data) {
|
||||
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
|
||||
data.forEach(function(custom_field, key) {
|
||||
var custom_field_key = key+8; // Custom fields start from field 8.
|
||||
|
||||
if (custom_field_key > max_macro_fields) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Display field row for current input.
|
||||
var custom_field_row = $('#table_macros-field'+custom_field_key);
|
||||
custom_field_row.show();
|
||||
|
||||
// Replace label text of field row for current input.
|
||||
var label_html = $('#table_macros-field'+custom_field_key+' td').first().html();
|
||||
var label_name = label_html.split('<br>')[0];
|
||||
var new_html_content = custom_field_row.html().replace(label_name, custom_field.label);
|
||||
custom_field_row.html(new_html_content);
|
||||
|
||||
switch (custom_field.type) {
|
||||
case 'CHECKBOX':
|
||||
var checkbox_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]');
|
||||
var checkbox_recovery_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]');
|
||||
|
||||
checkbox_selector.on('change', function() {
|
||||
if (checkbox_selector.prop('checked')) {
|
||||
checkbox_selector.attr('value', "1");
|
||||
} else {
|
||||
checkbox_selector.attr('value', "0");
|
||||
}
|
||||
});
|
||||
|
||||
checkbox_recovery_selector.on('change', function() {
|
||||
if (checkbox_recovery_selector.prop('checked')) {
|
||||
checkbox_recovery_selector.attr('value', "1");
|
||||
} else {
|
||||
checkbox_recovery_selector.attr('value', "0");
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof values[key] !== "undefined") {
|
||||
if (values[key] == 1) {
|
||||
checkbox_selector.prop('checked', true);
|
||||
checkbox_selector.attr('value', "1");
|
||||
} else {
|
||||
checkbox_selector.prop('checked', false);
|
||||
checkbox_selector.attr('value', "0");
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof recovery_values[key] !== "undefined") {
|
||||
if (recovery_values[key] == 1) {
|
||||
checkbox_recovery_selector.prop('checked', true);
|
||||
checkbox_recovery_selector.attr('value', "1");
|
||||
} else {
|
||||
checkbox_recovery_selector.prop('checked', false);
|
||||
checkbox_recovery_selector.attr('value', "0");
|
||||
}
|
||||
}
|
||||
|
||||
$('[name=field'+custom_field_key+'_value_container]').show();
|
||||
$('[name=field'+custom_field_key+'_recovery_value_container]').show();
|
||||
$('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
break;
|
||||
case 'COMBO':
|
||||
var combo_input = $('select[name=field'+custom_field_key+'_value\\[\\]]');
|
||||
var combo_input_recovery = $('select[name=field'+custom_field_key+'_recovery_value\\[\\]]');
|
||||
|
||||
combo_input.find('option').remove();
|
||||
combo_input_recovery.find('option').remove();
|
||||
|
||||
var combo_values_array = custom_field.comboValue.split(',');
|
||||
|
||||
combo_values_array.forEach(function(value) {
|
||||
combo_input.append($('<option>', {
|
||||
value: value,
|
||||
text: value
|
||||
}));
|
||||
|
||||
combo_input_recovery.append($('<option>', {
|
||||
value: value,
|
||||
text: value
|
||||
}));
|
||||
});
|
||||
|
||||
if (typeof values[key] !== "undefined") {
|
||||
combo_input.val(values[key]);
|
||||
}
|
||||
|
||||
if (typeof recovery_values[key] !== "undefined") {
|
||||
combo_input_recovery.val(recovery_values[key]);
|
||||
}
|
||||
|
||||
combo_input.show();
|
||||
combo_input_recovery.show();
|
||||
break;
|
||||
case 'DATE':
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').removeClass("hasDatepicker");
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').removeClass("hasDatepicker");
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker("destroy");
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker("destroy");
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
|
||||
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
|
||||
|
||||
if (typeof values[key] !== "undefined") {
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
|
||||
}
|
||||
|
||||
if (typeof recovery_values[key] !== "undefined") {
|
||||
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
|
||||
}
|
||||
break;
|
||||
case 'NUMERIC':
|
||||
if (typeof values[key] !== "undefined") {
|
||||
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
|
||||
}
|
||||
|
||||
if (typeof recovery_values[key] !== "undefined") {
|
||||
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
|
||||
}
|
||||
|
||||
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
break;
|
||||
case 'TEXT':
|
||||
if (typeof values[key] !== "undefined") {
|
||||
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
|
||||
}
|
||||
|
||||
if (typeof recovery_values[key] !== "undefined") {
|
||||
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
|
||||
}
|
||||
|
||||
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
break;
|
||||
case 'TEXTAREA':
|
||||
default:
|
||||
if (typeof values[key] !== "undefined") {
|
||||
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
|
||||
}
|
||||
|
||||
if (typeof recovery_values[key] !== "undefined") {
|
||||
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
|
||||
}
|
||||
|
||||
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').show();
|
||||
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
|
||||
break;
|
||||
}
|
||||
});
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
$("#id_command").change (function () {
|
||||
values = Array ();
|
||||
// No se envia el valor del commando.
|
||||
|
@ -707,7 +520,7 @@ $(document).ready (function () {
|
|||
name: "id_action",
|
||||
value: "<?php echo (int) $id; ?>"
|
||||
});
|
||||
|
||||
|
||||
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
|
||||
values,
|
||||
function (data, status) {
|
||||
|
@ -739,6 +552,9 @@ $(document).ready (function () {
|
|||
|
||||
// If the row is empty, hide it
|
||||
if (field_row == '') {
|
||||
// Clear hidden fields.
|
||||
$("[name=field" + i + "_value]").val('');
|
||||
$("[name=field" + i + "_recovery_value]").val('')
|
||||
$table_macros_field.hide();
|
||||
continue;
|
||||
}
|
||||
|
@ -914,12 +730,22 @@ $(document).ready (function () {
|
|||
}
|
||||
|
||||
if ($('#field5_value').val() !== '') {
|
||||
ajax_get_integria_custom_fields($('#field5_value').val(), integria_custom_fields_values, integria_custom_fields_rvalues);
|
||||
ajax_get_integria_custom_fields(
|
||||
$('#field5_value').val(),
|
||||
integria_custom_fields_values,
|
||||
integria_custom_fields_rvalues,
|
||||
max_macro_fields
|
||||
);
|
||||
$('#field5_value').trigger('change');
|
||||
}
|
||||
|
||||
$('#field5_value').on('change', function() {
|
||||
ajax_get_integria_custom_fields($(this).val());
|
||||
ajax_get_integria_custom_fields(
|
||||
$(this).val(),
|
||||
[],
|
||||
[],
|
||||
max_macro_fields
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1240,7 +1240,7 @@ if ($step == 2) {
|
|||
'priority',
|
||||
$priority,
|
||||
'',
|
||||
0,
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
|
|
|
@ -27,7 +27,6 @@ if (! check_acl($config['id_user'], 0, 'DM')) {
|
|||
|
||||
// Get some general DB stats (not very heavy)
|
||||
// NOTE: this is not realtime monitoring stats, are more focused on DB sanity
|
||||
$stat_access = db_get_sql('SELECT COUNT(*) FROM tagent_access WHERE id_agent != 0');
|
||||
$stat_data = db_get_sql('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo != 0');
|
||||
$stat_data_log4x = db_get_sql('SELECT COUNT(*) FROM tagente_datos_log4x WHERE id_agente_modulo != 0');
|
||||
$stat_data_string = db_get_sql('SELECT COUNT(*) FROM tagente_datos_string WHERE id_agente_modulo != 0');
|
||||
|
@ -149,18 +148,6 @@ echo $stat_modules;
|
|||
echo '</b></td></tr>';
|
||||
|
||||
|
||||
|
||||
echo '<tr class="rowOdd"><td>';
|
||||
echo __('Total agent access records');
|
||||
echo '<td><b>';
|
||||
if ($stat_access > $max_access) {
|
||||
echo "<font color='#ff0000'>$stat_access</font>";
|
||||
} else {
|
||||
echo $stat_access;
|
||||
}
|
||||
|
||||
echo '</b></td></tr>';
|
||||
|
||||
// Sanity
|
||||
echo '<tr><th colspan=2><i>';
|
||||
echo __('Database sanity');
|
||||
|
|
|
@ -115,6 +115,7 @@ $fields_available['module_status'] = __('Module Status');
|
|||
$fields_available['mini_severity'] = __('Severity mini');
|
||||
$fields_available['module_custom_id'] = __('Module custom ID');
|
||||
$fields_available['custom_data'] = __('Custom data');
|
||||
$fields_available['event_custom_id'] = __('Event Custom ID');
|
||||
|
||||
|
||||
// Remove fields already selected.
|
||||
|
|
|
@ -68,7 +68,7 @@ foreach ($layer_ids as $layer_id) {
|
|||
$layer_list[] = [
|
||||
'id' => (strpos($layer_id, 'new_') === false) ? (int) $layer_id : null,
|
||||
'layer_name' => $trimmed_name,
|
||||
'layer_visible' => ((int) $layers[$layer_id]['visible'] === 1),
|
||||
'layer_visible' => ($layers[$layer_id]['visible'] === 'true'),
|
||||
'layer_group' => (int) $layers[$layer_id]['agents_from_group'],
|
||||
'layer_agent_list' => $layers[$layer_id]['agents'],
|
||||
'layer_group_list' => $layers[$layer_id]['groups'],
|
||||
|
@ -560,21 +560,23 @@ html_print_table($table);
|
|||
|
||||
$user_groups = users_get_groups($config['user'], 'AR', false);
|
||||
|
||||
echo '<h3>'.__('Layers').'</h3>';
|
||||
echo '<fieldset class="margin-bottom-10"><legend>'.__('Layers').'</legend>';
|
||||
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->valign = [];
|
||||
$table->valign[0] = 'top';
|
||||
$table->valign[1] = 'top';
|
||||
$table->valign[0] = 'top; width: 50%';
|
||||
$table->valign[1] = 'top; width: 50%';
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = '<h4>'.__('List of layers').'</h4>';
|
||||
$table->data[0][1] = '<div class="right">'.html_print_button(__('New layer'), 'new_layer', false, 'newLayer();', 'class="sub add "', true).'</div>';
|
||||
|
||||
$table->data[1][0] = '<table class="databox" border="0" cellpadding="4" cellspacing="4" id="list_layers"></table>';
|
||||
$table->data[1][1] = '<div id="form_layer" class="invisible">
|
||||
$table->data[1][0] = '<div id="form_layer" class="invisible">
|
||||
<table id="form_layer_table" class="" border="0" cellpadding="4" cellspacing="4">
|
||||
<tr>
|
||||
<td colspan="4"><hr/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.__('Layer name').':</td>
|
||||
<td>'.html_print_input_text('layer_name_form', '', '', 20, 40, true).'</td>
|
||||
|
@ -592,10 +594,6 @@ $table->data[1][1] = '<div id="form_layer" class="invisible">
|
|||
<td>'.__('Agent').':</td>
|
||||
<td colspan="3">';
|
||||
|
||||
|
||||
|
||||
$table->data[1][1] .= html_print_button(__('Add agent'), 'add_agent', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
|
||||
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
|
@ -608,12 +606,13 @@ $params['javascript_function_action_after_select'] = 'active_button_add_agent';
|
|||
$params['javascript_is_function_select'] = true;
|
||||
$params['disabled_javascript_on_blur_function'] = false;
|
||||
|
||||
$table->data[1][1] .= ui_print_agent_autocomplete_input($params);
|
||||
|
||||
|
||||
|
||||
$table->data[1][1] .= '</td>
|
||||
$table->data[1][0] .= ui_print_agent_autocomplete_input($params);
|
||||
$buttonAgent = html_print_button(__('Add agent'), 'add_agent', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
|
||||
$table->data[1][0] .= '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4" align="right">'.$buttonAgent.'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<h4>'.__('List of Agents to be shown in the layer').'</h4>
|
||||
|
@ -641,7 +640,7 @@ $params['disabled_javascript_on_blur_function'] = false;
|
|||
$agent_for_group_input = ui_print_agent_autocomplete_input($params);
|
||||
$add_group_btn = html_print_button(__('Add'), 'add_group', true, '', ['mode' => 'secondary', 'icon' => 'next'], true);
|
||||
|
||||
$table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
|
||||
$table->data[1][0] .= '<tr><td colspan="4"><hr /></td></tr>
|
||||
<tr>
|
||||
<td>'.__('Group').':</td>
|
||||
<td colspan="3">'.$group_select.'</td>
|
||||
|
@ -661,7 +660,7 @@ $table->data[1][1] .= '<tr><td colspan="4"><hr /></td></tr>
|
|||
</td>
|
||||
</tr>';
|
||||
|
||||
$table->data[1][1] .= '<tr>
|
||||
$table->data[1][0] .= '<tr>
|
||||
<td align="right" colspan="4">'.html_print_button(__('Save Layer'), 'save_layer', false, 'javascript:saveNewLayer();', 'class="sub wand"', true).'
|
||||
'.html_print_input_hidden('current_edit_layer_id', '', true).'
|
||||
</td>
|
||||
|
@ -669,7 +668,12 @@ $table->data[1][1] .= '<tr>
|
|||
</table>
|
||||
</div>';
|
||||
|
||||
$table->data[1][1] = '<fieldset>
|
||||
<legend>'.__('Layers list').'</legend>
|
||||
<table class="databox invisible" border="0" id="list_layers"></table>
|
||||
</fieldset>';
|
||||
html_print_table($table);
|
||||
echo '</fieldset>';
|
||||
|
||||
switch ($action) {
|
||||
case 'save_new':
|
||||
|
@ -1229,6 +1233,8 @@ function getLayerRow (layerId, layerData) {
|
|||
.append($editCol)
|
||||
.append($deleteCol);
|
||||
|
||||
$("#list_layers").removeClass('invisible');
|
||||
|
||||
return $row;
|
||||
}
|
||||
|
||||
|
|
|
@ -84,6 +84,9 @@ if (is_ajax() === true) {
|
|||
}
|
||||
|
||||
$group = db_get_row('tgrupo', 'id_grupo', $id_group);
|
||||
if (str_contains($group['icon'], '.png') === true) {
|
||||
$group['folder'] = 'groups_small/';
|
||||
}
|
||||
|
||||
echo json_encode($group);
|
||||
return;
|
||||
|
@ -757,6 +760,125 @@ if ($tab == 'tree') {
|
|||
/*
|
||||
* Group tree view.
|
||||
*/
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
if (is_metaconsole() === true) {
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
}
|
||||
|
||||
$search_group_string = get_parameter('search_group_string', '');
|
||||
$search_agent_string = get_parameter('search_agent_string', '');
|
||||
$agent_status = get_parameter('agent_status', '');
|
||||
$show_not_init_agents = get_parameter('show_not_init_agents', 1);
|
||||
$show_not_init_modules = get_parameter('show_not_init_modules', 1);
|
||||
$show_full_hirearchy = get_parameter('show_full_hirearchy', 1);
|
||||
|
||||
|
||||
$table->data = [];
|
||||
$table->head = [];
|
||||
$table->style = [];
|
||||
|
||||
$table->style[0] = 'width: 50%;';
|
||||
$table->style[1] = 'width: 50%;';
|
||||
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Search group'),
|
||||
html_print_input_text(
|
||||
'search_group_string',
|
||||
$search_group_string,
|
||||
'',
|
||||
25,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
)
|
||||
);
|
||||
|
||||
$agents_status_list = agents_status_list();
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Search by agent status').ui_print_help_tip(__('Shows the groups that contain an agent with the status that has been searched'), true),
|
||||
html_print_select(
|
||||
$agents_status_list,
|
||||
'agent_status',
|
||||
$agent_status,
|
||||
'',
|
||||
__('All'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w200p',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Search by agent').ui_print_help_tip(__('Shows groups that contain an agent matching the search'), true),
|
||||
html_print_input_text(
|
||||
'search_agent_string',
|
||||
$search_agent_string,
|
||||
'',
|
||||
25,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Show full hierarchy'),
|
||||
html_print_checkbox_switch_extended(
|
||||
'show_full_hirearchy',
|
||||
1,
|
||||
$show_full_hirearchy,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[3][0] = ' ';
|
||||
|
||||
$table->data[3][1] = html_print_submit_button(
|
||||
__('Filter'),
|
||||
'filter',
|
||||
false,
|
||||
[
|
||||
'class' => 'float-right',
|
||||
'icon' => 'search',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$form = "<form method='post' action=''>";
|
||||
$form .= html_print_table($table, true);
|
||||
$form .= '</form>';
|
||||
|
||||
|
||||
|
||||
ui_toggle(
|
||||
$form,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
'filter_form',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
|
||||
|
||||
echo "<div id='tree-controller-recipient'></div>";
|
||||
} else {
|
||||
/*
|
||||
|
@ -826,6 +948,8 @@ if ($tab == 'tree') {
|
|||
);
|
||||
$form .= '</form>';
|
||||
|
||||
|
||||
|
||||
ui_toggle(
|
||||
$form,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
|
@ -1058,87 +1182,119 @@ $tab = 'group_edition';
|
|||
<?php } ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
var treeController = TreeController.getController();
|
||||
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
|
||||
|
||||
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
|
||||
treeController.recipient.empty();
|
||||
let show_full_hirearchy = "<?php echo $show_full_hirearchy; ?>";
|
||||
let show_not_init_agents = "<?php echo $show_not_init_agents; ?>";
|
||||
let show_not_init_modules = "<?php echo $show_not_init_modules; ?>";
|
||||
|
||||
showSpinner();
|
||||
$('#checkbox-show_full_hirearchy').on("change", function() {
|
||||
if (show_full_hirearchy == 1) {
|
||||
show_full_hirearchy = 0;
|
||||
} else {
|
||||
show_full_hirearchy = 1;
|
||||
}
|
||||
});
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = "include/ajax/tree.ajax";
|
||||
parameters['getChildren'] = 1;
|
||||
parameters['type'] = "<?php echo $tab; ?>";
|
||||
parameters['filter'] = {};
|
||||
parameters['filter']['searchGroup'] = '';
|
||||
parameters['filter']['searchAgent'] = '';
|
||||
parameters['filter']['statusAgent'] = '';
|
||||
parameters['filter']['searchModule'] = '';
|
||||
parameters['filter']['statusModule'] = '';
|
||||
parameters['filter']['groupID'] = '';
|
||||
parameters['filter']['tagID'] = '';
|
||||
parameters['filter']['searchHirearchy'] = 1;
|
||||
parameters['filter']['show_not_init_agents'] = 1;
|
||||
parameters['filter']['show_not_init_modules'] = 1;
|
||||
$('#button-filter').on('click', function(event) {
|
||||
console.log('here');
|
||||
event.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
data: parameters,
|
||||
success: function(data) {
|
||||
if (data.success) {
|
||||
hideSpinner();
|
||||
load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules);
|
||||
});
|
||||
|
||||
treeController.init({
|
||||
recipient: $("div#tree-controller-recipient"),
|
||||
page: parameters['page'],
|
||||
emptyMessage: "<?php echo __('No data found'); ?>",
|
||||
foundMessage: "<?php echo __('Found groups'); ?>",
|
||||
tree: data.tree,
|
||||
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
|
||||
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
filter: parameters['filter'],
|
||||
counterTitles: {
|
||||
total: {
|
||||
agents: "<?php echo __('Total agents'); ?>",
|
||||
modules: "<?php echo __('Total modules'); ?>",
|
||||
none: "<?php echo __('Total'); ?>"
|
||||
},
|
||||
alerts: {
|
||||
agents: "<?php echo __('Fired alerts'); ?>",
|
||||
modules: "<?php echo __('Fired alerts'); ?>",
|
||||
none: "<?php echo __('Fired alerts'); ?>"
|
||||
},
|
||||
critical: {
|
||||
agents: "<?php echo __('Critical agents'); ?>",
|
||||
modules: "<?php echo __('Critical modules'); ?>",
|
||||
none: "<?php echo __('Critical'); ?>"
|
||||
},
|
||||
warning: {
|
||||
agents: "<?php echo __('Warning agents'); ?>",
|
||||
modules: "<?php echo __('Warning modules'); ?>",
|
||||
none: "<?php echo __('Warning'); ?>"
|
||||
},
|
||||
unknown: {
|
||||
agents: "<?php echo __('Unknown agents'); ?>",
|
||||
modules: "<?php echo __('Unknown modules'); ?>",
|
||||
none: "<?php echo __('Unknown'); ?>"
|
||||
},
|
||||
not_init: {
|
||||
agents: "<?php echo __('Not init agents'); ?>",
|
||||
modules: "<?php echo __('Not init modules'); ?>",
|
||||
none: "<?php echo __('Not init'); ?>"
|
||||
},
|
||||
ok: {
|
||||
agents: "<?php echo __('Normal agents'); ?>",
|
||||
modules: "<?php echo __('Normal modules'); ?>",
|
||||
none: "<?php echo __('Normal'); ?>"
|
||||
window.addEventListener('load', function() {
|
||||
load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
function load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules) {
|
||||
var treeController = TreeController.getController();
|
||||
treeController.meta = <?php echo (is_metaconsole() === true) ? 1 : 0; ?>;
|
||||
|
||||
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
|
||||
treeController.recipient.empty();
|
||||
|
||||
showSpinner();
|
||||
|
||||
var parameters = {};
|
||||
parameters['page'] = "include/ajax/tree.ajax";
|
||||
parameters['getChildren'] = 1;
|
||||
parameters['type'] = "<?php echo $tab; ?>";
|
||||
parameters['filter'] = {};
|
||||
parameters['filter']['searchGroup'] = $('#text-search_group_string').val();
|
||||
parameters['filter']['searchAgent'] = $('#text-search_agent_string').val();
|
||||
parameters['filter']['statusAgent'] = $('#agent_status option:selected').val();
|
||||
parameters['filter']['searchModule'] = '';
|
||||
parameters['filter']['statusModule'] = '';
|
||||
parameters['filter']['groupID'] = '';
|
||||
parameters['filter']['tagID'] = '';
|
||||
parameters['filter']['searchHirearchy'] = 1;
|
||||
parameters['filter']['show_full_hirearchy'] = show_full_hirearchy;
|
||||
parameters['filter']['show_not_init_agents'] = show_not_init_agents;
|
||||
parameters['filter']['show_not_init_modules'] = show_not_init_modules;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
data: parameters,
|
||||
success: function(data) {
|
||||
if (data.success) {
|
||||
hideSpinner();
|
||||
|
||||
treeController.init({
|
||||
recipient: $("div#tree-controller-recipient"),
|
||||
page: parameters['page'],
|
||||
emptyMessage: "<?php echo __('No data found'); ?>",
|
||||
foundMessage: "<?php echo __('Found groups'); ?>",
|
||||
tree: data.tree,
|
||||
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
|
||||
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
||||
filter: parameters['filter'],
|
||||
counterTitles: {
|
||||
total: {
|
||||
agents: "<?php echo __('Total agents'); ?>",
|
||||
modules: "<?php echo __('Total modules'); ?>",
|
||||
none: "<?php echo __('Total'); ?>"
|
||||
},
|
||||
alerts: {
|
||||
agents: "<?php echo __('Fired alerts'); ?>",
|
||||
modules: "<?php echo __('Fired alerts'); ?>",
|
||||
none: "<?php echo __('Fired alerts'); ?>"
|
||||
},
|
||||
critical: {
|
||||
agents: "<?php echo __('Critical agents'); ?>",
|
||||
modules: "<?php echo __('Critical modules'); ?>",
|
||||
none: "<?php echo __('Critical'); ?>"
|
||||
},
|
||||
warning: {
|
||||
agents: "<?php echo __('Warning agents'); ?>",
|
||||
modules: "<?php echo __('Warning modules'); ?>",
|
||||
none: "<?php echo __('Warning'); ?>"
|
||||
},
|
||||
unknown: {
|
||||
agents: "<?php echo __('Unknown agents'); ?>",
|
||||
modules: "<?php echo __('Unknown modules'); ?>",
|
||||
none: "<?php echo __('Unknown'); ?>"
|
||||
},
|
||||
not_init: {
|
||||
agents: "<?php echo __('Not init agents'); ?>",
|
||||
modules: "<?php echo __('Not init modules'); ?>",
|
||||
none: "<?php echo __('Not init'); ?>"
|
||||
},
|
||||
ok: {
|
||||
agents: "<?php echo __('Normal agents'); ?>",
|
||||
modules: "<?php echo __('Normal modules'); ?>",
|
||||
none: "<?php echo __('Normal'); ?>"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -255,7 +255,18 @@ $table->data[1][1] = html_print_select(
|
|||
true,
|
||||
'',
|
||||
false,
|
||||
'width:180px;'
|
||||
'width:180px;',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
);
|
||||
$table->data[1][2] = __('When select agents');
|
||||
$table->data[1][2] .= '<br>';
|
||||
|
@ -271,7 +282,31 @@ $table->data[1][2] .= html_print_select(
|
|||
'',
|
||||
true
|
||||
);
|
||||
$table->data[1][3] = html_print_select([], 'module[]', '', false, '', '', true, true, false, '', false, 'width:180px;');
|
||||
$table->data[1][3] = html_print_select(
|
||||
[],
|
||||
'module[]',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width:180px;',
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
$usr_groups = users_get_groups($config['id_user'], 'LW', true);
|
||||
$filter_groups = '';
|
||||
|
|
|
@ -269,15 +269,14 @@ $size_pagination .= '</div>';
|
|||
// Home screen.
|
||||
$home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('Home screen').ui_print_help_tip(__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'), true).'</p>';
|
||||
$values = [
|
||||
'-1' => __('No change'),
|
||||
'Default' => __('Default'),
|
||||
'Visual console' => __('Visual console'),
|
||||
'Event list' => __('Event list'),
|
||||
'Group view' => __('Group view'),
|
||||
'Tactical view' => __('Tactical view'),
|
||||
'Alert detail' => __('Alert detail'),
|
||||
'Other' => __('Other'),
|
||||
'Dashboard' => __('Dashboard'),
|
||||
HOME_SCREEN_DEFAULT => __('Default'),
|
||||
HOME_SCREEN_VISUAL_CONSOLE => __('Visual console'),
|
||||
HOME_SCREEN_EVENT_LIST => __('Event list'),
|
||||
HOME_SCREEN_GROUP_VIEW => __('Group view'),
|
||||
HOME_SCREEN_TACTICAL_VIEW => __('Tactical view'),
|
||||
HOME_SCREEN_ALERT_DETAIL => __('Alert detail'),
|
||||
HOME_SCREEN_OTHER => __('Other'),
|
||||
HOME_SCREEN_DASHBOARD => __('Dashboard'),
|
||||
];
|
||||
|
||||
$home_screen .= html_print_select(
|
||||
|
|
|
@ -80,12 +80,17 @@ $options_agents = [
|
|||
];
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'UM')) {
|
||||
$options_users['edit_users'] = __('Edit users in bulk');
|
||||
$options_users = [
|
||||
'edit_users' => __('Edit users in bulk'),
|
||||
];
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
$options_users = [
|
||||
$options_profiles = [
|
||||
'add_profiles' => __('Bulk profile add'),
|
||||
'delete_profiles' => __('Bulk profile delete'),
|
||||
];
|
||||
|
||||
$options_users = array_merge(array_slice($options_users, 0, count($options_users)), $options_profiles, array_slice($options_users, count($options_users)));
|
||||
}
|
||||
} else {
|
||||
$options_users = [];
|
||||
|
|
|
@ -367,6 +367,8 @@ if ($access_console_node === true) {
|
|||
$sub['godmode/alerts/alert_list']['text'] = __('List of Alerts');
|
||||
$sub['godmode/alerts/alert_list']['id'] = 'List_of_Alerts';
|
||||
$sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view'];
|
||||
$sub['godmode/agentes/planned_downtime.list']['text'] = __('Scheduled downtime');
|
||||
$sub['godmode/agentes/planned_downtime.list']['id'] = 'scheduled_downtime';
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||
$sub['godmode/alerts/alert_templates']['text'] = __('Templates');
|
||||
|
@ -708,6 +710,17 @@ if ($access_console_node === true) {
|
|||
}
|
||||
|
||||
if ($access_console_node === true) {
|
||||
// Tools
|
||||
$menu_godmode['tools']['text'] = __('Tools');
|
||||
$menu_godmode['tools']['sec2'] = 'operation/extensions';
|
||||
$menu_godmode['tools']['id'] = 'oper-extensions';
|
||||
$sub = [];
|
||||
$sub['operation/agentes/exportdata']['text'] = __('Export data');
|
||||
$sub['operation/agentes/exportdata']['id'] = 'export_data';
|
||||
$sub['extensions/files_repo']['text'] = __('File repository');
|
||||
$sub['extensions/files_repo']['id'] = 'file_repository';
|
||||
$menu_godmode['tools']['sub'] = $sub;
|
||||
|
||||
// About.
|
||||
$menu_godmode['about']['text'] = __('About');
|
||||
$menu_godmode['about']['id'] = 'about';
|
||||
|
|
|
@ -95,7 +95,7 @@ $subsection = reporting_enterprise_add_graph_template_subsection('', $buttons);
|
|||
$buttons['graph_container'] = [
|
||||
'active' => true,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
|
||||
'images/graph-container.svg@svg',
|
||||
'images/graph-container@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Graph container'),
|
||||
|
|
|
@ -519,9 +519,9 @@ if (!$maps && is_metaconsole() === false) {
|
|||
$data = [];
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
$data[0] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$map['id'].'&refr='.$refr.'">'.$map['name'].'</a>';
|
||||
$data[0] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$map['id'].'&refr='.$refr.'">'.io_safe_output($map['name']).'</a>';
|
||||
} else {
|
||||
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&refr='.$refr.'">'.$map['name'].'</a>';
|
||||
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&refr='.$refr.'">'.io_safe_output($map['name']).'</a>';
|
||||
}
|
||||
|
||||
$data[1] = ui_print_group_icon($map['id_group'], true);
|
||||
|
@ -541,7 +541,7 @@ if (!$maps && is_metaconsole() === false) {
|
|||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.io_safe_output($map['name']).'\')) return false;">'.html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
|
@ -552,7 +552,7 @@ if (!$maps && is_metaconsole() === false) {
|
|||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.io_safe_output($map['name']).'\')) return false;">'.html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
|
@ -571,6 +571,7 @@ if (!$maps && is_metaconsole() === false) {
|
|||
}
|
||||
|
||||
if ($maps || is_metaconsole() === true) {
|
||||
$buttons = '';
|
||||
if ($vconsoles_write || $vconsoles_manage) {
|
||||
if (is_metaconsole() === false) {
|
||||
$actionUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder';
|
||||
|
@ -578,20 +579,22 @@ if ($maps || is_metaconsole() === true) {
|
|||
$actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure='.$pure;
|
||||
}
|
||||
|
||||
echo '<form action="'.$actionUrl.'" method="post">';
|
||||
html_print_input_hidden('edit_layout', 1);
|
||||
$buttons .= '<form action="'.$actionUrl.'" method="post">';
|
||||
$buttons .= html_print_input_hidden('edit_layout', 1, true);
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'next'],
|
||||
true
|
||||
),
|
||||
[ 'right_content' => $tablePagination ]
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Create'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'next'],
|
||||
true
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
$buttons .= '</form>';
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
$buttons,
|
||||
[ 'right_content' => $tablePagination ]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -150,6 +150,7 @@ $fullscale = false;
|
|||
$percentil = false;
|
||||
$image_threshold = false;
|
||||
$time_compare_overlapped = false;
|
||||
$unknowns_graph = false;
|
||||
|
||||
// Added for events items.
|
||||
$server_multiple = [0];
|
||||
|
@ -354,6 +355,7 @@ switch ($action) {
|
|||
$percentil = isset($style['percentil']) ? (bool) $style['percentil'] : 0;
|
||||
$image_threshold = (isset($style['image_threshold']) === true) ? (bool) $style['image_threshold'] : false;
|
||||
$graph_render = $item['graph_render'];
|
||||
$unknowns_graph = $item['check_unknowns_graph'];
|
||||
// The break hasn't be forgotten.
|
||||
case 'simple_baseline_graph':
|
||||
case 'projection_graph':
|
||||
|
@ -1084,6 +1086,50 @@ switch ($action) {
|
|||
$period = $item['period'];
|
||||
break;
|
||||
|
||||
case 'vuls_severity_graph':
|
||||
$group = $item['id_group'];
|
||||
break;
|
||||
|
||||
case 'vuls_attack_complexity':
|
||||
$group = $item['id_group'];
|
||||
break;
|
||||
|
||||
case 'vuls_by_packages':
|
||||
$group = $item['id_group'];
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
$group = $item['id_group'];
|
||||
$es = json_decode($item['external_source'], true);
|
||||
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
|
||||
$security_hardening_score = $es['security_hardening_score'];
|
||||
$vulnerabilities_status = $es['vulnerabilities_status'];
|
||||
$secmon_status = $es['secmon_status'];
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
$idAgent = $item['id_agent'];
|
||||
$es = json_decode($item['external_source'], true);
|
||||
$vul_package = $es['vul_package'];
|
||||
$vul_severity = $es['vul_severity'];
|
||||
$vul_ac = $es['vul_ac'];
|
||||
$vul_pr = $es['vul_pr'];
|
||||
$vul_ui = $es['vul_ui'];
|
||||
$vul_av = (empty($es['vul_av']) === true) ? 'all' : $es['vul_av'];
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
$group = $item['id_group'];
|
||||
$recursion = $item['recursion'];
|
||||
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
$group = $item['id_group'];
|
||||
$recursion = $item['recursion'];
|
||||
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
|
||||
break;
|
||||
|
||||
default:
|
||||
// It's not possible.
|
||||
break;
|
||||
|
@ -1589,7 +1635,7 @@ if (is_metaconsole() === true) {
|
|||
<?php
|
||||
html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
(string) $period,
|
||||
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
|
||||
'',
|
||||
'0',
|
||||
|
@ -1697,6 +1743,39 @@ if (is_metaconsole() === true) {
|
|||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row_period2" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Time lapse');
|
||||
ui_print_help_tip(
|
||||
__('This is the range, or period of time over which the report renders the information for this report type. For example, a week means data from a week ago from now. ')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td >
|
||||
<?php
|
||||
html_print_extended_select_for_time(
|
||||
'period',
|
||||
(string) $period,
|
||||
'onselect=loadLogAgents();',
|
||||
'',
|
||||
'0',
|
||||
10,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
0,
|
||||
null,
|
||||
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="row_estimate" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
|
@ -2921,6 +3000,23 @@ if (is_metaconsole() === true) {
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_unknowns_graph" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Show unknowns in graph');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox_switch(
|
||||
'unknowns_graph',
|
||||
1,
|
||||
$unknowns_graph
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_time_compare_overlapped" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
|
@ -3913,6 +4009,217 @@ if (is_metaconsole() === true) {
|
|||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_secmon_status" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Secmon status');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'critical' => __('Critical'),
|
||||
'warning' => __('Warning'),
|
||||
],
|
||||
'secmon_status',
|
||||
$secmon_status,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_security_hardening_score" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Security hardening score');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'90' => __('< 90%'),
|
||||
'80' => __('< 80%'),
|
||||
'70' => __('< 70%'),
|
||||
'60' => __('< 60%'),
|
||||
'50' => __('< 50%'),
|
||||
'40' => __('< 40%'),
|
||||
'30' => __('< 30%'),
|
||||
'20' => __('< 20%'),
|
||||
'10' => __('< 10%'),
|
||||
],
|
||||
'security_hardening_score',
|
||||
(empty($security_hardening_score) === false) ? $security_hardening_score : 'all',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_status" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Vulnerabilities status');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'crit' => __('Critical'),
|
||||
'warn' => __('Warning'),
|
||||
],
|
||||
'vulnerabilities_status',
|
||||
$vulnerabilities_status,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_packages" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Package').ui_print_help_tip(__('Select a agent for load his packages.'), true);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
],
|
||||
'vul_package',
|
||||
$vul_package,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_severity" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Severity');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'high' => __('High'),
|
||||
'low' => __('Low'),
|
||||
'none' => __('None'),
|
||||
],
|
||||
'vul_severity',
|
||||
$vul_severity,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_ac" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Attack Complexity');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'H' => __('High'),
|
||||
'L' => __('Low'),
|
||||
],
|
||||
'vul_ac',
|
||||
$vul_ac,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_pr" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Privileges Required');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'H' => __('High'),
|
||||
'L' => __('Low'),
|
||||
'N' => __('None'),
|
||||
],
|
||||
'vul_pr',
|
||||
$vul_pr,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_ui" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('User Interaction');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'R' => __('Required'),
|
||||
'N' => __('None'),
|
||||
],
|
||||
'vul_ui',
|
||||
$vul_ui,
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr id="row_vulnerabilities_av" class="datos">
|
||||
<td class="bolder">
|
||||
<?php
|
||||
echo __('Attack vector');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_select(
|
||||
[
|
||||
'all' => __('All'),
|
||||
'A' => __('Adjacent Network'),
|
||||
'L' => __('Local'),
|
||||
'N' => __('Network'),
|
||||
'P' => __('Physical'),
|
||||
],
|
||||
'vul_av',
|
||||
(empty($vul_av) === true) ? 'all' : $vul_av,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<tr id="row_status_check" class="datos">
|
||||
|
@ -5640,6 +5947,27 @@ $(document).ready (function () {
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
case 'vuls_info_agent':
|
||||
if ($("#hidden-id_agent").val() == 0) {
|
||||
dialog_message('#message_no_agent');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
if ($("#text-max_items").val() == '') {
|
||||
dialog_message('#message_no_max_item');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
if ($("#text-max_items").val() == '') {
|
||||
dialog_message('#message_no_max_item');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -5794,7 +6122,24 @@ $(document).ready (function () {
|
|||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
if ($("#hidden-id_agent").val() == 0) {
|
||||
dialog_message('#message_no_agent');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'top_n_agents_vuls':
|
||||
if ($("#text-max_items").val() == '') {
|
||||
dialog_message('#message_no_max_item');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'top_n_vuls_count':
|
||||
if ($("#text-max_items").val() == '') {
|
||||
dialog_message('#message_no_max_item');
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -6685,7 +7030,7 @@ function loadLogAgents() {
|
|||
params["get_agent_source"] = 1;
|
||||
params["log_alert"] = 1;
|
||||
params["page"] = "enterprise/include/ajax/log_viewer.ajax";
|
||||
|
||||
params["date"] = $('#period_select').val();
|
||||
jQuery.ajax({
|
||||
data: params,
|
||||
dataType: "json",
|
||||
|
@ -6693,9 +7038,9 @@ function loadLogAgents() {
|
|||
url: "ajax.php",
|
||||
async: true,
|
||||
success: function(data) {
|
||||
$('#id_agents3')
|
||||
.find('option')
|
||||
.remove();
|
||||
$('#id_agents3').find('option').remove();
|
||||
$('#source option[value!=""]').remove();
|
||||
|
||||
$.each(data['source'],function(key,value) {
|
||||
if (value === source) {
|
||||
$('#source').append( `<option selected='selected' value='${key}'>${value}</option>`);
|
||||
|
@ -6725,10 +7070,10 @@ function chooseType() {
|
|||
$("#row_period_range").hide();
|
||||
$("#row_agent").hide();
|
||||
$("#row_module").hide();
|
||||
$("#row_period").hide();
|
||||
$("#row_search").hide();
|
||||
$("#row_log_number").hide();
|
||||
$("#row_period1").hide();
|
||||
$("#row_period2").hide();
|
||||
$("#row_estimate").hide();
|
||||
$("#row_interval").hide();
|
||||
$("#row_custom_graph").hide();
|
||||
|
@ -6844,12 +7189,22 @@ function chooseType() {
|
|||
$("#row_group_by").hide();
|
||||
$("#row_type_show").hide();
|
||||
$("#row_use_prefix_notation").hide();
|
||||
$("#row_unknowns_graph").hide();
|
||||
$("#row_os_selector").hide();
|
||||
$("#row_os_version_regexp").hide();
|
||||
$("#row_os_end_of_life").hide();
|
||||
$("#row_cat_security_hardening").hide();
|
||||
$("#row_ignore_skipped").hide();
|
||||
$("#row_status_check").hide();
|
||||
$("#row_secmon_status").hide();
|
||||
$("#row_security_hardening_score").hide();
|
||||
$("#row_vulnerabilities_status").hide();
|
||||
$("#row_vulnerabilities_packages").hide();
|
||||
$("#row_vulnerabilities_severity").hide();
|
||||
$("#row_vulnerabilities_ac").hide();
|
||||
$("#row_vulnerabilities_pr").hide();
|
||||
$("#row_vulnerabilities_ui").hide();
|
||||
$("#row_vulnerabilities_av").hide();
|
||||
|
||||
// SLA list default state.
|
||||
$("#sla_list").hide();
|
||||
|
@ -6895,7 +7250,7 @@ function chooseType() {
|
|||
case 'event_report_log':
|
||||
$("#log_help_tip").css("visibility", "visible");
|
||||
$("#row_description").show();
|
||||
$("#row_period").show();
|
||||
$("#row_period2").show();
|
||||
$("#row_search").show();
|
||||
$("#row_log_number").show();
|
||||
$("#agents_row").show();
|
||||
|
@ -6909,7 +7264,7 @@ function chooseType() {
|
|||
case 'event_report_log_table':
|
||||
$("#log_help_tip").css("visibility", "visible");
|
||||
$("#row_description").show();
|
||||
$("#row_period").show();
|
||||
$("#row_period2").show();
|
||||
$("#row_period_range").show();
|
||||
$("#row_search").show();
|
||||
$("#row_log_number").show();
|
||||
|
@ -6936,6 +7291,7 @@ function chooseType() {
|
|||
$("#row_image_threshold").show();
|
||||
$("#row_graph_render").show();
|
||||
$("#row_percentil").show();
|
||||
$("#row_unknowns_graph").show();
|
||||
|
||||
// Force type.
|
||||
if('<?php echo $action; ?>' === 'new'){
|
||||
|
@ -7749,6 +8105,50 @@ function chooseType() {
|
|||
$("#row_group").show();
|
||||
$('#row_period').show();
|
||||
break;
|
||||
|
||||
case 'vuls_severity_graph':
|
||||
$("#row_group").show();
|
||||
break;
|
||||
|
||||
case 'vuls_attack_complexity':
|
||||
$("#row_group").show();
|
||||
break;
|
||||
|
||||
case 'vuls_by_packages':
|
||||
$("#row_group").show();
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
$("#row_group").show();
|
||||
$("#row_custom_field_filter").show();
|
||||
$("#row_secmon_status").show();
|
||||
$("#row_security_hardening_score").show();
|
||||
$("#row_vulnerabilities_status").show();
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
$("#row_agent").show();
|
||||
$("#row_vulnerabilities_packages").show();
|
||||
$("#row_vulnerabilities_severity").show();
|
||||
$("#row_vulnerabilities_ac").show();
|
||||
$("#row_vulnerabilities_pr").show();
|
||||
$("#row_vulnerabilities_ui").show();
|
||||
$("#row_vulnerabilities_av").show();
|
||||
updatePackages();
|
||||
$('#row_agent input[type=text]').change(function(e) {
|
||||
updatePackages();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
$("#row_group").show();
|
||||
$("#row_max_items").show();
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
$("#row_group").show();
|
||||
$("#row_max_items").show();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
|
@ -7904,8 +8304,10 @@ function source_change_agents() {
|
|||
$("#id_agents3 option").attr("style","display:none");
|
||||
|
||||
var params = {};
|
||||
params["get_agent_source"] = 1;
|
||||
params["get_agents_by_source"] = 1;
|
||||
params["page"] = "enterprise/include/ajax/log_viewer.ajax";
|
||||
params["date"] = '<?php echo SECONDS_1MONTH; ?>';
|
||||
params["sources"] = JSON.stringify(source);
|
||||
|
||||
jQuery.ajax({
|
||||
data: params,
|
||||
|
@ -7914,19 +8316,8 @@ function source_change_agents() {
|
|||
url: "ajax.php",
|
||||
async: true,
|
||||
success: function(data) {
|
||||
let source_array = [];
|
||||
$.each(data['source'],function(key,value) {
|
||||
if (value === source) {
|
||||
const split = key.split('-');
|
||||
source_array.push(split[1]);
|
||||
}
|
||||
});
|
||||
|
||||
$.each(data['agent'],function(key,value) {
|
||||
const result = source_array.includes(key);
|
||||
if (result === true) {
|
||||
$(`#id_agents3 option[value*='${key}']`).attr("style","display:");
|
||||
}
|
||||
$.each(data,function(key,value) {
|
||||
$(`#id_agents3 option[value*='${value}']`).attr("style","display:");
|
||||
});
|
||||
|
||||
$("#spinner_hack").hide();
|
||||
|
@ -7955,7 +8346,7 @@ function dialog_message(message_id) {
|
|||
}
|
||||
function control_period_range() {
|
||||
let value_period_range = $('#row_period_range #hidden-period_range').val();
|
||||
let current_value = $('#row_period #hidden-period').val();
|
||||
let current_value = $('#row_period2 #hidden-period').val();
|
||||
let min_range = (current_value/12);
|
||||
if(min_range > value_period_range) {
|
||||
$('#row_period_range div:nth-child(2) select option').removeAttr("selected");
|
||||
|
@ -8000,13 +8391,53 @@ function control_period_range() {
|
|||
}, 800);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function updateSelect(element, fields, selected) {
|
||||
if (typeof fields === "object") {
|
||||
$(element).find("select").empty();
|
||||
$(element).find(".select2-container .select2-selection__rendered").empty();
|
||||
Object.keys(fields).forEach(function(key) {
|
||||
if (key === selected) {
|
||||
$(element).find(".select2-container .select2-selection__rendered").append(`${fields[key]}`);
|
||||
$(element).find("select").append(`<option value="${key}" selected>${fields[key]}</option>`);
|
||||
} else {
|
||||
$(element).find("select").append(`<option value="${key}">${fields[key]}</option>`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updatePackages() {
|
||||
let id_agent = $('#hidden-id_agent').val();
|
||||
let server_id = $('#hidden-server_id').val();
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "<?php echo ui_get_full_url('ajax.php'); ?>",
|
||||
data: {
|
||||
page: "<?php echo ENTERPRISE_DIR.'/include/ajax/vulnerabilities.ajax'; ?>",
|
||||
action: "updatePackages",
|
||||
id_agent: id_agent,
|
||||
server_id: server_id,
|
||||
},
|
||||
success: function(data) {
|
||||
const json = JSON.parse(data);
|
||||
if (json.success) {
|
||||
updateSelect("#row_vulnerabilities_packages", json.data, '<?php echo $vul_package; ?>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('[id^=period], #combo_graph_options, #combo_sla_sort_options').next().css('z-index', 0);
|
||||
|
||||
$('#row_period input').change(function(e){
|
||||
$('#row_period2 input').change(function(e){
|
||||
control_period_range();
|
||||
});
|
||||
$('#row_period select').change(function(e){
|
||||
$('#row_period2 select').change(function(e){
|
||||
control_period_range();
|
||||
});
|
||||
$('#row_period_range input').change(function(e){
|
||||
|
|
|
@ -777,7 +777,7 @@ $table->data[0][0] = html_print_label_input_block(
|
|||
)
|
||||
);
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Poisition'),
|
||||
__('Position'),
|
||||
html_print_input_text_extended(
|
||||
'position_to_delete',
|
||||
1,
|
||||
|
|
|
@ -180,8 +180,8 @@ if ($report_id_user == $config['id_user']
|
|||
$options['div_class'] = '';
|
||||
}
|
||||
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Write Access Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'RW',
|
||||
|
@ -216,7 +216,7 @@ if ($enterpriseEnable) {
|
|||
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
$table->data[4][0] = html_print_label_input_block(
|
||||
__('Generate cover page in PDF render'),
|
||||
html_print_checkbox_switch(
|
||||
'cover_page_render',
|
||||
|
@ -226,7 +226,7 @@ if (enterprise_installed() === true) {
|
|||
)
|
||||
);
|
||||
|
||||
$table->data[3][1] = html_print_label_input_block(
|
||||
$table->data[4][1] = html_print_label_input_block(
|
||||
__('Generate index in PDF render'),
|
||||
html_print_checkbox_switch(
|
||||
'index_render',
|
||||
|
|
|
@ -1928,6 +1928,7 @@ switch ($action) {
|
|||
$values['graph_render'] = (int) get_parameter(
|
||||
'graph_render'
|
||||
);
|
||||
$values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
|
||||
case 'simple_baseline_graph':
|
||||
// HACK it is saved in show_graph field.
|
||||
$values['show_graph'] = (int) get_parameter(
|
||||
|
@ -2045,6 +2046,56 @@ switch ($action) {
|
|||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_severity_graph':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_attack_complexity':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_by_packages':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['secmon_status'] = get_parameter('secmon_status');
|
||||
$es['security_hardening_score'] = get_parameter('security_hardening_score');
|
||||
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
$values['id_agent'] = get_parameter('id_agent');
|
||||
$es['server_id'] = get_parameter('server_id');
|
||||
$es['vul_package'] = get_parameter('vul_package');
|
||||
$es['vul_severity'] = get_parameter('vul_severity');
|
||||
$es['vul_ac'] = get_parameter('vul_ac');
|
||||
$es['vul_pr'] = get_parameter('vul_pr');
|
||||
$es['vul_ui'] = get_parameter('vul_ui');
|
||||
$es['vul_av'] = get_parameter('vul_av');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['top_n_value'] = get_parameter('max_items');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['top_n_value'] = get_parameter('max_items');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$values['period'] = get_parameter('period');
|
||||
$values['top_n'] = get_parameter(
|
||||
|
@ -2867,6 +2918,7 @@ switch ($action) {
|
|||
$values['graph_render'] = (int) get_parameter(
|
||||
'graph_render'
|
||||
);
|
||||
$values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
|
||||
case 'simple_baseline_graph':
|
||||
// HACK it is saved in show_graph field.
|
||||
$values['show_graph'] = (int) get_parameter(
|
||||
|
@ -2977,6 +3029,56 @@ switch ($action) {
|
|||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_severity_graph':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_attack_complexity':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_by_packages':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_by_agent':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
|
||||
$es['secmon_status'] = get_parameter('secmon_status');
|
||||
$es['security_hardening_score'] = get_parameter('security_hardening_score');
|
||||
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'vuls_info_agent':
|
||||
$values['id_agent'] = get_parameter('id_agent');
|
||||
$es['server_id'] = get_parameter('server_id');
|
||||
$es['vul_package'] = get_parameter('vul_package');
|
||||
$es['vul_severity'] = get_parameter('vul_severity');
|
||||
$es['vul_ac'] = get_parameter('vul_ac');
|
||||
$es['vul_pr'] = get_parameter('vul_pr');
|
||||
$es['vul_ui'] = get_parameter('vul_ui');
|
||||
$es['vul_av'] = get_parameter('vul_av');
|
||||
$values['external_source'] = json_encode($es);
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'top_n_agents_vuls':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['top_n_value'] = get_parameter('max_items');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
case 'top_n_vuls_count':
|
||||
$values['id_group'] = get_parameter('combo_group');
|
||||
$values['top_n_value'] = get_parameter('max_items');
|
||||
$good_format = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
$values['period'] = get_parameter('period');
|
||||
$values['top_n'] = get_parameter(
|
||||
|
|
|
@ -151,7 +151,7 @@ $table->data[0][] = html_print_label_input_block(
|
|||
__('Name'),
|
||||
html_print_input_text(
|
||||
'name',
|
||||
$visualConsoleName,
|
||||
io_safe_output($visualConsoleName),
|
||||
'',
|
||||
80,
|
||||
100,
|
||||
|
|
|
@ -163,7 +163,7 @@ switch ($activeTab) {
|
|||
$background_color = (string) get_parameter('background_color');
|
||||
$width = (int) get_parameter('width');
|
||||
$height = (int) get_parameter('height');
|
||||
$visualConsoleName = (string) get_parameter('name');
|
||||
$visualConsoleName = (string) io_safe_input(get_parameter('name'));
|
||||
$is_favourite = (int) get_parameter('is_favourite_sent');
|
||||
$auto_adjust = (int) get_parameter('auto_adjust_sent');
|
||||
|
||||
|
@ -239,7 +239,7 @@ switch ($activeTab) {
|
|||
if ($uploadOK == 1) {
|
||||
if (move_uploaded_file($_FILES['background_image']['tmp_name'], $target_file)) {
|
||||
$background = $nameImage;
|
||||
$values['background'] = $background;
|
||||
$values['background'] = io_safe_input($background);
|
||||
$error2 = chmod($target_file, 0644);
|
||||
$uploadOK = $error2;
|
||||
} else {
|
||||
|
@ -872,7 +872,7 @@ $buttons[$activeTab]['active'] = true;
|
|||
|
||||
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
|
||||
ui_print_standard_header(
|
||||
($visualConsoleName ?? ''),
|
||||
(io_safe_output($visualConsoleName) ?? ''),
|
||||
'images/visual_console.png',
|
||||
false,
|
||||
$tab_builder,
|
||||
|
|
|
@ -24,14 +24,6 @@ if (! check_acl($config['id_user'], 0, 'AR')
|
|||
|
||||
ui_require_css_file('discovery');
|
||||
|
||||
ui_require_javascript_file('pandora_alerts');
|
||||
ui_include_time_picker();
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
|
||||
ui_require_css_file('main.min', 'include/javascript/fullcalendar/');
|
||||
ui_require_javascript_file('main.min', 'include/javascript/fullcalendar/');
|
||||
ui_require_javascript_file('pandora_fullcalendar');
|
||||
|
||||
|
||||
/**
|
||||
* Mask class names.
|
||||
|
@ -212,115 +204,3 @@ if ($classname_selected === null) {
|
|||
|
||||
Wizard::printBigButtonsList($wiz_data);
|
||||
}
|
||||
|
||||
$is_management_allowed = is_management_allowed();
|
||||
$task_id = get_parameter('task', '');
|
||||
if ($task_id !== '') {
|
||||
$task = db_get_row_filter(
|
||||
'tuser_task_scheduled',
|
||||
['id' => $task_id]
|
||||
);
|
||||
$args = unserialize($task['args']);
|
||||
$event_calendar = io_safe_output($args['weekly_schedule']);
|
||||
} else {
|
||||
$event_calendar = '{"monday":[{"start":"00:00:00","end":"00:00:00"}],"tuesday":[{"start":"00:00:00","end":"00:00:00"}],"wednesday":[{"start":"00:00:00","end":"00:00:00"}],"thursday":[{"start":"00:00:00","end":"00:00:00"}],"friday":[{"start":"00:00:00","end":"00:00:00"}],"saturday":[{"start":"00:00:00","end":"00:00:00"}],"sunday":[{"start":"00:00:00","end":"00:00:00"}]}';
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$("#table-new-job-3").hide();
|
||||
var edit = '<?php echo $task_id; ?>';
|
||||
if (edit != '') {
|
||||
exec_calendar();
|
||||
}
|
||||
|
||||
$("#scheduled").change(exec_calendar);
|
||||
|
||||
function exec_calendar() {
|
||||
if ($("#scheduled").val() == "weekly") {
|
||||
var is_management_allowed = parseInt('<?php echo (int) $is_management_allowed; ?>');
|
||||
var eventsBBDD = '<?php echo $event_calendar; ?>';
|
||||
var events = loadEventBBDD(eventsBBDD);
|
||||
var calendarEl = document.getElementById('calendar_map');
|
||||
|
||||
var options = {
|
||||
contentHeight: "auto",
|
||||
headerToolbar: {
|
||||
left: "",
|
||||
center: "",
|
||||
right: is_management_allowed === 0 ? '' : "timeGridWeek,dayGridWeek"
|
||||
},
|
||||
buttonText: {
|
||||
dayGridWeek: '<?php echo __('Simple'); ?>',
|
||||
timeGridWeek: '<?php echo __('Detailed'); ?>'
|
||||
},
|
||||
dayHeaderFormat: { weekday: "short" },
|
||||
initialView: "dayGridWeek",
|
||||
navLinks: false,
|
||||
selectable: true,
|
||||
selectMirror: true,
|
||||
slotDuration: "01:00:00",
|
||||
slotLabelInterval: "02:00:00",
|
||||
snapDuration: "01:00:00",
|
||||
slotMinTime: "00:00:00",
|
||||
slotMaxTime: "24:00:00",
|
||||
scrollTime: "01:00:00",
|
||||
locale: "en-GB",
|
||||
firstDay: 1,
|
||||
eventTimeFormat: {
|
||||
hour: "numeric",
|
||||
minute: "2-digit",
|
||||
hour12: false
|
||||
},
|
||||
eventColor: "#82b92e",
|
||||
editable: is_management_allowed === 0 ? false : true,
|
||||
dayMaxEvents: 3,
|
||||
dayPopoverFormat: { weekday: "long" },
|
||||
defaultAllDay: false,
|
||||
displayEventTime: true,
|
||||
displayEventEnd: true,
|
||||
selectOverlap: false,
|
||||
eventOverlap: false,
|
||||
allDaySlot: true,
|
||||
droppable: false,
|
||||
select: is_management_allowed === 0 ? false : select_alert_template,
|
||||
selectAllow: is_management_allowed === 0 ? false : selectAllow_alert_template,
|
||||
eventAllow: is_management_allowed === 0 ? false : eventAllow_alert_template,
|
||||
eventDrop: is_management_allowed === 0 ? false : eventDrop_alert_template,
|
||||
eventDragStop: is_management_allowed === 0 ? false : eventDragStop_alert_template,
|
||||
eventResize: is_management_allowed === 0 ? false : eventResize_alert_template,
|
||||
eventMouseEnter: is_management_allowed === 0 ? false : eventMouseEnter_alert_template,
|
||||
eventMouseLeave: is_management_allowed === 0 ? false : eventMouseLeave_alert_template,
|
||||
eventClick: is_management_allowed === 0 ? false : eventClick_alert_template,
|
||||
};
|
||||
|
||||
var settings = {
|
||||
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
||||
timeOnlyTitle: '<?php echo __('Choose time'); ?>',
|
||||
timeText: '<?php echo __('Time'); ?>',
|
||||
hourText: '<?php echo __('Hour'); ?>',
|
||||
minuteText: '<?php echo __('Minute'); ?>',
|
||||
secondText: '<?php echo __('Second'); ?>',
|
||||
currentText: '<?php echo __('Now'); ?>',
|
||||
closeText: '<?php echo __('Close'); ?>',
|
||||
url: '<?php echo ui_get_full_url('ajax.php', false, false, false); ?>',
|
||||
removeText: '<?php echo __('Remove'); ?>',
|
||||
userLanguage: '<?php echo get_user_language(); ?>',
|
||||
loadingText: '<?php echo __('Loading, this operation might take several minutes...'); ?>',
|
||||
tooltipText: '<?php echo __('Drag out to remove'); ?>',
|
||||
alert: '<?php echo __('Alert'); ?>'
|
||||
}
|
||||
|
||||
var calendar = fullCalendarPandora(calendarEl, options, settings, events);
|
||||
calendar.render();
|
||||
|
||||
$("#table-new-job-3").show();
|
||||
$('.fc-event-title').hide();
|
||||
$(".fc-button-active" ).trigger( "click" );
|
||||
} else {
|
||||
$("#calendar_map").html();
|
||||
$("#table-new-job-3").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -860,8 +860,10 @@ if (empty($create) === false || empty($view) === false) {
|
|||
if ($management_allowed === false) {
|
||||
ui_print_warning_message(
|
||||
__(
|
||||
'This console is not manager of this environment,
|
||||
please manage this feature from centralized manager console (Metaconsole).'
|
||||
'This console is not manager of this environment, please manage this feature from feature from %s.',
|
||||
'<a target="_blank" href="'.ui_get_meta_url(
|
||||
'index.php?sec=advanced&sec2=godmode/servers/plugin_registration&tab=plugin_registration&pure=0'
|
||||
).'">'.__('metaconsole').'</a>'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -64,32 +64,33 @@ $table->style = [];
|
|||
// $table->style[0] = 'font-weight: bold';
|
||||
$table->align = [];
|
||||
$table->align[1] = 'center';
|
||||
$table->align[3] = 'center';
|
||||
$table->align[8] = 'right';
|
||||
$table->align[4] = 'center';
|
||||
$table->align[9] = 'right';
|
||||
|
||||
$table->headstyle[1] = 'text-align:center';
|
||||
$table->headstyle[3] = 'text-align:center';
|
||||
$table->headstyle[8] = 'text-align:right;width: 120px;';
|
||||
$table->headstyle[4] = 'text-align:center';
|
||||
$table->headstyle[9] = 'text-align:right;width: 120px;';
|
||||
|
||||
$table->titleclass = 'tabletitle';
|
||||
$table->titlestyle = 'text-transform:uppercase;';
|
||||
|
||||
$table->style[6] = 'display: flex;align-items: center;';
|
||||
$table->style[7] = 'display: flex;align-items: center;';
|
||||
|
||||
$table->head = [];
|
||||
$table->head[0] = __('Name');
|
||||
$table->head[1] = __('Status');
|
||||
$table->head[2] = __('Type');
|
||||
$table->head[3] = __('Version');
|
||||
$table->head[4] = __('Modules');
|
||||
$table->head[5] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true);
|
||||
$table->head[6] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true);
|
||||
$table->head[3] = __('Master');
|
||||
$table->head[4] = __('Version');
|
||||
$table->head[5] = __('Modules');
|
||||
$table->head[6] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true);
|
||||
$table->head[7] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true);
|
||||
// This will have a column of data such as "6 hours".
|
||||
$table->head[7] = __('Updated');
|
||||
$table->head[8] = __('Updated');
|
||||
|
||||
// Only Pandora Administrator can delete servers.
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$table->head[8] = '<span title="Operations">'.__('Op.').'</span>';
|
||||
$table->head[9] = '<span title="Operations">'.__('Op.').'</span>';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
|
@ -143,9 +144,11 @@ foreach ($servers as $server) {
|
|||
}
|
||||
|
||||
// Type.
|
||||
$data[2] = '<span class="nowrap">'.$server['img'];
|
||||
$data[2] = '<span class="nowrap">'.$server['img'].' '.$server['name'];
|
||||
if ($server['master'] == $master) {
|
||||
$data[2] .= ui_print_help_tip(__('This is a master server'), true);
|
||||
$data[3] .= __('Yes', true);
|
||||
} else {
|
||||
$data[3] .= __('-');
|
||||
}
|
||||
|
||||
if ((int) $server['exec_proxy'] === 1) {
|
||||
|
@ -157,27 +160,27 @@ foreach ($servers as $server) {
|
|||
case 'event':
|
||||
case 'autoprovision':
|
||||
case 'migration':
|
||||
$data[3] = $server['version'];
|
||||
$data[4] = __('N/A');
|
||||
$data[4] = $server['version'];
|
||||
$data[5] = __('N/A');
|
||||
$data[6] = __('N/A');
|
||||
break;
|
||||
|
||||
case 'export':
|
||||
$data[3] = $server['version'];
|
||||
$data[4] = $server['modules'].' '.__('of').' '.$server['modules_total'];
|
||||
$data[5] = __('N/A');
|
||||
$data[4] = $server['version'];
|
||||
$data[5] = $server['modules'].' '.__('of').' '.$server['modules_total'];
|
||||
$data[6] = __('N/A');
|
||||
break;
|
||||
|
||||
default:
|
||||
$data[3] = $server['version'];
|
||||
$data[4] = $server['modules'].' '.__('of').' '.$server['modules_total'];
|
||||
$data[5] = '<span class="nowrap">'.$server['lag_txt'].'</span>';
|
||||
$data[4] = $server['version'];
|
||||
$data[5] = $server['modules'].' '.__('of').' '.$server['modules_total'];
|
||||
$data[6] = '<span class="nowrap">'.$server['lag_txt'].'</span>';
|
||||
break;
|
||||
}
|
||||
|
||||
$data[6] = '';
|
||||
if ($server['queued_modules'] > 500) {
|
||||
$data[6] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
|
||||
$data[7] = '';
|
||||
if ($server['queued_modules'] >= $config['number_modules_queue']) {
|
||||
$data[7] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
|
||||
'images/info-warning.svg',
|
||||
true,
|
||||
[
|
||||
|
@ -189,9 +192,9 @@ foreach ($servers as $server) {
|
|||
).'</a></div> ';
|
||||
}
|
||||
|
||||
$data[6] .= $server['threads'].' : '.$server['queued_modules'];
|
||||
$data[7] .= $server['threads'].' : '.$server['queued_modules'];
|
||||
|
||||
$data[7] = ui_print_timestamp($server['keepalive'], true);
|
||||
$data[8] = ui_print_timestamp($server['keepalive'], true);
|
||||
|
||||
if ($server['type'] === 'data') {
|
||||
$ext = '_server';
|
||||
|
@ -208,11 +211,11 @@ foreach ($servers as $server) {
|
|||
|
||||
// Only Pandora Administrator can delete servers.
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$data[8] = '';
|
||||
$data[9] = '';
|
||||
|
||||
if ($server['type'] === 'recon') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=tasklist').'">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/snmp-trap@svg.svg',
|
||||
true,
|
||||
[
|
||||
|
@ -221,12 +224,12 @@ foreach ($servers as $server) {
|
|||
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
}
|
||||
|
||||
if ($server['type'] === 'data') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_counts='.$server['id_server']).'">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/force@svg.svg',
|
||||
true,
|
||||
[
|
||||
|
@ -234,10 +237,10 @@ foreach ($servers as $server) {
|
|||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
} else if ($server['type'] === 'enterprise snmp') {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=0&server_reset_snmp_enterprise='.$server['id_server']).'">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/force@svg.svg',
|
||||
true,
|
||||
[
|
||||
|
@ -245,12 +248,12 @@ foreach ($servers as $server) {
|
|||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
}
|
||||
|
||||
if ($server['type'] === 'event' && (bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||
$data[8] .= '<a class="open-alerts-list-modal" href="">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a class="open-alerts-list-modal" href="">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/alert@svg.svg',
|
||||
true,
|
||||
[
|
||||
|
@ -258,11 +261,11 @@ foreach ($servers as $server) {
|
|||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
}
|
||||
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server='.$server['id_server']).'">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
|
@ -270,11 +273,11 @@ foreach ($servers as $server) {
|
|||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
|
||||
if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) {
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=advanced_editor').'">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/agents@svg.svg',
|
||||
true,
|
||||
[
|
||||
|
@ -282,10 +285,10 @@ foreach ($servers as $server) {
|
|||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext).'">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/remote-configuration@svg.svg',
|
||||
true,
|
||||
[
|
||||
|
@ -293,12 +296,12 @@ foreach ($servers as $server) {
|
|||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
$names_servers[$safe_server_name] = false;
|
||||
}
|
||||
|
||||
$data[8] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&delete=1').'">';
|
||||
$data[8] .= html_print_image(
|
||||
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_del='.$server['id_server'].'&delete=1').'">';
|
||||
$data[9] .= html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
|
@ -307,14 +310,14 @@ foreach ($servers as $server) {
|
|||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[8] .= '</a>';
|
||||
$data[9] .= '</a>';
|
||||
}
|
||||
|
||||
if ($tiny) {
|
||||
unset($data[4]);
|
||||
unset($data[6]);
|
||||
unset($data[5]);
|
||||
unset($data[7]);
|
||||
unset($data[8]);
|
||||
unset($data[9]);
|
||||
}
|
||||
|
||||
$ext = '';
|
||||
|
@ -323,10 +326,10 @@ foreach ($servers as $server) {
|
|||
}
|
||||
|
||||
if ($tiny) {
|
||||
unset($table->head[4]);
|
||||
unset($table->head[6]);
|
||||
unset($table->head[5]);
|
||||
unset($table->head[7]);
|
||||
unset($table->head[8]);
|
||||
unset($table->head[9]);
|
||||
}
|
||||
|
||||
if ($tiny) {
|
||||
|
|
|
@ -71,6 +71,8 @@ if (isset($config['filemanager']['message']) === true) {
|
|||
$fallback_directory = 'images';
|
||||
// Get directory.
|
||||
$directory = (string) get_parameter('directory');
|
||||
$directory = str_replace('<', '', $text);
|
||||
$directory = str_replace('>', '', $text);
|
||||
if (empty($directory) === true) {
|
||||
$directory = $fallback_directory;
|
||||
} else {
|
||||
|
|
|
@ -54,8 +54,12 @@ if (isset($_POST['create'])) {
|
|||
if (! $result) {
|
||||
ui_print_error_message(__('There was a problem creating link'));
|
||||
} else {
|
||||
ui_print_success_message(__('Successfully created'));
|
||||
$id_link = $result;
|
||||
ui_print_result_message(
|
||||
$id_link,
|
||||
__('Successfully created'),
|
||||
__('Could not be created')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,8 +115,8 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
|
|||
$link = '';
|
||||
}
|
||||
|
||||
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
|
||||
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">';
|
||||
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
|
||||
if ($creation_mode == 1) {
|
||||
echo "<input type='hidden' name='create' value='1'>";
|
||||
} else {
|
||||
|
@ -179,10 +183,10 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
|
|||
)
|
||||
);
|
||||
|
||||
echo '</form></td></tr></table>';
|
||||
echo '</td></tr></table></form>';
|
||||
} else {
|
||||
// Main list view for Links editor
|
||||
$rows = db_get_all_rows_in_table('tlink', 'name');
|
||||
// Main list view for Links editor.
|
||||
$rows = db_get_all_fields_in_table('tlink', '', '', 'name');
|
||||
if ($rows === false) {
|
||||
$rows = [];
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ if ($idOS > 0) {
|
|||
$description = $os['description'];
|
||||
$icon = $os['icon_name'];
|
||||
} else {
|
||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
||||
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
|
||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||
$icon = get_parameter('icon', 0);
|
||||
}
|
||||
|
@ -87,9 +87,16 @@ if ($is_management_allowed === true) {
|
|||
|
||||
if (in_array($file_ext, $allowed_extensions) === false) {
|
||||
$message = 9;
|
||||
} else if (exif_imagetype($file_tmp) === false && $file_ext !== 'svg') {
|
||||
$message = 10;
|
||||
} else {
|
||||
$message = 8;
|
||||
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
|
||||
$file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
|
||||
if ($file_uploaded !== true) {
|
||||
$message = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -108,7 +115,7 @@ if ($is_management_allowed === true) {
|
|||
|
||||
if ($resultOrId === false) {
|
||||
$message = 2;
|
||||
$tab = 'builder';
|
||||
$tab = 'manage_os';
|
||||
$actionHidden = 'save';
|
||||
$textButton = __('Create');
|
||||
$classButton = ['icon' => 'wand'];
|
||||
|
@ -144,13 +151,19 @@ if ($is_management_allowed === true) {
|
|||
|
||||
if (in_array($file_ext, $allowed_extensions) === false) {
|
||||
$message = 9;
|
||||
} else if (exif_imagetype($file_tmp) === false) {
|
||||
$message = 10;
|
||||
} else {
|
||||
$message = 8;
|
||||
move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
$file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
|
||||
|
||||
if ($file_uploaded !== true) {
|
||||
$message = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
|
||||
$name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
|
||||
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
|
||||
$icon = get_parameter('icon', 0);
|
||||
|
||||
|
@ -254,7 +267,7 @@ $table->class = 'databox filter-table-adv';
|
|||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text('name', $name, __('Name'), 20, 30, true, false, false, '', 'w250px')
|
||||
html_print_input_text('name', $name, __('Name'), 20, 30, true, false, true, '', 'w250px')
|
||||
);
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
|
@ -290,6 +303,28 @@ html_print_action_buttons(
|
|||
|
||||
echo '</form>';
|
||||
|
||||
$id_message = get_parameter('id_message', 0);
|
||||
|
||||
if ($id_message !== 0) {
|
||||
switch ($id_message) {
|
||||
case 8:
|
||||
echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
|
||||
break;
|
||||
|
||||
case 9:
|
||||
echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
echo ui_print_error_message(__('An error ocurrered to upload icon'), '', true);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function get_list_os_icons_dir()
|
||||
{
|
||||
|
|
|
@ -97,6 +97,24 @@ try {
|
|||
'column_names' => $column_names,
|
||||
'ajax_url' => 'include/ajax/os',
|
||||
'ajax_data' => ['method' => 'drawOSTable'],
|
||||
'pagination_options' => [
|
||||
[
|
||||
$config['block_size'],
|
||||
10,
|
||||
25,
|
||||
100,
|
||||
200,
|
||||
500,
|
||||
],
|
||||
[
|
||||
$config['block_size'],
|
||||
10,
|
||||
25,
|
||||
100,
|
||||
200,
|
||||
500,
|
||||
],
|
||||
],
|
||||
'ajax_postprocess' => 'process_datatables_item(item)',
|
||||
'no_sortable_columns' => [
|
||||
-1,
|
||||
|
@ -137,6 +155,10 @@ if (is_metaconsole() === true) {
|
|||
true
|
||||
);
|
||||
$buttons .= '</form>';
|
||||
} else {
|
||||
$buttons .= '<form method="post" action="index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit">';
|
||||
$buttons .= html_print_submit_button(__('Create OS'), 'update_button', false, ['icon' => 'next'], true);
|
||||
$buttons .= '</form>';
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
|
@ -150,15 +172,6 @@ html_print_action_buttons(
|
|||
|
||||
echo '<div id="aux" class="invisible"></div>';
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit">';
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(__('Create OS'), 'update_button', false, ['icon' => 'next'], true),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
function process_datatables_item(item) {
|
||||
|
|
|
@ -162,11 +162,15 @@ if (empty($id_message) === false) {
|
|||
break;
|
||||
|
||||
case 8:
|
||||
echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
|
||||
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=8');
|
||||
break;
|
||||
|
||||
case 9:
|
||||
echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
|
||||
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=9');
|
||||
break;
|
||||
|
||||
case 10:
|
||||
header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=10');
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -154,8 +154,7 @@ if ($update_config == 1 && $config['history_db_enabled'] == 1) {
|
|||
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
|
||||
|
||||
$total_agents = db_get_value('count(*)', 'tagente');
|
||||
$disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
|
||||
|
||||
// $disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
|
||||
$table_status = new StdClass();
|
||||
$table_status->width = '100%';
|
||||
$table_status->class = 'databox filters';
|
||||
|
@ -666,8 +665,8 @@ $table_other->data[2][1] = html_print_label_input_block(
|
|||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table_other->data[3][0] = html_print_label_input_block(
|
||||
/*
|
||||
$table_other->data[3][0] = html_print_label_input_block(
|
||||
__('Use agent access graph'),
|
||||
html_print_checkbox_switch(
|
||||
'agentaccess',
|
||||
|
@ -676,9 +675,9 @@ $table_other->data[3][0] = html_print_label_input_block(
|
|||
true,
|
||||
$disable_agentaccess
|
||||
)
|
||||
);
|
||||
|
||||
$table_other->data[3][1] = html_print_label_input_block(
|
||||
);
|
||||
*/
|
||||
$table_other->data[3][0] = html_print_label_input_block(
|
||||
__('Max. recommended number of files in attachment directory'),
|
||||
html_print_input_text(
|
||||
'num_files_attachment',
|
||||
|
|
|
@ -93,7 +93,7 @@ $buttons['general'] = [
|
|||
'images/setup.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('General'),
|
||||
'title' => __('General setup'),
|
||||
'class' => 'invert_filter',
|
||||
|
||||
]
|
||||
|
@ -265,7 +265,7 @@ if (enterprise_installed()) {
|
|||
switch ($section) {
|
||||
case 'general':
|
||||
$buttons['general']['active'] = true;
|
||||
$subpage = __('General');
|
||||
$subpage = __('General setup');
|
||||
$help_header = 'setup_general_tab';
|
||||
break;
|
||||
|
||||
|
@ -370,14 +370,14 @@ switch ($section) {
|
|||
break;
|
||||
|
||||
default:
|
||||
$subpage = 'seccion: '.$section;
|
||||
$subpage = 'seccion: ';
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$subpage,
|
||||
__('Setup').' » '.$subpage,
|
||||
'',
|
||||
false,
|
||||
$help_header,
|
||||
|
@ -388,6 +388,10 @@ ui_print_standard_header(
|
|||
'link' => '',
|
||||
'label' => __('Setup'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => $subpage,
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -187,7 +187,8 @@ $button_test .= ' <span id="ITSM-message" class="invisible"></span>';
|
|||
|
||||
$row['control'] = html_print_label_input_block(
|
||||
__('Test connection pandora to ITSM'),
|
||||
$button_test
|
||||
$button_test,
|
||||
['div_class' => 'ITSM-remote-setup-ITSM_token']
|
||||
);
|
||||
$table_remote->data['ITSM_test'] = $row;
|
||||
|
||||
|
|
|
@ -535,16 +535,47 @@ html_print_action_buttons(
|
|||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
[
|
||||
'icon' => 'update',
|
||||
'onclick' => 'onFormSubmit()',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
echo ui_print_warning_message(
|
||||
[
|
||||
'message' => __('Session timeout must be a number'),
|
||||
'force_class' => 'invisible js_warning_msg',
|
||||
],
|
||||
'',
|
||||
true
|
||||
);
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function onFormSubmit() {
|
||||
const isNumber = n => $.isNumeric(n);
|
||||
|
||||
let session_timeout = $('#text-session_timeout').val()
|
||||
if(isNumber(session_timeout)) {
|
||||
if (session_timeout < 0) {
|
||||
|
||||
session_timeout = -1;
|
||||
}
|
||||
if (session_timeout > 604800) {
|
||||
session_timeout = 604800;
|
||||
}
|
||||
$('#text-session_timeout').val(session_timeout);
|
||||
} else {
|
||||
$('.js_warning_msg').removeClass('invisible');
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function showAndHide() {
|
||||
if ($('input[type=checkbox][name=double_auth_enabled]:checked').val() == 1) {
|
||||
$('#table1-2FA_all_users').removeClass('invisible');
|
||||
|
|
|
@ -405,19 +405,6 @@ $table->data[$i++][] = html_print_label_input_block(
|
|||
|
||||
|
||||
$table->data[$i][] = html_print_label_input_block(
|
||||
__('Enable Sflow'),
|
||||
html_print_checkbox_switch_extended(
|
||||
'activate_sflow',
|
||||
1,
|
||||
$config['activate_sflow'],
|
||||
$rbt_disabled,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
),
|
||||
);
|
||||
|
||||
$table->data[$i++][] = html_print_label_input_block(
|
||||
__('General network path'),
|
||||
html_print_input_text(
|
||||
'general_network_path',
|
||||
|
@ -733,7 +720,7 @@ $table->data[$i++][] = html_print_label_input_block(
|
|||
);
|
||||
|
||||
$help_tip = ui_print_help_tip(
|
||||
__('If there are any "In process" events with a specific Extra ID and a New event with that Extra ID is received, it will be created as "In process" instead.'),
|
||||
__('If there are any "In process" events with a specific Extra ID and a New event with that Extra ID is received, it will be created as "In process" instead. The new events also inherit Event Custom ID'),
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -766,6 +753,17 @@ $table->data[$i][] = html_print_label_input_block(
|
|||
true
|
||||
)
|
||||
);
|
||||
$table->data[$i++][] = html_print_label_input_block(
|
||||
__('Number of modules in queue'),
|
||||
html_print_input_number(
|
||||
[
|
||||
'name' => 'number_modules_queue',
|
||||
'min' => 0,
|
||||
'value' => $config['number_modules_queue'],
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&section=general&pure='.$config['pure'].'">';
|
||||
|
||||
|
|
|
@ -83,6 +83,19 @@ $table->data[3][] = html_print_label_input_block(
|
|||
html_print_checkbox_switch_extended('netflow_get_ip_hostname', 1, $config['netflow_get_ip_hostname'], false, $onclick, '', true)
|
||||
);
|
||||
|
||||
$table->data[4][] = html_print_label_input_block(
|
||||
__('Enable Sflow'),
|
||||
html_print_checkbox_switch_extended(
|
||||
'activate_sflow',
|
||||
1,
|
||||
$config['activate_sflow'],
|
||||
$rbt_disabled,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
),
|
||||
);
|
||||
|
||||
echo '<form class="max_floating_element_size" id="netflow_setup" method="post">';
|
||||
html_print_table($table);
|
||||
html_print_input_hidden('update_config', 1);
|
||||
|
|
|
@ -2129,6 +2129,15 @@ $table_other->data[$row][] = html_print_label_input_block(
|
|||
__('Data multiplier to use in graphs/data'),
|
||||
html_print_select($options_data_multiplier, 'use_data_multiplier', $config['use_data_multiplier'], '', '', 1, true, false, false)
|
||||
);
|
||||
$table_other->data[$row][] = html_print_label_input_block(
|
||||
__('Hide general stats for non admin users in tactical view'),
|
||||
html_print_checkbox_switch(
|
||||
'disable_general_statistics',
|
||||
1,
|
||||
$config['disable_general_statistics'],
|
||||
true
|
||||
)
|
||||
);
|
||||
$row++;
|
||||
|
||||
/*
|
||||
|
|
|
@ -1952,6 +1952,7 @@ if ($create_alert || $update_alert) {
|
|||
[
|
||||
'border' => '0',
|
||||
'alt' => __('Delete'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a> </td>';
|
||||
$data[1] .= '</tr>';
|
||||
|
@ -2063,7 +2064,7 @@ if ($create_alert || $update_alert) {
|
|||
}
|
||||
|
||||
// DIALOG ADD MORE ACTIONS.
|
||||
echo '<div id="add_action_snmp-div" class="invisible left">';
|
||||
echo '<div id="add_action_snmp-div" class="invisible">';
|
||||
|
||||
echo '<form id="add_action_form" method="post">';
|
||||
echo '<table class="w100p">';
|
||||
|
@ -2212,6 +2213,7 @@ if ($create_alert || $update_alert) {
|
|||
|
||||
ui_require_javascript_file('pandora', 'include/javascript/', true);
|
||||
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
|
||||
ui_require_javascript_file('alert');
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
||||
|
@ -2287,6 +2289,7 @@ $(document).ready (function () {
|
|||
name: "content_type",
|
||||
value: "<?php echo $al_field4; ?>"
|
||||
})
|
||||
|
||||
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
|
||||
values,
|
||||
function (data, status) {
|
||||
|
@ -2317,6 +2320,26 @@ $(document).ready (function () {
|
|||
}
|
||||
$('#table_macros-field').show();
|
||||
}
|
||||
|
||||
if($("#alert_type option:selected").text() === "Create Pandora ITSM ticket") {
|
||||
// At start hide all rows and inputs corresponding to custom fields, regardless of what its type is.
|
||||
if (i>=8) {
|
||||
$('[name=field'+i+'_value\\[\\]').hide();
|
||||
$('[name=field'+i+'_recovery_value\\[\\]').hide();
|
||||
$('#table_macros-field'+i).hide();
|
||||
$('[name=field'+i+'_value_container').hide();
|
||||
$('[name=field'+i+'_recovery_value_container').hide();
|
||||
}
|
||||
|
||||
if ($('#field5_value').val() !== '') {
|
||||
ajax_get_integria_custom_fields($('#field5_value').val(), [], [], max_fields);
|
||||
$('#field5_value').trigger('change');
|
||||
}
|
||||
|
||||
$('#field5_value').on('change', function() {
|
||||
ajax_get_integria_custom_fields($(this).val(), [], [], max_fields);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
"json"
|
||||
|
@ -2341,7 +2364,8 @@ $(document).ready (function () {
|
|||
});
|
||||
|
||||
function show_add_action_snmp(id_alert_snmp) {
|
||||
$("#add_action_snmp-div").hide()
|
||||
$("#add_action_snmp-div")
|
||||
.hide()
|
||||
.dialog ({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
|
|
|
@ -53,12 +53,30 @@ try {
|
|||
echo 'current historyDB MR: '.Config::get('MR', 'unknown', true)."\n";
|
||||
}
|
||||
|
||||
global $pandora_version;
|
||||
if (isset($pandora_version) === true
|
||||
&& empty($pandora_version) === false
|
||||
) {
|
||||
$version_array = explode('.', $pandora_version);
|
||||
if (is_array($version_array) === true) {
|
||||
$current_package = $version_array[2];
|
||||
if (count($version_array) > 2) {
|
||||
foreach ($version_array as $key => $value) {
|
||||
if ($key > 2) {
|
||||
$current_package .= '.'.$value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$umc = new UpdateManager\Client(
|
||||
[
|
||||
'homedir' => $config['homedir'],
|
||||
'dbconnection' => $config['dbconnection'],
|
||||
'historydb' => $historical_dbh,
|
||||
'MR' => (int) $current_mr,
|
||||
'homedir' => $config['homedir'],
|
||||
'dbconnection' => $config['dbconnection'],
|
||||
'historydb' => $historical_dbh,
|
||||
'MR' => (int) $current_mr,
|
||||
'current_package' => ($current_package ?? ''),
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -33,8 +33,6 @@ check_login();
|
|||
|
||||
require_once $config['homedir'].'/vendor/autoload.php';
|
||||
|
||||
use PandoraFMS\Dashboard\Manager;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_profile.php';
|
||||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
require_once $config['homedir'].'/include/functions_groups.php';
|
||||
|
@ -157,14 +155,92 @@ if (is_ajax() === true) {
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($delete_profile === true) {
|
||||
// Get parameters.
|
||||
$result = false;
|
||||
$id_user = (string) get_parameter('id_user');
|
||||
$id_up = (int) get_parameter('id_user_profile');
|
||||
$delete_user = (bool) get_parameter('delete_user', false);
|
||||
$user_is_global_admin = users_is_admin($id_user);
|
||||
|
||||
$perfilUser = db_get_row('tusuario_perfil', 'id_up', $id_up);
|
||||
$id_perfil = $perfilUser['id_perfil'];
|
||||
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
'Deleted profile for user '.io_safe_output($id_user),
|
||||
false,
|
||||
false,
|
||||
'The profile with id '.$id_perfil.' in the group '.$perfilUser['id_grupo']
|
||||
);
|
||||
// Delete profile.
|
||||
$profile_deleted = profile_delete_user_profile($id_user, $id_up);
|
||||
// Check if exists more profiles.
|
||||
$has_profile = db_get_row('tusuario_perfil', 'id_usuario', $id_user);
|
||||
if ($profile_deleted === true) {
|
||||
if ($has_profile === false && $user_is_global_admin === false && $delete_user === true) {
|
||||
if (is_metaconsole() === true) {
|
||||
$servers = metaconsole_get_servers();
|
||||
foreach ($servers as $server) {
|
||||
// Connect to the remote console.
|
||||
metaconsole_connect($server);
|
||||
|
||||
// Delete the user.
|
||||
$result = delete_user($id_user);
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s from metaconsole', io_safe_output($id_user))
|
||||
);
|
||||
}
|
||||
|
||||
// Restore the db connection.
|
||||
metaconsole_restore_db();
|
||||
|
||||
// Log to the metaconsole too.
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__(
|
||||
'Deleted user %s from %s',
|
||||
io_safe_input($id_user),
|
||||
io_safe_input($server['server_name'])
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$result = delete_user((string) $id_user);
|
||||
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s', io_safe_output($id_user))
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$result = delete_user((string) $id_user);
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s', io_safe_output($id_user))
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$result = $profile_deleted;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
$tab = get_parameter('tab', 'user');
|
||||
|
||||
// Save autorefresh list.
|
||||
$autorefresh_list = (array) get_parameter_post('autorefresh_list');
|
||||
$autorefresh_white_list = (($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')) ? '' : json_encode($autorefresh_list);
|
||||
|
||||
// Header.
|
||||
if (is_metaconsole() === true) {
|
||||
user_meta_print_header();
|
||||
|
@ -197,11 +273,11 @@ if (is_metaconsole() === true) {
|
|||
).'</a>',
|
||||
],
|
||||
];
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
}
|
||||
|
||||
$edit_user = get_parameter('edit_user');
|
||||
|
||||
ui_print_standard_header(
|
||||
($edit_user) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'),
|
||||
'images/gm_users.png',
|
||||
|
@ -224,11 +300,9 @@ if (is_metaconsole() === true) {
|
|||
],
|
||||
]
|
||||
);
|
||||
|
||||
$sec = 'gusuarios';
|
||||
}
|
||||
|
||||
|
||||
if ((bool) $config['user_can_update_info'] === true) {
|
||||
$view_mode = false;
|
||||
} else {
|
||||
|
@ -350,8 +424,10 @@ if ($create_user === true) {
|
|||
$values['data_section'] = $dashboard;
|
||||
} else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) {
|
||||
$values['data_section'] = $visual_console;
|
||||
} else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
|
||||
$values['data_section'] = get_parameter('data_section');
|
||||
} else if ($values['section'] === HOME_SCREEN_OTHER) {
|
||||
$values['data_section'] = get_parameter('data_section_other');
|
||||
} else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
|
||||
$values['data_section'] = get_parameter('data_section_external');
|
||||
}
|
||||
|
||||
// $values['section'] = $homeScreenValues[$values['section']];
|
||||
|
@ -598,8 +674,11 @@ if ($update_user) {
|
|||
$values['email'] = (string) get_parameter('email');
|
||||
$values['phone'] = (string) get_parameter('phone');
|
||||
$values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments'))));
|
||||
$values['allowed_ip_active'] = ((int) get_parameter('allowed_ip_active', -1) === 0);
|
||||
$values['allowed_ip_list'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('allowed_ip_list'))));
|
||||
if (users_is_admin($config['id_user']) === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$values['allowed_ip_active'] = ((int) get_parameter('allowed_ip_active', -1) === 0);
|
||||
$values['allowed_ip_list'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('allowed_ip_list'))));
|
||||
}
|
||||
|
||||
$values['is_admin'] = (get_parameter('is_admin', 0) === 0) ? 0 : 1;
|
||||
$values['language'] = (string) get_parameter('language');
|
||||
$values['timezone'] = (string) get_parameter('timezone');
|
||||
|
@ -645,8 +724,10 @@ if ($update_user) {
|
|||
$values['data_section'] = $dashboard;
|
||||
} else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) {
|
||||
$values['data_section'] = $visual_console;
|
||||
} else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
|
||||
$values['data_section'] = get_parameter('data_section');
|
||||
} else if ($values['section'] === HOME_SCREEN_OTHER) {
|
||||
$values['data_section'] = get_parameter('data_section_other');
|
||||
} else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
|
||||
$values['data_section'] = get_parameter('data_section_external');
|
||||
}
|
||||
|
||||
// $values['section'] = $homeScreenValues[$values['section']];
|
||||
|
@ -688,23 +769,55 @@ if ($update_user) {
|
|||
$id_user = (string) get_parameter('id_user', '');
|
||||
|
||||
if ($password_new != '') {
|
||||
$correct_password = false;
|
||||
if ($config['auth'] !== 'mysql') {
|
||||
ui_print_error_message(__('It is not possible to change the password because external authentication is being used'));
|
||||
} else {
|
||||
$correct_password = false;
|
||||
|
||||
$user_credentials_check = process_user_login($id_user, $own_password_confirm, true);
|
||||
$user_credentials_check = process_user_login($id_user, $own_password_confirm, true);
|
||||
|
||||
if ($user_credentials_check !== false) {
|
||||
$correct_password = true;
|
||||
}
|
||||
if ($user_credentials_check !== false) {
|
||||
$correct_password = true;
|
||||
}
|
||||
|
||||
if ((string) $password_confirm === (string) $password_new) {
|
||||
if ($correct_password === true || is_user_admin($config['id_user'])) {
|
||||
if ((is_user_admin($config['id_user']) === false || $config['enable_pass_policy_admin']) && $config['enable_pass_policy']) {
|
||||
$pass_ok = login_validate_pass($password_new, $id, true);
|
||||
if ($pass_ok != 1) {
|
||||
ui_print_error_message($pass_ok);
|
||||
if ((string) $password_confirm === (string) $password_new) {
|
||||
if ($correct_password === true || is_user_admin($config['id_user'])) {
|
||||
if ((is_user_admin($config['id_user']) === false || $config['enable_pass_policy_admin']) && $config['enable_pass_policy']) {
|
||||
$pass_ok = login_validate_pass($password_new, $id, true);
|
||||
if ($pass_ok != 1) {
|
||||
ui_print_error_message($pass_ok);
|
||||
} else {
|
||||
$res2 = update_user_password($id, $password_new);
|
||||
if ($res2) {
|
||||
db_process_sql_insert(
|
||||
'tsesion',
|
||||
[
|
||||
'id_sesion' => '',
|
||||
'id_usuario' => $id,
|
||||
'ip_origen' => $_SERVER['REMOTE_ADDR'],
|
||||
'accion' => 'Password change',
|
||||
'descripcion' => 'Access password updated',
|
||||
'fecha' => date('Y-m-d H:i:s'),
|
||||
'utimestamp' => time(),
|
||||
]
|
||||
);
|
||||
$res3 = save_pass_history($id, $password_new);
|
||||
|
||||
// Generate new API token.
|
||||
$newToken = api_token_generate();
|
||||
$res4 = update_user($id, ['api_token' => $newToken]);
|
||||
}
|
||||
|
||||
ui_print_result_message(
|
||||
$res1 || $res2,
|
||||
__('User info successfully updated'),
|
||||
__('Error updating user info (no change?)')
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$res2 = update_user_password($id, $password_new);
|
||||
if ($res2) {
|
||||
$res3 = save_pass_history($id, $password_new);
|
||||
db_process_sql_insert(
|
||||
'tsesion',
|
||||
[
|
||||
|
@ -717,7 +830,6 @@ if ($update_user) {
|
|||
'utimestamp' => time(),
|
||||
]
|
||||
);
|
||||
$res3 = save_pass_history($id, $password_new);
|
||||
|
||||
// Generate new API token.
|
||||
$newToken = api_token_generate();
|
||||
|
@ -731,54 +843,27 @@ if ($update_user) {
|
|||
);
|
||||
}
|
||||
} else {
|
||||
$res2 = update_user_password($id, $password_new);
|
||||
if ($res2) {
|
||||
$res3 = save_pass_history($id, $password_new);
|
||||
db_process_sql_insert(
|
||||
'tsesion',
|
||||
[
|
||||
'id_sesion' => '',
|
||||
'id_usuario' => $id,
|
||||
'ip_origen' => $_SERVER['REMOTE_ADDR'],
|
||||
'accion' => 'Password change',
|
||||
'descripcion' => 'Access password updated',
|
||||
'fecha' => date('Y-m-d H:i:s'),
|
||||
'utimestamp' => time(),
|
||||
]
|
||||
);
|
||||
|
||||
// Generate new API token.
|
||||
$newToken = api_token_generate();
|
||||
$res4 = update_user($id, ['api_token' => $newToken]);
|
||||
if ($own_password_confirm === '') {
|
||||
ui_print_error_message(__('Password of the active user is required to perform password change'));
|
||||
} else {
|
||||
ui_print_error_message(__('Password of active user is not correct'));
|
||||
}
|
||||
|
||||
ui_print_result_message(
|
||||
$res1 || $res2,
|
||||
__('User info successfully updated'),
|
||||
__('Error updating user info (no change?)')
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if ($own_password_confirm === '') {
|
||||
ui_print_error_message(__('Password of the active user is required to perform password change'));
|
||||
} else {
|
||||
ui_print_error_message(__('Password of active user is not correct'));
|
||||
}
|
||||
db_process_sql_insert(
|
||||
'tsesion',
|
||||
[
|
||||
'id_sesion' => '',
|
||||
'id_usuario' => $id,
|
||||
'ip_origen' => $_SERVER['REMOTE_ADDR'],
|
||||
'accion' => 'Password change',
|
||||
'descripcion' => 'Access password update failed',
|
||||
'fecha' => date('Y-m-d H:i:s'),
|
||||
'utimestamp' => time(),
|
||||
]
|
||||
);
|
||||
ui_print_error_message(__('Passwords does not match'));
|
||||
}
|
||||
} else {
|
||||
db_process_sql_insert(
|
||||
'tsesion',
|
||||
[
|
||||
'id_sesion' => '',
|
||||
'id_usuario' => $id,
|
||||
'ip_origen' => $_SERVER['REMOTE_ADDR'],
|
||||
'accion' => 'Password change',
|
||||
'descripcion' => 'Access password update failed',
|
||||
'fecha' => date('Y-m-d H:i:s'),
|
||||
'utimestamp' => time(),
|
||||
]
|
||||
);
|
||||
ui_print_error_message(__('Passwords does not match'));
|
||||
}
|
||||
} else {
|
||||
$has_skin = false;
|
||||
|
@ -864,89 +949,6 @@ if ($update_user) {
|
|||
$user_info = $values;
|
||||
}
|
||||
|
||||
if ($delete_profile) {
|
||||
$id2 = (string) get_parameter('id_user');
|
||||
$id_up = (int) get_parameter('id_user_profile');
|
||||
$perfilUser = db_get_row('tusuario_perfil', 'id_up', $id_up);
|
||||
$id_perfil = $perfilUser['id_perfil'];
|
||||
$perfil = db_get_row('tperfil', 'id_perfil', $id_perfil);
|
||||
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
'Deleted profile for user '.io_safe_output($id2),
|
||||
false,
|
||||
false,
|
||||
'The profile with id '.$id_perfil.' in the group '.$perfilUser['id_grupo']
|
||||
);
|
||||
|
||||
$return = profile_delete_user_profile($id2, $id_up);
|
||||
ui_print_result_message(
|
||||
$return,
|
||||
__('Successfully deleted'),
|
||||
__('Could not be deleted')
|
||||
);
|
||||
|
||||
|
||||
$has_profile = db_get_row('tusuario_perfil', 'id_usuario', $id2);
|
||||
$user_is_global_admin = users_is_admin($id2);
|
||||
|
||||
if ($has_profile === false && $user_is_global_admin === false) {
|
||||
$result = delete_user($id2);
|
||||
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s', io_safe_output($id_user))
|
||||
);
|
||||
}
|
||||
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Successfully deleted'),
|
||||
__('There was a problem deleting the user')
|
||||
);
|
||||
|
||||
// Delete the user in all the consoles.
|
||||
if (is_metaconsole() === true) {
|
||||
$servers = metaconsole_get_servers();
|
||||
foreach ($servers as $server) {
|
||||
// Connect to the remote console.
|
||||
metaconsole_connect($server);
|
||||
|
||||
// Delete the user.
|
||||
$result = delete_user($id_user);
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__('Deleted user %s from metaconsole', io_safe_output($id_user))
|
||||
);
|
||||
}
|
||||
|
||||
// Restore the db connection.
|
||||
metaconsole_restore_db();
|
||||
|
||||
// Log to the metaconsole too.
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_MANAGEMENT,
|
||||
__(
|
||||
'Deleted user %s from %s',
|
||||
io_safe_input($id_user),
|
||||
io_safe_input($server['server_name'])
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Successfully deleted from %s', io_safe_input($server['server_name'])),
|
||||
__('There was a problem deleting the user from %s', io_safe_input($server['server_name']))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((int) $status !== -1) {
|
||||
ui_print_result_message(
|
||||
$status,
|
||||
|
@ -1157,6 +1159,13 @@ if (is_user_admin($id) === true) {
|
|||
);
|
||||
}
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'id' => 'delete_profile_modal',
|
||||
'content' => '',
|
||||
]
|
||||
);
|
||||
|
||||
$full_name = ' <div class="label_select_simple">'.html_print_input_text_extended(
|
||||
'fullname',
|
||||
$user_info['fullname'],
|
||||
|
@ -1376,72 +1385,6 @@ if (is_metaconsole() === true) {
|
|||
);
|
||||
}
|
||||
|
||||
$values = [
|
||||
-1 => __('Use global conf'),
|
||||
1 => __('Yes'),
|
||||
0 => __('No'),
|
||||
];
|
||||
|
||||
$home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('Home screen').ui_print_help_tip(
|
||||
__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'),
|
||||
true
|
||||
).'</p>';
|
||||
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$id_usr
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
$dashboards = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($dashboards as $key => $dashboard) {
|
||||
$dashboards_aux[$dashboard['id']] = $dashboard['name'];
|
||||
}
|
||||
}
|
||||
|
||||
$home_screen .= '<div id="show_db" style="display: none; width: 100%;">';
|
||||
$home_screen .= html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true);
|
||||
$home_screen .= '</div>';
|
||||
|
||||
$layouts = visual_map_get_user_layouts($config['id_user'], true);
|
||||
$layouts_aux = [];
|
||||
if ($layouts === false) {
|
||||
$layouts_aux = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($layouts as $layout) {
|
||||
$layouts_aux[$layout] = $layout;
|
||||
}
|
||||
}
|
||||
|
||||
$home_screen .= '<div id="show_vc" style="display: none; width: 100%;">';
|
||||
$home_screen .= html_print_select(
|
||||
$layouts_aux,
|
||||
'visual_console',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$home_screen .= '</div>';
|
||||
|
||||
$home_screen .= html_print_input_text(
|
||||
'data_section',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
60,
|
||||
255,
|
||||
true,
|
||||
false
|
||||
);
|
||||
|
||||
$home_screen = '';
|
||||
|
||||
$size_pagination = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Block size for pagination').'</p>';
|
||||
$size_pagination .= html_print_input_text(
|
||||
'block_size',
|
||||
|
@ -1995,24 +1938,87 @@ if (is_metaconsole() === false) {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('input:image[name="del"]').click(function(e) {
|
||||
if ($(json_profile).length > 0) return;
|
||||
if (!confirm('Are you sure?')) return;
|
||||
e.preventDefault();
|
||||
var rows = $("#table_profiles tr").length;
|
||||
if (((is_metaconsole === '1' && rows <= 4) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
|
||||
if (!confirm('<?php echo __('Deleting last profile will delete this user'); ?>' + '. ' + '<?php echo __('Are you sure?'); ?>')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var rows = $("#table_profiles tr").length;
|
||||
let deleteuser = 0;
|
||||
e.preventDefault();
|
||||
var id_user_profile = $(this).siblings();
|
||||
id_user_profile = id_user_profile[1].value;
|
||||
var row = $(this).closest('tr');
|
||||
|
||||
if (((is_metaconsole === '1' && rows <= 3) || (is_metaconsole !== '1' && rows <= 3)) && user_is_global_admin !== '1') {
|
||||
$("#delete_profile_modal")
|
||||
.empty()
|
||||
.html("<?php echo __('Deleting this profile will leave your user without a profile or group. You can continue by deleting the user or preserving it.'); ?>");
|
||||
// Set the title.
|
||||
$("#delete_profile_modal").prop("title", "<?php echo __('Are you sure?'); ?>");
|
||||
// Build the dialog for show the mesage.
|
||||
$("#delete_profile_modal").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
width: 500,
|
||||
buttons: [
|
||||
{
|
||||
text: "Cancel",
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Delete",
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
deleteuser = 1;
|
||||
delete_user_profile(id_user_profile, row, id_user, deleteuser);
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Preserve",
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
deleteuser = 0;
|
||||
delete_user_profile(id_user_profile, row, id_user, deleteuser)
|
||||
}
|
||||
}
|
||||
],
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
closeOnEscape: false,
|
||||
open: function(event, ui) {
|
||||
$(".ui-dialog-titlebar-close").hide();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (((is_metaconsole === '1' && rows <= 3) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
|
||||
if (!confirm('<?php echo __('Deleting last profile will delete this user'); ?>' + '. ' + '<?php echo __('Are you sure?'); ?>')) {
|
||||
return false;
|
||||
} else {
|
||||
delete_user_profile(id_user_profile, row, id_user, deleteuser);
|
||||
}
|
||||
} else {
|
||||
if (!confirm('Are you sure?')) {
|
||||
return false;
|
||||
} else {
|
||||
delete_user_profile(id_user_profile, row, id_user, deleteuser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($(json_profile).length > 0) return;
|
||||
});
|
||||
|
||||
function delete_user_profile(id_user_profile, row, id_user, deleteuser){
|
||||
var params = [];
|
||||
params.push("delete_profile=1");
|
||||
params.push("edit_user=1");
|
||||
params.push("delete_user=" + deleteuser);
|
||||
params.push("id_user=" + id_user);
|
||||
params.push("id_user_profile=" + id_user_profile);
|
||||
params.push("page=godmode/users/configure_user");
|
||||
|
@ -2023,15 +2029,14 @@ if (is_metaconsole() === false) {
|
|||
success: function(data) {
|
||||
row.remove();
|
||||
var rows = $("#table_profiles tr").length;
|
||||
|
||||
if (is_metaconsole === '' && rows <= 2 && user_is_global_admin !== '1') {
|
||||
if (is_metaconsole === '' && rows <= 2 && user_is_global_admin !== '1' && deleteuser == '1') {
|
||||
window.location.replace("<?php echo ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0', false, false, false); ?>");
|
||||
} else if (is_metaconsole === '1' && rows <= 3 && user_is_global_admin !== '1') {
|
||||
} else if (is_metaconsole === '1' && rows <= 2 && user_is_global_admin !== '1' && deleteuser == '1') {
|
||||
window.location.replace("<?php echo ui_get_full_url('index.php?sec=advanced&sec2=advanced/users_setup', false, false, true); ?>");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function checkProfiles(e) {
|
||||
e.preventDefault();
|
||||
|
@ -2078,17 +2083,20 @@ if (is_metaconsole() === false) {
|
|||
}
|
||||
|
||||
function show_data_section() {
|
||||
var $section = $("#section").val();
|
||||
var $allElements = $('div[id^="custom_home_screen_"]');
|
||||
var $elementSelected = $('div[id="custom_home_screen_' + $section + '"]');
|
||||
var section = $("#section").val();
|
||||
if(section === 'other'){
|
||||
section = 'external_link';
|
||||
}
|
||||
var allElements = $('div[id^="custom_home_screen_"]');
|
||||
var elementSelected = $('div[id="custom_home_screen_' + section + '"]');
|
||||
// Hide all elements.
|
||||
$allElements.each(function() {
|
||||
allElements.each(function() {
|
||||
$(this).addClass('invisible');
|
||||
$(this).children().addClass('invisible');
|
||||
})
|
||||
// Show only the selected.
|
||||
$elementSelected.removeClass('invisible');
|
||||
$elementSelected.children().removeClass('invisible');
|
||||
elementSelected.removeClass('invisible');
|
||||
elementSelected.children().removeClass('invisible');
|
||||
}
|
||||
|
||||
function switch_ehorus_conf() {
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
* ============================================================================
|
||||
*/
|
||||
|
||||
use PandoraFMS\Dashboard\Manager;
|
||||
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
|
@ -45,16 +47,80 @@ $homeScreenValues = [
|
|||
HOME_SCREEN_DASHBOARD => __('Dashboard'),
|
||||
];
|
||||
|
||||
$dashboards = Manager::getDashboards(
|
||||
-1,
|
||||
-1,
|
||||
false,
|
||||
false,
|
||||
$id_usr
|
||||
);
|
||||
|
||||
$dashboards_aux = [];
|
||||
if ($dashboards === false) {
|
||||
$dashboards = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($dashboards as $key => $dashboard) {
|
||||
$dashboards_aux[$dashboard['id']] = $dashboard['name'];
|
||||
}
|
||||
}
|
||||
|
||||
// Custom Home Screen controls.
|
||||
$customHomeScreenAddition = [];
|
||||
// Home screen. Dashboard.
|
||||
$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
|
||||
$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select(
|
||||
$dashboards_aux,
|
||||
'dashboard',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
);
|
||||
// Home screen. Visual consoles.
|
||||
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select($layouts_aux, 'visual_console', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
|
||||
// Home screen. External link and Other.
|
||||
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true);
|
||||
$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true);
|
||||
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section_external', $user_info['data_section'], '', 60, 255, true);
|
||||
$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section_other', $user_info['data_section'], '', 60, 255, true);
|
||||
|
||||
$layouts = visual_map_get_user_layouts($config['id_user'], true);
|
||||
$layouts_aux = [];
|
||||
if ($layouts === false) {
|
||||
$layouts_aux = ['None' => 'None'];
|
||||
} else {
|
||||
foreach ($layouts as $layout) {
|
||||
$layouts_aux[$layout] = $layout;
|
||||
}
|
||||
}
|
||||
|
||||
// Home screen. Visual consoles.
|
||||
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select(
|
||||
$layouts_aux,
|
||||
'visual_console',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
);
|
||||
// Home screen. External link and Other.
|
||||
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text(
|
||||
'data_section',
|
||||
$user_info['data_section'],
|
||||
'',
|
||||
60,
|
||||
255,
|
||||
true
|
||||
);
|
||||
$customHomeScreenDataField = '';
|
||||
foreach ($customHomeScreenAddition as $key => $customField) {
|
||||
$customHomeScreenDataField .= html_print_div(
|
||||
|
@ -266,7 +332,7 @@ $passwordManageTable->data = [];
|
|||
|
||||
$passwordManageTable->data['captions_newpassword'][0] = __('New password');
|
||||
$passwordManageTable->rowclass['fields_newpassword'] = 'w540px';
|
||||
$passwordManageTable->data['fields_newpassword'][0] = html_print_input_text_extended(
|
||||
$passwordManageTable->data['fields_newpassword'][0] = '<div class="relative container-div-input-password ">'.html_print_input_text_extended(
|
||||
'password_new',
|
||||
'',
|
||||
'password_new',
|
||||
|
@ -276,16 +342,17 @@ $passwordManageTable->data['fields_newpassword'][0] = html_print_input_text_exte
|
|||
$view_mode,
|
||||
'',
|
||||
[
|
||||
'class' => 'input w100p',
|
||||
'class' => 'input',
|
||||
'placeholder' => __('Password'),
|
||||
'style' => 'width: 540px',
|
||||
],
|
||||
true,
|
||||
true
|
||||
);
|
||||
).'</div>';
|
||||
|
||||
$passwordManageTable->data['captions_repeatpassword'][0] = __('Repeat new password');
|
||||
$passwordManageTable->rowclass['fields_repeatpassword'] = 'w540px';
|
||||
$passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_extended(
|
||||
$passwordManageTable->data['fields_repeatpassword'][0] = '<div class="relative container-div-input-password ">'.html_print_input_text_extended(
|
||||
'password_confirm',
|
||||
'',
|
||||
'password_conf',
|
||||
|
@ -297,10 +364,11 @@ $passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_e
|
|||
[
|
||||
'class' => 'input w100p',
|
||||
'placeholder' => __('Password confirmation'),
|
||||
'style' => 'width: 540px',
|
||||
],
|
||||
true,
|
||||
true
|
||||
);
|
||||
).'</div>';
|
||||
|
||||
if ($new_user === false && users_is_admin() === false) {
|
||||
$passwordManageTable->data['captions_currentpassword'][0] = __('Current password');
|
||||
|
@ -576,7 +644,7 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh
|
|||
true
|
||||
);
|
||||
|
||||
// eHorus conf
|
||||
// EHorus conf.
|
||||
if (isset($config['ehorus_user_level_conf']) === true && (bool) $config['ehorus_user_level_conf'] === true) {
|
||||
$userManagementTable->data['captions_ehorus_user_level_enabled'][1] = __('Pandora RC user access enabled');
|
||||
$userManagementTable->data['fields_ehorus_user_level_enabled'][1] = html_print_checkbox_switch(
|
||||
|
@ -791,55 +859,61 @@ $userManagementTable->data['fields_addSettings'][0] = html_print_textarea(
|
|||
5,
|
||||
65,
|
||||
$user_info['comments'],
|
||||
($view_mode ? 'readonly="readonly"' : ''),
|
||||
($view_mode) ? 'readonly="readonly"' : '',
|
||||
true,
|
||||
''
|
||||
);
|
||||
|
||||
$userManagementTable->data['captions_addSettings'][1] = __('Login allowed IP list');
|
||||
$userManagementTable->data['fields_addSettings'][1] = html_print_div(
|
||||
[
|
||||
'class' => 'edit_user_allowed_ip',
|
||||
'content' => html_print_textarea(
|
||||
'allowed_ip_list',
|
||||
5,
|
||||
65,
|
||||
($user_info['allowed_ip_list'] ?? ''),
|
||||
(((bool) $view_mode === true) ? 'readonly="readonly"' : ''),
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
if (users_is_admin($config['id_user']) === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$allowAllIpsContent = [];
|
||||
$allowAllIpsContent[] = '<span>'.__('Enable IP allowlist').'</span>';
|
||||
$allowAllIpsContent[] = html_print_div(
|
||||
[
|
||||
'content' => html_print_checkbox_switch(
|
||||
'allowed_ip_active',
|
||||
0,
|
||||
($user_info['allowed_ip_active'] ?? 0),
|
||||
true,
|
||||
false,
|
||||
'handleIpAllowlist(this)'
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$userManagementTable->data['fields_addSettings'][1] .= ui_print_input_placeholder(
|
||||
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'),
|
||||
true
|
||||
);
|
||||
$userManagementTable->data['captions_addSettings'][1] = html_print_div(
|
||||
[
|
||||
'class' => 'margin-top-10',
|
||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||
'content' => implode('', $allowAllIpsContent),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$allowAllIpsContent = [];
|
||||
$allowAllIpsContent[] = '<span>'.__('Allow all IPs').'</span>';
|
||||
$allowAllIpsContent[] = html_print_div(
|
||||
[
|
||||
'content' => html_print_checkbox_switch(
|
||||
'allowed_ip_active',
|
||||
0,
|
||||
($user_info['allowed_ip_active'] ?? 0),
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
||||
[
|
||||
'class' => 'margin-top-10',
|
||||
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
|
||||
'content' => implode('', $allowAllIpsContent),
|
||||
],
|
||||
true
|
||||
);
|
||||
$userManagementTable->data['fields_addSettings'][1] .= html_print_div(
|
||||
[
|
||||
'class' => 'edit_user_allowed_ip '.(((int) $user_info['allowed_ip_active'] === 1) ? '' : 'invisible'),
|
||||
'content' => html_print_textarea(
|
||||
'allowed_ip_list',
|
||||
5,
|
||||
65,
|
||||
($user_info['allowed_ip_list'] ?? ''),
|
||||
(((bool) $view_mode === true) ? 'readonly="readonly"' : ''),
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$userManagementTable->data['fields_addSettings'][1] .= ui_print_input_placeholder(
|
||||
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'),
|
||||
true,
|
||||
[
|
||||
'id' => 'info_allowed_ip',
|
||||
'class' => ((int) $user_info['allowed_ip_active'] === 1) ? 'input_sub_placeholder' : 'input_sub_placeholder invisible',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
if ($config['ITSM_enabled'] && $config['ITSM_user_level_conf']) {
|
||||
// Pandora ITSM user remote login.
|
||||
|
@ -945,15 +1019,7 @@ $(document).ready(function () {
|
|||
$('#advanced-line1_looknfeel-1 > a').css('display', 'block');
|
||||
})
|
||||
|
||||
var ehorus_user_level_enabled =
|
||||
<?php
|
||||
if (isset($user_info['ehorus_user_level_enabled']) === true) {
|
||||
echo $user_info['ehorus_user_level_enabled'];
|
||||
} else {
|
||||
echo 0;
|
||||
}
|
||||
?>
|
||||
;
|
||||
var ehorus_user_level_enabled = '<?php echo (isset($user_info['ehorus_user_level_enabled']) === true) ? $user_info['ehorus_user_level_enabled'] : 0; ?>';
|
||||
var chk_ehorus_user_level_enabled = ehorus_user_level_enabled;
|
||||
|
||||
if (ehorus_user_level_enabled == 0) {
|
||||
|
@ -985,4 +1051,14 @@ $(document).ready(function () {
|
|||
}
|
||||
})
|
||||
});
|
||||
|
||||
function handleIpAllowlist(e){
|
||||
if(e.checked === true) {
|
||||
$('.edit_user_allowed_ip').show();
|
||||
$('#info_allowed_ip').show();
|
||||
} else {
|
||||
$('.edit_user_allowed_ip').hide();
|
||||
$('#info_allowed_ip').hide();
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
|
||||
<title>Dark / 20 / alert@svg</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Dark-/-20-/-alert" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M10,20 C11.4190985,20 12.5702076,18.8808594 12.5702076,17.5 L7.42979244,17.5 C7.42979244,18.8808594 8.5809015,20 10,20 Z M18.6540098,14.1519531 C17.8777645,13.3410156 16.425318,12.1210937 16.425318,8.125 C16.425318,5.08984375 14.2364028,2.66015625 11.2849029,2.0640625 L11.2849029,1.25 C11.2849029,0.559765625 10.7095493,0 10,0 C9.29045075,0 8.71509711,0.559765625 8.71509711,1.25 L8.71509711,2.0640625 C5.76359722,2.66015625 3.57468198,5.08984375 3.57468198,8.125 C3.57468198,12.1210938 2.12223547,13.3410156 1.3459902,14.1519531 C1.10492023,14.4039062 0.998045886,14.7050781 1.00002702,15 C1.00447442,15.640625 1.52156948,16.25 2.28977909,16.25 L17.7102209,16.25 C18.4784305,16.25 18.9959274,15.640625 18.999973,15 C19.0019541,14.7050781 18.8950798,14.4035156 18.6540098,14.1519531 L18.6540098,14.1519531 Z" id="Shape" fill="#82b92e"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons/Dark/20/desacoplar-ventana</title>
|
||||
<g id="Icons/Dark/20/desacoplar-ventana" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Back" transform="translate(3, 1)">
|
||||
<rect id="Rectangle-2" stroke="#3F3F3F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" x="0" y="0" width="20" height="16" rx="1"></rect>
|
||||
<path d="M3,4 C3.55228475,4 4,3.55228475 4,3 C4,2.44771525 3.55228475,2 3,2 C2.44771525,2 2,2.44771525 2,3 C2,3.55228475 2.44771525,4 3,4 Z M6,4 C6.55228475,4 7,3.55228475 7,3 C7,2.44771525 6.55228475,2 6,2 C5.44771525,2 5,2.44771525 5,3 C5,3.55228475 5.44771525,4 6,4 Z M9,4 C9.55228475,4 10,3.55228475 10,3 C10,2.44771525 9.55228475,2 9,2 C8.44771525,2 8,2.44771525 8,3 C8,3.55228475 8.44771525,4 9,4 Z" id="Oval-2" fill="#3F3F3F"></path>
|
||||
</g>
|
||||
<g id="Front" transform="translate(0, 8)">
|
||||
<rect id="Rectangle-2" fill="#3F3F3F" x="0" y="0" width="20" height="16" rx="1"></rect>
|
||||
<path d="M3,4 C3.55228475,4 4,3.55228475 4,3 C4,2.44771525 3.55228475,2 3,2 C2.44771525,2 2,2.44771525 2,3 C2,3.55228475 2.44771525,4 3,4 Z M6,4 C6.55228475,4 7,3.55228475 7,3 C7,2.44771525 6.55228475,2 6,2 C5.44771525,2 5,2.44771525 5,3 C5,3.55228475 5.44771525,4 6,4 Z M9,4 C9.55228475,4 10,3.55228475 10,3 C10,2.44771525 9.55228475,2 9,2 C8.44771525,2 8,2.44771525 8,3 C8,3.55228475 8.44771525,4 9,4 Z" id="Oval-2" fill="#FFFFFF"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.6 KiB |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons/Dark/20/minimizar</title>
|
||||
<g id="Icons/Dark/20/minimizar" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<rect id="Rectangle" fill="#3F3F3F" x="2" y="18" width="20" height="4" rx="2"></rect>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 436 B |
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Vulnerability scanner@svg</title>
|
||||
<g id="Vulnerability-scanner" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M1,15 C1.55228475,15 2,15.4477153 2,16 L2,18 L4,18 C4.55228475,18 5,18.4477153 5,19 C5,19.5522847 4.55228475,20 4,20 L1,20 C0.44771525,20 0,19.5522847 0,19 L2.22044605e-16,16 C2.22044605e-16,15.4477153 0.44771525,15 1,15 Z M19,15 C19.5522847,15 20,15.4477153 20,16 L20,19 C20,19.5522847 19.5522847,20 19,20 L16,20 C15.4477153,20 15,19.5522847 15,19 C15,18.4477153 15.4477153,18 16,18 L18,18 L18,16 C18,15.4477153 18.4477153,15 19,15 Z M10,3.054 L10.2249383,3.05813847 C13.4344251,3.17642824 16,5.81560306 16,9.054 L16,14.0937431 L13.104,16.031 L12.0698805,13.7307161 L14.2125487,13.4284958 C14.556044,13.3800462 14.7107272,12.9297411 14.4915053,12.6217094 L10.3337249,6.72755475 C10.2297804,6.58020088 10.0683722,6.50924823 9.91239579,6.53116927 C9.62831588,6.5712384 9.45479699,6.90055719 9.56613598,7.20888317 L10.9914706,11.1541491 L8.78753031,11.4650118 C8.51830424,11.5029857 8.34782116,11.7998997 8.42525378,12.0959539 L9.92,18.054 L4,14.0937431 L4,9.054 C4,5.81560306 6.56557489,3.17642824 9.77506174,3.05813847 L10,3.054 Z M4,0 C4.55228475,-1.01453063e-16 5,0.44771525 5,1 C5,1.55228475 4.55228475,2 4,2 L2,2 L2,4 C2,4.55228475 1.55228475,5 1,5 C0.44771525,5 2.22044605e-16,4.55228475 2.22044605e-16,4 L0,1 C0,0.44771525 0.44771525,1.01453063e-16 1,0 L4,0 Z M19,0 C19.5522847,1.01453063e-16 20,0.44771525 20,1 L20,4 C20,4.55228475 19.5522847,5 19,5 C18.4477153,5 18,4.55228475 18,4 L18,2 L16,2 C15.4477153,2 15,1.55228475 15,1 C15,0.44771525 15.4477153,-1.01453063e-16 16,0 Z" id="Scan" fill="#3F3F3F" transform="translate(10, 10) scale(1, -1) translate(-10, -10)"></path>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1,235 @@
|
|||
<?php
|
||||
/**
|
||||
* Update manager client historical updates backend.
|
||||
*
|
||||
* @category Update Manager
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 Pandora FMS
|
||||
* Please see https://pandorafms.com/community/ for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation for version 2.
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
$method = get_parameter('method', null);
|
||||
$filter = get_parameter('filter', '');
|
||||
$urlDashboard = get_parameter('urlDashboard', '');
|
||||
$manageDashboards = get_parameter('manageDashboards', 1);
|
||||
|
||||
if ($method === 'draw') {
|
||||
// Datatables offset, limit and order.
|
||||
$filter = get_parameter('filter', []);
|
||||
$start = get_parameter('start', 0);
|
||||
$length = get_parameter('length', $config['block_size']);
|
||||
$orderBy = get_datatable_order(true);
|
||||
|
||||
$sort_field = $orderBy['field'];
|
||||
$order = $orderBy['direction'];
|
||||
|
||||
$pagination = '';
|
||||
$pagination = sprintf(
|
||||
' LIMIT %d OFFSET %d ',
|
||||
$length,
|
||||
$start,
|
||||
);
|
||||
|
||||
try {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->headstyle['name'] = 'text-align: left;';
|
||||
$table->headstyle['cells'] = 'text-align: center;';
|
||||
$table->headstyle['groups'] = 'text-align: center;';
|
||||
$table->headstyle['favorite'] = 'text-align: center;';
|
||||
$table->headstyle['full_screen'] = 'text-align: center;';
|
||||
|
||||
$table->style = [];
|
||||
$table->style['name'] = 'text-align: left;';
|
||||
$table->style['cells'] = 'text-align: center;';
|
||||
$table->style['groups'] = 'text-align: center;';
|
||||
$table->style['favorite'] = 'text-align: center;';
|
||||
$table->style['full_screen'] = 'text-align: center;';
|
||||
|
||||
$table->size = [];
|
||||
$table->size['name'] = '40%';
|
||||
$table->size['full_screen'] = '30px';
|
||||
|
||||
$table->head = [];
|
||||
$table->head['name'] = __('Name');
|
||||
$table->head['cells'] = __('Cells');
|
||||
$table->head['groups'] = __('Group');
|
||||
$table->head['favorite'] = __('Favorite');
|
||||
$table->head['full_screen'] = __('Full screen');
|
||||
|
||||
if ($manageDashboards === 1) {
|
||||
$table->head['copy'] = __('Copy');
|
||||
$table->head['delete'] = __('Delete');
|
||||
$table->headstyle['copy'] = 'text-align: center;';
|
||||
$table->headstyle['delete'] = 'text-align: center;';
|
||||
$table->style['copy'] = 'text-align: center;';
|
||||
$table->style['delete'] = 'text-align: center;';
|
||||
$table->size['cells'] = '30px';
|
||||
$table->size['groups'] = '30px';
|
||||
$table->size['favorite'] = '30px';
|
||||
$table->size['copy'] = '30px';
|
||||
$table->size['delete'] = '30px';
|
||||
} else {
|
||||
$table->size['cells'] = '60px';
|
||||
$table->size['groups'] = '60px';
|
||||
$table->size['favorite'] = '60px';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$where_name = '';
|
||||
if (strlen($filter['free_search']) > 0) {
|
||||
$where_name = 'name LIKE "%'.$filter['free_search'].'%"';
|
||||
}
|
||||
|
||||
$where_group = '';
|
||||
if (empty($filter['group']) === false && $filter['group'] !== '0') {
|
||||
$where_group = sprintf('id_group = %s', $filter['group']);
|
||||
if (empty($where_name) === false) {
|
||||
$where_group = 'AND '.$where_group;
|
||||
}
|
||||
}
|
||||
|
||||
$where = '';
|
||||
if (empty($where_name) === false || empty($where_group) === false) {
|
||||
$where = sprintf(
|
||||
'WHERE %s %s',
|
||||
$where_name,
|
||||
$where_group
|
||||
);
|
||||
}
|
||||
|
||||
$sql = 'SELECT * FROM tdashboard '.$where.' ORDER BY id '.$pagination;
|
||||
$dashboards = db_get_all_rows_sql($sql);
|
||||
$count = db_get_value_sql('SELECT COUNT(*) FROM tdashboard '.$where);
|
||||
foreach ($dashboards as $dashboard) {
|
||||
$data = [];
|
||||
|
||||
$dataQuery = ['dashboardId' => $dashboard['id']];
|
||||
|
||||
$url = $urlDashboard.'&'.http_build_query($dataQuery);
|
||||
$data['name'] = '<a href="'.$url.'">';
|
||||
$data['name'] .= $dashboard['name'];
|
||||
$data['name'] .= '</a>';
|
||||
|
||||
$data['cells'] = $dashboard['cells'];
|
||||
|
||||
if (empty($dashboard['id_user']) === false) {
|
||||
$data['groups'] = __(
|
||||
'Private for (%s)',
|
||||
$dashboard['id_user']
|
||||
);
|
||||
} else {
|
||||
$data['groups'] = ui_print_group_icon(
|
||||
$dashboard['id_group'],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$data['favorite'] = $dashboard['active'];
|
||||
|
||||
$dataQueryFull = [
|
||||
'dashboardId' => $dashboard['id'],
|
||||
'pure' => 1,
|
||||
];
|
||||
|
||||
$urlFull = $urlDashboard;
|
||||
$urlFull .= '&'.\http_build_query($dataQueryFull);
|
||||
$data['full_screen'] = '<a href="'.$urlFull.'">';
|
||||
$data['full_screen'] .= \html_print_image(
|
||||
'images/fullscreen@svg.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
);
|
||||
$data['full_screen'] .= '</a>';
|
||||
|
||||
if ($manageDashboards === 1) {
|
||||
$data['copy'] = '';
|
||||
$data['delete'] = '';
|
||||
}
|
||||
|
||||
if (check_acl_restricted_all($config['id_user'], $dashboard['id_group'], 'RM')) {
|
||||
$dataQueryCopy = [
|
||||
'dashboardId' => $dashboard['id'],
|
||||
'copyDashboard' => 1,
|
||||
];
|
||||
$urlCopy = $urlDashboard.'&'.\http_build_query($dataQueryCopy);
|
||||
$data['copy'] = '<a href="'.$urlCopy.'">';
|
||||
$data['copy'] .= html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']);
|
||||
$data['copy'] .= '</a>';
|
||||
|
||||
$dataQueryDelete = [
|
||||
'dashboardId' => $dashboard['id'],
|
||||
'deleteDashboard' => 1,
|
||||
];
|
||||
$urlDelete = $urlDashboard;
|
||||
$urlDelete .= '&'.\http_build_query($dataQueryDelete);
|
||||
$data['delete'] = '<a href="'.$urlDelete;
|
||||
$data['delete'] .= '" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||
$data['delete'] .= \html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
);
|
||||
$data['delete'] .= '</a>';
|
||||
}
|
||||
|
||||
$table->cellclass[] = [
|
||||
'full_screen' => 'table_action_buttons',
|
||||
'copy' => 'table_action_buttons',
|
||||
'delete' => 'table_action_buttons',
|
||||
];
|
||||
|
||||
$table->data[] = $data;
|
||||
}
|
||||
|
||||
// Datatables format: RecordsTotal && recordsfiltered.
|
||||
echo json_encode(
|
||||
[
|
||||
'data' => $table->data,
|
||||
'recordsTotal' => $count,
|
||||
'recordsFiltered' => $count,
|
||||
]
|
||||
);
|
||||
// Capture output.
|
||||
$response = ob_get_clean();
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['error' => $e->getMessage()]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// If not valid, show error with issue.
|
||||
json_decode($response);
|
||||
if (json_last_error() == JSON_ERROR_NONE) {
|
||||
// If valid dump.
|
||||
echo $response;
|
||||
} else {
|
||||
echo json_encode(
|
||||
['error' => $response]
|
||||
);
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
|
@ -92,6 +92,9 @@ $get_id_source_event = get_parameter('get_id_source_event');
|
|||
$node_id = (int) get_parameter('node_id', 0);
|
||||
$settings_modal = get_parameter('settings', 0);
|
||||
$parameters_modal = get_parameter('parameters', 0);
|
||||
$update_event_custom_id = get_parameter('update_event_custom_id', 0);
|
||||
$draw_events_graph = get_parameter('drawEventsGraph', false);
|
||||
|
||||
// User private filter.
|
||||
$current_filter = get_parameter('current_filter', 0);
|
||||
$private_filter_event = get_parameter('private_filter_event', 0);
|
||||
|
@ -2065,14 +2068,6 @@ if ($table_events) {
|
|||
// (propagate ACL funct!).
|
||||
$groups = users_get_groups($config['id_user']);
|
||||
|
||||
$tags_condition = tags_get_acl_tags(
|
||||
$config['id_user'],
|
||||
array_keys($groups),
|
||||
'ER',
|
||||
'event_condition',
|
||||
'AND'
|
||||
);
|
||||
|
||||
$tableEvents24h = new stdClass();
|
||||
$tableEvents24h->class = 'filter_table';
|
||||
$tableEvents24h->styleTable = 'border: 0;padding: 0;margin: 0 0 10px;';
|
||||
|
@ -2107,7 +2102,7 @@ if ($table_events) {
|
|||
);
|
||||
} else {
|
||||
events_print_event_table(
|
||||
'estado <> 1 '.$tags_condition,
|
||||
'estado <> 1',
|
||||
200,
|
||||
'100%',
|
||||
false,
|
||||
|
@ -2650,6 +2645,8 @@ if ($get_events_fired) {
|
|||
$filter['date_to'] = date('Y-m-d', $end);
|
||||
$filter['time_from'] = date('H:i:s', $start);
|
||||
$filter['time_to'] = date('H:i:s', $end);
|
||||
$filter['severity'] = explode(',', $filter['severity']);
|
||||
|
||||
$data = events_get_all(
|
||||
['te.*'],
|
||||
$filter
|
||||
|
@ -2759,3 +2756,56 @@ if ($draw_row_response_info === true) {
|
|||
echo $output;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($update_event_custom_id) {
|
||||
$event_custom_id = get_parameter('event_custom_id');
|
||||
$event_id = get_parameter('event_id');
|
||||
$server_id = 0;
|
||||
if (is_metaconsole() === true) {
|
||||
$server_id = (int) get_parameter('server_id');
|
||||
}
|
||||
|
||||
// Safe custom fields for hacks.
|
||||
if (preg_match('/script/i', io_safe_output($event_custom_id))) {
|
||||
$return = false;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node = new Node($server_id);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$return = events_event_custom_id(
|
||||
$event_id,
|
||||
$event_custom_id
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$return = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $server_id > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo ($return === true) ? 'update_ok' : 'update_error';
|
||||
return;
|
||||
}
|
||||
|
||||
if ((bool) $draw_events_graph === true) {
|
||||
$filter = get_parameter('filter');
|
||||
$output = event_print_graph($filter);
|
||||
echo $output;
|
||||
return;
|
||||
}
|
|
@ -35,6 +35,7 @@ if (check_login()) {
|
|||
include_once $config['homedir'].'/include/functions_agents.php';
|
||||
include_once $config['homedir'].'/include/functions_modules.php';
|
||||
include_once $config['homedir'].'/include/functions_ui.php';
|
||||
include_once $config['homedir'].'/include/functions_macros.php';
|
||||
enterprise_include_once('include/functions_metaconsole.php');
|
||||
|
||||
$get_plugin_macros = get_parameter('get_plugin_macros');
|
||||
|
@ -1168,7 +1169,9 @@ if (check_login()) {
|
|||
);
|
||||
}
|
||||
|
||||
$data[2] .= '<a href ="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&id_agent_module='.$module['id_agente_modulo'].'&edit_module='.$module['id_modulo'].'">';
|
||||
$data[2] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '…', 'font-size: 9pt;');
|
||||
$data[2] .= '</a>';
|
||||
if (empty($module['extended_info']) === false) {
|
||||
$data[2] .= ui_print_help_tip($module['extended_info'], true, '/images/default_list.png');
|
||||
}
|
||||
|
@ -1204,7 +1207,23 @@ if (check_login()) {
|
|||
);
|
||||
|
||||
if (strlen($module['ip_target']) !== 0) {
|
||||
$title .= '<br/>IP: '.$module['ip_target'];
|
||||
// Check if value is custom field.
|
||||
if ($module['ip_target'][0] == '_' && $module['ip_target'][(strlen($module['ip_target']) - 1)] == '_') {
|
||||
$custom_field_name = substr($module['ip_target'], 1, -1);
|
||||
$custom_value = agents_get_agent_custom_field($id_agente, $custom_field_name);
|
||||
if (isset($custom_value) && $custom_value !== false) {
|
||||
$title .= '<br/>IP: '.$custom_value;
|
||||
} else {
|
||||
$array_macros = return_agent_macros($id_agente);
|
||||
if (isset($array_macros[$module['ip_target']])) {
|
||||
$title .= '<br/>IP: '.$array_macros[$module['ip_target']];
|
||||
} else {
|
||||
$title .= '<br/>IP: '.$module['ip_target'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$title .= '<br/>IP: '.$module['ip_target'];
|
||||
}
|
||||
}
|
||||
|
||||
$last_status_change_text = __('Time elapsed since last status change: ');
|
||||
|
@ -1361,10 +1380,12 @@ if (check_login()) {
|
|||
$additionalLinkAction = '&flag=1';
|
||||
$linkCaption = __('Force checks');
|
||||
$imgaction = 'images/force@svg.svg';
|
||||
$visibility = '';
|
||||
} else {
|
||||
$additionalLinkAction = '';
|
||||
$linkCaption = __('Refresh');
|
||||
$imgaction = 'images/go-back@svg.svg';
|
||||
$visibility = 'visibility: initial;';
|
||||
}
|
||||
|
||||
$moduleActionButtons[] = html_print_anchor(
|
||||
|
@ -1376,6 +1397,7 @@ if (check_login()) {
|
|||
[
|
||||
'title' => __('Force remote check'),
|
||||
'class' => 'main_menu_icon forced_title',
|
||||
'style' => $visibility,
|
||||
]
|
||||
),
|
||||
],
|
||||
|
|
|
@ -38,6 +38,10 @@ if ($change_label === '1') {
|
|||
$source = get_parameter('source', 0);
|
||||
$user = get_parameter('user', '');
|
||||
$value = get_parameter('value', 0) ? 1 : 0;
|
||||
$user_info = get_user_info($config['id_user']);
|
||||
if ((bool) $user_info['is_admin'] === false && $config['id_user'] !== $user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Update the label value.
|
||||
ob_clean();
|
||||
|
|
|
@ -59,6 +59,7 @@ if (is_ajax() === true) {
|
|||
$metaID = (int) get_parameter('metaID', 0);
|
||||
$childrenMethod = get_parameter('childrenMethod', 'on_demand');
|
||||
|
||||
|
||||
$default_filters = [
|
||||
'searchAgent' => '',
|
||||
'statusAgent' => AGENT_STATUS_ALL,
|
||||
|
@ -69,6 +70,7 @@ if (is_ajax() === true) {
|
|||
];
|
||||
$filter = get_parameter('filter', $default_filters);
|
||||
|
||||
|
||||
$agent_a = check_acl($config['id_user'], 0, 'AR');
|
||||
$agent_w = check_acl($config['id_user'], 0, 'AW');
|
||||
$access = ($agent_a === true) ? 'AR' : (($agent_w === true) ? 'AW' : 'AR');
|
||||
|
|
|
@ -70,8 +70,7 @@ $otherSerialize = get_parameter('other');
|
|||
$otherMode = get_parameter('other_mode', 'url_encode');
|
||||
$returnType = get_parameter('return_type', 'string');
|
||||
$info = get_parameter('info', '');
|
||||
$raw_decode = (bool) get_parameter('raw_decode', false);
|
||||
|
||||
$raw_decode = (bool) get_parameter('raw_decode', true);
|
||||
$other = parseOtherParameter($otherSerialize, $otherMode, $raw_decode);
|
||||
$apiPassword = io_output_password(
|
||||
db_get_value_filter(
|
||||
|
|
|
@ -829,17 +829,47 @@ class AgentWizard extends HTML
|
|||
];
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
$this->actionLabel,
|
||||
'sub-protocol',
|
||||
$create_modules_button = '';
|
||||
if ($this->actionType === 'snmp' && $this->version !== null && $this->message['type'][0] !== 'error') {
|
||||
$create_modules_button = html_print_submit_button(
|
||||
__('Create modules'),
|
||||
'create-modules-action',
|
||||
false,
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'onclick' => '$("#form-main-wizard").submit();',
|
||||
'icon' => 'next',
|
||||
'onclick' => 'processListModules()',
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
} else if ($this->actionType === 'wmi' && $this->protocol === 'wmi' && $this->message['type'][0] !== 'error') {
|
||||
$create_modules_button = html_print_submit_button(
|
||||
__('Create modules'),
|
||||
'create-modules-action',
|
||||
false,
|
||||
[
|
||||
'icon' => 'next',
|
||||
'onclick' => 'processListModules()',
|
||||
],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$create_modules_button = '';
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
[
|
||||
html_print_submit_button(
|
||||
$this->actionLabel,
|
||||
'sub-protocol',
|
||||
false,
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'onclick' => '$("#form-main-wizard").submit();',
|
||||
],
|
||||
true
|
||||
),
|
||||
$create_modules_button,
|
||||
]
|
||||
);
|
||||
|
||||
// Prints main form.
|
||||
|
@ -3765,7 +3795,10 @@ class AgentWizard extends HTML
|
|||
'label' => __('Create modules'),
|
||||
'name' => 'create-modules-action',
|
||||
'type' => 'button',
|
||||
'attributes' => [ 'icon' => 'next' ],
|
||||
'attributes' => [
|
||||
'icon' => 'next',
|
||||
'style' => 'display: none;',
|
||||
],
|
||||
'script' => 'processListModules();',
|
||||
'return' => true,
|
||||
],
|
||||
|
|
|
@ -457,9 +457,7 @@ class AgentsAlerts extends HTML
|
|||
$template2 = get_parameter('template');
|
||||
$module_action_threshold = get_parameter('module_action_threshold');
|
||||
$action_select = get_parameter('action_select', 0);
|
||||
|
||||
$id_alert = alerts_create_alert_agent_module($this->create_alert, $template2);
|
||||
|
||||
$id_alert = alerts_create_alert_agent_module($this->createAlert, $template2);
|
||||
if ($id_alert !== false) {
|
||||
if ($action_select != 0) {
|
||||
$values = [];
|
||||
|
|
|
@ -269,13 +269,6 @@ class ConsoleSupervisor
|
|||
$this->checkSyncQueueStatus();
|
||||
}
|
||||
|
||||
/*
|
||||
* Check number of agents is equals and more than 200.
|
||||
* NOTIF.ACCESSSTASTICS.PERFORMANCE
|
||||
*/
|
||||
|
||||
$this->checkAccessStatisticsPerformance();
|
||||
|
||||
/*
|
||||
* Checkc agent missing libraries.
|
||||
* NOTIF.AGENT.LIBRARY
|
||||
|
@ -573,13 +566,6 @@ class ConsoleSupervisor
|
|||
$this->checkSyncQueueStatus();
|
||||
}
|
||||
|
||||
/*
|
||||
* Check number of agents is equals and more than 200.
|
||||
* NOTIF.ACCESSSTASTICS.PERFORMANCE
|
||||
*/
|
||||
|
||||
$this->checkAccessStatisticsPerformance();
|
||||
|
||||
/*
|
||||
* Checkc agent missing libraries.
|
||||
* NOTIF.AGENT.LIBRARY
|
||||
|
@ -732,6 +718,8 @@ class ConsoleSupervisor
|
|||
'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
|
||||
}
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE');
|
||||
|
@ -2390,17 +2378,19 @@ class ConsoleSupervisor
|
|||
include_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
$login = get_parameter('login', false);
|
||||
|
||||
if (update_manager_verify_registration() === false) {
|
||||
$this->notify(
|
||||
[
|
||||
'type' => 'NOTIF.UPDATEMANAGER.REGISTRATION',
|
||||
'title' => __('This instance is not registered in the Update manager section'),
|
||||
'message' => __('Click here to start the registration process'),
|
||||
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.UPDATEMANAGER.REGISTRATION');
|
||||
if ($config['autoupdate'] === '1' || $_GET['sec2'] === 'godmode/update_manager/update_manager') {
|
||||
if (update_manager_verify_registration() === false) {
|
||||
$this->notify(
|
||||
[
|
||||
'type' => 'NOTIF.UPDATEMANAGER.REGISTRATION',
|
||||
'title' => __('This instance is not registered in the Update manager section'),
|
||||
'message' => __('Click here to start the registration process'),
|
||||
'url' => '__url__/index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=online',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$this->cleanNotifications('NOTIF.UPDATEMANAGER.REGISTRATION');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2414,13 +2404,17 @@ class ConsoleSupervisor
|
|||
{
|
||||
global $config;
|
||||
include_once $config['homedir'].'/include/functions_update_manager.php';
|
||||
|
||||
$server_name = db_get_value_filter(
|
||||
'name',
|
||||
'tserver',
|
||||
[ 'server_type' => '1' ]
|
||||
);
|
||||
if (update_manager_verify_api() === false) {
|
||||
$this->notify(
|
||||
[
|
||||
'type' => 'NOTIF.API.ACCESS',
|
||||
'title' => __('Cannot access the Pandora FMS API '),
|
||||
'message' => __('Please check the configuration, some components may fail due to this misconfiguration.'),
|
||||
'message' => __('Please check the configuration, some components may fail due to this misconfiguration in '.$server_name.' ('.$config['public_url'].')'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -580,9 +580,6 @@ class Diagnostics extends Wizard
|
|||
$countModuleData = db_get_value_sql(
|
||||
'SELECT COUNT(*) FROM tagente_datos'
|
||||
);
|
||||
$countAgentAccess = db_get_value_sql(
|
||||
'SELECT COUNT(*) FROM tagent_access'
|
||||
);
|
||||
$countEvents = db_get_value_sql('SELECT COUNT(*) FROM tevento');
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
|
@ -595,39 +592,35 @@ class Diagnostics extends Wizard
|
|||
$result = [
|
||||
'error' => false,
|
||||
'data' => [
|
||||
'countAgents' => [
|
||||
'countAgents' => [
|
||||
'name' => __('Total agents'),
|
||||
'value' => $countAgents,
|
||||
],
|
||||
'countModules' => [
|
||||
'countModules' => [
|
||||
'name' => __('Total modules'),
|
||||
'value' => $countModules,
|
||||
],
|
||||
'countGroups' => [
|
||||
'countGroups' => [
|
||||
'name' => __('Total groups'),
|
||||
'value' => $countGroups,
|
||||
],
|
||||
'countModuleData' => [
|
||||
'countModuleData' => [
|
||||
'name' => __('Total module data records'),
|
||||
'value' => $countModuleData,
|
||||
],
|
||||
'countAgentAccess' => [
|
||||
'name' => __('Total agent access record'),
|
||||
'value' => $countAgentAccess,
|
||||
],
|
||||
'countEvents' => [
|
||||
'countEvents' => [
|
||||
'name' => __('Total events'),
|
||||
'value' => $countEvents,
|
||||
],
|
||||
'countTraps' => [
|
||||
'countTraps' => [
|
||||
'name' => __('Total traps'),
|
||||
'value' => $countTraps,
|
||||
],
|
||||
'countUsers' => [
|
||||
'countUsers' => [
|
||||
'name' => __('Total users'),
|
||||
'value' => $countUsers,
|
||||
],
|
||||
'countSessions' => [
|
||||
'countSessions' => [
|
||||
'name' => __('Total sessions'),
|
||||
'value' => $countSessions,
|
||||
],
|
||||
|
@ -744,7 +737,7 @@ class Diagnostics extends Wizard
|
|||
$cpuModelName = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"';
|
||||
$cpuProcessor = 'cat /proc/cpuinfo | grep "processor" | wc -l';
|
||||
$ramMemTotal = 'cat /proc/meminfo | grep "MemTotal"';
|
||||
|
||||
$distroInfo = 'cat /etc/os-release | grep "PRETTY_NAME" | cut -f 2 -d "="';
|
||||
exec(
|
||||
"ifconfig | awk '{ print $2}' | grep -E -o '([0-9]{1,3}[\.]){3}[0-9]{1,3}'",
|
||||
$output
|
||||
|
@ -763,6 +756,10 @@ class Diagnostics extends Wizard
|
|||
'name' => __('RAM'),
|
||||
'value' => exec($ramMemTotal),
|
||||
],
|
||||
'distroInfo' => [
|
||||
'name' => __('Distro'),
|
||||
'value' => str_replace('"', '', exec($distroInfo)),
|
||||
],
|
||||
'osInfo' => [
|
||||
'name' => __('Os'),
|
||||
'value' => exec('uname -a'),
|
||||
|
|
|
@ -47,6 +47,7 @@ class TipsWindow
|
|||
'renderPreview',
|
||||
'setShowTipsAtStartup',
|
||||
'getTips',
|
||||
'getTipById',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -221,8 +222,13 @@ class TipsWindow
|
|||
*
|
||||
* @return array $tip
|
||||
*/
|
||||
public function getTipById($idTip)
|
||||
public function getTipById($idTip=false, $return=false)
|
||||
{
|
||||
if ($idTip === false) {
|
||||
$idTip = get_parameter('idTip');
|
||||
}
|
||||
|
||||
$return = get_parameter('return', false);
|
||||
$tip = db_get_row(
|
||||
'twelcome_tip',
|
||||
'id',
|
||||
|
@ -232,9 +238,20 @@ class TipsWindow
|
|||
$tip['title'] = io_safe_output($tip['title']);
|
||||
$tip['text'] = io_safe_output($tip['text']);
|
||||
$tip['url'] = io_safe_output($tip['url']);
|
||||
$tip['files'] = $this->getFilesFromTip($tip['id']);
|
||||
}
|
||||
|
||||
return $tip;
|
||||
if ($return !== false) {
|
||||
if (empty($tip) === false) {
|
||||
echo json_encode(['success' => true, 'data' => $tip]);
|
||||
return;
|
||||
} else {
|
||||
echo json_encode(['success' => false]);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return $tip;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -106,20 +106,24 @@ class TreeGroupEdition extends TreeGroup
|
|||
}
|
||||
|
||||
// Build the group hierarchy.
|
||||
foreach ($groups as $id => $group) {
|
||||
if (isset($groups[$id]['parent']) === true
|
||||
&& ($groups[$id]['parent'] != 0)
|
||||
) {
|
||||
$parent = $groups[$id]['parent'];
|
||||
// Parent exists.
|
||||
if (isset($groups[$parent]['children']) === false) {
|
||||
$groups[$parent]['children'] = [];
|
||||
}
|
||||
if (isset($this->filter['show_full_hirearchy']) === false
|
||||
|| (isset($this->filter['show_full_hirearchy']) === true && (bool) $this->filter['show_full_hirearchy'] === true)
|
||||
) {
|
||||
foreach ($groups as $id => $group) {
|
||||
if (isset($groups[$id]['parent']) === true
|
||||
&& ($groups[$id]['parent'] != 0)
|
||||
) {
|
||||
$parent = $groups[$id]['parent'];
|
||||
// Parent exists.
|
||||
if (isset($groups[$parent]['children']) === false) {
|
||||
$groups[$parent]['children'] = [];
|
||||
}
|
||||
|
||||
// Store a reference to the group into the parent.
|
||||
$groups[$parent]['children'][] = &$groups[$id];
|
||||
// This group was introduced into a parent.
|
||||
$groups[$id]['have_parent'] = true;
|
||||
// Store a reference to the group into the parent.
|
||||
$groups[$parent]['children'][] = &$groups[$id];
|
||||
// This group was introduced into a parent.
|
||||
$groups[$id]['have_parent'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,24 +171,112 @@ class TreeGroupEdition extends TreeGroup
|
|||
];
|
||||
|
||||
$group_acl = '';
|
||||
if (users_can_manage_group_all('AR') === false) {
|
||||
$user_groups_str = implode(',', $this->userGroupsArray);
|
||||
$group_acl = sprintf(
|
||||
'AND id_grupo IN (%s)',
|
||||
$user_groups_str
|
||||
$search_agent = '';
|
||||
$status_agent = '';
|
||||
$inner_agent = '';
|
||||
|
||||
if ((bool) is_metaconsole() === true) {
|
||||
if (users_can_manage_group_all('AR') === false) {
|
||||
$user_groups_str = implode(',', $this->userGroupsArray);
|
||||
$group_acl = sprintf(
|
||||
' AND tgrupo.id_grupo IN (%s) ',
|
||||
$user_groups_str
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($this->filter['searchAgent']) === true && empty($this->filter['searchAgent']) === false
|
||||
|| isset($this->filter['statusAgent']) === true && strlen($this->filter['statusAgent']) > 0
|
||||
) {
|
||||
$inner_agent = 'INNER JOIN tmetaconsole_agent ON tgrupo.id_grupo = tmetaconsole_agent.id_grupo';
|
||||
}
|
||||
|
||||
if (isset($this->filter['searchAgent']) === true && empty($this->filter['searchAgent']) === false) {
|
||||
$search_agent = ' AND tmetaconsole_agent.alias LIKE "%'.$this->filter['searchAgent'].'%" ';
|
||||
}
|
||||
|
||||
if (isset($this->filter['statusAgent']) === true && strlen($this->filter['statusAgent']) > 0) {
|
||||
switch ($this->filter['statusAgent']) {
|
||||
case AGENT_STATUS_NORMAL:
|
||||
$status_agent = ' AND (
|
||||
tmetaconsole_agent.critical_count = 0
|
||||
AND tmetaconsole_agent.warning_count = 0
|
||||
AND tmetaconsole_agent.unknown_count = 0
|
||||
AND tmetaconsole_agent.normal_count > 0)';
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_WARNING:
|
||||
$status_agent = ' AND (
|
||||
tmetaconsole_agent.critical_count = 0
|
||||
AND tmetaconsole_agent.warning_count > 0
|
||||
AND tmetaconsole_agent.total_count > 0)';
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_CRITICAL:
|
||||
$status_agent = ' AND tmetaconsole_agent.critical_count > 0';
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_UNKNOWN:
|
||||
$status_agent = ' AND (
|
||||
tmetaconsole_agent.critical_count = 0
|
||||
AND tmetaconsole_agent.warning_count = 0
|
||||
AND tmetaconsole_agent.unknown_count > 0)';
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_NOT_NORMAL:
|
||||
$status_agent = ' AND (
|
||||
tmetaconsole_agent.normal_count <> total_count
|
||||
OR tmetaconsole_agent.total_count = notinit_count)';
|
||||
break;
|
||||
|
||||
case AGENT_STATUS_NOT_INIT:
|
||||
$status_agent = ' AND (
|
||||
tmetaconsole_agent.total_count = 0
|
||||
OR tmetaconsole_agent.total_count = notinit_count)';
|
||||
break;
|
||||
|
||||
default:
|
||||
// Nothing to do.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'SELECT tgrupo.id_grupo AS gid,
|
||||
tgrupo.nombre as name,
|
||||
tgrupo.parent,
|
||||
tgrupo.icon
|
||||
FROM tgrupo
|
||||
%s
|
||||
WHERE 1=1
|
||||
%s
|
||||
%s
|
||||
%s ',
|
||||
$inner_agent,
|
||||
$search_agent,
|
||||
$status_agent,
|
||||
$group_acl
|
||||
);
|
||||
} else {
|
||||
if (users_can_manage_group_all('AR') === false) {
|
||||
$user_groups_str = implode(',', $this->userGroupsArray);
|
||||
$group_acl = sprintf(
|
||||
'AND id_grupo IN (%s)',
|
||||
$user_groups_str
|
||||
);
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'SELECT id_grupo AS gid,
|
||||
nombre as name,
|
||||
parent,
|
||||
icon
|
||||
FROM tgrupo
|
||||
WHERE 1=1
|
||||
%s ',
|
||||
$group_acl
|
||||
);
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'SELECT id_grupo AS gid,
|
||||
nombre as name,
|
||||
parent,
|
||||
icon
|
||||
FROM tgrupo
|
||||
WHERE 1=1 %s',
|
||||
$group_acl
|
||||
);
|
||||
|
||||
$stats = db_get_all_rows_sql($sql);
|
||||
$group_stats = [];
|
||||
foreach ($stats as $group) {
|
||||
|
|
|
@ -372,7 +372,7 @@ class WelcomeWindow extends Wizard
|
|||
$flag_um = true;
|
||||
}
|
||||
|
||||
if (empty($config['welcome_mail_configured']) === false) {
|
||||
if (empty($config['email_username']) === false && empty($config['email_password']) === false) {
|
||||
$btn_configure_mail_class = '';
|
||||
$li_configure_mail_class = 'row_green';
|
||||
$flag_cm = true;
|
||||
|
@ -702,7 +702,7 @@ class WelcomeWindow extends Wizard
|
|||
<?php
|
||||
echo html_print_input_hidden('check_connectivity', 1);
|
||||
echo html_print_label_input_block(
|
||||
__('Ip target'),
|
||||
__('IP address target'),
|
||||
html_print_input_text(
|
||||
'ip_target',
|
||||
'',
|
||||
|
@ -717,7 +717,7 @@ class WelcomeWindow extends Wizard
|
|||
)
|
||||
);
|
||||
echo html_print_label_input_block(
|
||||
__('Agent name'),
|
||||
__('Agent alias'),
|
||||
html_print_input_text(
|
||||
'agent_name',
|
||||
'',
|
||||
|
@ -732,7 +732,7 @@ class WelcomeWindow extends Wizard
|
|||
)
|
||||
);
|
||||
echo html_print_label_input_block(
|
||||
__('Module group'),
|
||||
__('Agent group'),
|
||||
html_print_select_from_sql(
|
||||
'SELECT * FROM tgrupo ORDER BY nombre',
|
||||
'id_group',
|
||||
|
@ -747,7 +747,6 @@ class WelcomeWindow extends Wizard
|
|||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
echo html_print_submit_button(__('Create'), 'create_conectivity', false, ['icon' => 'next', 'style' => 'margin-top:15px; float:right;']);
|
||||
?>
|
||||
</div>
|
||||
|
@ -1136,7 +1135,7 @@ class WelcomeWindow extends Wizard
|
|||
}
|
||||
|
||||
function configureEmail() {
|
||||
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general#table3'); ?>';
|
||||
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup§ion=general#table4'); ?>';
|
||||
}
|
||||
|
||||
function serversUp() {
|
||||
|
@ -1263,14 +1262,18 @@ class WelcomeWindow extends Wizard
|
|||
});
|
||||
});
|
||||
|
||||
$('#button-create_conectivity').click(function(){
|
||||
$('#button-create_conectivity').click(function(e){
|
||||
if($("#text-ip_target")[0].checkValidity() == false) {
|
||||
$("#text-ip_target")[0].reportValidity();
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
async: false,
|
||||
type: "POST",
|
||||
url: "include/ajax/task_to_perform.php",
|
||||
data: {
|
||||
check_connectivity: 1,
|
||||
id_group: $('#id_group :selected').val(),
|
||||
id_group: $('#id_group1 option:selected').val(),
|
||||
ip_target: $('#text-ip_target').val(),
|
||||
agent_name: $('#text-agent_name').val(),
|
||||
},
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC231102';
|
||||
$build_version = 'PC231201';
|
||||
$pandora_version = 'v7.0NG.774';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -45,6 +45,7 @@ define('EVENT_NEW', 0);
|
|||
define('EVENT_VALIDATE', 1);
|
||||
define('EVENT_PROCESS', 2);
|
||||
define('EVENT_NO_VALIDATED', 3);
|
||||
define('EVENT_NO_PROCESS', 4);
|
||||
|
||||
// Events group by constants.
|
||||
define('EVENT_GROUP_REP_ALL', 0);
|
||||
|
|
|
@ -990,6 +990,70 @@ function get_parameter($name, $default='')
|
|||
}
|
||||
|
||||
|
||||
function get_parameter_date($name, $default='', $date_format='Y/m/d')
|
||||
{
|
||||
$date_end = get_parameter('date_end', 0);
|
||||
$time_end = get_parameter('time_end');
|
||||
$datetime_end = strtotime($date_end.' '.$time_end);
|
||||
|
||||
$custom_date = get_parameter('custom_date', 0);
|
||||
$range = get_parameter('range', SECONDS_1DAY);
|
||||
$date_text = get_parameter('range_text', SECONDS_1DAY);
|
||||
$date_init_less = (strtotime(date('Y/m/d')) - SECONDS_1DAY);
|
||||
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
|
||||
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
|
||||
$datetime_init = strtotime($date_init.' '.$time_init);
|
||||
if ($custom_date === '1') {
|
||||
if ($datetime_init >= $datetime_end) {
|
||||
$datetime_init = $date_init_less;
|
||||
}
|
||||
|
||||
$date_init = date('Y/m/d H:i:s', $datetime_init);
|
||||
$date_end = date('Y/m/d H:i:s', $datetime_end);
|
||||
$period = ($datetime_end - $datetime_init);
|
||||
} else if ($custom_date === '2') {
|
||||
$date_units = get_parameter('range_units');
|
||||
$date_end = date('Y/m/d H:i:s');
|
||||
$date_init = date('Y/m/d H:i:s', (strtotime($date_end) - ((int) $date_text * (int) $date_units)));
|
||||
$period = (strtotime($date_end) - strtotime($date_init));
|
||||
} else if (in_array($range, ['this_week', 'this_month', 'past_week', 'past_month'])) {
|
||||
if ($range === 'this_week') {
|
||||
$monday = date('Y/m/d', strtotime('last monday'));
|
||||
|
||||
$sunday = date('Y/m/d', strtotime($monday.' +6 days'));
|
||||
$period = (strtotime($sunday) - strtotime($monday));
|
||||
$date_init = $monday;
|
||||
$date_end = $sunday;
|
||||
} else if ($range === 'this_month') {
|
||||
$date_end = date('Y/m/d', strtotime('last day of this month'));
|
||||
$first_of_month = date('Y/m/d', strtotime('first day of this month'));
|
||||
$date_init = $first_of_month;
|
||||
$period = (strtotime($date_end) - strtotime($first_of_month));
|
||||
} else if ($range === 'past_month') {
|
||||
$date_end = date('Y/m/d', strtotime('last day of previous month'));
|
||||
$first_of_month = date('Y/m/d', strtotime('first day of previous month'));
|
||||
$date_init = $first_of_month;
|
||||
$period = (strtotime($date_end) - strtotime($first_of_month));
|
||||
} else if ($range === 'past_week') {
|
||||
$date_end = date('Y/m/d', strtotime('sunday', strtotime('last week')));
|
||||
$first_of_week = date('Y/m/d', strtotime('monday', strtotime('last week')));
|
||||
$date_init = $first_of_week;
|
||||
$period = (strtotime($date_end) - strtotime($first_of_week));
|
||||
}
|
||||
} else {
|
||||
$date_end = date('Y/m/d H:i:s');
|
||||
$date_init = date('Y/m/d H:i:s', (strtotime($date_end) - $range));
|
||||
$period = (strtotime($date_end) - strtotime($date_init));
|
||||
}
|
||||
|
||||
return [
|
||||
'date_init' => date($date_format, strtotime($date_init)),
|
||||
'date_end' => date($date_format, strtotime($date_end)),
|
||||
'period' => $period,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a parameter from a get request.
|
||||
*
|
||||
|
|
|
@ -4752,7 +4752,7 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||
$secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
|
||||
$secondaryLinks = [];
|
||||
if (empty($secondary_groups['for_select']) === true) {
|
||||
$secondaryLinks[] = '<em>'.__('N/A').'</em>';
|
||||
$secondaryLinks = [];
|
||||
} else {
|
||||
foreach ($secondary_groups['for_select'] as $id => $name) {
|
||||
$secondaryLinks[] = html_print_anchor(
|
||||
|
@ -4811,22 +4811,22 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||
'content' => groups_get_name($agent['id_grupo']),
|
||||
],
|
||||
true
|
||||
);
|
||||
).' '.ui_print_group_icon($agent['id_grupo'], true, '', 'margin-left: 2%;', true, false, false, '', true);
|
||||
$table_contact->data[] = $data;
|
||||
|
||||
// Secondary groups.
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Secondary groups').'</b>';
|
||||
$data[1] = implode(', ', $secondaryLinks);
|
||||
$table_contact->data[] = $data;
|
||||
if (!empty($secondaryLinks) === true) {
|
||||
$data[0] = '<b>'.__('Secondary groups').'</b>';
|
||||
$data[1] = implode(', ', $secondaryLinks);
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
// Parent agent line.
|
||||
if (enterprise_installed() === true) {
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Parent').'</b>';
|
||||
if ((int) $agent['id_parent'] === 0) {
|
||||
$data[1] = '<em>'.__('N/A').'</em>';
|
||||
} else {
|
||||
if ((int) $agent['id_parent'] !== 0) {
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Parent').'</b>';
|
||||
$data[1] = html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_parent'],
|
||||
|
@ -4834,9 +4834,9 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table_contact->data[] = $data;
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
// Last status change line.
|
||||
|
@ -4845,6 +4845,123 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||
$data[1] = $time_elapsed;
|
||||
$table_contact->data[] = $data;
|
||||
|
||||
$has_remote_conf = enterprise_hook(
|
||||
'config_agents_has_remote_configuration',
|
||||
[$agent['id_agente']]
|
||||
);
|
||||
|
||||
if ((bool) $has_remote_conf) {
|
||||
$data = [];
|
||||
$data[0] = __('Remote configuration');
|
||||
$data[1] = '<spam style="position: relative;top: -10%; margin-right: 10px;">'.__('Enabled').'</spam>';
|
||||
$data[1] .= html_print_menu_button(
|
||||
[
|
||||
'href' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$agent['id_agente'].'&disk_conf=1'),
|
||||
'image' => 'images/remote-configuration@svg.svg',
|
||||
'title' => __('Edit remote config'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$satellite_server = (int) db_get_value_filter(
|
||||
'satellite_server',
|
||||
'tagente',
|
||||
['id_agente' => $id_agente]
|
||||
);
|
||||
|
||||
if (empty($satellite_server) === false) {
|
||||
$satellite_name = db_get_value_filter(
|
||||
'name',
|
||||
'tserver',
|
||||
['id_server' => $satellite_server]
|
||||
);
|
||||
|
||||
$data[0] = __('Satellite server');
|
||||
$data[1] = $satellite_name;
|
||||
}
|
||||
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
// SecurityMon line.
|
||||
$id_module_group = db_get_value('id_mg', 'tmodule_group', 'name', 'Security');
|
||||
$modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
[
|
||||
'id_agente' => $agent['id_agente'],
|
||||
'id_module_group' => $id_module_group,
|
||||
]
|
||||
);
|
||||
|
||||
if (is_array($modules) === true && count($modules) > 0) {
|
||||
$secmon_status = secmon_status($agent['id_agente']);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('SecurityMon').'</b>';
|
||||
$data[1] = ui_print_status_secmon_div($secmon_status, __('Total security modules: %s', count($modules)));
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
// Hardening line.
|
||||
$module_score = modules_get_agentmodule_id(io_safe_input('Hardening - Score'), $agent['id_agente']);
|
||||
$hardening = '';
|
||||
if (is_array($module_score) === true && key_exists('id_agente_modulo', $module_score) == true) {
|
||||
$raw_data_score = modules_get_raw_data($module_score['id_agente_modulo'], 0, time());
|
||||
$hardening = format_numeric($raw_data_score[0]['datos'], 2);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Hardening').'</b>';
|
||||
$data[1] = $hardening.' %';
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
// Vulnerabilities line.
|
||||
$vuls = get_vulnerabilities($agent['id_agente']);
|
||||
if (is_array($vuls) === true && count($vuls) > 0) {
|
||||
$score = get_score($vuls);
|
||||
$data = [];
|
||||
$data[0] = '<b>'.__('Vulnerability').'</b>';
|
||||
$data[1] = ui_print_status_vulnerability_div($score);
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
// Optional data
|
||||
// Position Information.
|
||||
if ((bool) $config['activate_gis'] === true) {
|
||||
$data = [];
|
||||
|
||||
$dataPositionAgent = gis_get_data_last_position_agent(
|
||||
$agent['id_agente']
|
||||
);
|
||||
if (is_array($dataPositionAgent) === true && $dataPositionAgent['stored_longitude'] !== '' && $dataPositionAgent['stored_latitude'] !== '') {
|
||||
$data[0] = __('Position (Long, Lat)');
|
||||
|
||||
$dataOptionalOutput = html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=gis&id_agente='.$id_agente,
|
||||
'content' => $dataPositionAgent['stored_longitude'].', '.$dataPositionAgent['stored_latitude'],
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if (empty($dataPositionAgent['description']) === false) {
|
||||
$dataOptionalOutput .= ' ('.$dataPositionAgent['description'].')';
|
||||
}
|
||||
|
||||
$data[1] = $dataOptionalOutput;
|
||||
}
|
||||
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
// Timezone Offset.
|
||||
if ((int) $agent['timezone_offset'] !== 0) {
|
||||
$data = [];
|
||||
$data[0] = __('Timezone Offset');
|
||||
$data[1] = $agent['timezone_offset'];
|
||||
$table_contact->data[] = $data;
|
||||
}
|
||||
|
||||
$agent_contact = html_print_div(
|
||||
[
|
||||
'class' => 'agent_details_header',
|
||||
|
@ -4856,4 +4973,25 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
|
|||
$agent_contact .= html_print_table($table_contact, true);
|
||||
|
||||
return $agent_contact;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return an array with a list of status agents
|
||||
*
|
||||
* @return array.
|
||||
*/
|
||||
|
||||
|
||||
function agents_status_list()
|
||||
{
|
||||
$status_list = [];
|
||||
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
|
||||
$status_list[AGENT_STATUS_WARNING] = __('Warning');
|
||||
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
|
||||
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
||||
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||
|
||||
return $status_list;
|
||||
}
|
|
@ -22,7 +22,7 @@ require_once $config['homedir'].'/include/functions_modules.php';
|
|||
require_once $config['homedir'].'/include/functions_users.php';
|
||||
|
||||
|
||||
function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby=-1, $acl=false, $total=false, $id_agent=0)
|
||||
function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby=-1, $acl=false, $total=false, $id_agent=0, $only_enabled=false)
|
||||
{
|
||||
$sql = '';
|
||||
$alerts = [];
|
||||
|
@ -121,6 +121,10 @@ function alerts_get_alerts($id_group=0, $free_search='', $status='all', $standby
|
|||
// Only enabled agent.
|
||||
$sql .= ' AND t3.disabled = 0';
|
||||
|
||||
if ($only_enabled === true) {
|
||||
$sql .= ' AND t0.disabled = 0';
|
||||
}
|
||||
|
||||
$row_alerts = db_get_all_rows_sql($sql);
|
||||
|
||||
if ($total) {
|
||||
|
|
|
@ -12952,7 +12952,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||
$values = [];
|
||||
|
||||
if ($other['data'][0] != '') {
|
||||
$values['event'] = $other['data'][0];
|
||||
$values['event'] = io_safe_input(io_safe_output($other['data'][0]));
|
||||
} else {
|
||||
returnError('Event text required.');
|
||||
return;
|
||||
|
@ -13132,7 +13132,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||
|
||||
if ($other['data'][18] != '') {
|
||||
$values['id_extra'] = $other['data'][18];
|
||||
$sql_validation = 'SELECT id_evento,estado,ack_utimestamp,id_usuario
|
||||
$sql_validation = 'SELECT id_evento,estado,ack_utimestamp,id_usuario,event_custom_id
|
||||
FROM tevento
|
||||
WHERE estado IN (0,2) AND id_extra ="'.$other['data'][18].'";';
|
||||
|
||||
|
@ -13147,6 +13147,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||
$values['status'] = 2;
|
||||
$ack_utimestamp = $val['ack_utimestamp'];
|
||||
$values['id_usuario'] = $val['id_usuario'];
|
||||
$values['event_custom_id'] = $val['event_custom_id'];
|
||||
}
|
||||
|
||||
api_set_validate_event_by_id($val['id_evento']);
|
||||
|
@ -13177,7 +13178,8 @@ function api_set_create_event($id, $trash1, $other, $returnType)
|
|||
$custom_data,
|
||||
$values['server_id'],
|
||||
$values['id_extra'],
|
||||
$ack_utimestamp
|
||||
$ack_utimestamp,
|
||||
$values['event_custom_id'] ?? null
|
||||
);
|
||||
|
||||
if ($other['data'][12] != '') {
|
||||
|
@ -17787,6 +17789,48 @@ function api_token_check(string $token)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set custom field value in tevento
|
||||
*
|
||||
* @param mixed $id_event Event id.
|
||||
* @param mixed $custom_field Custom field to set.
|
||||
* @return void
|
||||
*/
|
||||
function api_set_event_custom_id($id, $value)
|
||||
{
|
||||
// Get the event
|
||||
$event = events_get_event($id, false, is_metaconsole());
|
||||
// If event not exists, end the execution.
|
||||
if ($event === false) {
|
||||
returnError(
|
||||
'event_not_exists',
|
||||
'Event not exists'
|
||||
);
|
||||
$result = false;
|
||||
}
|
||||
|
||||
// Safe custom fields for hacks.
|
||||
if (preg_match('/script/i', io_safe_output($value))) {
|
||||
$result = false;
|
||||
}
|
||||
|
||||
$result = events_event_custom_id(
|
||||
$id,
|
||||
$value
|
||||
);
|
||||
|
||||
// If update results failed
|
||||
if (empty($result) === true || $result === false) {
|
||||
returnError(
|
||||
'The event could not be updated'
|
||||
);
|
||||
return false;
|
||||
} else {
|
||||
returnData('string', ['data' => 'Event updated.']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Extract info Agents for inventories ITSM.
|
||||
*
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue