diff --git a/README.md b/README.md index 74825e8419..2a6c68fc2b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,16 @@ [![Build Status](https://travis-ci.org/pandorafms/pandorafms.svg?branch=develop)](https://travis-ci.org/pandorafms/pandorafms) -[![Pandora logo](http://wolf359.artica.es/public_images/logo_pandora_community.png)](http://pandorafms.org) +![logo Pandora-FMS](https://user-images.githubusercontent.com/8567291/151817953-dc9c4c88-5f3c-459b-98a7-da0534930a2c.png) -Pandora FMS is a monitoring software for IT infrastructure management which includes network equipment, Windows and Unix servers, virtual infrastructure and all different kind of applications. It has a large amount of features, making it a new generation software which discovers all the monitoring issues that an organization may need. +With more than 50,000 customer installations across the five continents, Pandora FMS is an out-of-the-box monitoring solution: profitable and scalable, covering most infrastructure deployment options. + +Pandora FMS gives you the agility to find and solve problems quickly, scaling them so they can be derived from any source, on-premise, multi cloud or both of them mixed. Now you have that capability across your entire IT stack and analytics to find any problem, even the ones that are hard to find. + +Thanks to more than 500 plugins available, you can control and manage any application and technology, from SAP, Oracle, Lotus, Citrix or Jboss to VMware, AWS, SQL Server, Redhat, Websphere, etc. ### Support -For community support you can visit our forums at http://forums.pandorafms.org. Visit our community page at http://pandorafms.org and if you need commercial information or/and professional support visit http://pandorafms.com. +For community support you can visit our forums at https://pandorafms.com/community/ and if you need commercial information or/and professional support visit https://pandorafms.com ### How to install Pandora FMS diff --git a/extras/deploy-scripts/pandora_agent_deploy.sh b/extras/deploy-scripts/pandora_agent_deploy.sh index fbd349e8b9..74db9d7c72 100644 --- a/extras/deploy-scripts/pandora_agent_deploy.sh +++ b/extras/deploy-scripts/pandora_agent_deploy.sh @@ -82,10 +82,10 @@ execute_cmd "[ $PANDORA_SERVER_IP ]" 'Check Server IP Address' 'Please define e # Check OS. OS=$([[ $(grep '^ID_LIKE=' /etc/os-release) ]] && grep ^ID_LIKE= /etc/os-release | cut -d '=' -f2 | tr -d '"' || grep ^ID= /etc/os-release | cut -d '=' -f2 | tr -d '"') -[[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS -[[ $OS == 'fedora' ]] && OS_RELEASE=$OS -[[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS -[[ $OS == 'debian' ]] && OS_RELEASE=$OS +[[ $OS =~ 'rhel' ]] && OS_RELEASE=$OS +[[ $OS =~ 'debian' ]] && OS_RELEASE=$OS +#[[ $OS == 'rhel fedora' ]] && OS_RELEASE=$OS +#[[ $OS == 'centos rhel fedora' ]] && OS_RELEASE=$OS # initialice logfile execute_cmd "echo 'Starting community deployment' > $LOGFILE" "All installer activity is logged on $LOGFILE" @@ -113,7 +113,7 @@ execute_cmd "cd $HOME/pandora_deploy_tmp" "Moving to workspace: $HOME/pandora_d # Downloading and installing packages -if [[ $OS_RELEASE == 'rhel fedora' ]] || [[ $OS_RELEASE == 'centos rhel fedora' ]]; then +if [[ $OS_RELEASE =~ 'rhel' ]]; then yum install -y perl wget curl perl-Sys-Syslog unzip &>> $LOGFILE echo -e "${cyan}Instaling agent dependencies...${reset}" ${green}OK${reset} diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index 7f70addfec..2e617eeeb1 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -1,20 +1,32 @@ #!/bin/bash +####################################################### +# PandoraFMS Community online installation script +####################################################### +## Tested versions ## +# Centos 7.9 -# define variables +#Constants PANDORA_CONSOLE=/var/www/html/pandora_console -CONSOLE_PATH=/var/www/html/pandora_console PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf -PANDORA_SERVER_BIN=/usr/bin/pandora_server -PANDORA_HA_BIN=/usr/bin/pandora_ha -PANDORA_TABLES_MIN=160 -DBHOST=127.0.0.1 -DBNAME=pandora -DBUSER=pandora -DBPASS=pandora -DBPORT=3306 -S_VERSION='2021012801' +PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf + + +S_VERSION='2022012401' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" +# define default variables +[ "$TZ" ] || TZ="Europe/Madrid" +[ "$DBHOST" ] || DBHOST=127.0.0.1 +[ "$DBNAME" ] || DBNAME=pandora +[ "$DBUSER" ] || DBUSER=pandora +[ "$DBPASS" ] || DBPASS=pandora +[ "$DBPORT" ] || DBPORT=3306 +[ "$DBROOTPASS" ] || DBROOTPASS=pandora +[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0 +[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0 +[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0 +[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g") + # Ansi color code variables red="\e[0;91m" green="\e[0;92m" @@ -60,7 +72,7 @@ check_pre_pandora () { echo -en "${cyan}Checking environment ... ${reset}" rpm -qa | grep pandora &>> /dev/null && local fail=true - [ -d "$CONSOLE_PATH" ] && local fail=true + [ -d "$PANDORA_CONSOLE" ] && local fail=true [ -f /usr/bin/pandora_server ] && local fail=true echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true @@ -111,7 +123,7 @@ echo "Community installer version: $S_VERSION" >> $LOGFILE check_root_permissions # Pre installed pandora -check_pre_pandora +[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora # Connectivity check_repo_connection @@ -125,6 +137,9 @@ execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]" # Check disk size at least 10 Gb free space execute_cmd "[ $(df -BM / | tail -1 | awk '{print $4}' | tr -d M) -gt 10000 ]" 'Checking Disk (required: 10 GB free min)' +# Setting timezone +execute_cmd "timedatectl set-timezone $TZ" "Setting Timezone $TZ" + # Execute tools check execute_cmd "awk --version" 'Checking needed tools: awk' execute_cmd "grep --version" 'Checking needed tools: grep' @@ -148,10 +163,10 @@ http://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" -execute_cmd "yum-config-manager --enable remi-php73" "Configuring PHP" +execute_cmd "yum-config-manager --enable remi-php74" "Configuring PHP" # Install percona Database -[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf +#[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf execute_cmd "yum install -y Percona-Server-server-57" "Installing Percona Server" # Console dependencies @@ -256,6 +271,7 @@ server_dependencies=" \ perl(XML::Twig) \ expect \ openssh-clients \ + java \ http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm" execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies" @@ -275,32 +291,51 @@ execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl de oracle_dependencies=" \ https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm \ https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm" -execute_cmd "yum install -y $oracle_dependencies" "Installing Oracle Instant client" +execute_cmd "yum install -y $oracle_dependencies || yum reinstall -y $oracle_dependencies" "Installing Oracle Instant client" + +#ipam dependencies +ipam_dependencies=" \ + http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ + perl(NetAddr::IP) \ + perl(Sys::Syslog) \ + perl(DBI) \ + perl(XML::Simple) \ + perl(Geo::IP) \ + perl(IO::Socket::INET6) \ + perl(XML::Twig)" +execute_cmd "yum install -y $ipam_dependencies" "Installing IPAM Instant client" + +# MSSQL dependencies el7 +execute_cmd "curl https://packages.microsoft.com/config/rhel/7/prod.repo -o /etc/yum.repos.d/mssql-release.repo" "Configuring Microsoft repositories" +execute_cmd "yum remove unixODBC-utf16 unixODBC-utf16-devel" "Removing default unixODBC packages" +execute_cmd "env ACCEPT_EULA=Y yum install -y msodbcsql17" "Installing ODBC Driver for Microsoft(R) SQL Server(R)" +MS_ID=$(head -1 /etc/odbcinst.ini | tr -d '[]') &>> "$LOGFILE" +#yum config-manager --set-disable packages-microsoft-com-prod # Disabling SELINUX and firewalld setenforce 0 sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config systemctl disable firewalld --now &>> $LOGFILE - #Configuring Database +if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then execute_cmd "systemctl start mysqld" "Starting database engine" export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev) echo """ SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!'); UNINSTALL PLUGIN validate_password; - SET PASSWORD FOR 'root'@'localhost' = PASSWORD('pandora'); - """ | mysql --connect-expired-password -uroot - -export MYSQL_PWD=$DBPASS + SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$DBROOTPASS'); + """ | mysql --connect-expired-password -uroot &>> "$LOGFILE" +fi +export MYSQL_PWD=$DBROOTPASS echo -en "${cyan}Creating Pandora FMS database...${reset}" echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST -check_cmd_status 'Error creating database pandora, is this an empty node? if you have a previus installation please contact with support.' +check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support." echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%' identified by \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST +export MYSQL_PWD=$DBPASS #Generating my.cnf -POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g") cat > /etc/my.cnf << EO_CONFIG_F [mysqld] datadir=/var/lib/mysql @@ -350,7 +385,7 @@ execute_cmd "systemctl restart mysqld" "Configuring database engine" # Downloading Pandora Packages execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm" "Downloading Pandora FMS Server community" execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm" "Downloading Pandora FMS Console community" -execute_cmd "wget http://firefly.artica.es/centos7/pandorafms_agent_unix-7.0NG.751_x86_64.rpm" "Downloading Pandora FMS Agent community" +execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm" "Downloading Pandora FMS Agent community" # Install Pandora execute_cmd "yum install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages" @@ -374,13 +409,13 @@ mysql -u$DBUSER -P$DBPORT -h$DBHOST $DBNAME < $PANDORA_CONSOLE/pandoradb_data.sq check_cmd_status 'Error Loading database schema data' # Configure console -cat > $CONSOLE_PATH/include/config.php << EO_CONFIG_F +cat > $PANDORA_CONSOLE/include/config.php << EO_CONFIG_F /etc/pandora/pandora_server.env << 'EOF_ENV' @@ -459,7 +498,7 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/$VERSION/client64/lib export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64 EOF_ENV -# Kernel optimization +if [ "$SKIP_KERNEL_OPTIMIZATIONS" -eq '0' ] ; then cat >> /etc/sysctl.conf <> $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" +execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent" #SSH banner [ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh index b5b2935192..5b0bc37b1e 100644 --- a/extras/deploy-scripts/pandora_deploy_community_el8.sh +++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh @@ -1,17 +1,35 @@ #!/bin/bash +####################################################### +# PandoraFMS Community online installation script +####################################################### +## Tested versions ## +# Centos 8.4, 8.5 +# Rocky 8.4, 8.5 +# Almalinuz 8.4, 8.5 +# RedHat 8.5 -# define variables +#Constants PANDORA_CONSOLE=/var/www/html/pandora_console -CONSOLE_PATH=/var/www/html/pandora_console PANDORA_SERVER_CONF=/etc/pandora/pandora_server.conf -DBHOST=127.0.0.1 -DBNAME=pandora -DBUSER=pandora -DBPASS=pandora -DBPORT=3306 -S_VERSION='2021070101' +PANDORA_AGENT_CONF=/etc/pandora/pandora_agent.conf + + +S_VERSION='2022012401' LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log" +# define default variables +[ "$TZ" ] || TZ="Europe/Madrid" +[ "$DBHOST" ] || DBHOST=127.0.0.1 +[ "$DBNAME" ] || DBNAME=pandora +[ "$DBUSER" ] || DBUSER=pandora +[ "$DBPASS" ] || DBPASS=pandora +[ "$DBPORT" ] || DBPORT=3306 +[ "$DBROOTPASS" ] || DBROOTPASS=pandora +[ "$SKIP_PRECHECK" ] || SKIP_PRECHECK=0 +[ "$SKIP_DATABASE_INSTALL" ] || SKIP_DATABASE_INSTALL=0 +[ "$SKIP_KERNEL_OPTIMIZATIONS" ] || SKIP_KERNEL_OPTIMIZATIONS=0 +[ "$POOL_SIZE" ] || POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g") + # Ansi color code variables red="\e[0;91m" green="\e[0;92m" @@ -56,7 +74,7 @@ check_pre_pandora () { echo -en "${cyan}Checking environment ... ${reset}" rpm -qa | grep pandora &>> /dev/null && local fail=true - [ -d "$CONSOLE_PATH" ] && local fail=true + [ -d "$PANDORA_CONSOLE" ] && local fail=true [ -f /usr/bin/pandora_server ] && local fail=true echo "use $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST &>> /dev/null && local fail=true @@ -74,7 +92,7 @@ check_root_permissions () { echo -en "${cyan}Checking root account... ${reset}" if [ "$(whoami)" != "root" ]; then echo -e "${red}Fail${reset}" - echo "Please use a root account or sudo for installing PandoraFMS" + echo "Please use a root account or sudo for installing Pandora FMS" echo "Error installing Pandora FMS for detailed error please check log: $LOGFILE" exit 1 @@ -87,8 +105,8 @@ check_root_permissions () { echo "Starting PandoraFMS Community deployment EL8 ver. $S_VERSION" # Centos Version -if [ ! "$(grep -Ei 'centos|rocky' /etc/redhat-release)" ]; then - printf "\n ${red}Error this is not a Centos/Rocky Base system, this installer is compatible with Centos/Rocky systems only${reset}\n" +if [ ! "$(grep -Ei 'centos|rocky|Almalinux|Red Hat Enterprise' /etc/redhat-release)" ]; then + printf "\n ${red}Error this is not a Centos/Rocky/Almalinux Base system, this installer is compatible with Centos/Rocky systems only${reset}\n" exit 1 fi @@ -106,7 +124,7 @@ echo "Community installer version: $S_VERSION" >> "$LOGFILE" check_root_permissions # Pre installed pandora -check_pre_pandora +[ "$SKIP_PRECHECK" == 1 ] || check_pre_pandora # Connectivity check_repo_connection @@ -120,6 +138,9 @@ execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]" # Check disk size at least 10 Gb free space execute_cmd "[ $(df -BM / | tail -1 | awk '{print $4}' | tr -d M) -gt 10000 ]" 'Checking Disk (required: 10 GB free min)' +# Setting timezone +execute_cmd "timedatectl set-timezone $TZ" "Setting Timezone $TZ" + # Execute tools check execute_cmd "awk --version" 'Checking needed tools: awk' execute_cmd "grep --version" 'Checking needed tools: grep' @@ -131,25 +152,57 @@ rm -rf "$HOME"/pandora_deploy_tmp/*.rpm* &>> "$LOGFILE" mkdir "$HOME"/pandora_deploy_tmp &>> "$LOGFILE" execute_cmd "cd $HOME/pandora_deploy_tmp" "Moving to workspace: $HOME/pandora_deploy_tmp" +## Extra steps on redhat envs +if [ "$(grep -Ei 'Red Hat Enterprise' /etc/redhat-release)" ]; then + ## In case REDHAT + # Check susbscription manager status: + echo -en "${cyan}Checking Red Hat Enterprise subscription... ${reset}" + subscription-manager status &>> "$LOGFILE" + subscription-manager list &>> "$LOGFILE" + subscription-manager list | grep 'Status:' | grep Subscribed &>> "$LOGFILE" + check_cmd_status 'Error checking subscription status, make sure your server is activated and suscribed to Red Hat Enterprise repositories' + + # Ckeck repolist + dnf repolist &>> "$LOGFILE" + echo -en "${cyan}Checking Red Hat Enterprise repolist... ${reset}" + dnf repolist | grep 'rhel-8-for-x86_64-baseos-rpms' &>> "$LOGFILE" + check_cmd_status 'Error checking repositories status, could try a subscription-manager attach command or contact sysadmin' + + #install extra repos + extra_repos=" \ + 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://repo.percona.com/yum/percona-release-latest.noarch.rpm" + + execute_cmd "dnf install -y $extra_repos" "Installing extra repositories" + execute_cmd "subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms" "Enabling subscription to codeready-builder" +else + # For alma/rocky/centos + extra_repos=" \ + tar \ + dnf-utils \ + epel-release \ + http://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" + execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools" +fi + + #Installing wget execute_cmd "dnf install -y wget" "Installing wget" #Installing extra repositiries -extra_repos=" \ - tar \ - dnf-utils \ - epel-release \ - http://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" -execute_cmd "dnf config-manager --set-enabled powertools" "Configuring Powertools" execute_cmd "dnf module reset -y php " "Disabling standard PHP module" -execute_cmd "dnf module install -y php:remi-7.3" "Configuring PHP" +execute_cmd "dnf module install -y php:remi-7.4" "Configuring PHP" # Install percona Database execute_cmd "dnf module disable -y mysql" "Disabiling mysql module" -rm -rf /etc/my.cnf +#rm -rf /etc/my.cnf execute_cmd "dnf install -y Percona-Server-server-57" "Installing Percona Server" # Console dependencies @@ -231,6 +284,7 @@ console_dependencies=" \ xorg-x11-fonts-misc \ poppler-data \ php-yaml \ + mod_ssl \ http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm \ http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm" @@ -255,7 +309,8 @@ server_dependencies=" \ perl(IO::Socket::INET6) \ perl(XML::Twig) \ expect \ - openssh-clients \ + openssh-clients \ + java \ http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm" execute_cmd "dnf install -y $server_dependencies" "Installing Pandora FMS Server dependencies" @@ -281,6 +336,7 @@ oracle_dependencies=" \ https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm" execute_cmd "dnf install -y $oracle_dependencies" "Installing Oracle Instant client" +#ipam dependencies ipam_dependencies=" \ http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ perl(NetAddr::IP) \ @@ -290,32 +346,39 @@ ipam_dependencies=" \ perl(Geo::IP) \ perl(IO::Socket::INET6) \ perl(XML::Twig)" -execute_cmd "dnf install -y $ipam_dependencies" "Installing Oracle Instant client" +execute_cmd "dnf install -y $ipam_dependencies" "Installing IPAM Instant client" + +# MSSQL dependencies el8 +execute_cmd "curl https://packages.microsoft.com/config/rhel/8/prod.repo -o /etc/yum.repos.d/mssql-release.repo" "Configuring Microsoft repositories" +execute_cmd "dnf remove unixODBC-utf16 unixODBC-utf16-devel" "Removing default unixODBC packages" +execute_cmd "env ACCEPT_EULA=Y dnf install -y msodbcsql17" "Installing ODBC Driver for Microsoft(R) SQL Server(R)" +MS_ID=$(head -1 /etc/odbcinst.ini | tr -d '[]') &>> "$LOGFILE" +#dnf config-manager --set-disable packages-microsoft-com-prod # Disabling SELINUX and firewalld setenforce 0 &>> "$LOGFILE" sed -i -e "s/^SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config &>> "$LOGFILE" systemctl disable firewalld --now &>> "$LOGFILE" - #Configuring Database +if [ "$SKIP_DATABASE_INSTALL" -eq '0' ] ; then execute_cmd "systemctl start mysqld" "Starting database engine" export MYSQL_PWD=$(grep "temporary password" /var/log/mysqld.log | rev | cut -d' ' -f1 | rev) echo """ SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Pandor4!'); UNINSTALL PLUGIN validate_password; - SET PASSWORD FOR 'root'@'localhost' = PASSWORD('pandora'); - """ | mysql --connect-expired-password -uroot - -export MYSQL_PWD=$DBPASS + SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$DBROOTPASS'); + """ | mysql --connect-expired-password -uroot &>> "$LOGFILE" +fi +export MYSQL_PWD=$DBROOTPASS echo -en "${cyan}Creating Pandora FMS database...${reset}" echo "create database $DBNAME" | mysql -uroot -P$DBPORT -h$DBHOST -check_cmd_status 'Error creating database pandora, is this an empty node? if you have a previus installation please contact with support.' +check_cmd_status "Error creating database $DBNAME, is this an empty node? if you have a previus installation please contact with support." echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO \"$DBUSER\"@'%' identified by \"$DBPASS\"" | mysql -uroot -P$DBPORT -h$DBHOST +export MYSQL_PWD=$DBPASS #Generating my.cnf -POOL_SIZE=$(grep -i total /proc/meminfo | head -1 | awk '{printf "%.2f \n", $(NF-1)*0.4/1024}' | sed "s/\\..*$/M/g") cat > /etc/my.cnf << EO_CONFIG_F [mysqld] datadir=/var/lib/mysql @@ -365,10 +428,10 @@ execute_cmd "systemctl restart mysqld" "Configuring database engine" # Downloading Pandora Packages execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_server-7.0NG.noarch.rpm" "Downloading Pandora FMS Server community" execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_console-7.0NG.noarch.rpm" "Downloading Pandora FMS Console community" -execute_cmd "wget http://firefly.artica.es/centos7/pandorafms_agent_unix-7.0NG.751_x86_64.rpm" "Downloading Pandora FMS Agent community" +execute_cmd "wget http://firefly.artica.es/pandorafms/latest/RHEL_CentOS/pandorafms_agent_unix-7.0NG.noarch.rpm" "Downloading Pandora FMS Agent community" # Install Pandora -execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "installing PandoraFMS packages" +execute_cmd "dnf install -y $HOME/pandora_deploy_tmp/pandorafms*.rpm" "Installing Pandora FMS packages" # Copy gotty utility execute_cmd "wget https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz" 'Dowloading gotty util' @@ -391,13 +454,13 @@ mysql -u$DBUSER -P$DBPORT -h$DBHOST $DBNAME < $PANDORA_CONSOLE/pandoradb_data.sq check_cmd_status 'Error Loading database schema data' # Configure console -cat > $CONSOLE_PATH/include/config.php << EO_CONFIG_F +cat > $PANDORA_CONSOLE/include/config.php << EO_CONFIG_F > "$LOGFILE" # Prepare php.ini sed -i -e "s/^max_input_time.*/max_input_time = -1/g" /etc/php.ini @@ -466,6 +529,10 @@ sed -i -e "s/^dbname.*/dbname $DBNAME/g" $PANDORA_SERVER_CONF sed -i -e "s/^dbuser.*/dbuser $DBUSER/g" $PANDORA_SERVER_CONF sed -i -e "s|^dbpass.*|dbpass $DBPASS|g" $PANDORA_SERVER_CONF sed -i -e "s/^dbport.*/dbport $DBPORT/g" $PANDORA_SERVER_CONF +sed -i -e "s/^#.mssql_driver.*/mssql_driver $MS_ID/g" $PANDORA_SERVER_CONF + +# Enable agent remote config +sed -i "s/^remote_config.*$/remote_config 1/g" $PANDORA_AGENT_CONF # Set Oracle environment for pandora_server cat > /etc/pandora/pandora_server.env << 'EOF_ENV' @@ -477,6 +544,8 @@ export ORACLE_HOME=/usr/lib/oracle/$VERSION/client64 EOF_ENV # Kernel optimization + +if [ "$SKIP_KERNEL_OPTIMIZATIONS" -eq '0' ] ; then cat >> /etc/sysctl.conf <> "$LOGFILE" chmod +x /etc/init.d/pandora_websocket_engine # Start Websocket engine @@ -569,7 +639,7 @@ systemctl enable pandora_websocket_engine &>> "$LOGFILE" # Enable pandora ha service systemctl enable pandora_server --now &>> "$LOGFILE" -execute_cmd "systemctl start pandora_server" "Starting Pandora FMS Server" +execute_cmd "/etc/init.d/pandora_server start" "Starting Pandora FMS Server" # starting tentacle server systemctl enable tentacle_serverd &>> "$LOGFILE" @@ -580,7 +650,7 @@ execute_cmd "echo \"* * * * * root wget -q -O - --no-check-certificate http://12 echo "* * * * * root wget -q -O - --no-check-certificate http://127.0.0.1/pandora_console/enterprise/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" +execute_cmd "systemctl start pandora_agent_daemon" "Starting Pandora FMS Agent" #SSH banner [ "$(curl -s ifconfig.me)" ] && ipplublic=$(curl -s ifconfig.me) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index f1adc4aced..9b941484cc 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.759-220202 +Version: 7.0NG.759-220216 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index e50e34915e..13be8995ab 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.759-220202" +pandora_version="7.0NG.759-220216" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/README b/pandora_agents/unix/README index 3758fa31b7..fd05861db3 100644 --- a/pandora_agents/unix/README +++ b/pandora_agents/unix/README @@ -47,4 +47,3 @@ License The project is distributed under the GPL License v2 or later. Copyright (C) 2004-2011 Pandora FMS development team - diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a1e92986d8..ad13448b69 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1015,7 +1015,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.759'; -use constant AGENT_BUILD => '220202'; +use constant AGENT_BUILD => '220216'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 2f34c49649..f90dd6eb49 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.759 -%define release 220202 +%define release 220216 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index d89eaf63b2..920ba850d0 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.759 -%define release 220202 +%define release 220216 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 649ef1ab95..0a691fc419 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.759" -PI_BUILD="220202" +PI_BUILD="220216" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 0e37901ba1..0e7bc283b9 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{220202} +{220216} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b09e2700eb..6fecf36f8a 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.759 Build 220202") +#define PANDORA_VERSION ("7.0NG.759 Build 220216") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index afe809eebe..ad64c8bf25 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.759(Build 220202))" + VALUE "ProductVersion", "(7.0NG.759(Build 220216))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9998bb0d3f..afe146c0ea 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.759-220202 +Version: 7.0NG.759-220216 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 6f067bb9d2..ff2c8bf4a5 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.759-220202" +pandora_version="7.0NG.759-220216" package_pear=0 package_pandora=1 diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index f0032476e2..d6a48d27d0 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -89,7 +89,11 @@ if (isset($_GET['loginhash']) === true) { $config['id_user'] = $loginhash_user; } else { include_once 'general/login_page.php'; - db_pandora_audit('Logon Failed (loginhash', '', 'system'); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Loginhash failed', + 'system' + ); while (ob_get_length() > 0) { ob_end_flush(); } @@ -111,8 +115,8 @@ if (class_exists($auth_class) === false || $public_hash === false) { } else { if ($auth_class::validatePublicHash($public_hash) === false) { db_pandora_audit( - 'Invalid public hash', - 'Trying to access public dashboard' + AUDIT_LOG_USER_REGISTRATION, + 'Trying to access public dashboard (Invalid public hash)' ); include 'general/noaccess.php'; exit; diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 815a0ed8d0..08218e7f51 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -284,7 +284,7 @@ function mainAgentsModules() // ACL Check. if (! check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent view (Grouped)' ); include 'general/noaccess.php'; @@ -304,7 +304,10 @@ function mainAgentsModules() db_process_sql_update('tagente_modulo', ['flag' => 1], $where); } else { - db_pandora_audit('ACL Violation', 'Trying to set flag for groups'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to set flag for groups' + ); include 'general/noaccess.php'; exit; } diff --git a/pandora_console/extensions/api_checker.php b/pandora_console/extensions/api_checker.php index 49f742217e..cafbf6016d 100755 --- a/pandora_console/extensions/api_checker.php +++ b/pandora_console/extensions/api_checker.php @@ -63,7 +63,7 @@ function extension_api_checker() if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Profile Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/extensions/db_status.php b/pandora_console/extensions/db_status.php index d55294f3a6..638d795b31 100755 --- a/pandora_console/extensions/db_status.php +++ b/pandora_console/extensions/db_status.php @@ -32,7 +32,7 @@ function extension_db_status() if (!is_user_admin($config['id_user'])) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access db status' ); include 'general/noaccess.php'; diff --git a/pandora_console/extensions/dbmanager.php b/pandora_console/extensions/dbmanager.php index 7d32b730e5..fbe3d7cb47 100644 --- a/pandora_console/extensions/dbmanager.php +++ b/pandora_console/extensions/dbmanager.php @@ -89,7 +89,10 @@ function dbmgr_extension_main() global $config; if (!is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } @@ -143,7 +146,13 @@ function dbmgr_extension_main() echo 'An error has occured when querying the database.
'; echo $error; - db_pandora_audit('DB Interface Extension', 'Error in SQL', false, false, $sql); + db_pandora_audit( + AUDIT_LOG_SYSTEM, + 'DB Interface Extension. Error in SQL', + false, + false, + $sql + ); return; } @@ -151,7 +160,13 @@ function dbmgr_extension_main() if (! is_array($result)) { echo 'Output: '.$result; - db_pandora_audit('DB Interface Extension', 'SQL', false, false, $sql); + db_pandora_audit( + AUDIT_LOG_SYSTEM, + 'DB Interface Extension. SQL', + false, + false, + $sql + ); return; } diff --git a/pandora_console/extensions/disabled/matrix_events.php b/pandora_console/extensions/disabled/matrix_events.php index e93cd24f8e..e695e81bcf 100644 --- a/pandora_console/extensions/disabled/matrix_events.php +++ b/pandora_console/extensions/disabled/matrix_events.php @@ -16,7 +16,10 @@ function load_matrix_console() global $config; if (! check_acl($config['id_user'], 0, 'ER')) { - db_pandora_audit('ACL Violation', 'Trying to access event viewer'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access event viewer' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/extension_uploader.php b/pandora_console/extensions/extension_uploader.php index 4df1c25bd1..7871ab0b2a 100644 --- a/pandora_console/extensions/extension_uploader.php +++ b/pandora_console/extensions/extension_uploader.php @@ -17,7 +17,7 @@ function extension_uploader_extensions() if (!check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; @@ -61,7 +61,10 @@ function extension_uploader_extensions() } if ($result) { - db_pandora_audit('Extension manager', 'Upload extension '.$_FILES['extension']['name']); + db_pandora_audit( + AUDIT_LOG_EXTENSION_MANAGER, + 'Upload extension '.$_FILES['extension']['name'] + ); } ui_print_result_message( diff --git a/pandora_console/extensions/files_repo.php b/pandora_console/extensions/files_repo.php index d0edb1f591..34e5fe52d2 100644 --- a/pandora_console/extensions/files_repo.php +++ b/pandora_console/extensions/files_repo.php @@ -106,7 +106,10 @@ function pandora_files_repo_godmode() // ACL Check check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to access to Files repository'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access to Files repository' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/insert_data.php b/pandora_console/extensions/insert_data.php index d6b54cdb11..54306ac5d7 100644 --- a/pandora_console/extensions/insert_data.php +++ b/pandora_console/extensions/insert_data.php @@ -58,7 +58,10 @@ function mainInsertData() ui_print_page_header(__('Insert data'), 'images/extensions.png', false, '', true, ''); if (! check_acl($config['id_user'], 0, 'AW') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/matrix_events/ajax.php b/pandora_console/extensions/matrix_events/ajax.php index f83ae58c36..3931770309 100644 --- a/pandora_console/extensions/matrix_events/ajax.php +++ b/pandora_console/extensions/matrix_events/ajax.php @@ -15,7 +15,10 @@ global $config; if (is_ajax()) { if (! check_acl($config['id_user'], 0, 'ER')) { - db_pandora_audit('ACL Violation', 'Trying to access event viewer'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access event viewer' + ); return; } diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 0062c25a13..a04e6a08dc 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -33,7 +33,7 @@ check_login(); // ACL Check. if (!check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Module Groups view' ); include 'general/noaccess.php'; diff --git a/pandora_console/extensions/pandora_logs.php b/pandora_console/extensions/pandora_logs.php index 420d2bc6c1..21b817b978 100644 --- a/pandora_console/extensions/pandora_logs.php +++ b/pandora_console/extensions/pandora_logs.php @@ -56,7 +56,10 @@ function pandoralogs_extension_main() global $config; if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/quick_shell.php b/pandora_console/extensions/quick_shell.php index 54cb24e9f4..bc5f545905 100644 --- a/pandora_console/extensions/quick_shell.php +++ b/pandora_console/extensions/quick_shell.php @@ -46,7 +46,7 @@ function quickShell() if (check_acl($config['id_user'], 0, 'PM') === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Profile Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/extensions/resource_exportation.php b/pandora_console/extensions/resource_exportation.php index 16201ccec0..a9202a0381 100755 --- a/pandora_console/extensions/resource_exportation.php +++ b/pandora_console/extensions/resource_exportation.php @@ -29,7 +29,10 @@ if (isset($_GET['get_ptr'])) { if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } @@ -404,7 +407,10 @@ function resource_exportation_extension_main() check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/extensions/resource_registration.php b/pandora_console/extensions/resource_registration.php index 1d6ae952a7..732c0151ea 100755 --- a/pandora_console/extensions/resource_registration.php +++ b/pandora_console/extensions/resource_registration.php @@ -143,14 +143,14 @@ function process_upload_xml_report($xml, $group_filter=0) if ($id_report) { db_pandora_audit( - 'Report management', + AUDIT_LOG_REPORT_MANAGEMENT, 'Create report '.$id_report, false, false ); } else { db_pandora_audit( - 'Report management', + AUDIT_LOG_REPORT_MANAGEMENT, 'Fail to create report', false, false @@ -554,7 +554,11 @@ function process_upload_xml_visualmap($xml, $filter_group=0) ); if ($id_visual_map !== false) { - db_pandora_audit('CREATE VISUAL CONSOLE', $id_visual_map, $config['id_user']); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Create Visual Console #%s', $id_visual_map), + $config['id_user'] + ); } else { break; } @@ -716,7 +720,11 @@ function process_upload_xml_visualmap($xml, $filter_group=0) ); if ($id_item !== false) { - db_pandora_audit('CREATE ITEM VISUAL CONSOLE', $values['id_layout'].' - '.$id_item, $config['id_user']); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Create Item %s in Visual Console #%s', $id_item, $values['id_layout']), + $config['id_user'] + ); } } else { foreach ($agents_in_item as $id => $agent) { @@ -725,7 +733,7 @@ function process_upload_xml_visualmap($xml, $filter_group=0) $id_item = db_process_sql_insert('tlayout_data', $values); - if (isset($item->other_id)) { + if (isset($item->other_id) === true) { $relation_other_ids[(string) $item->other_id] = $id_item; } @@ -736,9 +744,14 @@ function process_upload_xml_visualmap($xml, $filter_group=0) ); if ($id_item !== false) { - db_pandora_audit('CREATE ITEM VISUAL CONSOLE', $values['id_layout'].' - '.$id_item, $config['id_user']); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Create Item %s in Visual Console #%s', $id_item, $values['id_layout']), + $config['id_user'] + ); } } else { + // TODO: Review this else. foreach ($agent['modules'] as $id_module => $module) { $values['id_agent'] = $id; $values['id_agente_modulo'] = $id_module; @@ -752,7 +765,11 @@ function process_upload_xml_visualmap($xml, $filter_group=0) ); if ($id_item !== false) { - db_pandora_audit('CREATE ITEM VISUAL CONSOLE', $values['id_layout'].' - '.$id_item, $config['id_user']); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Create Item %s in Visual Console #%s', $id_item, $values['id_layout']), + $config['id_user'] + ); } } } @@ -1063,7 +1080,10 @@ function resource_registration_extension_main() global $config; if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } @@ -1100,7 +1120,7 @@ function resource_registration_extension_main() } echo '
'; - echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'

'.__('You can get more resurces in our Public Resource Library'); + echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'

'.__('You can get more resurces in our Public Resource Library'); echo '
'; echo '

'; diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index f5db52a42a..9cbab3b020 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -117,4 +117,6 @@ mobile/include/style/jquery.mobile-1.3.1.css godmode/alerts/configure_alert_special_days.php godmode/admin_access_logs.php enterprise/extensions/backup/main.php -enterprise/extensions/backup.php \ No newline at end of file +enterprise/extensions/backup.php +mobile/include/javascript/jquery.mobile-1.4.5.js +mobile/include/style/jquery.mobile-1.4.5.css \ No newline at end of file diff --git a/pandora_console/extras/mr/52.sql b/pandora_console/extras/mr/52.sql index 3cae8d9ce9..fd4568d18c 100644 --- a/pandora_console/extras/mr/52.sql +++ b/pandora_console/extras/mr/52.sql @@ -9,4 +9,17 @@ ALTER TABLE `talert_execution_queue` DROP COLUMN `extra_macros`, MODIFY COLUMN `data` LONGTEXT; -COMMIT; \ No newline at end of file +ALTER TABLE `talert_templates` ADD COLUMN `schedule` TEXT; +ALTER TABLE `tevent_alert` ADD COLUMN `schedule` TEXT; + +SOURCE procedures/alertTemplates.sql; +CALL `migrateRanges`(); +DROP PROCEDURE `migrateRanges`; + +SOURCE procedures/alertEvents.sql; +CALL `migrateEventRanges`(); +DROP PROCEDURE `migrateEventRanges`; + +ALTER TABLE `tautoconfig` ADD COLUMN `disabled` TINYINT DEFAULT 0; + +COMMIT; diff --git a/pandora_console/extras/mr/procedures/alertEvents.sql b/pandora_console/extras/mr/procedures/alertEvents.sql new file mode 100644 index 0000000000..070a464ea2 --- /dev/null +++ b/pandora_console/extras/mr/procedures/alertEvents.sql @@ -0,0 +1,40 @@ + +CREATE PROCEDURE migrateEventRanges() +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE i INT; + DECLARE r TEXT; + DECLARE cur1 CURSOR FOR SELECT `id` FROM `tevent_alert`; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + UPDATE `tevent_alert` SET `schedule` = '{"monday":_1_,"tuesday":_2_,"wednesday":_3_,"thursday":_4_,"friday":_5_,"saturday":_6_,"sunday":_7_}'; + UPDATE `tevent_alert` SET `time_from` = "00:00:00", `time_to` = "00:00:00" WHERE `time_from` = `time_to`; + + OPEN cur1; + read_loop: LOOP + FETCH cur1 INTO i; + + IF done THEN + LEAVE read_loop; + END IF; + + SELECT concat('[{"start":"', `time_from`, '","end":"', `time_to`, '"}]') into r FROM `tevent_alert` WHERE `id` = i; + + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_1_", r) WHERE `monday` > 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_2_", r) WHERE `tuesday` > 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_3_", r) WHERE `wednesday` > 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_4_", r) WHERE `thursday` > 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_5_", r) WHERE `friday` > 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_6_", r) WHERE `saturday` > 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_7_", r) WHERE `sunday` > 0 AND `id` = i; + + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_1_", '""') WHERE `monday` = 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_2_", '""') WHERE `tuesday` = 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_3_", '""') WHERE `wednesday` = 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_4_", '""') WHERE `thursday` = 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_5_", '""') WHERE `friday` = 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_6_", '""') WHERE `saturday` = 0 AND `id` = i; + UPDATE `tevent_alert` SET `schedule` = REPLACE(`schedule`, "_7_", '""') WHERE `sunday` = 0 AND `id` = i; + END LOOP; + CLOSE cur1; +END ; \ No newline at end of file diff --git a/pandora_console/extras/mr/procedures/alertTemplates.sql b/pandora_console/extras/mr/procedures/alertTemplates.sql new file mode 100644 index 0000000000..4547fef8ed --- /dev/null +++ b/pandora_console/extras/mr/procedures/alertTemplates.sql @@ -0,0 +1,40 @@ + +CREATE PROCEDURE migrateRanges() +BEGIN + DECLARE done INT DEFAULT FALSE; + DECLARE i INT; + DECLARE r TEXT; + DECLARE cur1 CURSOR FOR SELECT `id` FROM `talert_templates`; + DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; + + UPDATE `talert_templates` SET `schedule` = '{"monday":_1_,"tuesday":_2_,"wednesday":_3_,"thursday":_4_,"friday":_5_,"saturday":_6_,"sunday":_7_}'; + UPDATE `talert_templates` SET `time_from` = "00:00:00", `time_to` = "00:00:00" WHERE `time_from` = `time_to`; + + OPEN cur1; + read_loop: LOOP + FETCH cur1 INTO i; + + IF done THEN + LEAVE read_loop; + END IF; + + SELECT concat('[{"start":"', `time_from`, '","end":"', `time_to`, '"}]') into r FROM `talert_templates` WHERE `id` = i; + + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_1_", r) WHERE `monday` > 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_2_", r) WHERE `tuesday` > 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_3_", r) WHERE `wednesday` > 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_4_", r) WHERE `thursday` > 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_5_", r) WHERE `friday` > 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_6_", r) WHERE `saturday` > 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_7_", r) WHERE `sunday` > 0 AND `id` = i; + + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_1_", '""') WHERE `monday` = 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_2_", '""') WHERE `tuesday` = 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_3_", '""') WHERE `wednesday` = 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_4_", '""') WHERE `thursday` = 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_5_", '""') WHERE `friday` = 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_6_", '""') WHERE `saturday` = 0 AND `id` = i; + UPDATE `talert_templates` SET `schedule` = REPLACE(`schedule`, "_7_", '""') WHERE `sunday` = 0 AND `id` = i; + END LOOP; + CLOSE cur1; +END ; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index f8ebdcc3e2..e92025fba0 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -715,6 +715,7 @@ ALTER TABLE `tevent_alert` ADD COLUMN `id_template_conditions` int(10) unsigned ALTER TABLE `tevent_alert` ADD COLUMN `id_template_fields` int(10) unsigned NOT NULL default 0; ALTER TABLE `tevent_alert` ADD COLUMN `last_evaluation` bigint(20) NOT NULL default 0; ALTER TABLE `tevent_alert` ADD COLUMN `pool_occurrences` int unsigned not null default 0; +ALTER TABLE `tevent_alert` ADD COLUMN `schedule` TEXT; -- ----------------------------------------------------- -- Table `tevent_alert_action` @@ -1317,6 +1318,7 @@ ALTER TABLE talert_templates ADD COLUMN `field18_recovery` TEXT NOT NULL DEFAULT ALTER TABLE talert_templates ADD COLUMN `field19_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_templates ADD COLUMN `field20_recovery` TEXT NOT NULL DEFAULT ""; ALTER TABLE `talert_templates` ADD COLUMN `disable_event` tinyint(1) DEFAULT 0; +ALTER TABLE `talert_templates` ADD COLUMN `schedule` TEXT; -- --------------------------------------------------------------------- -- Table `talert_snmp` @@ -1451,13 +1453,13 @@ ALTER TABLE `ttag` MODIFY COLUMN `name` text NOT NULL default ''; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 51); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 52); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 759); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package', 760); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; @@ -2185,6 +2187,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig` ( `name` varchar(100) NOT NULL, `order` int(11) NOT NULL DEFAULT '0', `description` text, + `disabled` TINYINT, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/general/first_task/HA_cluster_builder.php b/pandora_console/general/first_task/HA_cluster_builder.php index e39892b254..2f0bb24a20 100644 --- a/pandora_console/general/first_task/HA_cluster_builder.php +++ b/pandora_console/general/first_task/HA_cluster_builder.php @@ -26,7 +26,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access HA cluster' ); include 'general/noaccess.php'; diff --git a/pandora_console/general/first_task/cluster_builder.php b/pandora_console/general/first_task/cluster_builder.php index 22c624c9a6..3e6fe3dad4 100644 --- a/pandora_console/general/first_task/cluster_builder.php +++ b/pandora_console/general/first_task/cluster_builder.php @@ -17,7 +17,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Inventory' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/agent_incidents.php b/pandora_console/godmode/agentes/agent_incidents.php index 3917c2f81a..796a3afd77 100644 --- a/pandora_console/godmode/agentes/agent_incidents.php +++ b/pandora_console/godmode/agentes/agent_incidents.php @@ -27,7 +27,7 @@ $group = $id_grupo; if (! check_acl($config['id_user'], $group, 'AW', $id_agente)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access agent manager' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 2d77e7de29..9452a9f0b0 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -154,7 +154,10 @@ ui_require_javascript_file('openlayers.pandora'); $new_agent = (empty($id_agente)) ? true : false; if (! isset($id_agente) && ! $new_agent) { - db_pandora_audit('ACL Violation', 'Trying to access agent manager witout an agent'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access agent manager witout an agent' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 7965dbc566..d50a616379 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -70,7 +70,7 @@ if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { if (!$access_granted) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access agent manager' ); include 'general/noaccess.php'; @@ -198,7 +198,10 @@ if ($create_agent) { $grupo = (int) get_parameter_post('grupo'); if ((bool) check_acl($config['id_user'], $grupo, 'AW') === false) { - db_pandora_audit('ACL Violation', 'Trying to access agent manager'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access agent manager' + ); include $config['homedir'].'/general/noaccess.php'; return; } @@ -352,7 +355,7 @@ if ($create_agent) { $unsafe_alias = io_safe_output($alias); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Created agent '.$unsafe_alias, false, true, @@ -1243,7 +1246,7 @@ if ($update_agent) { ui_print_success_message(__('Successfully updated')); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Updated agent '.io_safe_output($alias), false, false, @@ -1259,7 +1262,10 @@ if ($id_agente) { // This has been done in the beginning of the page, but if an agent was created, this id might change. $id_grupo = agents_get_agent_group($id_agente); if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') && !check_acl_one_of_groups($config['id_user'], $all_groups, 'AD')) { - db_pandora_audit('ACL Violation', 'Trying to admin an agent without access'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to admin an agent without access' + ); include 'general/noaccess.php'; exit; } @@ -1319,7 +1325,7 @@ if ($update_module || $create_module) { if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to create a module without admin rights' ); include 'general/noaccess.php'; @@ -1803,7 +1809,7 @@ if ($update_module) { $edit_module = true; db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Fail to try update module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']) ); } else { @@ -1827,7 +1833,7 @@ if ($update_module) { $agent = db_get_row('tagente', 'id_agente', $id_agente); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Updated module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']), false, false, @@ -1989,7 +1995,7 @@ if ($create_module) { $edit_module = true; $moduletype = $id_module; db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']) ); } else { @@ -2014,7 +2020,7 @@ if ($create_module) { $agent = db_get_row('tagente', 'id_agente', $id_agente); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias']), false, true, @@ -2049,12 +2055,12 @@ if ($enable_module) { $success_action = $result; if ($result === NOERR) { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) ); } else { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Fail to enable #'.$enable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) ); } @@ -2084,12 +2090,12 @@ if ($disable_module) { if ($result === NOERR) { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) ); } else { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Fail to disable #'.$disable_module.' | '.$module_name.' | '.io_safe_output($agent['alias']) ); } @@ -2133,7 +2139,7 @@ if ($delete_module) { if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to delete a module without admin rights' ); include 'general/noaccess.php'; @@ -2143,7 +2149,7 @@ if ($delete_module) { if (empty($module_data) || $id_borrar_modulo < 1) { db_pandora_audit( - 'HACK Attempt', + AUDIT_LOG_HACK_ATTEMPT, 'Expected variable from form is not correct' ); include 'general/noaccess.php'; @@ -2165,7 +2171,7 @@ if ($delete_module) { $agent = db_get_row('tagente', 'id_agente', $id_agente); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Deleted module '".io_safe_output($module_data['nombre'])."' for agent ".io_safe_output($agent['alias']) ); } @@ -2206,12 +2212,12 @@ if (!empty($duplicate_module)) { if ($result) { db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Duplicate module '".$id_duplicate_module."' for agent ".$agent['alias'].' with the new id for clon '.$result ); } else { db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Fail to try duplicate module '".$id_duplicate_module."' for agent ".$agent['alias'] ); } @@ -2225,9 +2231,15 @@ if ($enable_module) { if ($result === NOERR) { enterprise_hook('config_agents_enable_module_conf', [$id_agente, $enable_module]); - db_pandora_audit('Module management', 'Enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias'] + ); } else { - db_pandora_audit('Module management', 'Fail to enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias']); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Fail to enable #'.$enable_module.' | '.$modulo_nombre.' | '.$agent['alias'] + ); } ui_print_result_message( @@ -2244,9 +2256,15 @@ if ($disable_module) { if ($result === NOERR) { enterprise_hook('config_agents_disable_module_conf', [$id_agente, $disable_module]); - db_pandora_audit('Module management', 'Disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias'] + ); } else { - db_pandora_audit('Module management', 'Fail to disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias']); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Fail to disable #'.$disable_module.' | '.$modulo_nombre.' | '.$agent['alias'] + ); } ui_print_result_message( diff --git a/pandora_console/godmode/agentes/configure_field.php b/pandora_console/godmode/agentes/configure_field.php index 0f7a42820a..7ef0fe042a 100755 --- a/pandora_console/godmode/agentes/configure_field.php +++ b/pandora_console/godmode/agentes/configure_field.php @@ -16,7 +16,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to access Group Management2'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Group Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php index 3fd8db3849..960ed62776 100644 --- a/pandora_console/godmode/agentes/fields_manager.php +++ b/pandora_console/godmode/agentes/fields_manager.php @@ -18,7 +18,7 @@ check_login(); if (!check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index e2aca5017f..2d6dd90bbe 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -58,7 +58,7 @@ if (! check_acl( ) ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access agent manager' ); include 'general/noaccess.php'; @@ -158,7 +158,7 @@ if ($agent_to_delete) { } else { // NO permissions. db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, "Trying to delete agent \'".agents_get_name($id_agente)."\'" ); include 'general/noaccess.php'; @@ -219,12 +219,12 @@ if ($enable_agent) { ] ); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Enable '.$alias ); } else { db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Fail to enable '.$alias ); } @@ -262,12 +262,12 @@ if ($disable_agent) { ); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Disable '.$alias ); } else { db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Fail to disable '.$alias ); } diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 1d39f0525a..dd1427af17 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -144,7 +144,7 @@ if ($prediction_available) { $modules['predictionserver'] = __('Create a new prediction server module'); } -if (is_metaconsole() === true || $web_available === '1') { +if (is_metaconsole() === true || $web_available >= '1') { $modules['webserver'] = __('Create a new web Server module'); } @@ -238,7 +238,7 @@ echo ''; if (!$config['disable_help']) { echo ''; } @@ -261,7 +261,7 @@ if ($module_action === 'delete') { if (! check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to delete a module without admin rights' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index c4e62816cb..005b1e578f 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -549,7 +549,7 @@ if ($is_function_policies !== ENTERPRISE_NOT_HOOK) { ); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Re-link module '.$id_agent_module ); } @@ -562,7 +562,10 @@ if ($is_function_policies !== ENTERPRISE_NOT_HOOK) { __('Module will be unlinked in the next application') ); - db_pandora_audit('Agent management', 'Unlink module '.$id_agent_module); + db_pandora_audit( + AUDIT_LOG_AGENT_MANAGEMENT, + 'Unlink module '.$id_agent_module + ); } } @@ -582,7 +585,7 @@ if ($__code_from !== 'policies') { if (!$tag_acl) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access agent manager' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php b/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php index 9616d568a3..6fa81baca7 100644 --- a/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php +++ b/pandora_console/godmode/agentes/pandora_networkmap_empty.editor.php @@ -73,7 +73,7 @@ if ($edit_networkmap) { if (!$networkmap_write && !$networkmap_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access networkmap' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php index 7d73a400c3..4eec189958 100644 --- a/pandora_console/godmode/agentes/planned_downtime.editor.php +++ b/pandora_console/godmode/agentes/planned_downtime.editor.php @@ -38,7 +38,7 @@ $agent_w = check_acl($config['id_user'], 0, 'AW'); $access = ($agent_d == true) ? 'AD' : (($agent_w == true) ? 'AW' : 'AD'); if (!$agent_d && !$agent_w) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -170,7 +170,7 @@ if ($delete_downtime_agent === 1) { || !in_array($downtime_group, $user_groups_ad) ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -189,7 +189,7 @@ if ($delete_downtime_agent === 1) { || !in_array($agent_group, $user_groups_ad) ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -266,7 +266,7 @@ if ($create_downtime || $update_downtime) { // Check AD permission on new downtime. if (!in_array($id_group, $user_groups_ad)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -324,7 +324,7 @@ if ($create_downtime || $update_downtime) { // Check AD permission on OLD downtime. if (empty($old_downtime) || !in_array($old_downtime['id_group'], $user_groups_ad)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -334,7 +334,7 @@ if ($create_downtime || $update_downtime) { // Check AD permission on NEW downtime group. if (!in_array($id_group, $user_groups_ad)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -498,7 +498,7 @@ if ($id_downtime > 0) { // Permission check for the downtime with the AD user groups if (empty($result) || !in_array($result['id_group'], $user_groups_ad)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -639,20 +639,20 @@ $table->data[5][1] = " ".ui_get_using_system_timezone_warning().' '.__('Type Periodicity:').' '.html_print_select( - [ - 'weekly' => __('Weekly'), - 'monthly' => __('Monthly'), - ], - 'type_periodicity', - $type_periodicity, - 'change_type_periodicity();', - '', - 0, - true, - false, - true, - '', - $disabled_in_execution + [ + 'weekly' => __('Weekly'), + 'monthly' => __('Monthly'), + ], + 'type_periodicity', + $type_periodicity, + 'change_type_periodicity();', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution )." @@ -672,31 +672,31 @@ $table->data[5][1] = " ".__('From day:').' '.html_print_select( - $days, - 'periodically_day_from', - $periodically_day_from, - '', - '', - 0, - true, - false, - true, - '', - $disabled_in_execution + $days, + 'periodically_day_from', + $periodically_day_from, + '', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution ).' '.__('To day:').' '.html_print_select( - $days, - 'periodically_day_to', - $periodically_day_to, - '', - '', - 0, - true, - false, - true, - '', - $disabled_in_execution + $days, + 'periodically_day_to', + $periodically_day_to, + '', + '', + 0, + true, + false, + true, + '', + $disabled_in_execution ).' '.ui_print_help_tip(__('The end day must be higher than the start day'), true).' @@ -705,26 +705,26 @@ $table->data[5][1] = " '.__('From hour:').' '.html_print_input_text( - 'periodically_time_from', - $periodically_time_from, - '', - 7, - 7, - true, - $disabled_in_execution + 'periodically_time_from', + $periodically_time_from, + '', + 7, + 7, + true, + $disabled_in_execution ).ui_print_help_tip( __('The end time must be higher than the start time'), true ).' '.__('To hour:').' '.html_print_input_text( - 'periodically_time_to', - $periodically_time_to, - '', - 7, - 7, - true, - $disabled_in_execution + 'periodically_time_to', + $periodically_time_to, + '', + 7, + 7, + true, + $disabled_in_execution ).ui_print_help_tip( __('The end time must be higher than the start time'), true @@ -1008,13 +1008,13 @@ $table->data['module'][1] = " ".''.html_print_image( - 'images/cross.png', - true, - [ - 'border' => '0', - 'alt' => __('Delete'), - 'class' => 'invert_filter', - ] + 'images/cross.png', + true, + [ + 'border' => '0', + 'alt' => __('Delete'), + 'class' => 'invert_filter', + ] ).''." @@ -1093,7 +1093,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad) || !in_array($downtime_group, $user_groups_ad) ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/planned_downtime.export_csv.php b/pandora_console/godmode/agentes/planned_downtime.export_csv.php index 7e0aff8a34..d61df4e8c3 100644 --- a/pandora_console/godmode/agentes/planned_downtime.export_csv.php +++ b/pandora_console/godmode/agentes/planned_downtime.export_csv.php @@ -23,7 +23,10 @@ require_once '../../include/functions_reporting.php'; $config['id_user'] = $_SESSION['id_usuario']; if (! check_acl($config['id_user'], 0, 'AR')) { - db_pandora_audit('ACL Violation', 'Trying to access downtime scheduler'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access downtime scheduler' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index cdd8bae876..fadea37460 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -23,7 +23,7 @@ $access = ($read_permisson == true) ? 'AR' : (($write_permisson == true) ? 'AD' if (! $read_permisson && !$manage_permisson) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -70,7 +70,7 @@ if ($stop_downtime) { // Check AD permission on the downtime if (empty($downtime) || (! check_acl($config['id_user'], $downtime['id_group'], 'AD') && ! check_acl($config['id_user'], $downtime['id_group'], 'AW'))) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; @@ -94,7 +94,7 @@ if ($delete_downtime) { // Check AD permission on the downtime if (empty($downtime) || (! check_acl($config['id_user'], $downtime['id_group'], 'AD') && ! check_acl($config['id_user'], $downtime['id_group'], 'AW'))) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access downtime scheduler' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/agentes/status_monitor_custom_fields.php b/pandora_console/godmode/agentes/status_monitor_custom_fields.php index 2b4b3d0538..d9960c7547 100644 --- a/pandora_console/godmode/agentes/status_monitor_custom_fields.php +++ b/pandora_console/godmode/agentes/status_monitor_custom_fields.php @@ -20,7 +20,7 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'], 0, 'AM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index de9d6e126d..873d91598c 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -42,7 +42,7 @@ enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert actions' ); include 'general/noaccess.php'; @@ -104,7 +104,7 @@ if ($copy_action) { // Then action group have to be in his own groups. if (!$is_in_group) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -115,17 +115,14 @@ if ($copy_action) { $result = alerts_clone_alert_action($id, $al_action['id_group']); - if ($result) { - db_pandora_audit( - 'Command management', - 'Duplicate alert action '.$id.' clone to '.$result - ); - } else { - db_pandora_audit( - 'Command management', - 'Fail try to duplicate alert action '.$id - ); - } + $auditMessage = ((bool) $result === true) + ? sprintf('Duplicate alert action %s clone to %s', $id, $result) + : sprintf('Fail try to duplicate alert action %s', $id); + + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + $auditMessage + ); ui_print_result_message( $result, @@ -145,7 +142,7 @@ if ($delete_action) { if (!check_acl_restricted_all($config['id_user'], $al_action['id_group'], 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -158,7 +155,7 @@ if ($delete_action) { // Then must have "PM" access privileges. if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -182,7 +179,7 @@ if ($delete_action) { // Then action group have to be in his own groups. if (!$is_in_group) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -194,17 +191,14 @@ if ($delete_action) { $result = alerts_delete_alert_action($id); - if ($result) { - db_pandora_audit( - 'Command management', - 'Delete alert action #'.$id - ); - } else { - db_pandora_audit( - 'Command management', - 'Fail try to delete alert action #'.$id - ); - } + $auditMessage = ((bool) $result === true) + ? sprintf('Delete alert action #%s', $id) + : sprintf('Fail try to delete alert action #%s', $id); + + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + $auditMessage + ); ui_print_result_message( $result, diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index a480f86651..a10e32aeff 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -21,7 +21,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -538,9 +538,20 @@ if ($create_command) { } if ($result) { - db_pandora_audit('Command management', 'Create alert command #'.$result, false, false, $info); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Create alert command #'.$result, + false, + false, + $info + ); } else { - db_pandora_audit('Command management', 'Fail try to create alert command', false, false); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Fail try to create alert command', + false, + false + ); } // Show errors. @@ -570,7 +581,7 @@ if ($delete_command) { // Internal commands cannot be deleted. if (alerts_get_alert_command_internal($id)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -579,11 +590,14 @@ if ($delete_command) { $result = alerts_delete_alert_command($id); - if ($result) { - db_pandora_audit('Command management', 'Delete alert command #'.$id); - } else { - db_pandora_audit('Command management', 'Fail try to delete alert command #'.$id); - } + $auditMessage = ((bool) $result === true) + ? sprintf('Delete alert command #%s', $id) + : sprintf('Fail try to delete alert command #%s', $id); + + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + $auditMessage + ); ui_print_result_message( $result, diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index f6a60fffae..8da2925473 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 95ace7d345..a721612eed 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -22,7 +22,7 @@ if (! check_acl($config['id_user'], 0, 'LW') && ! check_acl($config['id_user'], 0, 'LM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index 14d9bf10d4..15c55050da 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -21,7 +21,7 @@ if (! check_acl($config['id_user'], 0, 'LW') && ! check_acl($config['id_user'], 0, 'LM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -146,7 +146,7 @@ if ($create_alert) { $unsafe_agent_alias = io_safe_output($agent_alias); if ($id) { db_pandora_audit( - 'Alert management', + AUDIT_LOG_ALERT_MANAGEMENT, "Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'", false, false, @@ -154,7 +154,7 @@ if ($create_alert) { ); } else { db_pandora_audit( - 'Alert management', + AUDIT_LOG_ALERT_MANAGEMENT, "Fail Added alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'" ); } @@ -217,12 +217,12 @@ if ($delete_alert) { if ($result) { db_pandora_audit( - 'Alert management', + AUDIT_LOG_ALERT_MANAGEMENT, "Deleted alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'" ); } else { db_pandora_audit( - 'Alert management', + AUDIT_LOG_ALERT_MANAGEMENT, "Fail to deleted alert '$unsafe_alert_template_name' for module '$unsafe_module_name' in agent '$unsafe_agent_alias'" ); } @@ -255,9 +255,15 @@ if ($add_action) { $result = alerts_add_alert_agent_module_action($id_alert_module, $id_action, $values); if ($result) { - db_pandora_audit('Alert management', 'Add action '.$id_action.' in alert '.$id_alert_module); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Add action '.$id_action.' in alert '.$id_alert_module + ); } else { - db_pandora_audit('Alert management', 'Fail to add action '.$id_action.' in alert '.$id_alert_module); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Fail to add action '.$id_action.' in alert '.$id_alert_module + ); } $messageAction = ui_print_result_message( @@ -290,9 +296,15 @@ if ($update_action) { $result = alerts_update_alert_agent_module_action($id_module_action, $values); if ($result) { - db_pandora_audit('Alert management', 'Update action '.$id_action.' in alert '.$id_alert_module); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Update action '.$id_action.' in alert '.$id_alert_module + ); } else { - db_pandora_audit('Alert management', 'Fail to updated action '.$id_action.' in alert '.$id_alert_module); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Fail to updated action '.$id_action.' in alert '.$id_alert_module + ); } $messageAction = ui_print_result_message( @@ -311,9 +323,15 @@ if ($delete_action) { $result = alerts_delete_alert_agent_module_action($id_action); if ($result) { - db_pandora_audit('Alert management', 'Delete action '.$id_action.' in alert '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Delete action '.$id_action.' in alert '.$id_alert + ); } else { - db_pandora_audit('Alert management', 'Fail to delete action '.$id_action.' in alert '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Fail to delete action '.$id_action.' in alert '.$id_alert + ); } $messageAction = ui_print_result_message( @@ -332,9 +350,15 @@ if ($enable_alert) { $result = alerts_agent_module_disable($id_alert, false); if ($result) { - db_pandora_audit('Alert management', 'Enable '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Enable '.$id_alert + ); } else { - db_pandora_audit('Alert management', 'Fail to enable '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Fail to enable '.$id_alert + ); } $messageAction = ui_print_result_message( @@ -353,9 +377,15 @@ if ($disable_alert) { $result = alerts_agent_module_disable($id_alert, true); if ($result) { - db_pandora_audit('Alert management', 'Disable '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Disable '.$id_alert + ); } else { - db_pandora_audit('Alert management', 'Fail to disable '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Fail to disable '.$id_alert + ); } $messageAction = ui_print_result_message( @@ -374,9 +404,15 @@ if ($standbyon_alert) { $result = alerts_agent_module_standby($id_alert, true); if ($result) { - db_pandora_audit('Alert management', 'Standby '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Standby '.$id_alert + ); } else { - db_pandora_audit('Alert management', 'Fail to standby '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Fail to standby '.$id_alert + ); } $messageAction = ui_print_result_message( @@ -395,9 +431,15 @@ if ($standbyoff_alert) { $result = alerts_agent_module_standby($id_alert, false); if ($result) { - db_pandora_audit('Alert management', 'Standbyoff '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Standbyoff '.$id_alert + ); } else { - db_pandora_audit('Alert management', 'Fail to standbyoff '.$id_alert); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Fail to standbyoff '.$id_alert + ); } $messageAction = ui_print_result_message( diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index 3f6d8625b5..4833ef8b55 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -108,7 +108,7 @@ if (is_ajax()) { if (! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -118,12 +118,7 @@ if (! check_acl($config['id_user'], 0, 'LM')) { $update_template = (bool) get_parameter('update_template'); $delete_template = (bool) get_parameter('delete_template'); $pure = get_parameter('pure', 0); - -if (defined('METACONSOLE')) { - $sec = 'advanced'; -} else { - $sec = 'galertas'; -} +$sec = (is_metaconsole() === true) ? 'advanced' : 'galertas'; // This prevents to duplicate the header in // case delete_templete action is performed. @@ -175,7 +170,7 @@ if ($delete_template) { if ($al_template['id_group'] == 0) { if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -217,7 +212,7 @@ if ($delete_template) { } } else { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -242,12 +237,12 @@ if ($delete_template) { if ($result) { db_pandora_audit( - 'Template alert management', + AUDIT_LOG_ALERT_MANAGEMENT, 'Delete alert template #'.$id ); } else { db_pandora_audit( - 'Template alert management', + AUDIT_LOG_ALERT_MANAGEMENT, 'Fail try to delete alert template #'.$id ); } diff --git a/pandora_console/godmode/alerts/alert_view.php b/pandora_console/godmode/alerts/alert_view.php index cc467b99f8..55fb09e58d 100644 --- a/pandora_console/godmode/alerts/alert_view.php +++ b/pandora_console/godmode/alerts/alert_view.php @@ -1,24 +1,39 @@ class = 'databox'; $table_details->width = '100%'; $table_details->size = []; @@ -103,7 +126,7 @@ $data[1] = ''.html_print_image($img, true, ['title' => $policyInfo['name']]).''; + $policy = ''; + $policy .= html_print_image( + $img, + true, + ['title' => $policyInfo['name']] + ); + $policy .= ''; } $data[0] = __('Policy'); @@ -121,8 +150,7 @@ if (enterprise_installed() && $alert['id_policy_alerts'] != 0) { $table_details->data[] = $data; } -// TABLE DETAILS END -// TABLE CONDITIONS +$table_conditions = new stdClass; $table_conditions->class = 'databox'; $table_conditions->width = '100%'; $table_conditions->size = []; @@ -155,9 +183,13 @@ switch ($template['type']) { case 'max_min': if ($template['matches_value']) { - $condition = __('The alert would fire when the value is between and '); + $condition = __( + 'The alert would fire when the value is between and ' + ); } else { - $condition = __('The alert would fire when the value is not between and '); + $condition = __( + 'The alert would fire when the value is not between and ' + ); } $condition = str_replace('', $template['min_value'], $condition); @@ -200,111 +232,27 @@ switch ($template['type']) { case 'always': $condition = __('Always'); + break; + + default: + // Not possible. + break; } $data[0] = $condition; $table_conditions->data[] = $data; -// DAYS -$table_days->class = 'databox alert_days'; -$table_days->width = '100%'; -$table_days->size = []; -$table_days->data = []; -$table_days->style = []; -$table_days->styleTable = 'padding: 1px; margin: 0px; text-align: center; height: 80px;'; -$table_days->head[0] = __('Mon'); -$table_days->head[1] = __('Tue'); -$table_days->head[2] = __('Wed'); -$table_days->head[3] = __('Thu'); -$table_days->head[4] = __('Fri'); -$table_days->head[5] = __('Sat'); -$table_days->head[6] = __('Sun'); -$table_days->data[0] = array_fill(0, 7, html_print_image('images/blade.png', true)); +$table_conditions->colspan[1][0] = 2; +$schedule = io_safe_output( + $template['schedule'] +); -$days = []; -if ($template['monday']) { - $table_days->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); -} - -if ($template['tuesday']) { - $table_days->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); -} - -if ($template['wednesday']) { - $table_days->data[0][2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); -} - -if ($template['thursday']) { - $table_days->data[0][3] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); -} - -if ($template['friday']) { - $table_days->data[0][4] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); -} - -if ($template['saturday']) { - $table_days->data[0][5] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); -} - -if ($template['sunday']) { - $table_days->data[0][6] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); -} - -$data[0] = html_print_table($table_days, true); -unset($table_days); - -// TIME -$table_time->class = 'databox alert_time'; -$table_time->width = '100%'; -$table_time->size = []; -$table_time->data = []; -$table_time->style = []; -$table_time->styleTable = 'padding: 1px; margin: 0px; text-align: center; height: 80px; width: 100%;'; - -// $data[0] = __('Time from') . ' / ' . __('Time to'); -if ($template['time_from'] == $template['time_to']) { - $table_time->head[0] = '00:00:00
-
23:59:59'; - $table_time->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); -} else { - $from_array = explode(':', $template['time_from']); - $from = ($from_array[0] * SECONDS_1HOUR + $from_array[1] * SECONDS_1MINUTE + $from_array[2]); - $to_array = explode(':', $template['time_to']); - $to = ($to_array[0] * SECONDS_1HOUR + $to_array[1] * SECONDS_1MINUTE + $to_array[2]); - if ($to > $from) { - if ($template['time_from'] != '00:00:00') { - $table_time->head[0] = '00:00:00
-
'.$template['time_from']; - $table_time->data[0][0] = html_print_image('images/blade.png', true); - } - - $table_time->head[1] = $template['time_from'].'
-
'.$template['time_to']; - $table_time->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); - - if ($template['time_to'] != '23:59:59') { - $table_time->head[2] = $template['time_to'].'
-
23:59:59'; - $table_time->data[0][2] = html_print_image('images/blade.png', true); - } - } else { - if ($template['time_to'] != '00:00:00') { - $table_time->head[0] = '00:00:00
-
'.$template['time_to']; - $table_time->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); - } - - $table_time->head[1] = $template['time_to'].'
-
'.$template['time_from']; - $table_time->data[0][1] = html_print_image('images/blade.png', true, ['class' => 'invert_filter']); - - if ($template['time_from'] != '23:59:59') { - $table_time->head[2] = $template['time_from'].'
-
23:59:59'; - $table_time->data[0][2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); - } - } - - $data[1] = $template['time_from'].' / '.$template['time_to']; -} - -$data[1] = html_print_table($table_time, true); -unset($table_time); +$data[0] = ''; +$data[0] .= html_print_input_hidden('schedule', $schedule, true); +$data[0] .= '
'; +$data[1] = ''; $table_conditions->data[] = $data; $data[0] = __('Use special days list'); @@ -319,7 +267,8 @@ $data[0] = __('Number of alerts').' ('.__('Min').'/'.__('Max').')'; $data[1] = $template['min_alerts'].'/'.$template['max_alerts']; $table_conditions->data[] = $data; -// TABLE CONDITIONS END +// TABLE CONDITIONS END. +$table = new stdClass; $table->class = 'alert_list databox'; $table->width = '98%'; $table->size = []; @@ -339,7 +288,8 @@ unset($table); $actions = alerts_get_actions_escalation($actions, $default_action); -// ESCALATION +// ESCALATION. +$table = new stdClass; $table->class = 'alert_list databox alternate alert_escalation'; $table->width = '98%'; $table->size = []; @@ -354,19 +304,33 @@ $table->style[0] = 'font-weight: bold; text-align: left;'; if (count($actions) == 1 && isset($actions[0])) { $table->head[1] = __('Every time that the alert is fired'); $table->data[0][0] = $actions[0]['name']; - $table->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); + $table->data[0][1] = html_print_image( + 'images/tick.png', + true, + ['class' => 'invert_filter'] + ); } else { foreach ($actions as $kaction => $action) { $table->data[$kaction][0] = $action['name']; - if ($kaction == 0) { - $table->data[$kaction][0] .= ui_print_help_tip(__('The default actions will be executed every time that the alert is fired and no other action is executed'), true); + if ((int) $kaction === 0) { + $table->data[$kaction][0] .= ui_print_help_tip( + __('The default actions will be executed every time that the alert is fired and no other action is executed'), + true + ); } foreach ($action['escalation'] as $k => $v) { if ($v > 0) { - $table->data[$kaction][$k] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']); + $table->data[$kaction][$k] = html_print_image( + 'images/tick.png', + true, + ['class' => 'invert_filter'] + ); } else { - $table->data[$kaction][$k] = html_print_image('images/blade.png', true); + $table->data[$kaction][$k] = html_print_image( + 'images/blade.png', + true + ); } if (count($table->head) <= count($action['escalation'])) { @@ -382,12 +346,16 @@ if (count($actions) == 1 && isset($actions[0])) { } } - $action_threshold = $action['module_action_threshold'] > 0 ? $action['module_action_threshold'] : $action['action_threshold']; + $action_threshold = ($action['module_action_threshold'] > 0) ? $action['module_action_threshold'] : $action['action_threshold']; if ($action_threshold == 0) { $table->data[$kaction][($k + 1)] = __('No'); } else { - $table->data[$kaction][($k + 1)] = human_time_description_raw($action_threshold, true, 'tiny'); + $table->data[$kaction][($k + 1)] = human_time_description_raw( + $action_threshold, + true, + 'tiny' + ); } $table->head[($k + 1)] = __('Threshold'); @@ -397,7 +365,8 @@ if (count($actions) == 1 && isset($actions[0])) { html_print_table($table); unset($table); echo ''; -// ESCALATION TABLE +// ESCALATION TABLE. +$table = new stdClass; $table->class = 'alert_list databox'; $table->width = '98%'; $table->size = []; @@ -405,7 +374,7 @@ $table->head = []; $table->data = []; $table->rowstyle[1] = 'font-weight: bold;'; -if ($default_action != 0) { +if ((int) $default_action != 0) { $actions_select[0] = $default_action['name']; } @@ -416,17 +385,43 @@ foreach ($actions as $kaction => $action) { $table->data[0][0] = __('Select the desired action and mode to see the Firing/Recovery fields for this action'); $table->colspan[0][0] = 2; -$table->data[1][0] = __('Action').'
'.html_print_select($actions_select, 'firing_action_select', -1, '', __('Select the action'), -1, true, false, false); +$table->data[1][0] = __('Action'); +$table->data[1][0] .= '
'; +$table->data[1][0] .= html_print_select( + $actions_select, + 'firing_action_select', + -1, + '', + __('Select the action'), + -1, + true, + false, + false +); $modes = []; $modes['firing'] = __('Firing'); $modes['recovering'] = __('Recovering'); -$table->data[1][1] = ''; +$table->data[1][1] = ''; html_print_table($table); -unset($table); +$table = new stdClass; $table->class = 'alert_list databox alternate'; $table->width = '98%'; $table->size = []; @@ -437,13 +432,33 @@ $table->style[1] = 'width: 30%;'; $table->style[2] = 'width: 30%;'; $table->style[3] = 'font-weight: bold; width: 30%;'; -$table->title = __('Firing fields').ui_print_help_tip(__('Fields passed to the command executed by this action when the alert is fired'), true); +$table->title = __('Firing fields'); +$table->title .= ui_print_help_tip( + __('Fields passed to the command executed by this action when the alert is fired'), + true +); -$table->head[0] = __('Field').ui_print_help_tip(__('Fields configured on the command associated to the action'), true); -$table->head[1] = __('Template fields').ui_print_help_tip(__('Triggering fields configured in template'), true); -$table->head[2] = __('Action fields').ui_print_help_tip(__('Triggering fields configured in action'), true); +$table->head[0] = __('Field'); +$table->head[0] .= ui_print_help_tip( + __('Fields configured on the command associated to the action'), + true +); +$table->head[1] = __('Template fields'); +$table->head[1] .= ui_print_help_tip( + __('Triggering fields configured in template'), + true +); +$table->head[2] = __('Action fields'); +$table->head[2] .= ui_print_help_tip( + __('Triggering fields configured in action'), + true +); -$table->head[3] = __('Executed on firing').ui_print_help_tip(__('Fields used on execution when the alert is fired'), true); +$table->head[3] = __('Executed on firing'); +$table->head[3] .= ui_print_help_tip( + __('Fields used on execution when the alert is fired'), + true +); $firing_fields = []; @@ -456,14 +471,12 @@ foreach ($actions as $kaction => $action) { $descriptions = json_decode($command['fields_descriptions'], true); foreach ($descriptions as $kdesc => $desc) { - if (empty($desc)) { - // continue; - } - $field = 'field'.($kdesc + 1); $data = []; - $data[0] = $firing_fields[$kaction]['description'][$field] = $desc; - if (!empty($data[0])) { + $data[0] = $desc; + $firing_fields[$kaction]['description'][$field] = $desc; + + if (empty($data[0]) === false) { $data[0] = ''.$data[0].'
'; } @@ -473,12 +486,14 @@ foreach ($actions as $kaction => $action) { ).')
'; $data[1] = $template[$field]; $data[2] = $action[$field]; - $data[3] = $firing_fields[$kaction]['value'][$field] = empty($action[$field]) ? $template[$field] : $action[$field]; + $data[3] = (empty($action[$field]) === true) ? $template[$field] : $action[$field]; + + $firing_fields[$kaction]['value'][$field] = (empty($action[$field]) === true) ? $template[$field] : $action[$field]; $first_level = $template[$field]; $second_level = $action[$field]; - if (!empty($second_level) || !empty($first_level)) { - if (empty($second_level)) { + if (empty($second_level) === false || empty($first_level) === false) { + if (empty($second_level) === false) { $table->cellclass[count($table->data)][1] = 'used_field'; $table->cellclass[count($table->data)][2] = 'empty_field'; } else { @@ -493,7 +508,7 @@ foreach ($actions as $kaction => $action) { $table->rowclass[] = 'firing_action firing_action_'.$kaction; - if ($command_preview != 'Internal type') { + if ($command_preview !== 'Internal type') { $command_preview = str_replace('_'.$field.'_', $data[3], $command_preview); } } @@ -504,20 +519,32 @@ foreach ($actions as $kaction => $action) { echo ''; -// Firing table +// Firing table. echo ''; -// Recovering table + +ui_require_css_file('main.min', 'include/javascript/fullcalendar/'); +ui_require_javascript_file('main.min', 'include/javascript/fullcalendar/'); +ui_require_javascript_file('pandora_fullcalendar'); ?> '; // Load the data in edit or reload in update. diff --git a/pandora_console/godmode/groups/configure_group.php b/pandora_console/godmode/groups/configure_group.php index 4e34a89331..2077dce6ed 100644 --- a/pandora_console/godmode/groups/configure_group.php +++ b/pandora_console/godmode/groups/configure_group.php @@ -34,7 +34,10 @@ check_login(); enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'AW')) { - db_pandora_audit('ACL Violation', 'Trying to access Group Management2'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Group Management2' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/groups/configure_modu_group.php b/pandora_console/godmode/groups/configure_modu_group.php index 95beb0d39d..0ea11d117f 100644 --- a/pandora_console/godmode/groups/configure_modu_group.php +++ b/pandora_console/godmode/groups/configure_modu_group.php @@ -18,7 +18,10 @@ check_login(); enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to access Group Management2'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Group Management2' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 685076f5b2..990b0bac77 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -47,7 +47,10 @@ if (is_metaconsole() === true) { if (is_ajax() === true) { if ((bool) check_acl($config['id_user'], 0, 'AR') === false) { - db_pandora_audit('ACL Violation', 'Trying to access Group Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Group Management' + ); include 'general/noaccess.php'; return; } @@ -74,7 +77,7 @@ if (is_ajax() === true) { if ((bool) check_acl($config['id_user'], $id_group, 'AR') === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); echo json_encode(false); @@ -117,7 +120,7 @@ if (is_ajax() === true) { if ((bool) check_acl($config['id_user'], $id_group, 'AR') === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); echo json_encode(false); @@ -275,7 +278,7 @@ if ($tab !== 'credbox' && (bool) check_acl($config['id_user'], 0, 'AW') === false ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; @@ -285,7 +288,7 @@ if ($tab !== 'credbox' && (bool) check_acl($config['id_user'], 0, 'PM') === false ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Credential Store' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/groups/modu_group_list.php b/pandora_console/godmode/groups/modu_group_list.php index 24818de618..84dc35ada8 100644 --- a/pandora_console/godmode/groups/modu_group_list.php +++ b/pandora_console/godmode/groups/modu_group_list.php @@ -32,7 +32,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Group Management' ); include 'general/noaccess.php'; @@ -48,7 +48,7 @@ if (is_ajax() === true) { if (! check_acl($config['id_user'], $id_group, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); echo json_encode(false); diff --git a/pandora_console/godmode/massive/massive_add_action_alerts.php b/pandora_console/godmode/massive/massive_add_action_alerts.php index f9a02c8545..178f3c830a 100755 --- a/pandora_console/godmode/massive/massive_add_action_alerts.php +++ b/pandora_console/godmode/massive/massive_add_action_alerts.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive agent deletion section' ); include 'general/noaccess.php'; @@ -150,7 +150,13 @@ if ($add) { 'Fires_max' => $fires_max, 'Actions' => implode(',', $actions), ]; - db_pandora_audit('Massive management', 'Add alert action '.json_encode($id_agents), false, false, json_encode($info)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Add alert action '.json_encode($id_agents), + false, + false, + json_encode($info) + ); ui_print_result_message($results, __('Successfully added'), __('Could not be added')); } } else { diff --git a/pandora_console/godmode/massive/massive_add_alerts.php b/pandora_console/godmode/massive/massive_add_alerts.php index ad81def654..92027c3529 100755 --- a/pandora_console/godmode/massive/massive_add_alerts.php +++ b/pandora_console/godmode/massive/massive_add_alerts.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive alert deletion' ); include 'general/noaccess.php'; @@ -139,16 +139,28 @@ function process_manage_add($id_alert_template, $id_agents, $module_names) $success = alerts_create_alert_agent_module($module, $id_alert_template); if ($success) { - $contsuccess ++; + $contsuccess++; } - $conttotal ++; + $conttotal++; } if ($contsuccess > 0) { - db_pandora_audit('Massive management', 'Add alert', false, false, 'Alert template: '.$id_alert_template.' Modules: '.json_encode($modules_id)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Add alert', + false, + false, + 'Alert template: '.$id_alert_template.' Modules: '.json_encode($modules_id) + ); } else { - db_pandora_audit('Massive management', 'Fail try to add alert', false, false, 'Alert template: '.$id_alert_template.' Modules: '.json_encode($modules_id)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Fail try to add alert', + false, + false, + 'Alert template: '.$id_alert_template.' Modules: '.json_encode($modules_id) + ); } ui_print_result_message( diff --git a/pandora_console/godmode/massive/massive_add_profiles.php b/pandora_console/godmode/massive/massive_add_profiles.php index 71a0b6777a..4a3be0b304 100644 --- a/pandora_console/godmode/massive/massive_add_profiles.php +++ b/pandora_console/godmode/massive/massive_add_profiles.php @@ -31,7 +31,7 @@ check_login(); if (!check_acl($config['id_user'], 0, 'UM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive profile addition' ); include 'general/noaccess.php'; @@ -80,7 +80,7 @@ if ($create_profiles) { // If the profile doesnt exist, we create it if ($profile_data === false) { db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Added profile for user '.io_safe_input($user) ); $return = profile_create_user_profile($user, $profile, $group); @@ -95,7 +95,7 @@ if ($create_profiles) { if ($n_added > 0) { db_pandora_audit( - 'Massive management', + AUDIT_LOG_MASSIVE_MANAGEMENT, 'Add profiles', false, false, @@ -103,7 +103,7 @@ if ($create_profiles) { ); } else { db_pandora_audit( - 'Massive management', + AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail to try add profiles', false, false, diff --git a/pandora_console/godmode/massive/massive_copy_modules.php b/pandora_console/godmode/massive/massive_copy_modules.php index 5abe5a2d26..b6c9f3a420 100755 --- a/pandora_console/godmode/massive/massive_copy_modules.php +++ b/pandora_console/godmode/massive/massive_copy_modules.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Config Management Admin section' ); include 'general/noaccess.php'; @@ -66,7 +66,7 @@ if ($do_operation) { ]; if ($result) { db_pandora_audit( - 'Massive management', + AUDIT_LOG_MASSIVE_MANAGEMENT, 'Copy modules', false, false, @@ -74,7 +74,7 @@ if ($do_operation) { ); } else { db_pandora_audit( - 'Massive management', + AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail to try copy modules', false, false, diff --git a/pandora_console/godmode/massive/massive_delete_action_alerts.php b/pandora_console/godmode/massive/massive_delete_action_alerts.php index 9ce405d64d..cc6f9e4c90 100644 --- a/pandora_console/godmode/massive/massive_delete_action_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_action_alerts.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive agent deletion section' ); include 'general/noaccess.php'; @@ -148,9 +148,21 @@ if ($delete) { ]; if ($results) { - db_pandora_audit('Massive management', 'Delete alert action', false, false, json_encode($info)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Delete alert action', + false, + false, + json_encode($info) + ); } else { - db_pandora_audit('Massive management', 'Fail try to delete alert action', false, false, json_encode($info)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Fail try to delete alert action', + false, + false, + json_encode($info) + ); } ui_print_result_message( diff --git a/pandora_console/godmode/massive/massive_delete_agents.php b/pandora_console/godmode/massive/massive_delete_agents.php index 2808df1d8c..e85a12486d 100755 --- a/pandora_console/godmode/massive/massive_delete_agents.php +++ b/pandora_console/godmode/massive/massive_delete_agents.php @@ -34,7 +34,7 @@ check_login(); if ((bool) check_acl($config['id_user'], 0, 'AW') === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive agent deletion section' ); include 'general/noaccess.php'; @@ -149,9 +149,10 @@ if ($delete === true) { $result = process_manage_delete($id_agents); $info = '{"Agent":"'.implode(',', $id_agents).'"}'; + if ($result === true) { db_pandora_audit( - 'Massive management', + AUDIT_LOG_MASSIVE_MANAGEMENT, 'Delete agent ', false, false, @@ -159,7 +160,7 @@ if ($delete === true) { ); } else { db_pandora_audit( - 'Massive management', + AUDIT_LOG_MASSIVE_MANAGEMENT, 'Fail try to delete agent', false, false, diff --git a/pandora_console/godmode/massive/massive_delete_alerts.php b/pandora_console/godmode/massive/massive_delete_alerts.php index 2256405eb7..39028789de 100755 --- a/pandora_console/godmode/massive/massive_delete_alerts.php +++ b/pandora_console/godmode/massive/massive_delete_alerts.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive alert deletion' ); include 'general/noaccess.php'; @@ -190,10 +190,10 @@ function process_manage_delete($id_alert_template, $id_agents, $module_names) ); if ($success) { - $contsuccess ++; + $contsuccess++; } - $conttotal ++; + $conttotal++; } ui_print_result_message( @@ -223,9 +223,21 @@ if ($delete) { ]; if ($result) { - db_pandora_audit('Massive management', 'Delete alert ', false, false, json_encode($info)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Delete alert ', + false, + false, + json_encode($info) + ); } else { - db_pandora_audit('Massive management', 'Fail try to delete alert', false, false, json_encode($info)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Fail try to delete alert', + false, + false, + json_encode($info) + ); } } diff --git a/pandora_console/godmode/massive/massive_delete_modules.php b/pandora_console/godmode/massive/massive_delete_modules.php index b6a098f07d..f54a127b19 100755 --- a/pandora_console/godmode/massive/massive_delete_modules.php +++ b/pandora_console/godmode/massive/massive_delete_modules.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access agent massive deletion' ); include 'general/noaccess.php'; @@ -230,7 +230,7 @@ if ($delete) { foreach ($module_name as $mod_name) { $result = process_manage_delete($mod_name['nombre'], $id_agent['id_agente'], $modules_selection_mode); - $count ++; + $count++; $success += (int) $result; } } @@ -266,11 +266,16 @@ if ($delete) { 'Agent' => implode(',', $agents_), 'Module' => implode(',', $modules_), ]; - if ($result) { - db_pandora_audit('Massive management', 'Delete module ', false, false, json_encode($info)); - } else { - db_pandora_audit('Massive management', 'Fail try to delete module', false, false, json_encode($info)); - } + + $auditMessage = ((bool) $result === true) ? 'Delete module' : 'Fail try to delete module'; + + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + $auditMessage, + false, + false, + json_encode($info) + ); } $groups = users_get_groups(); diff --git a/pandora_console/godmode/massive/massive_delete_profiles.php b/pandora_console/godmode/massive/massive_delete_profiles.php index bfa490f3cd..3a8611f3c7 100644 --- a/pandora_console/godmode/massive/massive_delete_profiles.php +++ b/pandora_console/godmode/massive/massive_delete_profiles.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'UM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive profile deletion' ); include 'general/noaccess.php'; @@ -96,7 +96,7 @@ if ($delete_profiles) { } else { foreach ($users as $user) { db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Deleted profile for user '.io_safe_input($user) ); @@ -111,9 +111,21 @@ if ($delete_profiles) { ]; if ($result) { - db_pandora_audit('Massive management', 'Delete profile ', false, false, json_encode($info)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Delete profile ', + false, + false, + json_encode($info) + ); } else { - db_pandora_audit('Massive management', 'Fail try to delete profile', false, false, json_encode($info)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Fail try to delete profile', + false, + false, + json_encode($info) + ); } ui_print_result_message( diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 6ba5a3c848..d750e684b3 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive agent deletion section' ); include 'general/noaccess.php'; @@ -189,9 +189,15 @@ if ($update_agents) { if ($n_deleted > 0) { - db_pandora_audit('Massive management', 'Delete conf file '.$id_agent); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Delete conf file '.$id_agent + ); } else { - db_pandora_audit('Massive management', 'Try to delete conf file '.$id_agent); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Try to delete conf file '.$id_agent + ); } @@ -383,10 +389,22 @@ if ($update_agents) { if ($result !== false) { - db_pandora_audit('Massive management', 'Update agent '.$id_agent, false, false, json_encode($info)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Update agent '.$id_agent, + false, + false, + json_encode($info) + ); } else { if (isset($id_agent)) { - db_pandora_audit('Massive management', 'Try to update agent '.$id_agent, false, false, json_encode($info)); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Try to update agent '.$id_agent, + false, + false, + json_encode($info) + ); } } diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 1045e8efa6..73164c4c2f 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive module update' ); include 'general/noaccess.php'; @@ -187,9 +187,21 @@ if ($update) { $info = '{"Modules":"'.implode(',', $modules_).'","Agents":"'.implode(',', $agents_).'"}'; if ($success > 0) { - db_pandora_audit('Massive management', 'Edit module', false, false, $info); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Edit module', + false, + false, + $info + ); } else { - db_pandora_audit('Massive management', 'Fail try to edit module', false, false, $info); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Fail try to edit module', + false, + false, + $info + ); } } diff --git a/pandora_console/godmode/massive/massive_edit_plugins.php b/pandora_console/godmode/massive/massive_edit_plugins.php index bcbed6238d..2e91eafaf8 100644 --- a/pandora_console/godmode/massive/massive_edit_plugins.php +++ b/pandora_console/godmode/massive/massive_edit_plugins.php @@ -14,7 +14,7 @@ * |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______| * * ============================================================================ - * Copyright (c) 2005-2021 Artica Soluciones Tecnologicas + * Copyright (c) 2005-2022 Artica Soluciones Tecnologicas * Please see http://pandorafms.org for full contribution list * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -33,7 +33,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive plugin edition section' ); include 'general/noaccess.php'; @@ -45,7 +45,7 @@ $agent_ids = get_parameter('agent_ids', []); $module_ids = get_parameter('module_ids', []); $module_names = get_parameter('module_names', []); -if (is_ajax()) { +if (is_ajax() === true) { $get_plugin = (bool) get_parameter('get_plugin'); $get_agents = (bool) get_parameter('get_agents'); $get_modules = (bool) get_parameter('get_modules'); @@ -54,21 +54,21 @@ if (is_ajax()) { if ($get_plugin) { $plugin = db_get_row('tplugin', 'id', $plugin_id); - if (empty($plugin)) { + if (empty($plugin) === true) { $plugin = []; } - if (isset($plugin['description'])) { + if (isset($plugin['description']) === true) { $plugin['description'] = io_safe_output($plugin['description']); $plugin['description'] = str_replace("\n", '
', $plugin['description']); } - if (isset($plugin['macros'])) { + if (isset($plugin['macros']) === true) { $macros = json_decode($plugin['macros'], true); - if (!empty($macros)) { + if (empty($macros) === false) { $macros = array_values($macros); - if (!empty($macros)) { + if (empty($macros) === false) { $plugin['macros'] = $macros; } } @@ -79,15 +79,15 @@ if (is_ajax()) { } if ($get_agents) { - $sql = "SELECT ta.id_agente, ta.alias AS agent_alias, + $sql = 'SELECT ta.id_agente, ta.alias AS agent_alias, tam.nombre AS module_name FROM tagente ta INNER JOIN tagente_modulo tam ON ta.id_agente = tam.id_agente - AND tam.id_plugin = $plugin_id - ORDER BY ta.alias, tam.nombre"; + AND tam.id_plugin = '.$plugin_id.' + ORDER BY ta.alias, tam.nombre'; $result = db_get_all_rows_sql($sql); - if (empty($result)) { + if (empty($result) === true) { $result = []; } @@ -99,7 +99,7 @@ if (is_ajax()) { $name = io_safe_output($value['agent_alias']); $module_name = $value['module_name']; - if (!empty($current_element) && $current_element['id'] !== $id) { + if (empty($current_element) === false && $current_element['id'] !== $id) { $agents[] = $current_element; $current_element = []; } @@ -107,14 +107,14 @@ if (is_ajax()) { $current_element['id'] = $id; $current_element['name'] = $name; - if (!isset($current_element['module_names'])) { + if (isset($current_element['module_names']) === false) { $current_element['module_names'] = []; } $current_element['module_names'][] = $module_name; } - if (!empty($current_element)) { + if (empty($current_element) === false) { $agents[] = $current_element; } @@ -131,7 +131,7 @@ if (is_ajax()) { ]; $module_plugin_macros = db_get_all_rows_filter('tagente_modulo', $filter, $fields); $module_plugin_macros = io_safe_output($module_plugin_macros); - if (empty($module_plugin_macros)) { + if (empty($module_plugin_macros) === true) { $module_plugin_macros = []; } @@ -139,9 +139,9 @@ if (is_ajax()) { $module_plugin_macros, function ($carry, $item) { $macros = json_decode($item['macros'], true); - if (!empty($macros)) { + if (empty($macros) === false) { $macros = array_values($macros); - if (!empty($macros)) { + if (empty($macros) === false) { $carry[] = $macros; } } @@ -160,28 +160,28 @@ if (is_ajax()) { $update = (bool) get_parameter('update'); -if ($update) { +if ($update === true) { try { $plugin = db_get_row('tplugin', 'id', $plugin_id); - // Macros retrieved from the plugin definition + // Macros retrieved from the plugin definition. $plugin_macros = []; - if (isset($plugin['macros'])) { + if (isset($plugin['macros']) === true) { $plugin_macros = json_decode($plugin['macros'], true); - if (!empty($plugin_macros)) { + if (empty($plugin_macros) === false) { $plugin_macros = array_values($plugin_macros); } } - // Error + // Error. if (empty($plugin_macros)) { throw new Exception(__('Error retrieving the plugin macros')); } - // Macros returned by the form + // Macros returned by the form. $macros = get_parameter('macros', []); - // Error - if (empty($macros)) { + // Error. + if (empty($macros) === true) { throw new Exception(__('Error retrieving the modified macros')); } @@ -199,36 +199,36 @@ if ($update) { $filter, $fields ); - if (empty($module_plugin_macros)) { + if (empty($module_plugin_macros) === true) { $module_plugin_macros = []; } - // Error - if (empty($module_plugin_macros)) { + // Error. + if (empty($module_plugin_macros) === true) { throw new Exception(__('Error retrieving the module plugin macros')); } // Begin transaction - // db_process_sql_begin(); + // db_process_sql_begin();. $errors = 0; $count = 0; foreach ($module_plugin_macros as $item) { $module_id = $item['id_agente_modulo']; $module_macros_str = $item['macros']; - // Macros retrieved from the agent module + // Macros retrieved from the agent module. $module_macros = json_decode($module_macros_str, true); - // Error - if (empty($module_macros)) { + // Error. + if (empty($module_macros) === true) { throw new Exception( __('Error retrieving the module plugin macros data') ); } - // Get the new module plugin macros + // Get the new module plugin macros. $result_macros = array_map( function ($item) use ($macros, $module_macros) { $result = [ @@ -238,7 +238,7 @@ if ($update) { 'hide' => $item['hide'], ]; - // Get the default value os the module plugin macro + // Get the default value os the module plugin macro. $default = array_reduce( $module_macros, function ($carry, $module_macro) use ($result) { @@ -259,41 +259,48 @@ if ($update) { $plugin_macros ); - // Error - if (empty($result_macros)) { + // Error. + if (empty($result_macros) === true) { throw new Exception(__('Error building the new macros')); } $module_macros = io_json_mb_encode($result_macros, JSON_FORCE_OBJECT); - if (empty($module_macros)) { + if (empty($module_macros) === true) { $module_macros = $module_macros_str; } $values = ['macros' => $module_macros]; $where = ['id_agente_modulo' => $module_id]; - // $result = db_process_sql_update('tagente_modulo', $values, $where, 'AND', false); $result = db_process_sql_update('tagente_modulo', $values, $where); - if (!$result) { + if ((bool) $result === false) { $errors++; } else { $count += $result; } } - // if (!$errors) { - // db_process_sql_commit(); - // } - // else { - // db_process_sql_rollback(); - // } - // Result message + // Result message. + $auditMessage = sprintf( + 'Plugin #%s modules updated', + $plugin_id + ); ui_print_info_message(sprintf(__('%d modules updated'), $count)); } catch (Exception $e) { + $auditMessage = sprintf( + 'Try to update plugin #%s modules: %s', + $plugin_id, + $e->getMessage() + ); ui_print_error_message($e->getMessage()); } + + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + $auditMessage + ); } $table = new StdClass(); @@ -302,7 +309,7 @@ $table->width = '100%'; $table->rowstyle = []; $table->data = []; -// Plugins +// Plugins. $filter = ['order' => 'name']; $fields = [ 'id', @@ -341,10 +348,10 @@ $row[] = $plugins_select; $table->data['plugin-ids-row'] = $row; -// Agents & modules +// Agents & modules. $row = []; -// Agents +// Agents. $agents_select = html_print_select( $agent_ids, 'agent_ids[]', @@ -360,9 +367,7 @@ $agents_select = html_print_select( $row[] = ''.__('Agents').''; $row[] = $agents_select; -// Modules -// $modules_select = html_print_select ($module_ids, 'module_ids', -// false, '', '', 0, true, true, false); +// Modules. $modules_select = html_print_select( $module_names, 'module_names[]', @@ -393,7 +398,7 @@ echo ''; ?> diff --git a/pandora_console/godmode/massive/massive_enable_disable_alerts.php b/pandora_console/godmode/massive/massive_enable_disable_alerts.php index a8bb7478b5..bfe6d436e8 100644 --- a/pandora_console/godmode/massive/massive_enable_disable_alerts.php +++ b/pandora_console/godmode/massive/massive_enable_disable_alerts.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive alert deletion' ); include 'general/noaccess.php'; @@ -102,11 +102,15 @@ switch ($action) { ui_print_result_message($result, __('Successfully enabled'), __('Could not be enabled')); $info = '{"Alert":"'.implode(',', $id_disabled_alerts).'"}'; - if ($result) { - db_pandora_audit('Massive management', 'Enable alert', false, false, $info); - } else { - db_pandora_audit('Massive management', 'Fail try to enable alert', false, false, $info); - } + + $auditMessage = ((bool) $result === true) ? 'Enable alert' : 'Fail try to enable alert'; + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + $auditMessage, + false, + false, + $info + ); break; case 'disable_alerts': @@ -120,11 +124,15 @@ switch ($action) { ui_print_result_message($result, __('Successfully disabled'), __('Could not be disabled')); $info = '{"Alert":"'.implode(',', $id_enabled_alerts).'"}'; - if ($result) { - db_pandora_audit('Massive management', 'Disable alert', false, false, $info); - } else { - db_pandora_audit('Massive management', 'Fail try to Disable alert', false, false, $info); - } + + $auditMessage = ((bool) $result === true) ? 'Disable alert' : 'Fail try to disable alert'; + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + $auditMessage, + false, + false, + $info + ); break; default: diff --git a/pandora_console/godmode/massive/massive_operations.php b/pandora_console/godmode/massive/massive_operations.php index a3eefc359c..c066816dfd 100755 --- a/pandora_console/godmode/massive/massive_operations.php +++ b/pandora_console/godmode/massive/massive_operations.php @@ -33,7 +33,7 @@ global $config; if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive operation section' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/massive/massive_standby_alerts.php b/pandora_console/godmode/massive/massive_standby_alerts.php index 5844068665..e1def56976 100644 --- a/pandora_console/godmode/massive/massive_standby_alerts.php +++ b/pandora_console/godmode/massive/massive_standby_alerts.php @@ -31,7 +31,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access massive alert deletion' ); include 'general/noaccess.php'; @@ -103,9 +103,21 @@ switch ($action) { $info = '{"Alert":"'.implode(',', $id_standby_alerts).'"}'; if ($result) { - db_pandora_audit('Massive management', 'Set off standby alerts', false, false, $info); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Set off standby alerts', + false, + false, + $info + ); } else { - db_pandora_audit('Massive management', 'Fail try to set off standby alerts', false, false, $info); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Fail try to set off standby alerts', + false, + false, + $info + ); } break; @@ -121,9 +133,21 @@ switch ($action) { $info = '{"Alert":"'.implode(',', $id_not_standby_alerts).'"}'; if ($result) { - db_pandora_audit('Massive management', 'Set on standby alerts', false, false, $info); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Set on standby alerts', + false, + false, + $info + ); } else { - db_pandora_audit('Massive management', 'Fail try to set on standby alerts', false, false, $info); + db_pandora_audit( + AUDIT_LOG_MASSIVE_MANAGEMENT, + 'Fail try to set on standby alerts', + false, + false, + $info + ); } break; diff --git a/pandora_console/godmode/module_library/module_library_view.php b/pandora_console/godmode/module_library/module_library_view.php index 31553a5352..aeab26be20 100644 --- a/pandora_console/godmode/module_library/module_library_view.php +++ b/pandora_console/godmode/module_library/module_library_view.php @@ -32,7 +32,10 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AR')) { // Doesn't have access to this page. - db_pandora_audit('ACL Violation', 'Trying to access Module Library View'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Module Library View' + ); include 'general/noaccess.php'; exit; } @@ -156,8 +159,8 @@ var more_details = ''; var total_modules_text = ''; var view_web = ''; var empty_result = ''; -var error_get_token = ''; -var invalid_user = ''; +var error_get_token = ''; +var invalid_user = ''; var error_main = ''; var error_category = ''; var error_categories = ''; diff --git a/pandora_console/godmode/modules/configuration_wizard_setup.php b/pandora_console/godmode/modules/configuration_wizard_setup.php index 15c5f1b381..d2ec4d0900 100644 --- a/pandora_console/godmode/modules/configuration_wizard_setup.php +++ b/pandora_console/godmode/modules/configuration_wizard_setup.php @@ -25,7 +25,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Network Profile Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/modules/manage_nc_groups.php b/pandora_console/godmode/modules/manage_nc_groups.php index bfac159d4e..e3a546d16f 100644 --- a/pandora_console/godmode/modules/manage_nc_groups.php +++ b/pandora_console/godmode/modules/manage_nc_groups.php @@ -20,7 +20,7 @@ enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access SNMP Group Management' ); include 'general/noaccess.php'; @@ -72,11 +72,12 @@ if ($create) { 'parent' => $parent, ] ); - if ($result) { - db_pandora_audit('Module management', "Create component group #$result"); - } else { - db_pandora_audit('Module management', 'Fail try to create component group'); - } + + $auditMessage = ((bool) $result === true) ? sprintf('Create component group #%s', $result) : 'Fail try to create component group'; + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + $auditMessage + ); ui_print_result_message( $result, @@ -101,11 +102,16 @@ if ($update) { ], ['id_sg' => $id] ); - if ($result) { - db_pandora_audit('Module management', "Update component group #$id"); - } else { - db_pandora_audit('Module management', "Fail try to update component group #$id"); - } + + $auditMessage = ((bool) $result === true) ? 'Update component group' : 'Fail try to update component group'; + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + sprintf( + '%s #%s', + $auditMessage, + $id + ) + ); ui_print_result_message( $result, @@ -131,11 +137,15 @@ if ($delete) { $result = false; } - if ($result) { - db_pandora_audit('Module management', "Delete component group #$id"); - } else { - db_pandora_audit('Module management', "Fail try to delete component group #$id"); - } + $auditMessage = ((bool) $result === true) ? 'Delete component group' : 'Fail try to delete component group'; + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + sprintf( + '%s #%s', + $auditMessage, + $id + ) + ); ui_print_result_message( $result, @@ -168,17 +178,16 @@ if ($multiple_delete) { } $str_ids = implode(',', $ids); - if ($result) { - db_pandora_audit( - 'Module management', - "Multiple delete component group: $str_ids" - ); - } else { - db_pandora_audit( - 'Module management', - "Fail try to delete component group: $str_ids" - ); - } + + $auditMessage = ((bool) $result === true) ? 'Multiple delete component group' : 'Fail try to delete multiple component group'; + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + sprintf( + '%s #%s', + $auditMessage, + $str_ids + ) + ); ui_print_result_message( $result, diff --git a/pandora_console/godmode/modules/manage_nc_groups_form.php b/pandora_console/godmode/modules/manage_nc_groups_form.php index 98cfb8aa81..01beca52ed 100644 --- a/pandora_console/godmode/modules/manage_nc_groups_form.php +++ b/pandora_console/godmode/modules/manage_nc_groups_form.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access SNMO Groups Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index 4ab509dbc0..c4c3a0d2ac 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -34,7 +34,7 @@ enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management' ); include 'general/noaccess.php'; @@ -415,7 +415,7 @@ if ($is_management_allowed === true && $create_component) { if ($id === false || !$id) { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Fail try to create remote component' ); @@ -431,7 +431,10 @@ if ($is_management_allowed === true && $create_component) { return; } - db_pandora_audit('Module management', 'Create network component #'.$id); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Create network component #'.$id + ); ui_print_success_message(__('Created successfully')); $id = 0; } @@ -516,7 +519,7 @@ if ($is_management_allowed === true && $update_component) { if ($result === false || !$result) { db_pandora_audit( - 'Module management', + AUDIT_LOG_MODULE_MANAGEMENT, 'Fail try to update network component #'.$id ); ui_print_error_message(__('Could not be updated')); @@ -524,7 +527,10 @@ if ($is_management_allowed === true && $update_component) { return; } - db_pandora_audit('Module management', 'Update network component #'.$id); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Update network component #'.$id + ); ui_print_success_message(__('Updated successfully')); $id = 0; @@ -535,17 +541,11 @@ if ($is_management_allowed === true && $delete_component) { $result = network_components_delete_network_component($id); - if ($result) { - db_pandora_audit( - 'Module management', - 'Delete network component #'.$id - ); - } else { - db_pandora_audit( - 'Module management', - 'Fail try to delete network component #'.$id - ); - } + $auditMessage = ((bool) $result === true) ? 'Delete network component' : 'Fail try to delete network component'; + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + sprintf('%s #%s', $auditMessage, $id) + ); ui_print_result_message( $result, @@ -567,17 +567,11 @@ if ($is_management_allowed === true && $multiple_delete) { } $str_ids = implode(',', $ids); - if ($result) { - db_pandora_audit( - 'Module management', - 'Multiple delete network component:'.$str_ids - ); - } else { - db_pandora_audit( - 'Module management', - 'Fail try to delete network component:'.$str_ids - ); - } + $auditMessage = ((bool) $result === true) ? 'Multiple delete network component' : 'Fail try to delete multiple network component'; + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + sprintf('%s :%s', $auditMessage, $str_ids) + ); ui_print_result_message( $result, diff --git a/pandora_console/godmode/modules/manage_network_components_form.php b/pandora_console/godmode/modules/manage_network_components_form.php index 559ca0a376..c39fbc86b6 100644 --- a/pandora_console/godmode/modules/manage_network_components_form.php +++ b/pandora_console/godmode/modules/manage_network_components_form.php @@ -33,7 +33,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/modules/manage_network_components_form_common.php b/pandora_console/godmode/modules/manage_network_components_form_common.php index c924eefb2f..095f672a58 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_common.php +++ b/pandora_console/godmode/modules/manage_network_components_form_common.php @@ -18,7 +18,7 @@ include_javascript_d3(); if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/modules/manage_network_components_form_network.php b/pandora_console/godmode/modules/manage_network_components_form_network.php index 7c69e2784c..d91b80161e 100755 --- a/pandora_console/godmode/modules/manage_network_components_form_network.php +++ b/pandora_console/godmode/modules/manage_network_components_form_network.php @@ -33,7 +33,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/modules/manage_network_components_form_wizard.php b/pandora_console/godmode/modules/manage_network_components_form_wizard.php index 990390fe47..0fa9d763c5 100644 --- a/pandora_console/godmode/modules/manage_network_components_form_wizard.php +++ b/pandora_console/godmode/modules/manage_network_components_form_wizard.php @@ -19,7 +19,10 @@ include_javascript_d3(); if (!check_acl($config['id_user'], 0, 'PM') && !check_acl($config['id_user'], 0, 'AW') ) { - db_pandora_audit('ACL Violation', 'Trying to access Agent Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Agent Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/modules/manage_network_components_form_wmi.php b/pandora_console/godmode/modules/manage_network_components_form_wmi.php index 8ea57654cb..19739691fd 100755 --- a/pandora_console/godmode/modules/manage_network_components_form_wmi.php +++ b/pandora_console/godmode/modules/manage_network_components_form_wmi.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/modules/manage_network_templates.php b/pandora_console/godmode/modules/manage_network_templates.php index 9305bd6de1..00dab888b2 100644 --- a/pandora_console/godmode/modules/manage_network_templates.php +++ b/pandora_console/godmode/modules/manage_network_templates.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Network Profile Management' ); include 'general/noaccess.php'; @@ -67,9 +67,15 @@ if ($delete_profile) { $result = network_profiles_delete_network_profile($id); if ($result) { - db_pandora_audit('Module management', "Delete module template #$id"); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Delete module template #'.$id + ); } else { - db_pandora_audit('Module management', "Fail try to delete module template #$id"); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Fail try to delete module template #'.$id + ); } ui_print_result_message( @@ -92,9 +98,15 @@ if ($multiple_delete) { $str_ids = implode(',', $ids); if ($result) { - db_pandora_audit('Module management', "Multiple delete module template: $str_ids"); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Multiple delete module template: '.$str_ids + ); } else { - db_pandora_audit('Module management', "Fail try to delete module template: $str_ids"); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Fail try to delete module template: '.$str_ids + ); } ui_print_result_message( diff --git a/pandora_console/godmode/modules/manage_network_templates_form.php b/pandora_console/godmode/modules/manage_network_templates_form.php index 795e3c8c9b..2bb1e49fe9 100644 --- a/pandora_console/godmode/modules/manage_network_templates_form.php +++ b/pandora_console/godmode/modules/manage_network_templates_form.php @@ -19,7 +19,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Network Profile Management' ); include 'general/noaccess.php'; @@ -97,9 +97,15 @@ if (isset($_GET['create']) || isset($_GET['update'])) { $result = db_process_sql_update('tnetwork_profile', $values, ['id_np' => $id_np]); if ($result) { - db_pandora_audit('Module management', "Update module template #$id_np"); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Update module template #'.$id_np + ); } else { - db_pandora_audit('Module management', "Fail try to update module template #$id_np"); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Fail try to update module template #'.$id_np + ); } ui_print_result_message( @@ -116,9 +122,15 @@ if (isset($_GET['create']) || isset($_GET['update'])) { $result = db_process_sql_insert('tnetwork_profile', $values); if ($result) { - db_pandora_audit('Module management', "Create module template #$result"); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Create module template #'.$result + ); } else { - db_pandora_audit('Module management', 'Fail try to create module template'); + db_pandora_audit( + AUDIT_LOG_MODULE_MANAGEMENT, + 'Fail try to create module template' + ); } ui_print_result_message( diff --git a/pandora_console/godmode/modules/module_list.php b/pandora_console/godmode/modules/module_list.php index 864ebe32c2..f8c07d7848 100644 --- a/pandora_console/godmode/modules/module_list.php +++ b/pandora_console/godmode/modules/module_list.php @@ -17,12 +17,15 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to access module management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access module management' + ); include 'general/noaccess.php'; exit; } -// Header +// Header. ui_print_page_header(__('Module management').' » '.__('Defined modules'), 'images/gm_modules.png', false, '', true); $update_module = (bool) get_parameter_post('update_module'); diff --git a/pandora_console/godmode/netflow/nf_edit.php b/pandora_console/godmode/netflow/nf_edit.php index 51d999ef42..4ba54a9c75 100644 --- a/pandora_console/godmode/netflow/nf_edit.php +++ b/pandora_console/godmode/netflow/nf_edit.php @@ -23,7 +23,7 @@ enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access event viewer' ); include 'general/noaccess.php'; @@ -73,7 +73,7 @@ if ($id > 0) { if (!check_acl_restricted_all($config['id_user'], $filter_group, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access events filter editor' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/netflow/nf_edit_form.php b/pandora_console/godmode/netflow/nf_edit_form.php index 96bc06b87a..19a89ab589 100644 --- a/pandora_console/godmode/netflow/nf_edit_form.php +++ b/pandora_console/godmode/netflow/nf_edit_form.php @@ -25,7 +25,7 @@ enterprise_hook('open_meta_frame'); // Fix: Netflow have to check RW ACL if (! check_acl($config['id_user'], 0, 'RW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access event viewer' ); include $config['homedir'].'/general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/create_container.php b/pandora_console/godmode/reporting/create_container.php index e22a755678..e487723d2e 100644 --- a/pandora_console/godmode/reporting/create_container.php +++ b/pandora_console/godmode/reporting/create_container.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'RW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Inventory Module Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/graph_builder.graph_editor.php b/pandora_console/godmode/reporting/graph_builder.graph_editor.php index dfe8c1d117..baeb179da5 100644 --- a/pandora_console/godmode/reporting/graph_builder.graph_editor.php +++ b/pandora_console/godmode/reporting/graph_builder.graph_editor.php @@ -20,7 +20,7 @@ $report_m = check_acl($config['id_user'], 0, 'RM'); if (!$report_w && !$report_m) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access graph builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/graph_builder.main.php b/pandora_console/godmode/reporting/graph_builder.main.php index 3b77ed932f..a49495626f 100644 --- a/pandora_console/godmode/reporting/graph_builder.main.php +++ b/pandora_console/godmode/reporting/graph_builder.main.php @@ -66,7 +66,7 @@ if (! check_acl($config['id_user'], 0, 'RW') && ! check_acl($config['id_user'], 0, 'RM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access graph builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index bdbee9a14b..391181edf9 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -65,7 +65,7 @@ if (! check_acl($config['id_user'], 0, 'RW') && ! check_acl($config['id_user'], 0, 'RM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access graph builder' ); include 'general/noaccess.php'; @@ -90,7 +90,7 @@ if ($id_graph > 0) { && !check_acl_restricted_all($config['id_user'], $graph_group, 'RM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access graph builder' ); include 'general/noaccess.php'; @@ -145,11 +145,11 @@ if ($add_graph === true) { if (trim($name) != '') { $id_graph = db_process_sql_insert('tgraph', $values); - if ($id_graph !== false) { - db_pandora_audit('Report management', 'Create graph #'.$id_graph); - } else { - db_pandora_audit('Report management', 'Fail try to create graph'); - } + $auditMessage = ($id_graph !== false) ? sprintf('Create graph #%s', $id_graph) : 'Fail try to create graph'; + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + $auditMessage + ); } else { $id_graph = false; } @@ -197,17 +197,16 @@ if ($update_graph) { ], ['id_graph' => $id_graph] ); - if ($success !== false) { - db_pandora_audit( - 'Report management', - 'Update graph #'.$id_graph - ); - } else { - db_pandora_audit( - 'Report management', - 'Fail try to update graph #'.$id_graph - ); - } + + $auditMessage = ($success !== false) ? 'Update graph' : 'Fail try to update graph'; + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + sprintf( + '%s #%s', + $auditMessage, + $id_graph + ) + ); } else { $success = false; } diff --git a/pandora_console/godmode/reporting/graph_container.php b/pandora_console/godmode/reporting/graph_container.php index 765e93ea60..cbc947ef78 100644 --- a/pandora_console/godmode/reporting/graph_container.php +++ b/pandora_console/godmode/reporting/graph_container.php @@ -34,7 +34,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'RR') || enterprise_installed() === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Graph container' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/graphs.php b/pandora_console/godmode/reporting/graphs.php index 0c93074a2d..fce91e47c4 100644 --- a/pandora_console/godmode/reporting/graphs.php +++ b/pandora_console/godmode/reporting/graphs.php @@ -40,7 +40,7 @@ $report_m = check_acl($config['id_user'], 0, 'RM'); if (!$report_r && !$report_w && !$report_m) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Inventory Module Management' ); include 'general/noaccess.php'; @@ -155,17 +155,25 @@ if ($delete_graph) { $result = db_process_sql_delete('tgraph', ['id_graph' => $id]); - if ($result) { - db_pandora_audit('Report management', "Delete graph #$id"); - $result = ui_print_success_message(__('Successfully deleted')); - } else { - db_pandora_audit('Report management', "Fail try to delete graph #$id"); - $result = ui_print_error_message(__('Not deleted. Error deleting data')); - } + $auditMessage = ($result === true) ? 'Delete graph' : 'Fail try to delete graph'; + + ui_print_result_message( + $result, + __('Successfully deleted'), + __('Not deleted. Error deleting data') + ); + + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + sprintf('%s #%s', $auditMessage, $id) + ); echo $result; } else { - db_pandora_audit('ACL Violation', 'Trying to delete a graph from access graph builder'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to delete a graph from access graph builder' + ); include 'general/noaccess.php'; exit; } @@ -191,12 +199,14 @@ if ($multiple_delete) { $result = false; } + $auditMessage = ($result === true) ? 'Multiple delete graph' : 'Fail try to delete graphs'; + $str_ids = implode(',', $ids); - if ($result) { - db_pandora_audit('Report management', "Multiple delete graph: $str_ids"); - } else { - db_pandora_audit('Report management', "Fail try to delete graphs: $str_ids"); - } + + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + sprintf('%s: %s', $auditMessage, $str_ids) + ); ui_print_result_message( $result, diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index b0a8803336..f85849a4ea 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -41,7 +41,7 @@ $is_metaconsole = is_metaconsole(); if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access map builder' ); include 'general/noaccess.php'; @@ -157,7 +157,7 @@ if ($delete_layout || $copy_layout) { // Visual console required if (empty($id_layout)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access map builder' ); include 'general/noaccess.php'; @@ -167,7 +167,7 @@ if ($delete_layout || $copy_layout) { $group_id = db_get_value('id_group', 'tlayout', 'id', $id_layout); if ($group_id === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access map builder' ); include 'general/noaccess.php'; @@ -181,7 +181,7 @@ if ($delete_layout || $copy_layout) { if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access map builder' ); include 'general/noaccess.php'; @@ -197,22 +197,20 @@ if ($delete_layout || $copy_layout) { 'tlayout', ['id' => $id_layout] ); - if ($result) { - db_pandora_audit( - 'Visual console builder', - "Delete visual console #$id_layout" - ); - ui_print_success_message(__('Successfully deleted')); - db_clean_cache(); - } else { - db_pandora_audit( - 'Visual console builder', - "Fail try to delete visual console #$id_layout" - ); - ui_print_error_message( - __('Not deleted. Error deleting data') - ); - } + + $auditMessage = ((bool) $result === true) ? 'Delete visual console' : 'Fail try to delete visual console'; + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('%s #%s', $auditMessage, $id_layout) + ); + + ui_print_result_message( + (bool) $result, + __('Successfully deleted'), + __('Not deleted. Error deleting data') + ); + + db_clean_cache(); $id_layout = 0; } diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index fb93b3b30d..b98b651201 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -40,7 +40,7 @@ if (! check_acl($config['id_user'], 0, 'RW') && ! check_acl($config['id_user'], 0, 'RM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -4004,23 +4004,23 @@ function print_SLA_list($width, $action, $idItem=null) ], ] ); - if (!empty($services_tmp) - && $services_tmp != ENTERPRISE_NOT_HOOK - ) { - foreach ($services_tmp as $service) { - $check_module_sla = modules_check_agentmodule_exists( - $service['sla_id_module'] - ); - $check_module_sla_value = modules_check_agentmodule_exists( - $service['sla_value_id_module'] - ); - if ($check_module_sla - && $check_module_sla_value + if (!empty($services_tmp) + && $services_tmp != ENTERPRISE_NOT_HOOK ) { - $services[$service['id']] = $service['name']; + foreach ($services_tmp as $service) { + $check_module_sla = modules_check_agentmodule_exists( + $service['sla_id_module'] + ); + $check_module_sla_value = modules_check_agentmodule_exists( + $service['sla_value_id_module'] + ); + if ($check_module_sla + && $check_module_sla_value + ) { + $services[$service['id']] = $service['name']; + } + } } - } - } echo ''; echo html_print_select( diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index 45be7d1d6b..2d1cd69d37 100755 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -33,7 +33,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'RW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/reporting_builder.main.php b/pandora_console/godmode/reporting/reporting_builder.main.php index 5b1be809d4..177c84d68d 100755 --- a/pandora_console/godmode/reporting/reporting_builder.main.php +++ b/pandora_console/godmode/reporting/reporting_builder.main.php @@ -27,7 +27,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'RW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 9421f120f2..9d42914034 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -64,7 +64,7 @@ function dialog_message(message_id) { .addClass('checkselected'); $(".check_delete").prop("checked", true); $('.check_delete').each(function(){ - $('#hidden-id_report_'+$(this).val()).prop("disabled", false); + $('#hidden-id_report_'+$(this).val()).prop("disabled", false); }); } else{ @@ -128,7 +128,7 @@ $report_m = check_acl($config['id_user'], 0, 'RM'); $access = ($report_r == true) ? 'RR' : (($report_w == true) ? 'RW' : (($report_m == true) ? 'RM' : 'RR')); if (!$report_r && !$report_w && !$report_m) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -172,7 +172,7 @@ if ($action === 'edit' && $idReport > 0) { && ! check_acl_restricted_all($config['id_user'], $report_group, 'RM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -263,7 +263,7 @@ if ($idReport != 0) { if (!$delete_report_bypass) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -625,7 +625,7 @@ switch ($action) { $delete = true; // Owner can delete. } else { - $delete = check_acl( + $delete = (bool) check_acl( $config['id_user'], $report['id_group'], 'RM' @@ -646,9 +646,9 @@ switch ($action) { break; } - if (! $delete && !empty($type_access_selected)) { + if ($delete === false && empty($type_access_selected) === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder deletion' ); include 'general/noaccess.php'; @@ -656,17 +656,12 @@ switch ($action) { } $result = reports_delete_report($idReport); - if ($result !== false) { - db_pandora_audit( - 'Report management', - 'Delete report #'.$idReport - ); - } else { - db_pandora_audit( - 'Report management', - 'Fail try to delete report #'.$idReport - ); - } + $auditMessage = ($result !== false) ? 'Delete report' : 'Fail try to delete report'; + + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + sprintf('%s #%s', $auditMessage, $idReport) + ); ui_print_result_message( $result, @@ -721,9 +716,9 @@ switch ($action) { break; } - if (! $copy && !empty($type_access_selected)) { + if (! $copy && empty($type_access_selected) === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder copy' ); include 'general/noaccess.php'; @@ -731,17 +726,11 @@ switch ($action) { } $result = reports_copy_report($idReport); - if ($result !== false) { - db_pandora_audit( - 'Report management', - 'Copy report #'.$idReport - ); - } else { - db_pandora_audit( - 'Report management', - 'Fail try to copy report #'.$idReport - ); - } + $auditMessage = ((bool) $result === true) ? 'Copy report' : 'Fail try to copy report'; + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + sprintf('%s #%s', $auditMessage, $idReport) + ); ui_print_result_message( $result, @@ -1421,23 +1410,17 @@ switch ($action) { ['id_report' => $idReport] ); - if ($resultOperationDB !== false) { - db_pandora_audit( - 'Report management', - 'Update report #'.$idReport - ); - } else { - db_pandora_audit( - 'Report management', - 'Fail try to update report #'.$idReport - ); - } + $auditMessage = ($resultOperationDB === true) ? 'Update report' : 'Fail try to update report'; + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + sprintf('%s #%s', $auditMessage, $idReport) + ); } else { $resultOperationDB = false; } $action = 'edit'; - } else if ($action == 'save') { + } else if ($action === 'save') { if ($reportName != '' && $idGroupReport != '') { // This flag allow to differentiate // between normal console and metaconsole reports. @@ -1482,17 +1465,11 @@ switch ($action) { ] ); - if ($idOrResult !== false) { - db_pandora_audit( - 'Report management', - 'Create report #'.$idOrResult - ); - } else { - db_pandora_audit( - 'Report management', - 'Fail try to create report' - ); - } + $auditMessage = ((bool) $idOrResult === true) ? sprintf('Create report #%s', $idOrResult) : 'Fail try to create report'; + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + $auditMessage + ); } else { $idOrResult = false; } diff --git a/pandora_console/godmode/reporting/visual_console_builder.data.php b/pandora_console/godmode/reporting/visual_console_builder.data.php index 6bf5e0922e..e953e94092 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.data.php +++ b/pandora_console/godmode/reporting/visual_console_builder.data.php @@ -41,7 +41,7 @@ if (empty($idVisualConsole)) { if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.php b/pandora_console/godmode/reporting/visual_console_builder.editor.php index 48ef5cc2f9..a8a16ddeb6 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.php +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.php @@ -18,7 +18,7 @@ check_login(); // Visual console required if (empty($visualConsole)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -40,7 +40,7 @@ if (!isset($vconsole_manage)) { if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/visual_console_builder.elements.php b/pandora_console/godmode/reporting/visual_console_builder.elements.php index 295a27e9a3..71508d313a 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.elements.php +++ b/pandora_console/godmode/reporting/visual_console_builder.elements.php @@ -18,7 +18,7 @@ check_login(); // Visual console required if (empty($visualConsole)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -46,7 +46,7 @@ if (!isset($vconsole_manage)) { if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php index b8d939516f..4939102d39 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.php +++ b/pandora_console/godmode/reporting/visual_console_builder.php @@ -31,6 +31,7 @@ global $config; global $statusProcessInDB; +use PandoraFMS\Agent; use PandoraFMS\User; check_login(); @@ -95,7 +96,7 @@ else if ($activeTab != 'data' || ($activeTab == 'data' && $action != 'new')) { // The visual console should exist. if (empty($visualConsole)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -111,7 +112,7 @@ else if ($activeTab != 'data' || ($activeTab == 'data' && $action != 'new')) { $vconsole_manage = check_acl_restricted_all($config['id_user'], $visualConsole['id_group'], 'VM'); } else { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -121,7 +122,7 @@ else if ($activeTab != 'data' || ($activeTab == 'data' && $action != 'new')) { // This section is only to manage the visual console if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -173,7 +174,7 @@ switch ($activeTab) { // The user should have permissions on the new group if (!$vconsole_write_new && !$vconsole_manage_new) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -271,7 +272,10 @@ switch ($activeTab) { } if ($upload_file && !$uploadOK) { - db_pandora_audit('Visual console builder', $error_message); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + $error_message + ); break; } @@ -288,24 +292,30 @@ switch ($activeTab) { } if ($result !== false) { - db_pandora_audit('Visual console builder', "Update visual console #$idVisualConsole"); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Update visual console #%s', $idVisualConsole) + ); $action = 'edit'; $statusProcessInDB = [ 'flag' => true, 'message' => ui_print_success_message(__('Successfully update.'), '', true), ]; - // Return the updated visual console + // Return the updated visual console. $visualConsole = db_get_row_filter( 'tlayout', ['id' => $idVisualConsole] ); // Update the ACL - // $vconsole_read = $vconsole_read_new; + // $vconsole_read = $vconsole_read_new;. $vconsole_write = $vconsole_write_new; $vconsole_manage = $vconsole_manage_new; } else { - db_pandora_audit('Visual console builder', "Fail update visual console #$idVisualConsole"); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Fail update visual console #%s', $idVisualConsole) + ); $statusProcessInDB = [ 'flag' => false, 'message' => ui_print_error_message(__('Could not be update.'), '', true), @@ -321,24 +331,30 @@ switch ($activeTab) { } if ($idVisualConsole !== false) { - db_pandora_audit('Visual console builder', "Create visual console #$idVisualConsole"); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + sprintf('Create visual console #%s', $idVisualConsole) + ); $action = 'edit'; $statusProcessInDB = [ 'flag' => true, 'message' => ui_print_success_message(__('Successfully created.'), '', true), ]; - // Return the updated visual console + // Return the updated visual console. $visualConsole = db_get_row_filter( 'tlayout', ['id' => $idVisualConsole] ); // Update the ACL - // $vconsole_read = $vconsole_read_new; + // $vconsole_read = $vconsole_read_new;. $vconsole_write = $vconsole_write_new; $vconsole_manage = $vconsole_manage_new; } else { - db_pandora_audit('Visual console builder', 'Fail try to create visual console'); + db_pandora_audit( + AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT, + 'Fail try to create visual console' + ); $statusProcessInDB = [ 'flag' => false, 'message' => ui_print_error_message(__('Could not be created.'), '', true), @@ -615,44 +631,30 @@ switch ($activeTab) { 'message' => $message, ]; } else { - // One item per module - if (empty($name_modules)) { - $statusProcessInDB = [ - 'flag' => true, - 'message' => ui_print_error_message( - __('No modules selected'), - '', - true - ), - ]; - } else { - if (defined('METACONSOLE')) { - $agents_ids = []; - foreach ($id_agents as $id_agent_id) { - $server_and_agent = explode('|', $id_agent_id); + if (is_metaconsole() === true) { + $agents_ids = []; + foreach ($id_agents as $id_agent_id) { + $server_and_agent = explode('|', $id_agent_id); - $agents_ids[] = $server_and_agent[1]; - } - - $rows = db_get_all_rows_filter( - 'tmetaconsole_agent', - ['id_tagente' => $agents_ids] - ); - - $agents = []; - foreach ($rows as $row) { - $agents[$row['id_tmetaconsole_setup']][] = $row['id_tagente']; - } - } else { - $agents[0] = $id_agents; + $agents_ids[] = $server_and_agent[1]; } + + $rows = db_get_all_rows_filter( + 'tmetaconsole_agent', + ['id_tagente' => $agents_ids] + ); + + $agents = []; + foreach ($rows as $row) { + $agents[$row['id_tmetaconsole_setup']][] = $row['id_tagente']; + } + } else { + $agents[0] = $id_agents; } - - foreach ($agents as $id_server => $id_agents) { - // Any module - if ($name_modules[0] == '0') { + // Any module. + if (empty($name_modules) === true || $name_modules[0] === '0') { $message .= visual_map_process_wizard_add_agents( $id_agents, $image, @@ -690,19 +692,14 @@ switch ($activeTab) { } else { foreach ($name_modules as $mod) { foreach ($id_agents as $ag) { - $id_module = agents_get_modules( - $ag, - ['id_agente_modulo'], - ['nombre' => $mod] - ); + $agent = new Agent($ag); + $id_module = $agent->searchModules( + ['nombre' => $mod], + 1 + )->toArray()['id_agente_modulo']; - - - if (empty($id_module)) { + if (empty($id_module) === true) { continue; - } else { - $id_module = reset($id_module); - $id_module = $id_module['id_agente_modulo']; } $id_modules[] = $id_module; diff --git a/pandora_console/godmode/reporting/visual_console_builder.wizard.php b/pandora_console/godmode/reporting/visual_console_builder.wizard.php index d792d18adf..2468214dff 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.wizard.php +++ b/pandora_console/godmode/reporting/visual_console_builder.wizard.php @@ -18,7 +18,7 @@ check_login(); // Visual console required. if (empty($visualConsole) === true) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -53,7 +53,7 @@ if (!isset($vconsole_manage)) { if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -533,7 +533,7 @@ echo ''; echo ''; // Trick for it have a traduct text for javascript. -echo ''; +echo ''; echo ''; echo ''; ?> diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index 16b5978dd2..d3b2b515f9 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -43,7 +43,7 @@ $is_metaconsole = is_metaconsole(); if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access map builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index 67605a6a4b..7fceb324f9 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -15,7 +15,7 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'], 0, 'PM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Server Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index d0bc6d791b..8fe9d303f2 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -21,7 +21,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Server Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index c247987c42..791cf9c9b1 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -113,7 +113,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Plugin Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/servers/plugin_registration.php b/pandora_console/godmode/servers/plugin_registration.php index f29364bbc4..0b0be514a7 100644 --- a/pandora_console/godmode/servers/plugin_registration.php +++ b/pandora_console/godmode/servers/plugin_registration.php @@ -39,7 +39,7 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === false || (bool) check_acl($config['id_user'], 0, 'AW') === false ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Plugin Management' ); include 'general/noaccess.php'; @@ -101,7 +101,7 @@ $output .= '

'; $output .= __($str); $output .= '

'; $output .= __('You can get more plugins in our'); -$output .= ''; +$output .= ''; $output .= ' '.__('Public Resource Library'); $output .= ''; $output .= '

'; @@ -152,7 +152,7 @@ if ($error === null) { $error = __('Cannot load INI file'); } else { // Relocate files to target destination. - Files::move($tmp_path.'/*', $basepath.'/', true); + Files::move($tmp_path.'/', $basepath.'/', true); // Extract information. $version = preg_replace('/.*[.]/', '', $filename); diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index 4a7323fc8f..e947fc83f5 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -20,7 +20,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Server Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/setup/file_manager.php b/pandora_console/godmode/setup/file_manager.php index af7e9d6e3a..e969f1d57f 100644 --- a/pandora_console/godmode/setup/file_manager.php +++ b/pandora_console/godmode/setup/file_manager.php @@ -32,7 +32,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to access File manager'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access File manager' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/gis.php b/pandora_console/godmode/setup/gis.php index 9f8ed7eee0..ff0f4f426c 100755 --- a/pandora_console/godmode/setup/gis.php +++ b/pandora_console/godmode/setup/gis.php @@ -19,7 +19,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Visual Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Visual Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/gis_step_2.php b/pandora_console/godmode/setup/gis_step_2.php index 2ec5deb0d9..c4f823996e 100644 --- a/pandora_console/godmode/setup/gis_step_2.php +++ b/pandora_console/godmode/setup/gis_step_2.php @@ -19,7 +19,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Visual Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Visual Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/license.php b/pandora_console/godmode/setup/license.php index 3d9fa1171c..8ae1827cb8 100644 --- a/pandora_console/godmode/setup/license.php +++ b/pandora_console/godmode/setup/license.php @@ -32,7 +32,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { - db_pandora_audit('ACL Violation', 'Trying to change License settings'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to change License settings' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/links.php b/pandora_console/godmode/setup/links.php index ffeeb7fb23..61781d2e57 100644 --- a/pandora_console/godmode/setup/links.php +++ b/pandora_console/godmode/setup/links.php @@ -16,7 +16,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Link Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Link Management' + ); include 'general/noaccess.php'; exit; } diff --git a/pandora_console/godmode/setup/news.php b/pandora_console/godmode/setup/news.php index 52f7019dc4..b340e70066 100644 --- a/pandora_console/godmode/setup/news.php +++ b/pandora_console/godmode/setup/news.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Link Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/setup/os.builder.php b/pandora_console/godmode/setup/os.builder.php index ff58e8d5b4..83b79e95a4 100644 --- a/pandora_console/godmode/setup/os.builder.php +++ b/pandora_console/godmode/setup/os.builder.php @@ -17,7 +17,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/os.list.php b/pandora_console/godmode/setup/os.list.php index 7ee3bc8093..507f098bc0 100644 --- a/pandora_console/godmode/setup/os.list.php +++ b/pandora_console/godmode/setup/os.list.php @@ -32,7 +32,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/os.php b/pandora_console/godmode/setup/os.php index f347f9f01e..ab864205a4 100644 --- a/pandora_console/godmode/setup/os.php +++ b/pandora_console/godmode/setup/os.php @@ -32,7 +32,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php index 3d71be414c..52a429dc95 100644 --- a/pandora_console/godmode/setup/performance.php +++ b/pandora_console/godmode/setup/performance.php @@ -39,7 +39,10 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user']) ) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 1675f86f3e..665543ef60 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -59,7 +59,10 @@ if (is_ajax()) { if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php index ea3397b30f..59d208afaf 100644 --- a/pandora_console/godmode/setup/setup_auth.php +++ b/pandora_console/godmode/setup/setup_auth.php @@ -25,7 +25,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/setup_ehorus.php b/pandora_console/godmode/setup/setup_ehorus.php index 7d6eaef617..eeabebf0d5 100644 --- a/pandora_console/godmode/setup/setup_ehorus.php +++ b/pandora_console/godmode/setup/setup_ehorus.php @@ -23,7 +23,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/setup_integria.php b/pandora_console/godmode/setup/setup_integria.php index f04ac026e7..460b20e8c6 100644 --- a/pandora_console/godmode/setup/setup_integria.php +++ b/pandora_console/godmode/setup/setup_integria.php @@ -23,7 +23,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index d9127cab49..9a36b3ac1c 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -17,7 +17,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Visual Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Visual Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/setup/snmp_wizard.php b/pandora_console/godmode/setup/snmp_wizard.php index 89750a5b72..e788b408cd 100644 --- a/pandora_console/godmode/setup/snmp_wizard.php +++ b/pandora_console/godmode/setup/snmp_wizard.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Link Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/snmpconsole/snmp_alert.php b/pandora_console/godmode/snmpconsole/snmp_alert.php index 671bb310de..6829d445e1 100755 --- a/pandora_console/godmode/snmpconsole/snmp_alert.php +++ b/pandora_console/godmode/snmpconsole/snmp_alert.php @@ -16,7 +16,7 @@ // Load global vars if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access SNMP Alert Management' ); include 'general/noaccess.php'; @@ -270,10 +270,16 @@ if ($save_alert || $modify_alert) { $result = db_process_sql_insert('talert_snmp', $values); if (!$result) { - db_pandora_audit('SNMP management', 'Fail try to create snmp alert'); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + 'Fail try to create snmp alert' + ); ui_print_error_message(__('There was a problem creating the alert')); } else { - db_pandora_audit('SNMP management', "Create snmp alert #$result"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Create snmp alert #$result" + ); ui_print_success_message(__('Successfully created')); } } else { @@ -400,10 +406,16 @@ if ($save_alert || $modify_alert) { $result = db_process_sql($sql); if (!$result) { - db_pandora_audit('SNMP management', "Fail try to update snmp alert #$id_as"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Fail try to update snmp alert #$id_as" + ); ui_print_error_message(__('There was a problem updating the alert')); } else { - db_pandora_audit('SNMP management', "Update snmp alert #$id_as"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Update snmp alert #$id_as" + ); ui_print_success_message(__('Successfully updated')); } } @@ -497,7 +509,7 @@ if ($update_alert || $duplicate_alert) { if (!check_acl_restricted_all($config['id_user'], $group, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access SNMP Alert Management' ); include 'general/noaccess.php'; @@ -591,14 +603,23 @@ if ($duplicate_alert) { $result = db_process_sql_insert('talert_snmp', $values_duplicate); if (!$result) { - db_pandora_audit('SNMP management', "Fail try to duplicate snmp alert #$id_as"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Fail try to duplicate snmp alert #$id_as" + ); ui_print_error_message(__('There was a problem duplicating the alert')); } else { - db_pandora_audit('SNMP management', "Duplicate snmp alert #$id_as"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Duplicate snmp alert #$id_as" + ); ui_print_success_message(__('Successfully Duplicate')); } } else { - db_pandora_audit('SNMP management', "Fail try to duplicate snmp alert #$id_as"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Fail try to duplicate snmp alert #$id_as" + ); ui_print_error_message(__('There was a problem duplicating the alert')); } } @@ -616,10 +637,16 @@ if ($delete_alert) { ); if ($result === false) { - db_pandora_audit('SNMP management', "Fail try to delete snmp alert #$alert_delete"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Fail try to delete snmp alert #$alert_delete" + ); ui_print_error_message(__('There was a problem deleting the alert')); } else { - db_pandora_audit('SNMP management', "Delete snmp alert #$alert_delete"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Delete snmp alert #$alert_delete" + ); ui_print_success_message(__('Successfully deleted')); } } @@ -637,10 +664,16 @@ if ($multiple_delete) { ); if ($result !== false) { - db_pandora_audit('SNMP management', "Delete snmp alert #$alert_delete"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Delete snmp alert #$alert_delete" + ); $count++; } else { - db_pandora_audit('SNMP management', "Fail try to delete snmp alert #$alert_delete"); + db_pandora_audit( + AUDIT_LOG_SNMP_MANAGEMENT, + "Fail try to delete snmp alert #$alert_delete" + ); } } diff --git a/pandora_console/godmode/snmpconsole/snmp_filters.php b/pandora_console/godmode/snmpconsole/snmp_filters.php index 821d7a7c6e..de9f86697a 100644 --- a/pandora_console/godmode/snmpconsole/snmp_filters.php +++ b/pandora_console/godmode/snmpconsole/snmp_filters.php @@ -14,7 +14,7 @@ // Check ACL if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access SNMP Filter Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/snmpconsole/snmp_trap_generator.php b/pandora_console/godmode/snmpconsole/snmp_trap_generator.php index 15173eee4c..72578868e7 100755 --- a/pandora_console/godmode/snmpconsole/snmp_trap_generator.php +++ b/pandora_console/godmode/snmpconsole/snmp_trap_generator.php @@ -17,7 +17,7 @@ global $config; // Check ACL if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access SNMP Filter Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/tag/edit_tag.php b/pandora_console/godmode/tag/edit_tag.php index bbf1aac06b..37ac7c841b 100644 --- a/pandora_console/godmode/tag/edit_tag.php +++ b/pandora_console/godmode/tag/edit_tag.php @@ -19,7 +19,10 @@ enterprise_hook('open_meta_frame'); require_once $config['homedir'].'/include/functions_tags.php'; if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Edit Tag'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Edit Tag' + ); include 'general/noaccess.php'; return; @@ -110,13 +113,21 @@ if ($update_tag && $id_tag != 0) { $result = tags_update_tag($values, 'id_tag = '.$id_tag); } - if ($result === false) { - db_pandora_audit('Tag management', "Fail try to update tag #$id_tag"); - ui_print_error_message(__('Error updating tag')); - } else { - db_pandora_audit('Tag management', "Update tag #$id_tag"); - ui_print_success_message(__('Successfully updated tag')); - } + $auditMessage = ($result === false) ? 'Fail try to update tag' : 'Update tag'; + db_pandora_audit( + AUDIT_LOG_TAG_MANAGEMENT, + sprintf( + '%s #%s', + $auditMessage, + $id_tag + ) + ); + + ui_print_result_message( + (bool) $result, + __('Successfully updated tag'), + __('Error updating tag') + ); } // Create tag: creates a new tag @@ -140,16 +151,24 @@ if ($create_tag) { } if ($return_create === false) { - db_pandora_audit('Tag management', 'Fail try to create tag'); - ui_print_error_message(__('Error creating tag')); + $auditMessage = 'Fail try to create tag'; $action = 'new'; - // If create action ends successfully then current action is update + // If create action ends successfully then current action is update. } else { - db_pandora_audit('Tag management', "Create tag #$return_create"); - ui_print_success_message(__('Successfully created tag')); + $auditMessage = sprintf('Create tag #%s', $return_create); $id_tag = $return_create; $action = 'update'; } + + db_pandora_audit( + AUDIT_LOG_TAG_MANAGEMENT, + $auditMessage + ); + ui_print_result_message( + $action === 'update', + __('Successfully created tag'), + __('Error creating tag') + ); } // Form fields are filled here diff --git a/pandora_console/godmode/tag/tag.php b/pandora_console/godmode/tag/tag.php index b38e536e74..b808edde9b 100644 --- a/pandora_console/godmode/tag/tag.php +++ b/pandora_console/godmode/tag/tag.php @@ -33,7 +33,10 @@ global $config; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Tag Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Tag Management' + ); include 'general/noaccess.php'; return; } @@ -160,13 +163,21 @@ if (is_metaconsole() === false) { if ($delete !== 0) { $return_delete = tags_delete_tag($delete); - if ($return_delete === false) { - db_pandora_audit('Tag management', 'Fail try to delete tag #'.$delete); - ui_print_error_message(__('Error deleting tag')); - } else { - db_pandora_audit('Tag management', 'Delete tag #'.$delete); - ui_print_success_message(__('Successfully deleted tag')); - } + $auditMessage = ($return_delete === false) ? 'Fail try to delete tag' : 'Delete tag'; + db_pandora_audit( + AUDIT_LOG_TAG_MANAGEMENT, + sprintf( + '%s #%s', + $auditMessage, + $delete + ) + ); + + ui_print_result_message( + (bool) $return_delete !== false, + __('Successfully deleted tag'), + __('Error deleting tag') + ); } $is_management_allowed = is_management_allowed(); diff --git a/pandora_console/godmode/um_client/index.php b/pandora_console/godmode/um_client/index.php index 43385a8317..b8f3420f54 100644 --- a/pandora_console/godmode/um_client/index.php +++ b/pandora_console/godmode/um_client/index.php @@ -50,7 +50,10 @@ if (function_exists('check_acl') === true if ((bool) check_acl($config['id_user'], 0, 'PM') !== true && (bool) is_user_admin($config['id_user']) !== true ) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/update_manager/update_manager.php b/pandora_console/godmode/update_manager/update_manager.php index 67a03aa94f..c6dc09e90f 100644 --- a/pandora_console/godmode/update_manager/update_manager.php +++ b/pandora_console/godmode/update_manager/update_manager.php @@ -17,7 +17,10 @@ check_login(); // The ajax is in // include/ajax/update_manager.ajax.php if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/update_manager/update_manager.setup.php b/pandora_console/godmode/update_manager/update_manager.setup.php index 3a4643a53e..7d466857ba 100644 --- a/pandora_console/godmode/update_manager/update_manager.setup.php +++ b/pandora_console/godmode/update_manager/update_manager.setup.php @@ -35,7 +35,10 @@ require_once __DIR__.'/../../include/functions_update_manager.php'; check_login(); if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) { - db_pandora_audit('ACL Violation', 'Trying to access Setup Management'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access Setup Management' + ); include 'general/noaccess.php'; return; } diff --git a/pandora_console/godmode/users/configure_profile.php b/pandora_console/godmode/users/configure_profile.php index 467bd4703c..b1db4e26e9 100644 --- a/pandora_console/godmode/users/configure_profile.php +++ b/pandora_console/godmode/users/configure_profile.php @@ -31,7 +31,7 @@ enterprise_hook('open_meta_frame'); if (! check_acl($config['id_user'], 0, 'UM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Profile Management' ); include 'general/noaccess.php'; @@ -203,7 +203,7 @@ if ($id_profile || $new_profile) { $network_config_edit = (bool) $profile['network_config_edit'] || $network_config_management; $id_audit = db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Edit profile '.io_safe_output($name) ); enterprise_include_once('include/functions_audit.php'); diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index b91609e257..006f4b41da 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -105,7 +105,7 @@ $is_err = false; if (! check_acl($config['id_user'], 0, 'UM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access User Management' ); include 'general/noaccess.php'; @@ -124,7 +124,7 @@ if (is_ajax()) { $perfil = db_get_row('tperfil', 'id_perfil', $id_perfil); db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Deleted profile for user '.io_safe_output($id2), false, false, @@ -147,7 +147,7 @@ if (is_ajax()) { if ($result) { db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, __('Deleted user %s', io_safe_output($id_user)) ); } @@ -169,7 +169,7 @@ if (is_ajax()) { $result = delete_user($id_user); if ($result) { db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, __('Deleted user %s from metaconsole', io_safe_output($id_user)) ); } @@ -180,7 +180,7 @@ if (is_ajax()) { // Log to the metaconsole too if ($result) { db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, __('Deleted user %s from %s', io_safe_input($id_user), io_safe_input($server['server_name'])) ); } @@ -450,7 +450,7 @@ if ($create_user) { } db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Created user '.io_safe_output($id), false, false, @@ -493,7 +493,7 @@ if ($create_user) { $no_hierarchy = $profile['hierarchy']; db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Added profile for user '.io_safe_output($id2), false, false, @@ -702,7 +702,7 @@ if ($update_user) { db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Updated user '.io_safe_output($id), false, false, @@ -771,7 +771,7 @@ if ($add_profile && empty($json_profile)) { $tags = implode(',', $tags); db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Added profile for user '.io_safe_output($id2), false, false, @@ -808,7 +808,7 @@ if (!users_is_admin() && $config['id_user'] != $id && !$new_user) { $result = db_get_all_rows_sql($sql); if ($result == false && $user_info['is_admin'] == false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access User Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/users/profile_list.php b/pandora_console/godmode/users/profile_list.php index 1ee700c989..7ce7c82cc0 100644 --- a/pandora_console/godmode/users/profile_list.php +++ b/pandora_console/godmode/users/profile_list.php @@ -39,7 +39,7 @@ require_once $config['homedir'].'/include/functions_groups.php'; if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access User Management' ); include 'general/noaccess.php'; @@ -127,7 +127,7 @@ if ($is_management_allowed === true && $delete_profile === true) { ui_print_error_message(__('There was a problem deleting the profile')); } else { db_pandora_audit( - 'Profile management', + AUDIT_LOG_USER_MANAGEMENT, 'Delete profile '.io_safe_output($profile['name']) ); ui_print_success_message(__('Successfully deleted')); @@ -242,7 +242,7 @@ if ($is_management_allowed === true && $update_profile === true) { "'.get_product_name().' Management":"'.$pandora_management.'"}'; db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Update profile '.io_safe_output($name), false, false, @@ -293,7 +293,7 @@ if ($is_management_allowed === true && $create_profile === true) { "'.get_product_name().' Management":"'.$pandora_management.'"}'; db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, 'Created profile '.io_safe_output($name), false, false, diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index e146bf9646..7ac3f55261 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -41,7 +41,7 @@ enterprise_include_once('meta/include/functions_users_meta.php'); if (! check_acl($config['id_user'], 0, 'UM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access User Management' ); include 'general/noaccess.php'; @@ -271,7 +271,7 @@ if ((bool) get_parameter('user_del', false) === true) { if ($result) { db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, __('Deleted user %s', io_safe_output($id_user)) ); } @@ -292,7 +292,7 @@ if ((bool) get_parameter('user_del', false) === true) { $result = delete_user($id_user); if ($result) { db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, __('Deleted user %s from metaconsole', io_safe_input($id_user)) ); } @@ -304,7 +304,7 @@ if ((bool) get_parameter('user_del', false) === true) { // Log to the metaconsole too. if ($result) { db_pandora_audit( - 'User management', + AUDIT_LOG_USER_MANAGEMENT, __('Deleted user %s from %s', io_safe_input($id_user), io_safe_input($server['server_name'])) ); } diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 1c7149588c..24875b9d34 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -228,7 +228,7 @@ class DiscoveryTaskList extends HTML if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access recon task viewer' ); include 'general/noaccess.php'; @@ -269,7 +269,7 @@ class DiscoveryTaskList extends HTML if (!$this->aclMulticheck('RR|RW|RM|PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access recon task viewer' ); include 'general/noaccess.php'; @@ -332,7 +332,7 @@ class DiscoveryTaskList extends HTML if (! check_acl($config['id_user'], 0, 'RM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access recon task viewer' ); include 'general/noaccess.php'; @@ -373,7 +373,7 @@ class DiscoveryTaskList extends HTML if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access recon task viewer' ); include 'general/noaccess.php'; @@ -415,7 +415,7 @@ class DiscoveryTaskList extends HTML if (! check_acl($config['id_user'], 0, 'AW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access recon task viewer' ); include 'general/noaccess.php'; diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index f2819b4e74..36e7df0b21 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -616,7 +616,7 @@ class HostDevices extends Wizard if (! check_acl($config['id_user'], 0, $this->access)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/ajax/alert_list.ajax.php b/pandora_console/include/ajax/alert_list.ajax.php index 4ecc2c0895..dd02e6862e 100644 --- a/pandora_console/include/ajax/alert_list.ajax.php +++ b/pandora_console/include/ajax/alert_list.ajax.php @@ -25,6 +25,7 @@ $enable_alert = (bool) get_parameter('enable_alert'); $get_actions_module = (bool) get_parameter('get_actions_module'); $show_update_action_menu = (bool) get_parameter('show_update_action_menu'); $get_agent_alerts_agent_view = (bool) get_parameter('get_agent_alerts_agent_view'); +$resize_event_week = (bool) get_parameter('resize_event_week'); if ($get_agent_alerts_simple) { $id_agent = (int) get_parameter('id_agent'); @@ -37,7 +38,7 @@ if ($get_agent_alerts_simple) { if (! check_acl($config['id_user'], $id_group, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); echo json_encode(false); @@ -46,7 +47,7 @@ if ($get_agent_alerts_simple) { if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); echo json_encode(false); @@ -331,7 +332,7 @@ if ($get_agent_alerts_agent_view) { if ($enable_alert) { if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); return false; @@ -352,7 +353,7 @@ if ($enable_alert) { if ($disable_alert) { if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); return false; @@ -373,7 +374,7 @@ if ($disable_alert) { if ($get_actions_module) { if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); return false; @@ -394,7 +395,7 @@ if ($get_actions_module) { if ($show_update_action_menu) { if (! check_acl($config['id_user'], 0, 'LW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); return false; @@ -561,4 +562,51 @@ if ($show_update_action_menu) { return; } +if ($resize_event_week === true) { + // Date. + $day_from = get_parameter('day_from', 0); + $day_to = get_parameter('day_to', 0); + + // Time. + $time_from = get_parameter('time_from', ''); + $time_to = get_parameter('time_to', ''); + + $table = new StdClass(); + $table->class = 'databox filters'; + $table->width = '100%'; + $table->data = []; + + $table->data[0][0] = __('From:'); + $table->data[0][1] = html_print_input_hidden( + 'day_from', + $day_from, + true + ); + $table->data[0][1] .= html_print_input_text( + 'time_from_event', + $time_from, + '', + 9, + 9, + true + ); + $table->data[1][0] = __('To:'); + $table->data[1][1] = html_print_input_hidden( + 'day_to', + $day_from, + true + ); + $table->data[1][1] .= html_print_input_text( + 'time_to_event', + ($time_to === '00:00:00') ? '23:59:59' : $time_to, + '', + 9, + 9, + true + ); + + echo html_print_table($table, true); + return; +} + return; diff --git a/pandora_console/include/ajax/double_auth.ajax.php b/pandora_console/include/ajax/double_auth.ajax.php index ebe45a3894..0f85c9c0f5 100644 --- a/pandora_console/include/ajax/double_auth.ajax.php +++ b/pandora_console/include/ajax/double_auth.ajax.php @@ -23,7 +23,7 @@ $id_user_auth = (string) get_parameter('id_user_auth', $config['id_user']); if ($id_user !== $config['id_user'] && $FA_forced != 1) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Double Authentication' ); echo json_encode(-1); diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index 189a76022f..e8a0d5831a 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -47,7 +47,7 @@ if (! check_acl($config['id_user'], 0, 'ER') && ! check_acl($config['id_user'], 0, 'EM') ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access event viewer' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/ajax/group.php b/pandora_console/include/ajax/group.php index 1074ed227b..705ed79e2f 100644 --- a/pandora_console/include/ajax/group.php +++ b/pandora_console/include/ajax/group.php @@ -35,7 +35,7 @@ use PandoraFMS\Group; check_login(); if (! check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access credential store' ); diff --git a/pandora_console/include/ajax/map_enterprise.ajax.php b/pandora_console/include/ajax/map_enterprise.ajax.php index 8d888e4a23..a0178457f5 100644 --- a/pandora_console/include/ajax/map_enterprise.ajax.php +++ b/pandora_console/include/ajax/map_enterprise.ajax.php @@ -42,7 +42,7 @@ if ($networkmap) { if (!$networkmap_read && !$networkmap_write && !$networkmap_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access networkmap' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/ajax/reporting.ajax.php b/pandora_console/include/ajax/reporting.ajax.php index f77edb0d3d..89d5b715fb 100755 --- a/pandora_console/include/ajax/reporting.ajax.php +++ b/pandora_console/include/ajax/reporting.ajax.php @@ -18,7 +18,7 @@ check_login(); if (! check_acl($config['id_user'], 0, 'RW')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/ajax/tree.ajax.php b/pandora_console/include/ajax/tree.ajax.php index c6e9670df8..c00a63df35 100644 --- a/pandora_console/include/ajax/tree.ajax.php +++ b/pandora_console/include/ajax/tree.ajax.php @@ -63,7 +63,7 @@ if (is_ajax() === true) { 'searchAgent' => '', 'statusAgent' => AGENT_STATUS_ALL, 'searchModule' => '', - 'statusModule' => -1, + 'statusModule' => AGENT_MODULE_STATUS_ALL, 'groupID' => 0, 'tagID' => 0, ]; diff --git a/pandora_console/include/ajax/visual_console.ajax.php b/pandora_console/include/ajax/visual_console.ajax.php index cb7e016283..b3739d0c97 100644 --- a/pandora_console/include/ajax/visual_console.ajax.php +++ b/pandora_console/include/ajax/visual_console.ajax.php @@ -23,7 +23,7 @@ check_login(); // Fix: IW was the old ACL to check for report editing, now is RW if (! check_acl($config['id_user'], 0, 'VR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index 9cd2efeb2a..5736815d6c 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -37,7 +37,7 @@ $id_visual_console = get_parameter('id_visual_console', null); // Visual console id required if (empty($id_visual_console)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -48,7 +48,7 @@ if (empty($id_visual_console)) { $group_id = db_get_value('id_group', 'tlayout', 'id', $id_visual_console); if ($group_id === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; @@ -68,7 +68,7 @@ if (!isset($vconsole_manage)) { if (!$vconsole_write && !$vconsole_manage) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access report builder' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index f7f053a80a..cb3dae8e72 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -334,7 +334,7 @@ if ($correctLogin) { * //TODO: Implement a new switch in config to enable / disable * ACL auth failure: if enabled and have lots of traffic can produce * millions of records and a considerable OVERHEAD in the system :( - * db_pandora_audit("API access Failed", $no_login_msg, $user, $ipOrigin); + * db_pandora_ audit("API access Failed", $no_login_msg, $user, $ipOrigin); */ sleep(15); diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index 5f1d168183..c8b3de54fe 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -293,7 +293,7 @@ class AgentWizard extends HTML if (!check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access event viewer' ); diff --git a/pandora_console/include/class/AgentsAlerts.class.php b/pandora_console/include/class/AgentsAlerts.class.php index b7e39af4b7..00f8f334ef 100644 --- a/pandora_console/include/class/AgentsAlerts.class.php +++ b/pandora_console/include/class/AgentsAlerts.class.php @@ -114,7 +114,7 @@ class AgentsAlerts extends HTML if (! check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access event viewer' ); @@ -174,7 +174,10 @@ class AgentsAlerts extends HTML db_process_sql_update('tagente_modulo', ['flag' => 1], $where); } else { - db_pandora_audit('ACL Violation', 'Trying to set flag for groups'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to set flag for groups' + ); include 'general/noaccess.php'; exit; } diff --git a/pandora_console/include/class/AuditLog.class.php b/pandora_console/include/class/AuditLog.class.php index cc73d9e378..b01e494101 100644 --- a/pandora_console/include/class/AuditLog.class.php +++ b/pandora_console/include/class/AuditLog.class.php @@ -69,7 +69,7 @@ class AuditLog extends HTML && is_user_admin($config['id_user']) === true ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Audit Logs' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/class/CalendarManager.class.php b/pandora_console/include/class/CalendarManager.class.php index 9d5db4e80d..fdd4fb963c 100644 --- a/pandora_console/include/class/CalendarManager.class.php +++ b/pandora_console/include/class/CalendarManager.class.php @@ -121,7 +121,7 @@ class CalendarManager // ACL Check. if ((bool) check_acl($config['id_user'], 0, $this->access) !== true) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert calendar view' ); include 'general/noaccess.php'; @@ -420,8 +420,8 @@ class CalendarManager if ($result === true) { db_pandora_audit( - 'Special days list', - 'Upload iCalendar '.$_FILES['ical_file']['name'] + AUDIT_LOG_SYSTEM, + 'Special Days. Upload iCalendar '.$_FILES['ical_file']['name'] ); } diff --git a/pandora_console/include/class/ConfigPEN.class.php b/pandora_console/include/class/ConfigPEN.class.php index 0482c10863..b3e8d9d319 100644 --- a/pandora_console/include/class/ConfigPEN.class.php +++ b/pandora_console/include/class/ConfigPEN.class.php @@ -64,7 +64,7 @@ class ConfigPEN extends HTML if (! check_acl($config['id_user'], 0, 'PM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access PEN Definition feature' ); diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 356867764f..9071614c2a 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -2436,7 +2436,7 @@ class ConsoleSupervisor // Only ask for messages once every 2 hours. $future = (time() + 2 * SECONDS_1HOUR); - config_update_value('last_um_check', $future); + config_update_value('last_um_check', $future, true); $messages = update_manager_get_messages(); if (is_array($messages) === true) { diff --git a/pandora_console/include/class/CredentialStore.class.php b/pandora_console/include/class/CredentialStore.class.php index 718ebe7d4a..f9778a33b5 100644 --- a/pandora_console/include/class/CredentialStore.class.php +++ b/pandora_console/include/class/CredentialStore.class.php @@ -160,7 +160,7 @@ class CredentialStore extends Wizard if (! check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access credential store' ); diff --git a/pandora_console/include/class/CustomNetScan.class.php b/pandora_console/include/class/CustomNetScan.class.php index 1eab6f6634..bb0b420f1e 100644 --- a/pandora_console/include/class/CustomNetScan.class.php +++ b/pandora_console/include/class/CustomNetScan.class.php @@ -282,7 +282,7 @@ class CustomNetScan extends Wizard if (!check_acl($config['id_user'], 0, $this->access)) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Custom Net Scan.' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/class/ExternalTools.class.php b/pandora_console/include/class/ExternalTools.class.php index 368b9d209a..58c021de17 100644 --- a/pandora_console/include/class/ExternalTools.class.php +++ b/pandora_console/include/class/ExternalTools.class.php @@ -56,7 +56,7 @@ class ExternalTools extends HTML if ($this->origin === 'agent') { if (check_acl($config['id_user'], 0, 'AR') === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent Management' ); include 'general/noaccess.php'; @@ -72,7 +72,7 @@ class ExternalTools extends HTML } else if ($this->origin === 'setup') { if (check_acl($config['id_user'], 0, 'PM') === false) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Profile Management' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/class/ManageNetScanScripts.class.php b/pandora_console/include/class/ManageNetScanScripts.class.php index bdcbd26a50..a047cfcb61 100644 --- a/pandora_console/include/class/ManageNetScanScripts.class.php +++ b/pandora_console/include/class/ManageNetScanScripts.class.php @@ -85,7 +85,7 @@ class ManageNetScanScripts extends Wizard if (check_acl($config['id_user'], 0, $this->access) === 0) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Net Scan Script.' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/class/ModuleTemplates.class.php b/pandora_console/include/class/ModuleTemplates.class.php index 90eee1b05f..ba67142560 100644 --- a/pandora_console/include/class/ModuleTemplates.class.php +++ b/pandora_console/include/class/ModuleTemplates.class.php @@ -120,7 +120,7 @@ class ModuleTemplates extends HTML if (! check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access event viewer' ); diff --git a/pandora_console/include/class/NetworkMap.class.php b/pandora_console/include/class/NetworkMap.class.php index f562f8110c..9d36db8bc8 100644 --- a/pandora_console/include/class/NetworkMap.class.php +++ b/pandora_console/include/class/NetworkMap.class.php @@ -3564,7 +3564,7 @@ class NetworkMap && !$networkmap_manage ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access networkmap' ); include 'general/noaccess.php'; diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 8dd8b97698..0c16a66e41 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -929,7 +929,9 @@ class Tree $agents_aux = []; foreach ($agents as $iterator => $agent) { $this->processAgent($agents[$iterator], $server); - if ($agents[$iterator]['counters']['total'] !== '0') { + if ($agents[$iterator]['counters']['total'] !== '0' + || (bool) $this->filter['show_not_init_agents'] === true + ) { $agents_aux[] = $agents[$iterator]; } } diff --git a/pandora_console/include/class/WebServerModuleDebug.class.php b/pandora_console/include/class/WebServerModuleDebug.class.php index e0e6f23c84..26bbb8b2f1 100644 --- a/pandora_console/include/class/WebServerModuleDebug.class.php +++ b/pandora_console/include/class/WebServerModuleDebug.class.php @@ -81,7 +81,7 @@ class WebServerModuleDebug extends Wizard if (! check_acl($config['id_user'], 0, 'AR')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access event viewer' ); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d3331fe249..c3481fec29 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC220202'; +$build_version = 'PC220216'; $pandora_version = 'v7.0NG.759'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index f2b73b332d..ba7ef746da 100644 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -769,3 +769,30 @@ define('COMMAND_PING', 2); define('COMMAND_SNMP', 3); define('COMMAND_NMAP', 4); define('COMMAND_DIGWHOIS', 5); + +// Audit logs. +define('AUDIT_LOG_SETUP', 'Setup'); +define('AUDIT_LOG_SYSTEM', 'System'); +define('AUDIT_LOG_HACK_ATTEMPT', 'HACK Attempt'); +define('AUDIT_LOG_ACL_VIOLATION', 'ACL Violation'); +define('AUDIT_LOG_METACONSOLE_NODE', 'Metaconsole node'); +define('AUDIT_LOG_USER_REGISTRATION', 'Console user registration'); +define('AUDIT_LOG_EXTENSION_MANAGER', 'Extension manager'); +define('AUDIT_LOG_WEB_SOCKETS', 'WebSockets engine'); +define('AUDIT_LOG_USER_MANAGEMENT', 'User management'); +define('AUDIT_LOG_AGENT_MANAGEMENT', 'Agent management'); +define('AUDIT_LOG_MODULE_MANAGEMENT', 'Module management'); +define('AUDIT_LOG_CATEGORY_MANAGEMENT', 'Category management'); +define('AUDIT_LOG_REPORT_MANAGEMENT', 'Report management'); +define('AUDIT_LOG_MASSIVE_MANAGEMENT', 'Massive operation management'); +define('AUDIT_LOG_POLICY_MANAGEMENT', 'Policy management'); +define('AUDIT_LOG_AGENT_REMOTE_MANAGEMENT', 'Agent remote configuration'); +define('AUDIT_LOG_FILE_COLLECTION', 'File collection'); +define('AUDIT_LOG_ALERT_MANAGEMENT', 'Alert management'); +define('AUDIT_LOG_ALERT_CORRELATION_MANAGEMENT', 'Alert correlation management'); +define('AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT', 'Visual Console Management'); +define('AUDIT_LOG_TAG_MANAGEMENT', 'Tag management'); +define('AUDIT_LOG_SNMP_MANAGEMENT', 'SNMP management'); +define('AUDIT_LOG_DASHBOARD_MANAGEMENT', 'Dashboard management'); +define('AUDIT_LOG_SERVICE_MANAGEMENT', 'Service management'); +define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management'); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index baaa10a317..d66612128e 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -2282,7 +2282,11 @@ function check_login($output=true) return false; } - db_pandora_audit('No session', 'Trying to access without a valid session', 'N/A'); + db_pandora_audit( + AUDIT_LOG_HACK_ATTEMPT, + 'Trying to access without a valid session', + 'N/A' + ); include $config['homedir'].'/general/noaccess.php'; exit; } @@ -5963,7 +5967,13 @@ function send_test_email( $result = $mailer->send($message); } catch (Exception $e) { error_log($e->getMessage()); - db_pandora_audit('Cron jobs mail', $e->getMessage()); + db_pandora_audit( + AUDIT_LOG_SYSTEM, + sprintf( + 'Cron jobs mail: %s', + $e->getMessage() + ) + ); } return $result; diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 6fd1f7cc65..56b9031e77 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -272,7 +272,10 @@ function agents_create_agent( agents_add_address($id_agent, $ip_address); } - db_pandora_audit('Agent management', 'New agent '.$name.' created'); + db_pandora_audit( + AUDIT_LOG_AGENT_MANAGEMENT, + 'New agent '.$name.' created' + ); return $id_agent; } @@ -1427,6 +1430,9 @@ function agents_get_group_agents( /** + * @deprecated use \PandoraFMS\Agent::searchModules + * + * * Get all the modules in an agent. If an empty list is passed it will select all * * @param mixed Agent id to get modules. It can also be an array of agent id's, by default is null and this mean that use the ids of agents in user's groups. @@ -2116,7 +2122,7 @@ function agents_delete_address($id_agent, $ip_address) $agent_name = agents_get_name($id_agent, ''); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, "Deleted IP $ip_address from agent '$agent_name'" ); @@ -2584,12 +2590,12 @@ function agents_delete_agent($id_agents, $disableACL=false) error_log($e->getMessage().' in '.$e->getFile().':'.$e->getLine()); } - // The status of the module + // The status of the module. db_process_delete_temp('tagente_estado', 'id_agente', $id_agent); // The actual modules, don't put anything based on // DONT Delete this, just mark for deletion - // db_process_delete_temp ("tagente_modulo", "id_agente", $id_agent); + // db_process_delete_temp ("tagente_modulo", "id_agente", $id_agent);. db_process_sql_update( 'tagente_modulo', [ @@ -2603,11 +2609,11 @@ function agents_delete_agent($id_agents, $disableACL=false) // Access entries // Dont delete here, this records are deleted in daily script // db_process_delete_temp ("tagent_access", "id_agent", $id_agent); - // Delete agent policies + // Delete agent policies. enterprise_include_once('include/functions_policies.php'); enterprise_hook('policies_delete_agent', [$id_agent]); - if (enterprise_installed()) { + if (enterprise_installed() === true) { // Delete agent in networkmap. enterprise_include_once('include/functions_networkmap.php'); networkmap_delete_nodes_by_agent([$id_agent]); @@ -2646,12 +2652,12 @@ function agents_delete_agent($id_agents, $disableACL=false) ); } - // tagente_datos_inc - // Dont delete here, this records are deleted later, in database script + // Tagente_datos_inc. + // Dont delete here, this records are deleted later, in database script. // db_process_delete_temp ("tagente_datos_inc", "id_agente_modulo", $where_modules, true); - // Delete remote configuration - if (enterprise_installed()) { - if (isset($config['remote_config'])) { + // Delete remote configuration. + if (enterprise_installed() === true) { + if (isset($config['remote_config']) === true) { enterprise_include_once('include/functions_config_agents.php'); if (enterprise_hook('config_agents_has_remote_configuration', [$id_agent])) { $agent_name = agents_get_name($id_agent); @@ -2659,47 +2665,45 @@ function agents_delete_agent($id_agents, $disableACL=false) $agent_alias = io_safe_output(agents_get_alias($id_agent)); $agent_md5 = md5($agent_name, false); - // Agent remote configuration editor + // Agent remote configuration editor. $file_name = $config['remote_config'].'/conf/'.$agent_md5.'.conf'; $error = !@unlink($file_name); - if (!$error) { + if ((bool) $error === false) { $file_name = $config['remote_config'].'/md5/'.$agent_md5.'.md5'; $error = !@unlink($file_name); - } - - if ($error) { + } else { db_pandora_audit( - 'Agent management', - "Error: Deleted agent $agent_alias, the error is in the delete conf or md5." + AUDIT_LOG_AGENT_MANAGEMENT, + sprintf('Error: Deleted agent %s, the error is in the delete conf or md5.', $agent_alias) ); } } } } - // And at long last, the agent + // And at long last, the agent. db_process_delete_temp('tagente', 'id_agente', $id_agent); db_process_sql('delete from ttag_module where id_agente_modulo in (select id_agente_modulo from tagente_modulo where id_agente = '.$id_agent.')'); db_pandora_audit( - 'Agent management', - "Deleted agent $agent_alias" + AUDIT_LOG_AGENT_MANAGEMENT, + sprintf('Deleted agent %s', $agent_alias) ); - // Delete the agent from the metaconsole cache + // Delete the agent from the metaconsole cache. enterprise_include_once('include/functions_agents.php'); enterprise_hook('agent_delete_from_cache', [$id_agent]); - // Break the loop on error - if ($error) { + // Break the loop on error. + if ((bool) $error === true) { break; } } - if ($error) { + if ((bool) $error === true) { return false; } else { return true; diff --git a/pandora_console/include/functions_alerts.php b/pandora_console/include/functions_alerts.php index 03ec9d8049..7180595c12 100644 --- a/pandora_console/include/functions_alerts.php +++ b/pandora_console/include/functions_alerts.php @@ -1059,39 +1059,6 @@ function alerts_get_alert_template_time_to($id_alert_template) } -/** - * Get alert template in weekday format. - * - * @param int Id of an alert template. - * - * @return mixed Alert template in weekday format or false if something goes wrong. - */ -function alerts_get_alert_template_weekdays($id_alert_template) -{ - $alert = alerts_get_alert_template($id_alert_template); - - if ($alert === false) { - return false; - } - - $retval = []; - $days = [ - 'monday', - 'tuesday', - 'wednesday', - 'thursday', - 'friday', - 'saturday', - 'sunday', - ]; - foreach ($days as $day) { - $retval[$day] = (bool) $alert[$day]; - } - - return $retval; -} - - /** * Get recovery_notify of talert_templates table. * @@ -2574,9 +2541,14 @@ function alerts_normalize_actions_escalation($escalation) $any_greater_than = true; } - $n = count($escalation[$k]); - if ($n > $max_elements) { - $max_elements = $n; + if (isset($escalation[$k]) === true + && empty($escalation[$k]) === false + && is_array($escalation[$k]) === true + ) { + $n = count($escalation[$k]); + if ($n > $max_elements) { + $max_elements = $n; + } } } @@ -2645,7 +2617,7 @@ function alerts_ui_update_or_create_actions($update=true) if ($al_action['id_group'] == 0) { if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'LM')) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Alert Management' ); include 'general/noaccess.php'; @@ -2745,7 +2717,7 @@ function alerts_ui_update_or_create_actions($update=true) if ($result) { db_pandora_audit( - 'Command management', + AUDIT_LOG_ALERT_MANAGEMENT, $update ? 'Update alert action #'.$id : 'Create alert action #'.$result, false, false, @@ -2753,7 +2725,7 @@ function alerts_ui_update_or_create_actions($update=true) ); } else { db_pandora_audit( - 'Command management', + AUDIT_LOG_ALERT_MANAGEMENT, $update ? 'Fail try to update alert action #'.$id : 'Fail try to create alert action', false, false, diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index b077a14654..8f5483b6a2 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -2099,7 +2099,7 @@ function api_set_new_agent($thrash1, $thrash2, $other, $thrash3) $unsafe_alias = io_safe_output($alias); db_pandora_audit( - 'Agent management', + AUDIT_LOG_AGENT_MANAGEMENT, 'Created agent '.$unsafe_alias, false, true, @@ -15083,21 +15083,30 @@ function api_set_new_cluster($thrash1, $thrash2, $other, $thrash3) $id_module = modules_create_agent_module($id_agent, $values_module['nombre'], $values_module, true); if ($id_module === false) { - db_pandora_audit('Report management', "Failed to create cluster status module in cluster $name (#$id_agent)"); + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + "Failed to create cluster status module in cluster $name (#$id_agent)" + ); } } - if ($id_cluster !== false) { - db_pandora_audit('Report management', "Created cluster $name (#$id_cluster)"); - } else { - db_pandora_audit('Report management', "Failed to create cluster $name"); - } + $auditMessageCluster = ((bool) $id_cluster === true) + ? sprintf('Created new cluster %s (#%s)', $name, $id_cluster) + : sprintf('Failed to create cluster %s ', $name); - if ($id_agent !== false) { - db_pandora_audit('Report management', "Created new cluster agent $name (#$id_agent)"); - } else { - db_pandora_audit('Report management', "Failed to create cluster agent $name"); - } + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + $auditMessageCluster + ); + + $auditMessageAgent = ((bool) $id_agent === true) + ? sprintf('Created new cluster agent %s (#%s)', $name, $id_agent) + : sprintf('Failed to create cluster agent %s ', $name); + + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + $auditMessageAgent + ); if ($id_cluster !== false) { returnData( @@ -15222,9 +15231,15 @@ function api_set_add_cluster_item($thrash1, $thrash2, $other, $thrash3) ); if ($tcluster_module !== false) { - db_pandora_audit('Report management', 'Module #'.$element['name'].' assigned to cluster #'.$element['id_cluster']); + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + 'Module #'.$element['name'].' assigned to cluster #'.$element['id_cluster'] + ); } else { - db_pandora_audit('Report management', 'Failed to assign AA item module to cluster '.$element['name']); + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + 'Failed to assign AA item module to cluster '.$element['name'] + ); } } else if ($element['type'] == 'AP') { $id_agent = db_get_value_sql('SELECT id_agent FROM tcluster WHERE id = '.$element['id_cluster']); @@ -15287,9 +15302,15 @@ function api_set_add_cluster_item($thrash1, $thrash2, $other, $thrash3) ); if ($tcluster_balanced_module !== false) { - db_pandora_audit('Report management', 'Module #'.$element['name'].' assigned to cluster #'.$element['id_cluster']); + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + 'Module #'.$element['name'].' assigned to cluster #'.$element['id_cluster'] + ); } else { - db_pandora_audit('Report management', 'The module could not be assigned to the cluster'); + db_pandora_audit( + AUDIT_LOG_REPORT_MANAGEMENT, + 'The module could not be assigned to the cluster' + ); } } } @@ -16675,16 +16696,32 @@ function api_set_access_process($thrash1, $thrash2, $other, $returnType) } } else { // There is no administrator user who has logged in since then to log us in. - db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Logged in '.$other['data'][3].' node '.$other['data'][2], + $other['data'][0] + ); returnData('string', ['type' => 'string', 'data' => 'free']); } } else if ($other['data'][1] == 'logout') { // The administrator user wants to log out - db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Logout from '.$other['data'][3].' node '.$other['data'][2], + $other['data'][0] + ); } else if ($other['data'][1] == 'exclude') { // The administrator user has ejected another administrator user who was logged in - db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); - db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $audit_concurrence[0]['id_usuario']); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Logged in '.$other['data'][3].' node '.$other['data'][2], + $other['data'][0] + ); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Logout from '.$other['data'][3].' node '.$other['data'][2], + $audit_concurrence[0]['id_usuario'] + ); } // The admin user is trying to browse else if ($other['data'][1] == 'browse') { @@ -16704,23 +16741,39 @@ function api_set_access_process($thrash1, $thrash2, $other, $returnType) } } else if ($other['data'][1] == 'cancelled') { // The administrator user tries to log in having another administrator logged in, but instead of expelling him he cancels his log in. - db_pandora_audit($other['data'][3].' cancelled access', 'Cancelled access in '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Cancelled access in '.$other['data'][3].' node '.$other['data'][2], + $other['data'][0] + ); returnData('string', ['type' => 'string', 'data' => 'cancelled']); } } else { if ($other['data'][4] == 1) { // The user trying to log in is not an administrator and is not allowed no admin access - db_pandora_audit($other['data'][3].' denied access', 'Denied access to non-admin user '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Denied access to non-admin user '.$other['data'][3].' node '.$other['data'][2], + $other['data'][0] + ); returnData('string', ['type' => 'string', 'data' => 'denied']); } else { // The user trying to log in is not an administrator and is allowed no admin access if ($other['data'][1] == 'login') { // The user trying to login is not admin, can enter without concurrent use filter - db_pandora_audit($other['data'][3].' Logon', 'Logged in '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Logged in '.$other['data'][3].' node '.$other['data'][2], + $other['data'][0] + ); returnData('string', ['type' => 'string', 'data' => 'free']); } else if ($other['data'][1] == 'logout') { // The user trying to logoff is not admin - db_pandora_audit($other['data'][3].' Logoff', 'Logout from '.$other['data'][3].' node '.$other['data'][2], $other['data'][0]); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Logout from '.$other['data'][3].' node '.$other['data'][2], + $other['data'][0] + ); } else if ($other['data'][1] == 'browse') { // The user trying to browse in an app page is not admin, can enter without concurrent use filter returnData('string', ['type' => 'string', 'data' => 'free']); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 27e976d486..ccf315072f 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -1,6 +1,6 @@ > updated.', $token) + ); + } + return (bool) $result; } } @@ -126,7 +138,7 @@ function config_update_config() include_once $config['homedir'].'/include/functions_io.php'; // If user is not even log it, don't try this. - if (! isset($config['id_user'])) { + if (isset($config['id_user']) === false) { $config['error_config_update_config'] = []; $config['error_config_update_config']['correct'] = false; $config['error_config_update_config']['message'] = __('Failed updated: User did not login.'); @@ -144,9 +156,7 @@ function config_update_config() $update_config = (bool) get_parameter('update_config'); - if ($update_config) { - db_pandora_audit('Setup', 'Setup has changed'); - } else { + if ($update_config === false) { // Do nothing. return false; } @@ -164,39 +174,39 @@ function config_update_config() // Setup now is divided in different tabs. switch ($section_setup) { case 'general': - if (!config_update_value('language', (string) get_parameter('language'))) { + if (config_update_value('language', (string) get_parameter('language'), true) === false) { $error_update[] = __('Language settings'); } - if (!config_update_value('remote_config', (string) get_parameter('remote_config'))) { + if (config_update_value('remote_config', (string) get_parameter('remote_config'), true) === false) { $error_update[] = __('Remote config directory'); } - if (!config_update_value('phantomjs_bin', (string) get_parameter('phantomjs_bin'))) { + if (config_update_value('phantomjs_bin', (string) get_parameter('phantomjs_bin'), true) === false) { $error_update[] = __('phantomjs config directory'); } - if (!config_update_value('loginhash_pwd', io_input_password((string) get_parameter('loginhash_pwd')))) { + if (config_update_value('loginhash_pwd', io_input_password((string) get_parameter('loginhash_pwd')), true) === false) { $error_update[] = __('Auto login (hash) password'); } - if (!config_update_value('timesource', (string) get_parameter('timesource'))) { + if (config_update_value('timesource', (string) get_parameter('timesource'), true) === false) { $error_update[] = __('Time source'); } - if (!config_update_value('autoupdate', (bool) get_parameter('autoupdate'))) { + if (config_update_value('autoupdate', (bool) get_parameter('autoupdate'), true) === false) { $error_update[] = __('Automatic check for updates'); } - if (!config_update_value('cert_path', get_parameter('cert_path'))) { + if (config_update_value('cert_path', get_parameter('cert_path'), true) === false) { $error_update[] = __('SSL cert path'); } - if (!config_update_value('https', (bool) get_parameter('https'))) { + if (config_update_value('https', (bool) get_parameter('https'), true) === false) { $error_update[] = __('Enforce https'); } - if (!config_update_value('use_cert', (bool) get_parameter('use_cert'))) { + if (config_update_value('use_cert', (bool) get_parameter('use_cert'), true) === false) { $error_update[] = __('Use cert.'); } @@ -209,57 +219,55 @@ function config_update_config() "Path doesn't exists or is not writable" ); } else { - if (config_update_value('attachment_store', $attachment_store) === false) { + if (config_update_value('attachment_store', $attachment_store, true) === false) { $error_update[] = __( 'Attachment store.' ); } } - if (!config_update_value('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API'))) { + if (config_update_value('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API'), true) === false) { $error_update[] = __('IP list with API access'); } - if (!config_update_value('api_password', io_input_password(get_parameter('api_password')))) { + if (config_update_value('api_password', io_input_password(get_parameter('api_password')), true) === false) { $error_update[] = __('API password'); } - if (!config_update_value('activate_gis', (bool) get_parameter('activate_gis'))) { + if (config_update_value('activate_gis', (bool) get_parameter('activate_gis'), true) === false) { $error_update[] = __('Enable GIS features'); } - if (!config_update_value('integria_inventory', get_parameter('integria_inventory'))) { + if (config_update_value('integria_inventory', get_parameter('integria_inventory'), true) === false) { $error_update[] = __('Integria inventory'); } - if (!config_update_value('integria_api_password', io_input_password(get_parameter('integria_api_password')))) { + if (config_update_value('integria_api_password', io_input_password(get_parameter('integria_api_password')), true) === false) { $error_update[] = __('Integria API password'); } - if (!config_update_value('integria_url', get_parameter('integria_url'))) { + if (config_update_value('integria_url', get_parameter('integria_url'), true) === false) { $error_update[] = __('Integria URL'); } - if (!config_update_value('activate_netflow', (bool) get_parameter('activate_netflow'))) { + if (config_update_value('activate_netflow', (bool) get_parameter('activate_netflow'), true) === false) { $error_update[] = __('Enable Netflow'); } $timezone = (string) get_parameter('timezone'); - if ($timezone != '') { - if (!config_update_value('timezone', $timezone)) { - $error_update[] = __('Timezone setup'); - } + if (empty($timezone) === true || config_update_value('timezone', $timezone, true) === false) { + $error_update[] = __('Timezone setup'); } - if (!config_update_value('sound_alert', get_parameter('sound_alert'))) { + if (config_update_value('sound_alert', get_parameter('sound_alert'), true) === false) { $error_update[] = __('Sound for Alert fired'); } - if (!config_update_value('sound_critical', get_parameter('sound_critical'))) { + if (config_update_value('sound_critical', get_parameter('sound_critical'), true) === false) { $error_update[] = __('Sound for Monitor critical'); } - if (!config_update_value('sound_warning', get_parameter('sound_warning'))) { + if (config_update_value('sound_warning', get_parameter('sound_warning'), true) === false) { $error_update[] = __('Sound for Monitor warning'); } @@ -268,7 +276,7 @@ function config_update_config() if ($update_manager_installed == 1) { $license_info_key = get_parameter('license_info_key', ''); - if (!empty($license_info_key)) { + if (empty($license_info_key) === false) { $values = [db_escape_key_identifier('value') => $license_info_key]; $where = [db_escape_key_identifier('key') => 'customer_key']; $update_manage_settings_result = db_process_sql_update('tupdate_settings', $values, $where); @@ -278,253 +286,253 @@ function config_update_config() } } - if (!config_update_value('public_url', get_parameter('public_url'))) { + if (config_update_value('public_url', get_parameter('public_url'), true) === false) { $error_update[] = __('Public URL'); } - if (!config_update_value('force_public_url', get_parameter_switch('force_public_url'))) { + if (config_update_value('force_public_url', get_parameter_switch('force_public_url'), true) === false) { $error_update[] = __('Force use Public URL'); } - if (!config_update_value('public_url_exclusions', get_parameter('public_url_exclusions'))) { + if (config_update_value('public_url_exclusions', get_parameter('public_url_exclusions'), true) === false) { $error_update[] = __('Public URL host exclusions'); } - if (!config_update_value('referer_security', get_parameter('referer_security'))) { + if (config_update_value('referer_security', get_parameter('referer_security'), true) === false) { $error_update[] = __('Referer security'); } - if (!config_update_value('event_storm_protection', get_parameter('event_storm_protection', 0))) { + if (config_update_value('event_storm_protection', get_parameter('event_storm_protection', 0), true) === false) { $error_update[] = __('Event storm protection'); } - if (!config_update_value('command_snapshot', get_parameter('command_snapshot'))) { + if (config_update_value('command_snapshot', get_parameter('command_snapshot'), true) === false) { $error_update[] = __('Command Snapshot'); } - if (!config_update_value('use_custom_encoding', get_parameter('use_custom_encoding', 0))) { + if (config_update_value('use_custom_encoding', get_parameter('use_custom_encoding', 0), true) === false) { $error_update[] = __('Use custom encoding'); } - if (!config_update_value('server_log_dir', io_safe_input(strip_tags(io_safe_output(get_parameter('server_log_dir')))))) { + if (config_update_value('server_log_dir', io_safe_input(strip_tags(io_safe_output(get_parameter('server_log_dir')))), true) === false) { $error_update[] = __('Server logs directory'); } - if (!config_update_value('max_log_size', get_parameter('max_log_size'))) { + if (config_update_value('max_log_size', get_parameter('max_log_size'), true) === false) { $error_update[] = __('Log size limit in system logs viewer extension'); } - if (!config_update_value('tutorial_mode', get_parameter('tutorial_mode'))) { + if (config_update_value('tutorial_mode', get_parameter('tutorial_mode'), true) === false) { $error_update[] = __('Tutorial mode'); } - if (!config_update_value('past_planned_downtimes', get_parameter('past_planned_downtimes'))) { + if (config_update_value('past_planned_downtimes', get_parameter('past_planned_downtimes'), true) === false) { $error_update[] = __('Allow create scheduled downtimes in the past'); } - if (!config_update_value('limit_parameters_massive', get_parameter('limit_parameters_massive'))) { + if (config_update_value('limit_parameters_massive', get_parameter('limit_parameters_massive'), true) === false) { $error_update[] = __('Limit parameters bulk'); } - if (!config_update_value('identification_reminder', get_parameter('identification_reminder'))) { + if (config_update_value('identification_reminder', get_parameter('identification_reminder'), true) === false) { $error_update[] = __('Identification_reminder'); } - if (!config_update_value('include_agents', (bool) get_parameter('include_agents'))) { + if (config_update_value('include_agents', (bool) get_parameter('include_agents'), true) === false) { $error_update[] = __('Include_agents'); } - if (!config_update_value('alias_as_name', get_parameter('alias_as_name'))) { + if (config_update_value('alias_as_name', get_parameter('alias_as_name'), true) === false) { $error_update[] = __('alias_as_name'); } - if (!config_update_value('console_log_enabled', get_parameter('console_log_enabled'))) { + if (config_update_value('console_log_enabled', get_parameter('console_log_enabled'), true) === false) { $error_update[] = __('Console log enabled'); } - if (!config_update_value('audit_log_enabled', get_parameter('audit_log_enabled'))) { + if (config_update_value('audit_log_enabled', get_parameter('audit_log_enabled'), true) === false) { $error_update[] = __('Audit log enabled'); } - if (!config_update_value('module_custom_id_ro', get_parameter('module_custom_id_ro'))) { + if (config_update_value('module_custom_id_ro', get_parameter('module_custom_id_ro'), true) === false) { $error_update[] = __('Module Custom ID read only'); } - if (!config_update_value('unique_ip', get_parameter('unique_ip'))) { - $error_update[] = __('unique_ip'); + if (config_update_value('unique_ip', get_parameter('unique_ip'), true) === false) { + $error_update[] = __('Unique IP'); } - if (!config_update_value('email_smtpServer', get_parameter('email_smtpServer'))) { + if (config_update_value('email_smtpServer', get_parameter('email_smtpServer'), true) === false) { $error_update[] = __('Server SMTP'); } - if (!config_update_value('email_from_dir', get_parameter('email_from_dir'))) { + if (config_update_value('email_from_dir', get_parameter('email_from_dir'), true) === false) { $error_update[] = __('From dir'); } - if (!config_update_value('email_from_name', get_parameter('email_from_name'))) { + if (config_update_value('email_from_name', get_parameter('email_from_name'), true) === false) { $error_update[] = __('From name'); } - if (!config_update_value('email_smtpPort', (int) get_parameter('email_smtpPort'))) { + if (config_update_value('email_smtpPort', (int) get_parameter('email_smtpPort'), true) === false) { $error_update[] = __('Port SMTP'); } - if (!config_update_value('email_encryption', get_parameter('email_encryption'))) { + if (config_update_value('email_encryption', get_parameter('email_encryption'), true) === false) { $error_update[] = __('Encryption'); } - if (!config_update_value('email_username', get_parameter('email_username'))) { + if (config_update_value('email_username', get_parameter('email_username'), true) === false) { $error_update[] = __('Email user'); } - if (!config_update_value('email_password', io_input_password(get_parameter('email_password')))) { + if (config_update_value('email_password', io_input_password(get_parameter('email_password')), true) === false) { $error_update[] = __('Email password'); } break; case 'enterprise': - if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) { - if (!config_update_value('trap2agent', (string) get_parameter('trap2agent'))) { + if (isset($config['enterprise_installed']) === true && (bool) $config['enterprise_installed'] === true) { + if (config_update_value('trap2agent', (string) get_parameter('trap2agent'), true) === false) { $error_update[] = __('Forward SNMP traps to agent (if exist)'); } - if (!config_update_value('acl_enterprise', get_parameter('acl_enterprise'))) { + if (config_update_value('acl_enterprise', get_parameter('acl_enterprise'), true) === false) { $error_update[] = __('Use Enterprise ACL System'); } - if (!config_update_value('metaconsole', get_parameter('metaconsole'))) { + if (config_update_value('metaconsole', get_parameter('metaconsole'), true) === false) { $error_update[] = __('Activate Metaconsole'); } - if (!config_update_value('collection_max_size', get_parameter('collection_max_size'))) { + if (config_update_value('collection_max_size', get_parameter('collection_max_size'), true) === false) { $error_update[] = __('Size of collection'); } - if (!config_update_value('event_replication', (int) get_parameter('event_replication'))) { + if (config_update_value('event_replication', (int) get_parameter('event_replication'), true) === false) { $error_update[] = __('Events replication'); } - if ((int) get_parameter('event_replication') == 1) { - if (!config_update_value('replication_interval', (int) get_parameter('replication_interval'))) { + if ((int) get_parameter('event_replication') === 1) { + if (config_update_value('replication_interval', (int) get_parameter('replication_interval'), true) === false) { $error_update[] = __('Replication interval'); } - if (!config_update_value('replication_limit', (int) get_parameter('replication_limit'))) { + if (config_update_value('replication_limit', (int) get_parameter('replication_limit'), true) === false) { $error_update[] = __('Replication limit'); } - if (!config_update_value('replication_mode', (string) get_parameter('replication_mode'))) { + if (config_update_value('replication_mode', (string) get_parameter('replication_mode'), true) === false) { $error_update[] = __('Replication mode'); } - if (!config_update_value('show_events_in_local', (string) get_parameter('show_events_in_local'))) { + if (config_update_value('show_events_in_local', (string) get_parameter('show_events_in_local'), true) === false) { $error_update[] = __('Show events list in local console (read only)'); } } - if (!config_update_value('replication_dbengine', (string) get_parameter('replication_dbengine'))) { + if (config_update_value('replication_dbengine', (string) get_parameter('replication_dbengine'), true) === false) { $error_update[] = __('Replication DB engine'); } - if (!config_update_value('replication_dbhost', (string) get_parameter('replication_dbhost'))) { + if (config_update_value('replication_dbhost', (string) get_parameter('replication_dbhost'), true) === false) { $error_update[] = __('Replication DB host'); } - if (!config_update_value('replication_dbname', (string) get_parameter('replication_dbname'))) { + if (config_update_value('replication_dbname', (string) get_parameter('replication_dbname'), true) === false) { $error_update[] = __('Replication DB database'); } - if (!config_update_value('replication_dbuser', (string) get_parameter('replication_dbuser'))) { + if (config_update_value('replication_dbuser', (string) get_parameter('replication_dbuser'), true) === false) { $error_update[] = __('Replication DB user'); } - if (!config_update_value('replication_dbpass', io_input_password((string) get_parameter('replication_dbpass')))) { + if (config_update_value('replication_dbpass', io_input_password((string) get_parameter('replication_dbpass')), true) === false) { $error_update[] = __('Replication DB password'); } - if (!config_update_value('replication_dbport', (string) get_parameter('replication_dbport'))) { + if (config_update_value('replication_dbport', (string) get_parameter('replication_dbport'), true) === false) { $error_update[] = __('Replication DB port'); } - if (!config_update_value('metaconsole_agent_cache', (int) get_parameter('metaconsole_agent_cache'))) { + if (config_update_value('metaconsole_agent_cache', (int) get_parameter('metaconsole_agent_cache'), true) === false) { $error_update[] = __('Metaconsole agent cache'); } - if (!config_update_value('log_collector', (bool) get_parameter('log_collector'))) { + if (config_update_value('log_collector', (bool) get_parameter('log_collector'), true) === false) { $error_update[] = __('Activate Log Collector'); } - if (!config_update_value('enable_update_manager', get_parameter('enable_update_manager'))) { + if (config_update_value('enable_update_manager', get_parameter('enable_update_manager'), true) === false) { $error_update[] = __('Enable Update Manager'); } - if (!config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'))) { + if (config_update_value('ipam_ocuppied_critical_treshold', get_parameter('ipam_ocuppied_critical_treshold'), true) === false) { $error_update[] = __('Ipam Ocuppied Manager Critical'); } - if (!config_update_value('ipam_ocuppied_warning_treshold', get_parameter('ipam_ocuppied_warning_treshold'))) { + if (config_update_value('ipam_ocuppied_warning_treshold', get_parameter('ipam_ocuppied_warning_treshold'), true) === false) { $error_update[] = __('Ipam Ocuppied Manager Warning'); } - if (!config_update_value('sap_license', get_parameter('sap_license'))) { + if (config_update_value('sap_license', get_parameter('sap_license'), true) === false) { $error_update[] = __('SAP/R3 Plugin Licence'); } $inventory_changes_blacklist = get_parameter('inventory_changes_blacklist', []); - if (!config_update_value('inventory_changes_blacklist', implode(',', $inventory_changes_blacklist))) { + if (config_update_value('inventory_changes_blacklist', implode(',', $inventory_changes_blacklist), true) === false) { $error_update[] = __('Inventory changes blacklist'); } } break; case 'pass': - if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) { - if (!config_update_value('enable_pass_policy', get_parameter('enable_pass_policy'))) { + if (isset($config['enterprise_installed']) === true && (bool) $config['enterprise_installed'] === 1) { + if (config_update_value('enable_pass_policy', get_parameter('enable_pass_policy'), true) === false) { $error_update[] = __('Enable password policy'); } - if (!config_update_value('pass_size', get_parameter('pass_size'))) { + if (config_update_value('pass_size', get_parameter('pass_size'), true) === false) { $error_update[] = __('Min. size password'); } - if (!config_update_value('pass_expire', get_parameter('pass_expire'))) { + if (config_update_value('pass_expire', get_parameter('pass_expire'), true) === false) { $error_update[] = __('Password expiration'); } - if (!config_update_value('first_login', get_parameter('first_login'))) { + if (config_update_value('first_login', get_parameter('first_login'), true) === false) { $error_update[] = __('Force change password on first login'); } - if (!config_update_value('mins_fail_pass', get_parameter('mins_fail_pass'))) { + if (config_update_value('mins_fail_pass', get_parameter('mins_fail_pass'), true) === false) { $error_update[] = __('User blocked if login fails'); } - if (!config_update_value('number_attempts', get_parameter('number_attempts'))) { + if (config_update_value('number_attempts', get_parameter('number_attempts'), true) === false) { $error_update[] = __('Number of failed login attempts'); } - if (!config_update_value('pass_needs_numbers', get_parameter('pass_needs_numbers'))) { + if (config_update_value('pass_needs_numbers', get_parameter('pass_needs_numbers'), true) === false) { $error_update[] = __('Password must have numbers'); } - if (!config_update_value('pass_needs_symbols', get_parameter('pass_needs_symbols'))) { + if (config_update_value('pass_needs_symbols', get_parameter('pass_needs_symbols'), true) === false) { $error_update[] = __('Password must have symbols'); } - if (!config_update_value('enable_pass_policy_admin', get_parameter('enable_pass_policy_admin'))) { + if (config_update_value('enable_pass_policy_admin', get_parameter('enable_pass_policy_admin'), true) === false) { $error_update[] = __('Apply password policy to admin users'); } - if (!config_update_value('enable_pass_history', get_parameter('enable_pass_history'))) { + if (config_update_value('enable_pass_history', get_parameter('enable_pass_history'), true) === false) { $error_update[] = __('Enable password history'); } - if (!config_update_value('compare_pass', get_parameter('compare_pass'))) { + if (config_update_value('compare_pass', get_parameter('compare_pass'), true) === false) { $error_update[] = __('Compare previous password'); } - if (!config_update_value('reset_pass_option', (bool) get_parameter('reset_pass_option'))) { + if (config_update_value('reset_pass_option', (bool) get_parameter('reset_pass_option'), true) === false) { $error_update[] = __('Activate reset password'); } } @@ -532,738 +540,736 @@ function config_update_config() case 'auth': // AUTHENTICATION SETUP. - if (!config_update_value('auth', get_parameter('auth'))) { + if (config_update_value('auth', get_parameter('auth'), true) === false) { $error_update[] = __('Authentication method'); } - if (!config_update_value('autocreate_remote_users', get_parameter('autocreate_remote_users'))) { + if (config_update_value('autocreate_remote_users', get_parameter('autocreate_remote_users'), true) === false) { $error_update[] = __('Autocreate remote users'); } - if (!config_update_value('default_remote_profile', get_parameter('default_remote_profile'))) { + if (config_update_value('default_remote_profile', get_parameter('default_remote_profile'), true) === false) { $error_update[] = __('Autocreate profile'); } - if (!config_update_value('default_remote_group', get_parameter('default_remote_group'))) { + if (config_update_value('default_remote_group', get_parameter('default_remote_group'), true) === false) { $error_update[] = __('Autocreate profile group'); } - if (!config_update_value('default_assign_tags', implode(',', get_parameter('default_assign_tags')))) { + if (config_update_value('default_assign_tags', implode(',', get_parameter('default_assign_tags')), true) === false) { $error_update[] = __('Autocreate profile tags'); } - if (!config_update_value('default_no_hierarchy', (int) get_parameter('default_no_hierarchy'))) { + if (config_update_value('default_no_hierarchy', (int) get_parameter('default_no_hierarchy'), true) === false) { $error_update[] = __('Automatically assigned no hierarchy'); } - if (!config_update_value('autocreate_blacklist', get_parameter('autocreate_blacklist'))) { + if (config_update_value('autocreate_blacklist', get_parameter('autocreate_blacklist'), true) === false) { $error_update[] = __('Autocreate blacklist'); } - if (!config_update_value('ad_server', get_parameter('ad_server'))) { + if (config_update_value('ad_server', get_parameter('ad_server'), true) === false) { $error_update[] = __('Active directory server'); } - if (!config_update_value('ad_port', get_parameter('ad_port'))) { + if (config_update_value('ad_port', get_parameter('ad_port'), true) === false) { $error_update[] = __('Active directory port'); } - if (!config_update_value('ad_start_tls', get_parameter('ad_start_tls'))) { + if (config_update_value('ad_start_tls', get_parameter('ad_start_tls'), true) === false) { $error_update[] = __('Start TLS'); } - if (!config_update_value('ad_advanced_config', get_parameter('ad_advanced_config'))) { + if (config_update_value('ad_advanced_config', get_parameter('ad_advanced_config'), true) === false) { $error_update[] = __('Advanced Config AD'); } - if (!config_update_value('ldap_advanced_config', get_parameter('ldap_advanced_config'))) { + if (config_update_value('ldap_advanced_config', get_parameter('ldap_advanced_config'), true) === false) { $error_update[] = __('Advanced Config LDAP'); } - if (!config_update_value('ad_domain', get_parameter('ad_domain'))) { + if (config_update_value('ad_domain', get_parameter('ad_domain'), true) === false) { $error_update[] = __('Domain'); } - if (!config_update_value('ad_adv_perms', get_parameter('ad_adv_perms'))) { + if (config_update_value('ad_adv_perms', get_parameter('ad_adv_perms'), true) === false) { $error_update[] = __('Advanced Permisions AD'); } - if (!config_update_value('ldap_adv_perms', get_parameter('ldap_adv_perms'))) { + if (config_update_value('ldap_adv_perms', get_parameter('ldap_adv_perms'), true) === false) { $error_update[] = __('Advanced Permissions LDAP'); } - if (!config_update_value('ldap_server', get_parameter('ldap_server'))) { + if (config_update_value('ldap_server', get_parameter('ldap_server'), true) === false) { $error_update[] = __('LDAP server'); } - if (!config_update_value('ldap_port', get_parameter('ldap_port'))) { + if (config_update_value('ldap_port', get_parameter('ldap_port'), true) === false) { $error_update[] = __('LDAP port'); } - if (!config_update_value('ldap_version', get_parameter('ldap_version'))) { + if (config_update_value('ldap_version', get_parameter('ldap_version'), true) === false) { $error_update[] = __('LDAP version'); } - if (!config_update_value('ldap_start_tls', get_parameter('ldap_start_tls'))) { + if (config_update_value('ldap_start_tls', get_parameter('ldap_start_tls'), true) === false) { $error_update[] = __('Start TLS'); } - if (!config_update_value('ldap_base_dn', get_parameter('ldap_base_dn'))) { + if (config_update_value('ldap_base_dn', get_parameter('ldap_base_dn'), true) === false) { $error_update[] = __('Base DN'); } - if (!config_update_value('ldap_login_attr', get_parameter('ldap_login_attr'))) { + if (config_update_value('ldap_login_attr', get_parameter('ldap_login_attr'), true) === false) { $error_update[] = __('Login attribute'); } - if (!config_update_value('ldap_admin_login', get_parameter('ldap_admin_login'))) { + if (config_update_value('ldap_admin_login', get_parameter('ldap_admin_login'), true) === false) { $error_update[] = __('Admin LDAP login'); } - if (!config_update_value('ldap_admin_pass', io_input_password(io_safe_output(get_parameter('ldap_admin_pass'))))) { + if (config_update_value('ldap_admin_pass', io_input_password(io_safe_output(get_parameter('ldap_admin_pass'))), true) === false) { $error_update[] = __('Admin LDAP password'); } - if (!config_update_value('fallback_local_auth', get_parameter('fallback_local_auth'))) { + if (config_update_value('fallback_local_auth', get_parameter('fallback_local_auth'), true) === false) { $error_update[] = __('Fallback to local authentication'); } - if (!config_update_value('ldap_login_user_attr', get_parameter('ldap_login_user_attr'))) { + if (config_update_value('ldap_login_user_attr', get_parameter('ldap_login_user_attr'), true) === false) { $error_update[] = __('Login user attribute'); } - if (!config_update_value('ldap_function', get_parameter('ldap_function'))) { + if (config_update_value('ldap_function', get_parameter('ldap_function'), true) === false) { $error_update[] = __('LDAP function'); } - if (isset($config['fallback_local_auth']) && $config['fallback_local_auth'] == 0) { - if (!config_update_value('ldap_save_password', get_parameter('ldap_save_password'))) { + if (isset($config['fallback_local_auth']) === true && (int) $config['fallback_local_auth'] === 0) { + if (config_update_value('ldap_save_password', get_parameter('ldap_save_password'), true) === false) { $error_update[] = __('Save Password'); } - } else if (isset($config['fallback_local_auth']) && $config['fallback_local_auth'] == 1) { + } else if (isset($config['fallback_local_auth']) === false && (int) $config['fallback_local_auth'] === 1) { config_update_value('ldap_save_password', 1); } - if (!config_update_value('ldap_save_profile', get_parameter('ldap_save_profile'))) { + if (config_update_value('ldap_save_profile', get_parameter('ldap_save_profile'), true) === false) { $error_update[] = __('Save profile'); } - if (!config_update_value('rpandora_server', get_parameter('rpandora_server'))) { + if (config_update_value('rpandora_server', get_parameter('rpandora_server'), true) === false) { $error_update[] = __('MySQL host'); } - if (!config_update_value('rpandora_port', get_parameter('rpandora_port'))) { + if (config_update_value('rpandora_port', get_parameter('rpandora_port'), true) === false) { $error_update[] = __('MySQL port'); } - if (!config_update_value('rpandora_dbname', get_parameter('rpandora_dbname'))) { + if (config_update_value('rpandora_dbname', get_parameter('rpandora_dbname'), true) === false) { $error_update[] = __('Database name'); } - if (!config_update_value('rpandora_user', get_parameter('rpandora_user'))) { + if (config_update_value('rpandora_user', get_parameter('rpandora_user'), true) === false) { $error_update[] = __('User'); } - if (!config_update_value('rpandora_pass', io_input_password(get_parameter('rpandora_pass')))) { + if (config_update_value('rpandora_pass', io_input_password(get_parameter('rpandora_pass')), true) === false) { $error_update[] = __('Password'); } - if (!config_update_value('rintegria_server', get_parameter('rintegria_server'))) { + if (config_update_value('rintegria_server', get_parameter('rintegria_server'), true) === false) { $error_update[] = __('Integria host'); } - if (!config_update_value('rintegria_port', get_parameter('rintegria_port'))) { + if (config_update_value('rintegria_port', get_parameter('rintegria_port'), true) === false) { $error_update[] = __('MySQL port'); } - if (!config_update_value('rintegria_dbname', get_parameter('rintegria_dbname'))) { + if (config_update_value('rintegria_dbname', get_parameter('rintegria_dbname'), true) === false) { $error_update[] = __('Database name'); } - if (!config_update_value('rintegria_user', get_parameter('rintegria_user'))) { + if (config_update_value('rintegria_user', get_parameter('rintegria_user'), true) === false) { $error_update[] = __('User'); } - if (!config_update_value('rintegria_pass', io_input_password(get_parameter('rintegria_pass')))) { + if (config_update_value('rintegria_pass', io_input_password(get_parameter('rintegria_pass')), true) === false) { $error_update[] = __('Password'); } - if (!config_update_value('saml_path', get_parameter('saml_path'))) { + if (config_update_value('saml_path', get_parameter('saml_path'), true) === false) { $error_update[] = __('Saml path'); } - if (!config_update_value('saml_source', get_parameter('saml_source'))) { + if (config_update_value('saml_source', get_parameter('saml_source'), true) === false) { $error_update[] = __('Saml source'); } - if (!config_update_value('saml_user_id', get_parameter('saml_user_id'))) { + if (config_update_value('saml_user_id', get_parameter('saml_user_id'), true) === false) { $error_update[] = __('Saml user id parameter'); } - if (!config_update_value('saml_mail', get_parameter('saml_mail'))) { + if (config_update_value('saml_mail', get_parameter('saml_mail'), true) === false) { $error_update[] = __('Saml mail parameter'); } - if (!config_update_value('saml_group_name', get_parameter('saml_group_name'))) { + if (config_update_value('saml_group_name', get_parameter('saml_group_name'), true) === false) { $error_update[] = __('Saml group name parameter'); } - if (!config_update_value('saml_attr_type', (bool) get_parameter('saml_attr_type'))) { + if (config_update_value('saml_attr_type', (bool) get_parameter('saml_attr_type'), true) === false) { $error_update[] = __('Saml attr type parameter'); } - if (!config_update_value('saml_profiles_and_tags', get_parameter('saml_profiles_and_tags'))) { + if (config_update_value('saml_profiles_and_tags', get_parameter('saml_profiles_and_tags'), true) === false) { $error_update[] = __('Saml profiles and tags parameter'); } - if (!config_update_value('saml_profile', get_parameter('saml_profile'))) { + if (config_update_value('saml_profile', get_parameter('saml_profile'), true) === false) { $error_update[] = __('Saml profile parameters'); } - if (!config_update_value('saml_tag', get_parameter('saml_tag'))) { + if (config_update_value('saml_tag', get_parameter('saml_tag'), true) === false) { $error_update[] = __('Saml tag parameter'); } - if (!config_update_value('saml_profile_tag_separator', get_parameter('saml_profile_tag_separator'))) { + if (config_update_value('saml_profile_tag_separator', get_parameter('saml_profile_tag_separator'), true) === false) { $error_update[] = __('Saml profile and tag separator'); } - if (!config_update_value('double_auth_enabled', get_parameter('double_auth_enabled'))) { + if (config_update_value('double_auth_enabled', get_parameter('double_auth_enabled'), true) === false) { $error_update[] = __('Double authentication'); } - if (!config_update_value('2FA_all_users', get_parameter('2FA_all_users'))) { + if (config_update_value('2FA_all_users', get_parameter('2FA_all_users'), true) === false) { $error_update[] = __('2FA all users'); } - if (!config_update_value('session_timeout', get_parameter('session_timeout'))) { + if (config_update_value('session_timeout', get_parameter('session_timeout'), true) === false) { $error_update[] = __('Session timeout'); } else { if ((int) get_parameter('session_timeout') === 0) { $error_update[] = __('Session timeout forced to 90 minutes'); - if (!config_update_value('session_timeout', 90)) { + if (config_update_value('session_timeout', 90, true) === false) { $error_update[] = __('Session timeout'); } } } - if (isset($config['fallback_local_auth']) && $config['fallback_local_auth'] == 0) { - if (!config_update_value('ad_save_password', get_parameter('ad_save_password'))) { + if (isset($config['fallback_local_auth']) === true && (int) $config['fallback_local_auth'] === 0) { + if (config_update_value('ad_save_password', get_parameter('ad_save_password'), true) === false) { $error_update[] = __('Save Password'); } - } else if (isset($config['fallback_local_auth']) && $config['fallback_local_auth'] == 1) { + } else if (isset($config['fallback_local_auth']) === true && (int) $config['fallback_local_auth'] === 1) { config_update_value('ad_save_password', 1); } break; case 'perf': // PERFORMANCE SETUP. - if (!config_update_value('event_purge', get_parameter('event_purge'))) { + if (config_update_value('event_purge', get_parameter('event_purge'), true) === false) { $check_metaconsole_events_history = get_parameter('metaconsole_events_history', -1); $error_update[] = $check_metaconsole_events_history; } if ($check_metaconsole_events_history != -1) { - if (!config_update_value('metaconsole_events_history', get_parameter('metaconsole_events_history'))) { + if (config_update_value('metaconsole_events_history', get_parameter('metaconsole_events_history'), true) === false) { $error_update[] = __('Max. days before delete events'); } } - if (!config_update_value('trap_purge', get_parameter('trap_purge'))) { + if (config_update_value('trap_purge', get_parameter('trap_purge'), true) === false) { $error_update[] = __('Max. days before delete traps'); } - if (!config_update_value('string_purge', get_parameter('string_purge'))) { + if (config_update_value('string_purge', get_parameter('string_purge'), true) === false) { $error_update[] = __('Max. days before delete string data'); } - if (!config_update_value('audit_purge', get_parameter('audit_purge'))) { + if (config_update_value('audit_purge', get_parameter('audit_purge'), true) === false) { $error_update[] = __('Max. days before delete audit events'); } - if (!config_update_value('gis_purge', get_parameter('gis_purge'))) { + if (config_update_value('gis_purge', get_parameter('gis_purge'), true) === false) { $error_update[] = __('Max. days before delete GIS data'); } - if (!config_update_value('days_purge', (int) get_parameter('days_purge'))) { + if (config_update_value('days_purge', (int) get_parameter('days_purge'), true) === false) { $error_update[] = __('Max. days before purge'); } - if (!config_update_value('days_delete_unknown', (int) get_parameter('days_delete_unknown'))) { + if (config_update_value('days_delete_unknown', (int) get_parameter('days_delete_unknown'), true) === false) { $error_update[] = __('Max. days before delete unknown modules'); } - if (!config_update_value('days_compact', (int) get_parameter('days_compact'))) { + if (config_update_value('days_compact', (int) get_parameter('days_compact'), true) === false) { $error_update[] = __('Max. days before compact data'); } - if (!config_update_value('days_autodisable_deletion', (int) get_parameter('days_autodisable_deletion'))) { + if (config_update_value('days_autodisable_deletion', (int) get_parameter('days_autodisable_deletion'), true) === false) { $error_update[] = __('Max. days before autodisable deletion'); } - if (!config_update_value('report_limit', (int) get_parameter('report_limit'))) { + if (config_update_value('report_limit', (int) get_parameter('report_limit'), true) === false) { $error_update[] = __('Item limit for realtime reports)'); } - if (!config_update_value('step_compact', (int) get_parameter('step_compact'))) { + if (config_update_value('step_compact', (int) get_parameter('step_compact'), true) === false) { $error_update[] = __('Compact interpolation in hours (1 Fine-20 bad)'); } - if (!config_update_value('event_view_hr', (int) get_parameter('event_view_hr'))) { + if (config_update_value('event_view_hr', (int) get_parameter('event_view_hr'), true) === false) { $error_update[] = __('Default hours for event view'); } - if (!config_update_value('realtimestats', get_parameter('realtimestats'))) { + if (config_update_value('realtimestats', get_parameter('realtimestats'), true) === false) { $error_update[] = __('Use realtime statistics'); } - if (!config_update_value('stats_interval', get_parameter('stats_interval'))) { + if (config_update_value('stats_interval', get_parameter('stats_interval'), true) === false) { $error_update[] = __('Batch statistics period (secs)'); } - if (!config_update_value('agentaccess', (int) get_parameter('agentaccess'))) { + if (config_update_value('agentaccess', (int) get_parameter('agentaccess'), true) === false) { $error_update[] = __('Use agent access graph'); } - if (!config_update_value('num_files_attachment', (int) get_parameter('num_files_attachment'))) { + if (config_update_value('num_files_attachment', (int) get_parameter('num_files_attachment'), true) === false) { $error_update[] = __('Max. recommended number of files in attachment directory'); } - if (!config_update_value('delete_notinit', get_parameter('delete_notinit'))) { + if (config_update_value('delete_notinit', get_parameter('delete_notinit'), true) === false) { $error_update[] = __('Delete not init modules'); } - if (!config_update_value('big_operation_step_datos_purge', get_parameter('big_operation_step_datos_purge'))) { + if (config_update_value('big_operation_step_datos_purge', get_parameter('big_operation_step_datos_purge'), true) === false) { $error_update[] = __('Big Operatiopn Step to purge old data'); } - if (!config_update_value('small_operation_step_datos_purge', get_parameter('small_operation_step_datos_purge'))) { + if (config_update_value('small_operation_step_datos_purge', get_parameter('small_operation_step_datos_purge'), true) === false) { $error_update[] = __('Small Operation Step to purge old data'); } - if (!config_update_value('num_past_special_days', get_parameter('num_past_special_days'))) { + if (config_update_value('num_past_special_days', get_parameter('num_past_special_days'), true) === false) { $error_update[] = __('Retention period of past special days'); } - if (!config_update_value('max_macro_fields', get_parameter('max_macro_fields'))) { + if (config_update_value('max_macro_fields', get_parameter('max_macro_fields'), true) === false) { $error_update[] = __('Max. macro data fields'); } - if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) { - if (!config_update_value('inventory_purge', get_parameter('inventory_purge'))) { + if (isset($config['enterprise_installed']) === true && (bool) $config['enterprise_installed'] === true) { + if (config_update_value('inventory_purge', get_parameter('inventory_purge'), true) === false) { $error_update[] = __('Max. days before delete inventory data'); } } - if (!config_update_value('delete_old_messages', get_parameter('delete_old_messages'))) { + if (config_update_value('delete_old_messages', get_parameter('delete_old_messages'), true) === false) { $error_update[] = __('Max. days before delete old messages'); } - if (!config_update_value('delete_old_network_matrix', get_parameter('delete_old_network_matrix'))) { + if (config_update_value('delete_old_network_matrix', get_parameter('delete_old_network_matrix'), true) === false) { $error_update[] = __('Max. days before delete old network matrix data'); } - if (!config_update_value('max_graph_container', get_parameter('max_graph_container'))) { + if (config_update_value('max_graph_container', get_parameter('max_graph_container'), true) === false) { $error_update[] = __('Graph container - Max. Items'); } - if (!config_update_value('max_execution_event_response', get_parameter('max_execution_event_response'))) { + if (config_update_value('max_execution_event_response', get_parameter('max_execution_event_response'), true) === false) { $error_update[] = __('Max execution event response'); } - if (!config_update_value('row_limit_csv', get_parameter('row_limit_csv'))) { + if (config_update_value('row_limit_csv', get_parameter('row_limit_csv'), true) === false) { $error_update[] = __('Row limit in csv log'); } - if (!config_update_value('snmpwalk', get_parameter('snmpwalk'))) { + if (config_update_value('snmpwalk', get_parameter('snmpwalk'), true) === false) { $error_update[] = __('SNMP walk binary path'); } - if (!config_update_value('snmpwalk_fallback', get_parameter('snmpwalk_fallback'))) { + if (config_update_value('snmpwalk_fallback', get_parameter('snmpwalk_fallback'), true) === false) { $error_update[] = __('SNMP walk binary path (fallback for v1)'); } break; case 'vis': // VISUAL STYLES SETUP. - if (!config_update_value('date_format', (string) get_parameter('date_format'))) { + if (config_update_value('date_format', (string) get_parameter('date_format'), true) === false) { $error_update[] = __('Date format string'); } - if (!config_update_value('prominent_time', (string) get_parameter('prominent_time'))) { + if (config_update_value('prominent_time', (string) get_parameter('prominent_time'), true) === false) { $error_update[] = __('Timestamp or time comparation'); } - if (!config_update_value('graph_color1', (string) get_parameter('graph_color1'))) { + if (config_update_value('graph_color1', (string) get_parameter('graph_color1'), true) === false) { $error_update[] = __('Graph color #1'); } - if (!config_update_value('graph_color2', (string) get_parameter('graph_color2'))) { + if (config_update_value('graph_color2', (string) get_parameter('graph_color2'), true) === false) { $error_update[] = __('Graph color #2'); } - if (!config_update_value('graph_color3', (string) get_parameter('graph_color3'))) { + if (config_update_value('graph_color3', (string) get_parameter('graph_color3'), true) === false) { $error_update[] = __('Graph color #3'); } - if (!config_update_value('graph_color4', (string) get_parameter('graph_color4'))) { + if (config_update_value('graph_color4', (string) get_parameter('graph_color4'), true) === false) { $error_update[] = __('Graph color #4'); } - if (!config_update_value('graph_color5', (string) get_parameter('graph_color5'))) { + if (config_update_value('graph_color5', (string) get_parameter('graph_color5'), true) === false) { $error_update[] = __('Graph color #5'); } - if (!config_update_value('graph_color6', (string) get_parameter('graph_color6'))) { + if (config_update_value('graph_color6', (string) get_parameter('graph_color6'), true) === false) { $error_update[] = __('Graph color #6'); } - if (!config_update_value('graph_color7', (string) get_parameter('graph_color7'))) { + if (config_update_value('graph_color7', (string) get_parameter('graph_color7'), true) === false) { $error_update[] = __('Graph color #7'); } - if (!config_update_value('graph_color8', (string) get_parameter('graph_color8'))) { + if (config_update_value('graph_color8', (string) get_parameter('graph_color8'), true) === false) { $error_update[] = __('Graph color #8'); } - if (!config_update_value('graph_color9', (string) get_parameter('graph_color9'))) { + if (config_update_value('graph_color9', (string) get_parameter('graph_color9'), true) === false) { $error_update[] = __('Graph color #9'); } - if (!config_update_value('graph_color10', (string) get_parameter('graph_color10'))) { + if (config_update_value('graph_color10', (string) get_parameter('graph_color10'), true) === false) { $error_update[] = __('Graph color #10'); } - if (!config_update_value('interface_unit', (string) get_parameter('interface_unit', __('Bytes')))) { + if (config_update_value('interface_unit', (string) get_parameter('interface_unit', __('Bytes')), true) === false) { $error_update[] = __('Value to interface graphics'); } - if (!config_update_value('graph_precision', (string) get_parameter('graph_precision', 1))) { + if (config_update_value('graph_precision', (string) get_parameter('graph_precision', 1), true) === false) { $error_update[] = __('Data precision for reports'); } $style = (string) get_parameter('style'); - if ($style != $config['style']) { + if ($style !== (string) $config['style']) { $style = substr($style, 0, (strlen($style) - 4)); } - if (!config_update_value('style', $style)) { + if (config_update_value('style', $style, true) === false) { $error_update[] = __('Style template'); } - if (!config_update_value('block_size', (int) get_parameter('block_size'))) { + if (config_update_value('block_size', (int) get_parameter('block_size'), true) === false) { $error_update[] = __('Block size for pagination'); } - if (!config_update_value('round_corner', (bool) get_parameter('round_corner'))) { + if (config_update_value('round_corner', (bool) get_parameter('round_corner'), true) === false) { $error_update[] = __('Use round corners'); } - if (!config_update_value('maximum_y_axis', (bool) get_parameter('maximum_y_axis'))) { + if (config_update_value('maximum_y_axis', (bool) get_parameter('maximum_y_axis'), true) === false) { $error_update[] = __('Chart fit to content'); } - if (!config_update_value('show_qr_code_header', (bool) get_parameter('show_qr_code_header'))) { + if (config_update_value('show_qr_code_header', (bool) get_parameter('show_qr_code_header'), true) === false) { $error_update[] = __('Show QR code header'); } - if (!config_update_value('status_images_set', (string) get_parameter('status_images_set'))) { + if (config_update_value('status_images_set', (string) get_parameter('status_images_set'), true) === false) { $error_update[] = __('Status icon set'); } - if (!config_update_value('fontpath', (string) get_parameter('fontpath'))) { + if (config_update_value('fontpath', (string) get_parameter('fontpath'), true) === false) { $error_update[] = __('Font path'); } - if (!config_update_value('font_size', get_parameter('font_size'))) { + if (config_update_value('font_size', get_parameter('font_size'), true) === false) { $error_update[] = __('Font size'); } - if (!config_update_value('custom_favicon', (string) get_parameter('custom_favicon'))) { + if (config_update_value('custom_favicon', (string) get_parameter('custom_favicon'), true) === false) { $error_update[] = __('Custom favicon'); } - if (!config_update_value('custom_logo', (string) get_parameter('custom_logo'))) { + if (config_update_value('custom_logo', (string) get_parameter('custom_logo'), true) === false) { $error_update[] = __('Custom logo'); } - if (!config_update_value('custom_logo_collapsed', (string) get_parameter('custom_logo_collapsed'))) { + if (config_update_value('custom_logo_collapsed', (string) get_parameter('custom_logo_collapsed'), true) === false) { $error_update[] = __('Custom logo collapsed'); } - if (!config_update_value('custom_logo_white_bg', (string) get_parameter('custom_logo_white_bg'))) { + if (config_update_value('custom_logo_white_bg', (string) get_parameter('custom_logo_white_bg'), true) === false) { $error_update[] = __('Custom logo white background'); } - if (!config_update_value('custom_logo_login', (string) get_parameter('custom_logo_login'))) { + if (config_update_value('custom_logo_login', (string) get_parameter('custom_logo_login'), true) === false) { $error_update[] = __('Custom logo login'); } - if (!config_update_value('custom_splash_login', (string) get_parameter('custom_splash_login'))) { + if (config_update_value('custom_splash_login', (string) get_parameter('custom_splash_login'), true) === false) { $error_update[] = __('Custom splash login'); } - if (!config_update_value('custom_docs_logo', (string) get_parameter('custom_docs_logo'))) { + if (config_update_value('custom_docs_logo', (string) get_parameter('custom_docs_logo'), true) === false) { $error_update[] = __('Custom documentation logo'); } - if (!config_update_value('custom_support_logo', (string) get_parameter('custom_support_logo'))) { + if (config_update_value('custom_support_logo', (string) get_parameter('custom_support_logo'), true) === false) { $error_update[] = __('Custom support logo'); } - if (!config_update_value('custom_network_center_logo', (string) get_parameter('custom_network_center_logo'))) { + if (config_update_value('custom_network_center_logo', (string) get_parameter('custom_network_center_logo'), true) === false) { $error_update[] = __('Custom networkmap center logo'); } - if (!config_update_value('custom_mobile_console_logo', (string) get_parameter('custom_mobile_console_logo'))) { + if (config_update_value('custom_mobile_console_logo', (string) get_parameter('custom_mobile_console_logo'), true) === false) { $error_update[] = __('Custom networkmap center logo'); } - if (!config_update_value('custom_title_header', (string) get_parameter('custom_title_header'))) { + if (config_update_value('custom_title_header', (string) get_parameter('custom_title_header'), true) === false) { $error_update[] = __('Custom title header'); } - if (!config_update_value('custom_subtitle_header', (string) get_parameter('custom_subtitle_header'))) { + if (config_update_value('custom_subtitle_header', (string) get_parameter('custom_subtitle_header'), true) === false) { $error_update[] = __('Custom subtitle header'); } - if (!config_update_value('meta_custom_title_header', (string) get_parameter('meta_custom_title_header'))) { + if (config_update_value('meta_custom_title_header', (string) get_parameter('meta_custom_title_header'), true) === false) { $error_update[] = __('Meta custom title header'); } - if (!config_update_value('meta_custom_subtitle_header', (string) get_parameter('meta_custom_subtitle_header'))) { + if (config_update_value('meta_custom_subtitle_header', (string) get_parameter('meta_custom_subtitle_header'), true) === false) { $error_update[] = __('Meta custom subtitle header'); } - if (!config_update_value('custom_title1_login', (string) get_parameter('custom_title1_login'))) { + if (config_update_value('custom_title1_login', (string) get_parameter('custom_title1_login'), true) === false) { $error_update[] = __('Custom title1 login'); } - if (!config_update_value('custom_title2_login', (string) get_parameter('custom_title2_login'))) { + if (config_update_value('custom_title2_login', (string) get_parameter('custom_title2_login'), true) === false) { $error_update[] = __('Custom title2 login'); } - if (!config_update_value('login_background', (string) get_parameter('login_background'))) { + if (config_update_value('login_background', (string) get_parameter('login_background'), true) === false) { $error_update[] = __('Login background'); } - if (!config_update_value('custom_docs_url', (string) get_parameter('custom_docs_url'))) { + if (config_update_value('custom_docs_url', (string) get_parameter('custom_docs_url'), true) === false) { $error_update[] = __('Custom Docs url'); } - if (!config_update_value('custom_support_url', (string) get_parameter('custom_support_url'))) { + if (config_update_value('custom_support_url', (string) get_parameter('custom_support_url'), true) === false) { $error_update[] = __('Custom support url'); } - if (!config_update_value('rb_product_name', (string) get_parameter('rb_product_name'))) { + if (config_update_value('rb_product_name', (string) get_parameter('rb_product_name'), true) === false) { $error_update[] = __('Product name'); } - if (!config_update_value('rb_copyright_notice', (string) get_parameter('rb_copyright_notice'))) { + if (config_update_value('rb_copyright_notice', (string) get_parameter('rb_copyright_notice'), true) === false) { $error_update[] = __('Copyright notice'); } - if (!config_update_value('meta_custom_logo_white_bg', (string) get_parameter('meta_custom_logo_white_bg'))) { + if (config_update_value('meta_custom_logo_white_bg', (string) get_parameter('meta_custom_logo_white_bg'), true) === false) { $error_update[] = __('Custom logo metaconsole (white background)'); } - if (!config_update_value('meta_custom_logo_login', (string) get_parameter('meta_custom_logo_login'))) { + if (config_update_value('meta_custom_logo_login', (string) get_parameter('meta_custom_logo_login'), true) === false) { $error_update[] = __('Custom logo login metaconsole'); } - if (!config_update_value('meta_custom_splash_login', (string) get_parameter('meta_custom_splash_login'))) { + if (config_update_value('meta_custom_splash_login', (string) get_parameter('meta_custom_splash_login'), true) === false) { $error_update[] = __('Custom splash login metaconsole'); } - if (!config_update_value('meta_custom_title1_login', (string) get_parameter('meta_custom_title1_login'))) { + if (config_update_value('meta_custom_title1_login', (string) get_parameter('meta_custom_title1_login'), true) === false) { $error_update[] = __('Custom title1 login metaconsole'); } - if (!config_update_value('meta_custom_title2_login', (string) get_parameter('meta_custom_title2_login'))) { + if (config_update_value('meta_custom_title2_login', (string) get_parameter('meta_custom_title2_login'), true) === false) { $error_update[] = __('Custom title2 login metaconsole'); } - if (!config_update_value('meta_login_background', (string) get_parameter('meta_login_background'))) { + if (config_update_value('meta_login_background', (string) get_parameter('meta_login_background'), true) === false) { $error_update[] = __('Login background metaconsole'); } - if (!config_update_value('meta_custom_docs_url', (string) get_parameter('meta_custom_docs_url'))) { + if (config_update_value('meta_custom_docs_url', (string) get_parameter('meta_custom_docs_url'), true) === false) { $error_update[] = __('Custom Docs url'); } - if (!config_update_value('meta_custom_support_url', (string) get_parameter('meta_custom_support_url'))) { + if (config_update_value('meta_custom_support_url', (string) get_parameter('meta_custom_support_url'), true) === false) { $error_update[] = __('Custom support url'); } - if (!config_update_value('legacy_vc', (int) get_parameter('legacy_vc'))) { + if (config_update_value('legacy_vc', (int) get_parameter('legacy_vc'), true) === false) { $error_update[] = __('Use the legacy Visual Console'); } - if (!config_update_value('vc_default_cache_expiration', (int) get_parameter('vc_default_cache_expiration'))) { + if (config_update_value('vc_default_cache_expiration', (int) get_parameter('vc_default_cache_expiration'), true) === false) { $error_update[] = __("Default expiration of the Visual Console item's cache"); } - if (!config_update_value('vc_refr', (int) get_parameter('vc_refr'))) { + if (config_update_value('vc_refr', (int) get_parameter('vc_refr'), true) === false) { $error_update[] = __('Default interval for refresh on Visual Console'); } - if (!config_update_value('vc_favourite_view', (int) get_parameter('vc_favourite_view', 0))) { + if (config_update_value('vc_favourite_view', (int) get_parameter('vc_favourite_view', 0), true) === false) { $error_update[] = __('Default line favourite_view for the Visual Console'); } - if (!config_update_value('vc_menu_items', (int) get_parameter('vc_menu_items', 10))) { + if (config_update_value('vc_menu_items', (int) get_parameter('vc_menu_items', 10), true) === false) { $error_update[] = __('Default line menu items for the Visual Console'); } - if (!config_update_value('vc_line_thickness', (int) get_parameter('vc_line_thickness'))) { + if (config_update_value('vc_line_thickness', (int) get_parameter('vc_line_thickness'), true) === false) { $error_update[] = __('Default line thickness for the Visual Console'); } - if (!config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10))) { + if (config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10), true) === false) { $error_update[] = __('Default line menu items for the Services'); } - if (!config_update_value('agent_size_text_small', get_parameter('agent_size_text_small'))) { + if (config_update_value('agent_size_text_small', get_parameter('agent_size_text_small'), true) === false) { $error_update[] = __('Agent size text'); } - if (!config_update_value('agent_size_text_medium', get_parameter('agent_size_text_medium'))) { + if (config_update_value('agent_size_text_medium', get_parameter('agent_size_text_medium'), true) === false) { $error_update[] = __('Agent size text'); } - if (!config_update_value('module_size_text_small', get_parameter('module_size_text_small'))) { + if (config_update_value('module_size_text_small', get_parameter('module_size_text_small'), true) === false) { $error_update[] = __('Module size text'); } - if (!config_update_value('module_size_text_medium', get_parameter('module_size_text_medium'))) { + if (config_update_value('module_size_text_medium', get_parameter('module_size_text_medium'), true) === false) { $error_update[] = __('Description size text'); } - if (!config_update_value('description_size_text', get_parameter('description_size_text'))) { + if (config_update_value('description_size_text', get_parameter('description_size_text'), true) === false) { $error_update[] = __('Description size text'); } - if (!config_update_value('item_title_size_text', get_parameter('item_title_size_text'))) { + if (config_update_value('item_title_size_text', get_parameter('item_title_size_text'), true) === false) { $error_update[] = __('Item title size text'); } - if (!config_update_value('gis_label', get_parameter('gis_label'))) { + if (config_update_value('gis_label', get_parameter('gis_label'), true) === false) { $error_update[] = __('GIS Labels'); } - if (!config_update_value('simple_module_value', get_parameter('simple_module_value'))) { + if (config_update_value('simple_module_value', get_parameter('simple_module_value'), true) === false) { $error_update[] = __('Show units in values report'); } - if (!config_update_value('gis_default_icon', get_parameter('gis_default_icon'))) { + if (config_update_value('gis_default_icon', get_parameter('gis_default_icon'), true) === false) { $error_update[] = __('Default icon in GIS'); } - if (!config_update_value('autohidden_menu', get_parameter('autohidden_menu'))) { + if (config_update_value('autohidden_menu', get_parameter('autohidden_menu'), true) === false) { $error_update[] = __('Autohidden menu'); } - if (!config_update_value('visual_animation', get_parameter('visual_animation'))) { + if (config_update_value('visual_animation', get_parameter('visual_animation'), true) === false) { $error_update[] = __('visual_animation'); } - if (!config_update_value('disable_help', get_parameter('disable_help'))) { + if (config_update_value('disable_help', get_parameter('disable_help'), true) === false) { $error_update[] = __('Disable help'); } - if (!config_update_value('fixed_graph', get_parameter('fixed_graph'))) { + if (config_update_value('fixed_graph', get_parameter('fixed_graph'), true) === false) { $error_update[] = __('Fixed graph'); } - if (!config_update_value('fixed_header', get_parameter('fixed_header'))) { + if (config_update_value('fixed_header', get_parameter('fixed_header'), true) === false) { $error_update[] = __('Fixed header'); } - if (!config_update_value('paginate_module', get_parameter('paginate_module'))) { + if (config_update_value('paginate_module', get_parameter('paginate_module'), true) === false) { $error_update[] = __('Paginate module'); } - if (!config_update_value('graphviz_bin_dir', get_parameter('graphviz_bin_dir'))) { + if (config_update_value('graphviz_bin_dir', get_parameter('graphviz_bin_dir'), true) === false) { $error_update[] = __('Custom graphviz directory'); } - if (!config_update_value('networkmap_max_width', get_parameter('networkmap_max_width'))) { + if (config_update_value('networkmap_max_width', get_parameter('networkmap_max_width'), true) === false) { $error_update[] = __('Networkmap max width'); } - if (!config_update_value('short_module_graph_data', get_parameter('short_module_graph_data'))) { + if (config_update_value('short_module_graph_data', get_parameter('short_module_graph_data'), true) === false) { $error_update[] = __('Shortened module graph data'); } - if (!config_update_value('show_group_name', get_parameter('show_group_name'))) { + if (config_update_value('show_group_name', get_parameter('show_group_name'), true) === false) { $error_update[] = __('Show the group name instead the group icon.'); } - if (!config_update_value('custom_graph_width', (int) get_parameter('custom_graph_width', 1))) { + if (config_update_value('custom_graph_width', (int) get_parameter('custom_graph_width', 1), true) === false) { $error_update[] = __('Default line thickness for the Custom Graph.'); } - if (!config_update_value('type_module_charts', (string) get_parameter('type_module_charts', 'area'))) { + if (config_update_value('type_module_charts', (string) get_parameter('type_module_charts', 'area'), true) === false) { $error_update[] = __('Default type of module charts.'); } - if (!config_update_value('items_combined_charts', (string) get_parameter('items_combined_charts', 10))) { + if (config_update_value('items_combined_charts', (string) get_parameter('items_combined_charts', 10), true) === false) { $error_update[] = __('Default Number of elements in Custom Graph.'); } - if (!config_update_value('type_interface_charts', (string) get_parameter('type_interface_charts', 'line'))) { + if (config_update_value('type_interface_charts', (string) get_parameter('type_interface_charts', 'line'), true) === false) { $error_update[] = __('Default type of interface charts.'); } - if (!config_update_value('render_proc', (bool) get_parameter('render_proc', false))) { + if (config_update_value('render_proc', (bool) get_parameter('render_proc', false), true) === false) { $error_update[] = __('Display data of proc modules in other format'); } - if (!config_update_value('render_proc_ok', (string) get_parameter('render_proc_ok', __('Ok')))) { + if (config_update_value('render_proc_ok', (string) get_parameter('render_proc_ok', __('Ok')), true) === false) { $error_update[] = __('Display text proc modules have state is ok'); } - if (!config_update_value('render_proc_fail', (string) get_parameter('render_proc_fail', __('Fail')))) { + if (config_update_value('render_proc_fail', (string) get_parameter('render_proc_fail', __('Fail')), true) === false) { $error_update[] = __('Display text when proc modules have state critical'); } - // Daniel maya 02/06/2016 Display menu with click --INI. - if (!config_update_value('click_display', (bool) get_parameter('click_display', false))) { + if (config_update_value('click_display', (bool) get_parameter('click_display', false), true) === false) { $error_update[] = __('Display lateral menus with left click'); } - // Daniel maya 02/06/2016 Display menu with click --END. - if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) { - if (!config_update_value('service_label_font_size', get_parameter('service_label_font_size', false))) { + if (isset($config['enterprise_installed']) === true && (bool) $config['enterprise_installed'] === true) { + if (config_update_value('service_label_font_size', get_parameter('service_label_font_size', false), true) === false) { $error_update[] = __('Service label font size'); } - if (!config_update_value('service_item_padding_size', get_parameter('service_item_padding_size', false))) { + if (config_update_value('service_item_padding_size', get_parameter('service_item_padding_size', false), true) === false) { $error_update[] = __('Service item padding size'); } } - if (!config_update_value('percentil', (int) get_parameter('percentil', 0))) { + if (config_update_value('percentil', (int) get_parameter('percentil', 0), true) === false) { $error_update[] = __('Default percentil'); } - if (!config_update_value('full_scale_option', (int) get_parameter('full_scale_option', 0))) { + if (config_update_value('full_scale_option', (int) get_parameter('full_scale_option', 0), true) === false) { $error_update[] = __('Default full scale (TIP)'); } - if (!config_update_value('type_mode_graph', (int) get_parameter('type_mode_graph', 0))) { + if (config_update_value('type_mode_graph', (int) get_parameter('type_mode_graph', 0), true) === false) { $error_update[] = __('Default soft graphs'); } - if (!config_update_value('zoom_graph', (int) get_parameter('zoom_graph', 1))) { + if (config_update_value('zoom_graph', (int) get_parameter('zoom_graph', 1), true) === false) { $error_update[] = __('Default zoom graphs'); } - if (!config_update_value( + if (config_update_value( 'graph_image_height', (int) get_parameter('graph_image_height', 130) - ) + ) === false ) { $error_update[] = __( 'Default height of the chart image' @@ -1280,22 +1286,22 @@ function config_update_config() $custom_value = str_replace(',', '.', $custom_value); - if ($custom_value_add) { + if ($custom_value_add === true) { include_once 'include/functions_post_process.php'; - if (!post_process_add_custom_value( + if (post_process_add_custom_value( $custom_text, (string) $custom_value - ) + ) === false ) { - $error_update[] = __('Add the custom post process'); + $error_update[] = __('Add the custom post process'); } } if ($custom_value_to_delete > 0) { include_once 'include/functions_post_process.php'; - if (!post_process_delete_custom_value($custom_value_to_delete)) { + if (post_process_delete_custom_value($custom_value_to_delete) === false) { $error_update[] = __('Delete the custom post process'); } } @@ -1317,7 +1323,7 @@ function config_update_config() $interval_values = $new_interval; } else { $interval_values_array = explode(',', $interval_values); - if (!in_array($new_interval, $interval_values_array)) { + if (in_array($new_interval, $interval_values_array) === false) { $interval_values_array[] = $new_interval; $interval_values = implode(',', $interval_values_array); } @@ -1337,7 +1343,7 @@ function config_update_config() $interval_values = implode(',', $interval_values_array); } - if (!config_update_value('interval_values', $interval_values)) { + if (config_update_value('interval_values', $interval_values, true) === false) { $error_update[] = __('Delete interval'); } @@ -1348,132 +1354,127 @@ function config_update_config() $custom_unit = io_safe_input(strip_tags(io_safe_output(get_parameter('custom_module_unit')))); $custom_unit_to_delete = io_safe_input(strip_tags(io_safe_output(get_parameter('custom_module_unit_to_delete', '')))); - if (!empty($custom_unit)) { - if (!add_custom_module_unit( - $custom_unit - ) - ) { + if (empty($custom_unit) === false) { + if (add_custom_module_unit($custom_unit) === false) { $error_update[] = __('Add custom module unit'); } } - if (!empty($custom_unit_to_delete)) { - if (!delete_custom_module_unit($custom_unit_to_delete)) { + if (empty($custom_unit_to_delete) === false) { + if (delete_custom_module_unit($custom_unit_to_delete) === false) { $error_update[] = __('Delete custom module unit'); } } - // -------------------------------------------------- - if (!config_update_value('custom_report_info', get_parameter('custom_report_info'))) { + if (config_update_value('custom_report_info', get_parameter('custom_report_info'), true) === false) { $error_update[] = __('Custom report info'); } - // Juanma (06/05/2014) New feature: Custom front page for reports. - if (!config_update_value('font_size_item_report', get_parameter('font_size_item_report', 2))) { + if (config_update_value('font_size_item_report', get_parameter('font_size_item_report', 2), true) === false) { $error_update[] = __('HTML font size for SLA (em)'); } - if (!config_update_value('global_font_size_report', get_parameter('global_font_size_report', 10))) { + if (config_update_value('global_font_size_report', get_parameter('global_font_size_report', 10), true) === false) { $error_update[] = __('PDF font size (px)'); } - if (!config_update_value('custom_report_front', get_parameter('custom_report_front'))) { + if (config_update_value('custom_report_front', get_parameter('custom_report_front'), true) === false) { $error_update[] = __('Custom report front'); } - if (!config_update_value('custom_report_front_font', get_parameter('custom_report_front_font'))) { + if (config_update_value('custom_report_front_font', get_parameter('custom_report_front_font'), true) === false) { $error_update[] = __('Custom report front').' - '.__('Font family'); } - if (!config_update_value('custom_report_front_logo', get_parameter('custom_report_front_logo'))) { + if (config_update_value('custom_report_front_logo', get_parameter('custom_report_front_logo'), true) === false) { $error_update[] = __('Custom report front').' - '.__('Custom logo'); } - if (!config_update_value('custom_report_front_header', get_parameter('custom_report_front_header'))) { + if (config_update_value('custom_report_front_header', get_parameter('custom_report_front_header'), true) === false) { $error_update[] = __('Custom report front').' - '.__('Header'); } - if (!config_update_value('custom_report_front_firstpage', get_parameter('custom_report_front_firstpage'))) { + if (config_update_value('custom_report_front_firstpage', get_parameter('custom_report_front_firstpage'), true) === false) { $error_update[] = __('Custom report front').' - '.__('First page'); } - if (!config_update_value('custom_report_front_footer', get_parameter('custom_report_front_footer'))) { + if (config_update_value('custom_report_front_footer', get_parameter('custom_report_front_footer'), true) === false) { $error_update[] = __('Custom report front').' - '.__('Footer'); } - if (!config_update_value('csv_divider', (string) get_parameter('csv_divider', ';'))) { + if (config_update_value('csv_divider', (string) get_parameter('csv_divider', ';'), true) === false) { $error_update[] = __('CSV divider'); } - if (!config_update_value('csv_decimal_separator', (string) get_parameter('csv_decimal_separator', '.'))) { + if (config_update_value('csv_decimal_separator', (string) get_parameter('csv_decimal_separator', '.'), true) === false) { $error_update[] = __('CSV decimal separator'); } - if (!config_update_value('use_data_multiplier', get_parameter('use_data_multiplier', '1'))) { + if (config_update_value('use_data_multiplier', get_parameter('use_data_multiplier', '1'), true) === false) { $error_update[] = __('Use data multiplier'); } break; case 'net': - if (!config_update_value('netflow_path', get_parameter('netflow_path'))) { + if (config_update_value('netflow_path', get_parameter('netflow_path'), true) === false) { $error_update[] = __('Data storage path'); } - if (!config_update_value('netflow_interval', (int) get_parameter('netflow_interval'))) { + if (config_update_value('netflow_interval', (int) get_parameter('netflow_interval'), true) === false) { $error_update[] = __('Daemon interval'); } - if (!config_update_value('netflow_daemon', get_parameter('netflow_daemon'))) { + if (config_update_value('netflow_daemon', get_parameter('netflow_daemon'), true) === false) { $error_update[] = __('Daemon binary path'); } - if (!config_update_value('netflow_nfdump', get_parameter('netflow_nfdump'))) { + if (config_update_value('netflow_nfdump', get_parameter('netflow_nfdump'), true) === false) { $error_update[] = __('Nfdump binary path'); } - if (!config_update_value('netflow_nfexpire', get_parameter('netflow_nfexpire'))) { + if (config_update_value('netflow_nfexpire', get_parameter('netflow_nfexpire'), true) === false) { $error_update[] = __('Nfexpire binary path'); } - if (!config_update_value('netflow_max_resolution', (int) get_parameter('netflow_max_resolution'))) { + if (config_update_value('netflow_max_resolution', (int) get_parameter('netflow_max_resolution'), true) === false) { $error_update[] = __('Maximum chart resolution'); } - if (!config_update_value('netflow_disable_custom_lvfilters', get_parameter('netflow_disable_custom_lvfilters'))) { + if (config_update_value('netflow_disable_custom_lvfilters', get_parameter('netflow_disable_custom_lvfilters'), true) === false) { $error_update[] = __('Disable custom live view filters'); } - if (!config_update_value('netflow_max_lifetime', (int) get_parameter('netflow_max_lifetime'))) { + if (config_update_value('netflow_max_lifetime', (int) get_parameter('netflow_max_lifetime'), true) === false) { $error_update[] = __('Netflow max lifetime'); } - if (!config_update_value('netflow_get_ip_hostname', (int) get_parameter('netflow_get_ip_hostname'))) { + if (config_update_value('netflow_get_ip_hostname', (int) get_parameter('netflow_get_ip_hostname'), true) === false) { $error_update[] = __('Name resolution for IP address'); } break; case 'log': - if (!config_update_value('elasticsearch_ip', get_parameter('elasticsearch_ip'))) { + if (config_update_value('elasticsearch_ip', get_parameter('elasticsearch_ip'), true) === false) { $error_update[] = __('IP ElasticSearch server'); } - if (!config_update_value('elasticsearch_port', get_parameter('elasticsearch_port'))) { + if (config_update_value('elasticsearch_port', get_parameter('elasticsearch_port'), true) === false) { $error_update[] = __('Port ElasticSearch server'); } - if (!config_update_value('number_logs_viewed', (int) get_parameter('number_logs_viewed'))) { + if (config_update_value('number_logs_viewed', (int) get_parameter('number_logs_viewed'), true) === false) { $error_update[] = __('Number of logs viewed'); } - if (!config_update_value('Days_purge_old_information', (int) get_parameter('Days_purge_old_information'))) { + if (config_update_value('Days_purge_old_information', (int) get_parameter('Days_purge_old_information'), true) === false) { $error_update[] = __('Days to purge old information'); } break; case 'hist_db': - if ($config['dbname'] == get_parameter('history_db_name') - && $config['dbport'] == get_parameter('history_db_port') - && $config['dbhost'] == io_input_password(get_parameter('history_db_host')) + if ($config['dbname'] === get_parameter('history_db_name') + && $config['dbport'] === get_parameter('history_db_port') + && $config['dbhost'] === io_input_password(get_parameter('history_db_host')) ) { // Same definition for active and historical database! // This is a critical error. @@ -1483,47 +1484,47 @@ function config_update_config() ); return; } else { - if (!config_update_value('history_db_host', get_parameter('history_db_host'))) { + if (config_update_value('history_db_host', get_parameter('history_db_host'), true) === false) { $error_update[] = __('Host'); } - if (!config_update_value('history_db_port', get_parameter('history_db_port'))) { + if (config_update_value('history_db_port', get_parameter('history_db_port'), true) === false) { $error_update[] = __('Port'); } - if (!config_update_value('history_db_name', get_parameter('history_db_name'))) { + if (config_update_value('history_db_name', get_parameter('history_db_name'), true) === false) { $error_update[] = __('Database name'); } } - if (!config_update_value('history_db_enabled', get_parameter('history_db_enabled'))) { + if (config_update_value('history_db_enabled', get_parameter('history_db_enabled'), true) === false) { $error_update[] = __('Enable history database'); } - if (!config_update_value('history_event_enabled', get_parameter('history_event_enabled'))) { + if (config_update_value('history_event_enabled', get_parameter('history_event_enabled'), true) === false) { $error_update[] = __('Enable history event'); } - if (!config_update_value('history_db_user', get_parameter('history_db_user'))) { + if (config_update_value('history_db_user', get_parameter('history_db_user'), true) === false) { $error_update[] = __('Database user'); } - if (!config_update_value('history_db_pass', io_input_password(get_parameter('history_db_pass')))) { + if (config_update_value('history_db_pass', io_input_password(get_parameter('history_db_pass')), true) === false) { $error_update[] = __('Database password'); } $history_db_days = get_parameter('history_db_days'); - if (!is_numeric($history_db_days) + if (is_numeric($history_db_days) === false || $history_db_days <= 0 - || !config_update_value('history_db_days', $history_db_days) + || config_update_value('history_db_days', $history_db_days) === false ) { $error_update[] = __('Days'); } $history_event_days = get_parameter('history_event_days'); - if (!is_numeric($history_event_days) + if (is_numeric($history_event_days) === false || $history_event_days <= 0 - || !config_update_value('history_event_days', $history_event_days) + || config_update_value('history_event_days', $history_event_days) === false ) { $error_update[] = __('Event Days'); } @@ -1608,53 +1609,53 @@ function config_update_config() break; case 'ehorus': - if (!config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', 0))) { + if (config_update_value('ehorus_enabled', (int) get_parameter('ehorus_enabled', 0), true) === false) { $error_update[] = __('Enable eHorus'); } - if (!config_update_value('ehorus_user_level_conf', (int) get_parameter('ehorus_user_level_conf', 0))) { + if (config_update_value('ehorus_user_level_conf', (int) get_parameter('ehorus_user_level_conf', 0), true) === false) { $error_update[] = __('eHorus user login'); } - if (!config_update_value('ehorus_user', (string) get_parameter('ehorus_user', $config['ehorus_user']))) { + if (config_update_value('ehorus_user', (string) get_parameter('ehorus_user', $config['ehorus_user']), true) === false) { $error_update[] = __('eHorus user'); } - if (!config_update_value('ehorus_pass', io_input_password((string) get_parameter('ehorus_pass', $config['ehorus_pass'])))) { + if (config_update_value('ehorus_pass', io_input_password((string) get_parameter('ehorus_pass', $config['ehorus_pass'])), true) === false) { $error_update[] = __('eHorus password'); } - if (!config_update_value('ehorus_hostname', (string) get_parameter('ehorus_hostname', $config['ehorus_hostname']))) { + if (config_update_value('ehorus_hostname', (string) get_parameter('ehorus_hostname', $config['ehorus_hostname']), true) === false) { $error_update[] = __('eHorus API hostname'); } - if (!config_update_value('ehorus_port', (int) get_parameter('ehorus_port', $config['ehorus_port']))) { + if (config_update_value('ehorus_port', (int) get_parameter('ehorus_port', $config['ehorus_port']), true) === false) { $error_update[] = __('eHorus API port'); } - if (!config_update_value('ehorus_req_timeout', (int) get_parameter('ehorus_req_timeout', $config['ehorus_req_timeout']))) { + if (config_update_value('ehorus_req_timeout', (int) get_parameter('ehorus_req_timeout', $config['ehorus_req_timeout']), true) === false) { $error_update[] = __('eHorus request timeout'); } - if (!config_update_value('ehorus_custom_field', (string) get_parameter('ehorus_custom_field', $config['ehorus_custom_field']))) { + if (config_update_value('ehorus_custom_field', (string) get_parameter('ehorus_custom_field', $config['ehorus_custom_field']), true) === false) { $error_update[] = __('eHorus id custom field'); } break; case 'integria': - if (!config_update_value('integria_user_level_conf', (int) get_parameter('integria_user_level_conf', 0))) { + if (config_update_value('integria_user_level_conf', (int) get_parameter('integria_user_level_conf', 0), true) === false) { $error_update[] = __('Integria user login'); } - if (!config_update_value('integria_enabled', (int) get_parameter('integria_enabled', 0))) { + if (config_update_value('integria_enabled', (int) get_parameter('integria_enabled', 0), true) === false) { $error_update[] = __('Enable Integria IMS'); } - if (!config_update_value('integria_user', (string) get_parameter('integria_user', $config['integria_user']))) { + if (config_update_value('integria_user', (string) get_parameter('integria_user', $config['integria_user']), true) === false) { $error_update[] = __('Integria user'); } - if (!config_update_value('integria_pass', io_input_password((string) get_parameter('integria_pass', $config['integria_pass'])))) { + if (config_update_value('integria_pass', io_input_password((string) get_parameter('integria_pass', $config['integria_pass'])), true) === false) { $error_update[] = __('Integria password'); } @@ -1668,101 +1669,99 @@ function config_update_config() } } - if (!config_update_value('integria_hostname', $integria_hostname)) { + if (config_update_value('integria_hostname', $integria_hostname, true) === false) { $error_update[] = __('integria API hostname'); } - if (!config_update_value('integria_api_pass', io_input_password((string) get_parameter('integria_api_pass', $config['integria_api_pass'])))) { + if (config_update_value('integria_api_pass', io_input_password((string) get_parameter('integria_api_pass', $config['integria_api_pass'])), true) === false) { $error_update[] = __('Integria API password'); } - if (!config_update_value('integria_req_timeout', (int) get_parameter('integria_req_timeout', $config['integria_req_timeout']))) { + if (config_update_value('integria_req_timeout', (int) get_parameter('integria_req_timeout', $config['integria_req_timeout']), true) === false) { $error_update[] = __('Integria request timeout'); } - if (!config_update_value('default_group', (int) get_parameter('default_group', $config['default_group']))) { + if (config_update_value('default_group', (int) get_parameter('default_group', $config['default_group']), true) === false) { $error_update[] = __('Integria default group'); } - if (!config_update_value('cr_default_group', (int) get_parameter('cr_default_group', $config['cr_default_group']))) { + if (config_update_value('cr_default_group', (int) get_parameter('cr_default_group', $config['cr_default_group']), true) === false) { $error_update[] = __('Integria custom response default group'); } - if (!config_update_value('default_criticity', (int) get_parameter('default_criticity', $config['default_criticity']))) { + if (config_update_value('default_criticity', (int) get_parameter('default_criticity', $config['default_criticity']), true) === false) { $error_update[] = __('Integria default priority'); } - if (!config_update_value('cr_default_criticity', (int) get_parameter('cr_default_criticity', $config['cr_default_criticity']))) { + if (config_update_value('cr_default_criticity', (int) get_parameter('cr_default_criticity', $config['cr_default_criticity']), true) === false) { $error_update[] = __('Integria custom response default priority'); } - if (!config_update_value('default_creator', (string) get_parameter('default_creator', $config['default_creator']))) { + if (config_update_value('default_creator', (string) get_parameter('default_creator', $config['default_creator']), true) === false) { $error_update[] = __('Integria default creator'); } - if (!config_update_value('default_owner', (string) get_parameter('default_owner', $config['default_owner']))) { + if (config_update_value('default_owner', (string) get_parameter('default_owner', $config['default_owner']), true) === false) { $error_update[] = __('Integria default owner'); } - if (!config_update_value('cr_default_owner', (string) get_parameter('cr_default_owner', $config['cr_default_owner']))) { + if (config_update_value('cr_default_owner', (string) get_parameter('cr_default_owner', $config['cr_default_owner']), true) === false) { $error_update[] = __('Integria custom response default owner'); } - if (!config_update_value('incident_type', (int) get_parameter('incident_type', $config['incident_type']))) { + if (config_update_value('incident_type', (int) get_parameter('incident_type', $config['incident_type']), true) === false) { $error_update[] = __('Integria default ticket type'); } - if (!config_update_value('cr_incident_type', (int) get_parameter('cr_incident_type', $config['cr_incident_type']))) { + if (config_update_value('cr_incident_type', (int) get_parameter('cr_incident_type', $config['cr_incident_type']), true) === false) { $error_update[] = __('Integria custom response default ticket type'); } - if (!config_update_value('incident_status', (int) get_parameter('incident_status', $config['incident_status']))) { + if (config_update_value('incident_status', (int) get_parameter('incident_status', $config['incident_status']), true) === false) { $error_update[] = __('Integria default ticket status'); } - if (!config_update_value('cr_incident_status', (int) get_parameter('cr_incident_status', $config['cr_incident_status']))) { + if (config_update_value('cr_incident_status', (int) get_parameter('cr_incident_status', $config['cr_incident_status']), true) === false) { $error_update[] = __('Integria custom response default ticket status'); } - if (!config_update_value('incident_title', (string) get_parameter('incident_title', $config['incident_title']))) { + if (config_update_value('incident_title', (string) get_parameter('incident_title', $config['incident_title']), true) === false) { $error_update[] = __('Integria default ticket title'); } - if (!config_update_value('cr_incident_title', (string) get_parameter('cr_incident_title', $config['cr_incident_title']))) { + if (config_update_value('cr_incident_title', (string) get_parameter('cr_incident_title', $config['cr_incident_title']), true) === false) { $error_update[] = __('Integria custom response default ticket title'); } - if (!config_update_value('incident_content', (string) get_parameter('incident_content', $config['incident_content']))) { + if (config_update_value('incident_content', (string) get_parameter('incident_content', $config['incident_content']), true) === false) { $error_update[] = __('Integria default ticket content'); } - if (!config_update_value('cr_incident_content', (string) get_parameter('cr_incident_content', $config['cr_incident_content']))) { + if (config_update_value('cr_incident_content', (string) get_parameter('cr_incident_content', $config['cr_incident_content']), true) === false) { $error_update[] = __('Integria custom response default ticket content'); } break; case 'module_library': - $module_library_user = get_parameter('module_library_user'); - if (!config_update_value('module_library_user', $module_library_user)) { - $error_update[] = __('User'); + if (config_update_value('module_library_user', get_parameter('module_library_user'), true) === false) { + $error_update[] = __('Module Library User'); } - $module_library_password = get_parameter('module_library_password'); - if (!config_update_value('module_library_password', $module_library_password)) { - $error_update[] = __('Password'); + if (config_update_value('module_library_password', get_parameter('module_library_password'), true) === false) { + $error_update[] = __('Module Library Password'); } break; case 'websocket_engine': - if (!config_update_value('ws_bind_address', get_parameter('ws_bind_address'))) { + if (config_update_value('ws_bind_address', get_parameter('ws_bind_address'), true) === false) { $error_update[] = __('WebSocket bind address'); } - if (!config_update_value('ws_port', get_parameter('ws_port'))) { + if (config_update_value('ws_port', get_parameter('ws_port'), true) === false) { $error_update[] = __('WebSocket port'); } - if (!config_update_value('ws_proxy_url', get_parameter('ws_proxy_url'))) { + if (config_update_value('ws_proxy_url', get_parameter('ws_proxy_url'), true) === false) { $error_update[] = __('WebSocket proxy url'); } break; @@ -1780,11 +1779,27 @@ function config_update_config() if (count($error_update) > 0) { $config['error_config_update_config'] = []; $config['error_config_update_config']['correct'] = false; - $values = implode(', ', $error_update); - $config['error_config_update_config']['message'] = sprintf(__('Failed updated: the next values cannot update: %s'), $values); + $values = implode('
-', $error_update); + $config['error_config_update_config']['message'] = sprintf( + __('Failed updated: the next values cannot update:
-%s'), + $values + ); + + db_pandora_audit( + AUDIT_LOG_SETUP, + 'Failed changing Setup', + false, + false, + $config['error_config_update_config']['message'] + ); } else { $config['error_config_update_config'] = []; $config['error_config_update_config']['correct'] = true; + + db_pandora_audit( + AUDIT_LOG_SETUP, + 'Setup has changed' + ); } if (count($errors) > 0) { @@ -3314,14 +3329,14 @@ function get_um_url() { global $config; - if (isset($config['url_update_manager'])) { + if (isset($config['url_update_manager']) === true) { $url = $config['url_update_manager']; $url = substr($url, 0, (strlen($url) - strpos(strrev($url), '/'))); } else { $url = 'https://licensing.artica.es/pandoraupdate7/'; config_update_value( 'url_update_manager', - 'https://licensing.artica.es/pandoraupdate7/server.php' + $url.'/server.php' ); } diff --git a/pandora_console/include/functions_cron.php b/pandora_console/include/functions_cron.php index bbcd1f4293..bbbac884b5 100644 --- a/pandora_console/include/functions_cron.php +++ b/pandora_console/include/functions_cron.php @@ -532,13 +532,20 @@ function cron_list_table() continue; } - $email = $args[1]; - $report_type = $args[4]; - $data[2] .= '
- '.__('Report').": "; - $data[2] .= $report['name'].''; - $data[2] .= '
- '.__('Report type').': '.$report_type; - $data[2] .= '
- '.__('Email').": "; - $data[2] .= ui_print_truncate_text($email, 60, false).''; + $email = ui_print_truncate_text($args[1], 120); + $reportName = ui_print_truncate_text($report['name'], 120); + $reportType = $args[4]; + $data[2] .= html_print_anchor( + [ + 'href' => ui_get_full_url( + 'index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$args[0] + ), + 'content' => $reportName, + ], + true + ); + $data[2] .= '
- '.__('Report type').': '.$reportType; + $data[2] .= '
- '.__('Email').': '.$email; break; case 'cron_task_generate_report_by_template': @@ -582,32 +589,48 @@ function cron_list_table() } if (empty($args[1]) === false && (string) $args[1] !== '0') { - $agents_id = $args[1]; + if (is_metaconsole() === true) { + $tmpAgents = explode(',', $args[1]); + $agentsId = ''; + foreach ($tmpAgents as $tmpAgent) { + $tmpAgentData = explode('|', $tmpAgent); + $agentsId .= (empty($agentsId) === false) ? ', '.$tmpAgentData[2] : $tmpAgentData[2]; + } + } } else { if (empty($args[2]) === false) { - $agents_id = sprintf( - '(%s) %s', + $agentsId = sprintf( + '(%s) %s', __('regex'), $args[2] ); } else { - $agents_id = __('None'); + $agentsId = __('None'); } } - $report_type = $args[8]; - $report_per_agent = $args[3]; - $report_name = $args[4]; - $email = $args[5]; + // Assignations. + $agentsId = ui_print_truncate_text($agentsId, 120); + $reportPerAgent = ((string) $args[3] === '1') ? __('Yes') : __('No'); + $reportName = ui_print_truncate_text($args[4], 120); + $email = ui_print_truncate_text($args[5], 120); + $reportType = $args[8]; + // Table row. $data[2] .= '
- '.__('Template').': '; - $data[2] .= ''; - $data[2] .= $template['name'].''; - $data[2] .= '
- '.__('Agents').': '.ui_print_truncate_text($agents_id, 120).''; - $data[2] .= '
- '.__('Report per agent').': '.$report_per_agent.''; - $data[2] .= '
- '.__('Report name').': '.$report_name.''; - $data[2] .= '
- '.__('Email').": ".$email.''; - $data[2] .= '
- '.__('Report type').': '.$report_type; - + $data[2] .= html_print_anchor( + [ + 'href' => ui_get_full_url( + 'index.php?sec=reporting&sec2=enterprise/godmode/reporting/reporting_builder.template&action=edit&id_template='.$args[0] + ), + 'content' => $template['name'], + ], + true + ); + $data[2] .= '
- '.__('Agents').': '.$agentsId; + $data[2] .= '
- '.__('Report per agent').': '.$reportPerAgent; + $data[2] .= '
- '.__('Report name').': '.$reportName; + $data[2] .= '
- '.__('Email').': '.$email; + $data[2] .= '
- '.__('Report type').': '.$reportType; break; case 'cron_task_execute_custom_script': diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index cbcc645fdb..6929325319 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -231,8 +231,8 @@ function db_pandora_audit($accion, $descripcion, $user_id=false, $ip=true, $info { global $config; - // Ignore $ip and always set the ip address - if (isset($config['remote_addr'])) { + // Ignore $ip and always set the ip address. + if (isset($config['remote_addr']) === true) { $ip = $config['remote_addr']; } else { if ($_SERVER['REMOTE_ADDR']) { @@ -245,46 +245,26 @@ function db_pandora_audit($accion, $descripcion, $user_id=false, $ip=true, $info if ($user_id !== false) { $id = $user_id; } else { - if (isset($config['id_user'])) { - $id = $config['id_user']; - } else { - $id = 0; - } + $id = (isset($config['id_user']) === true) ? $config['id_user'] : 0; } $accion = io_safe_input($accion); $descripcion = io_safe_input($descripcion); - switch ($config['dbtype']) { - case 'mysql': - case 'postgresql': - $values = [ - 'id_usuario' => $id, - 'accion' => $accion, - 'ip_origen' => $ip, - 'descripcion' => $descripcion, - 'fecha' => date('Y-m-d H:i:s'), - 'utimestamp' => time(), - ]; - break; - - case 'oracle': - $values = [ - 'id_usuario' => $id, - 'accion' => $accion, - 'ip_origen' => $ip, - 'descripcion' => $descripcion, - 'fecha' => '#to_date(\''.date('Y-m-d H:i:s').'\',\'YYYY-MM-DD HH24:MI:SS\')', - 'utimestamp' => time(), - ]; - break; - } + $values = [ + 'id_usuario' => $id, + 'accion' => $accion, + 'ip_origen' => $ip, + 'descripcion' => $descripcion, + 'fecha' => date('Y-m-d H:i:s'), + 'utimestamp' => time(), + ]; $id_audit = db_process_sql_insert('tsesion', $values); $valor = ''.$values['fecha'].' - '.io_safe_output($id).' - '.io_safe_output($accion).' - '.$ip.' - '.io_safe_output($descripcion)."\n"; - if ($config['audit_log_enabled']) { + if ((bool) $config['audit_log_enabled'] === true) { file_put_contents($config['homedir'].'/log/audit.log', $valor, FILE_APPEND); } @@ -298,12 +278,19 @@ function db_pandora_audit($accion, $descripcion, $user_id=false, $ip=true, $info /** * Log in a user into Pandora. * - * @param string $id_user User id + * @param string $id_user User id. * @param string $ip Client user IP address. + * + * @return void */ function db_logon($id_user, $ip) { - db_pandora_audit('Logon', 'Logged in', $id_user, $ip); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Logged in', + $id_user, + $ip + ); // Update last registry of user to set last logon. How do we audit when the user was created then? process_user_contact($id_user); @@ -313,12 +300,19 @@ function db_logon($id_user, $ip) /** * Log out a user into Pandora. * - * @param string $id_user User id + * @param string $id_user User id. * @param string $ip Client user IP address. + * + * @return void */ function db_logoff($id_user, $ip) { - db_pandora_audit('Logoff', 'Logged out', $id_user, $ip); + db_pandora_audit( + AUDIT_LOG_USER_REGISTRATION, + 'Logged out', + $id_user, + $ip + ); } diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 9b097d4a93..a70ad19ae0 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -779,19 +779,19 @@ function events_get_all( ); } - if (isset($filter['date_to']) - && !empty($filter['date_to']) - && $filter['date_to'] != '0000-00-00' + if (isset($filter['date_to']) === true + && empty($filter['date_to']) === false + && $filter['date_to'] !== '0000-00-00' ) { $date_to = $filter['date_to']; } - if (isset($filter['time_to'])) { + if (isset($filter['time_to']) === true) { $time_to = (empty($filter['time_to']) === true) ? '23:59:59' : $filter['time_to']; } - if (isset($date_to)) { - if (!isset($time_to)) { + if (isset($date_to) === true) { + if (isset($time_to) === false) { $time_to = '23:59:59'; } @@ -802,8 +802,8 @@ function events_get_all( ); } - if (!isset($from)) { - if (isset($filter['event_view_hr']) && ($filter['event_view_hr'] > 0)) { + if (isset($from) === false) { + if (isset($filter['event_view_hr']) === true && ($filter['event_view_hr'] > 0)) { $sql_filters[] = sprintf( ' AND utimestamp > UNIX_TIMESTAMP(now() - INTERVAL %d HOUR) ', $filter['event_view_hr'] @@ -811,20 +811,20 @@ function events_get_all( } } - if (isset($filter['id_agent']) && $filter['id_agent'] > 0) { + if (isset($filter['id_agent']) === true && $filter['id_agent'] > 0) { $sql_filters[] = sprintf( ' AND te.id_agente = %d ', $filter['id_agent'] ); } - if (!empty($filter['event_type']) && $filter['event_type'] != 'all') { - if ($filter['event_type'] == 'warning' - || $filter['event_type'] == 'critical' - || $filter['event_type'] == 'normal' + if (empty($filter['event_type']) === false && $filter['event_type'] !== 'all') { + if ($filter['event_type'] === 'warning' + || $filter['event_type'] === 'critical' + || $filter['event_type'] === 'normal' ) { $sql_filters[] = ' AND event_type LIKE "%'.$filter['event_type'].'%"'; - } else if ($filter['event_type'] == 'not_normal') { + } else if ($filter['event_type'] === 'not_normal') { $sql_filters[] = ' AND (event_type LIKE "%warning%" OR event_type LIKE "%critical%" OR event_type LIKE "%unknown%")'; @@ -833,9 +833,9 @@ function events_get_all( } } - if (isset($filter['severity']) && $filter['severity'] > 0) { - if (is_array($filter['severity'])) { - if (!in_array(-1, $filter['severity'])) { + if (isset($filter['severity']) === true && $filter['severity'] > 0) { + if (is_array($filter['severity']) === true) { + if (in_array(-1, $filter['severity']) === false) { $not_normal = array_search(EVENT_CRIT_NOT_NORMAL, $filter['severity']); if ($not_normal !== false) { unset($filter['severity'][$not_normal]); @@ -858,7 +858,7 @@ function events_get_all( $filter['severity'][] = EVENT_CRIT_CRITICAL; } - if (!empty($filter['severity'])) { + if (empty($filter['severity']) === false) { $filter['severity'] = implode(',', $filter['severity']); $sql_filters[] = sprintf( ' AND criticity IN (%s)', @@ -1015,7 +1015,7 @@ function events_get_all( $EW_groups = users_get_groups($config['id_user'], 'EW', true, true); } - if (!$user_is_admin && !users_can_manage_group_all('ER')) { + if (!$user_is_admin && users_can_manage_group_all('ER') === false) { // Get groups where user have ER grants. $sql_filters[] = sprintf( ' AND (te.id_grupo IN ( %s ) OR tasg.id_group IN (%s))', @@ -1038,14 +1038,14 @@ function events_get_all( $tagente_table = 'tagente'; $tagente_field = 'id_agente'; $conditionMetaconsole = ''; - if (is_metaconsole() && $nodeConnected === false) { + if ((is_metaconsole() === true) && ($nodeConnected === false)) { $tagente_table = 'tmetaconsole_agent'; $tagente_field = 'id_tagente'; $conditionMetaconsole = ' AND ta.id_tmetaconsole_setup = te.server_id '; } // Agent alias. - if (!empty($filter['agent_alias'])) { + if (empty($filter['agent_alias']) === false) { $agent_join_filters[] = sprintf( ' AND ta.alias = "%s" ', $filter['agent_alias'] @@ -1053,7 +1053,7 @@ function events_get_all( } // Free search. - if (!empty($filter['search'])) { + if (empty($filter['search']) === false) { if (isset($config['dbconnection']->server_version) && $config['dbconnection']->server_version > 50600 ) { @@ -1071,23 +1071,23 @@ function events_get_all( OR lower(te.evento) like lower("%%%s%%") OR lower(te.user_comment) like lower("%%%s%%") OR lower(te.id_extra) like lower("%%%s%%") - OR lower(te.source) like lower("%%%s%%") + OR lower(te.source) like lower("%%%s%%") OR lower('.$custom_data_search.') like lower("%%%s%%") )', array_fill(0, 7, $filter['search']) ); } // Id extra. - if (!empty($filter['id_extra'])) { + if (empty($filter['id_extra']) === false) { $sql_filters[] = sprintf( ' AND lower(te.id_extra) like lower("%%%s%%") ', $filter['id_extra'] ); } - if (is_metaconsole() && $nodeConnected === false) { + if ((is_metaconsole() === true) && ($nodeConnected === false)) { // Id source event. - if (!empty($filter['id_source_event'])) { + if (empty($filter['id_source_event']) === false) { $sql_filters[] = sprintf( ' AND lower(te.id_source_event) like lower("%%%s%%") ', $filter['id_source_event'] @@ -1096,7 +1096,7 @@ function events_get_all( } // User comment. - if (!empty($filter['user_comment'])) { + if (empty($filter['user_comment']) === false) { // For filter field. $sql_filters[] = sprintf( ' AND lower(te.user_comment) like lower("%%%s%%") ', @@ -1111,7 +1111,7 @@ function events_get_all( } // Source. - if (!empty($filter['source'])) { + if (empty($filter['source']) === false) { $sql_filters[] = sprintf( ' AND lower(te.source) like lower("%%%s%%") ', $filter['source'] @@ -1119,7 +1119,7 @@ function events_get_all( } // Validated or in process by. - if (!empty($filter['id_user_ack'])) { + if (empty($filter['id_user_ack']) === false) { $sql_filters[] = sprintf( ' AND te.id_usuario like lower("%%%s%%") ', $filter['id_user_ack'] @@ -1128,13 +1128,13 @@ function events_get_all( $tag_names = []; // With following tags. - if (!empty($filter['tag_with'])) { + if (empty($filter['tag_with']) === false) { $tag_with = base64_decode($filter['tag_with']); $tags = json_decode($tag_with, true); - if (is_array($tags) && !in_array('0', $tags)) { + if (is_array($tags) === true && in_array('0', $tags) === false) { if (!$user_is_admin) { $getUserTags = tags_get_tags_for_module_search(); - // Prevent false value for array_flip + // Prevent false value for array_flip. if ($getUserTags === false) { $getUserTags = []; } @@ -1152,7 +1152,7 @@ function events_get_all( $_tmp = ''; foreach ($tags as $id_tag) { - if (!isset($tags_names[$id_tag])) { + if (isset($tags_names[$id_tag]) === false) { $tags_names[$id_tag] = tags_get_name($id_tag); } @@ -1182,18 +1182,22 @@ function events_get_all( $tags_names[$id_tag] ); - $_tmp .= ') '; + if ($tags[0] === $id_tag) { + $_tmp .= ')) '; + } else { + $_tmp .= ') '; + } } - $sql_filters[] = $_tmp.')'; + $sql_filters[] = $_tmp; } } // Without following tags. - if (!empty($filter['tag_without'])) { + if (empty($filter['tag_without']) === false) { $tag_without = base64_decode($filter['tag_without']); $tags = json_decode($tag_without, true); - if (is_array($tags) && !in_array('0', $tags)) { + if (is_array($tags) === true && in_array('0', $tags) === false) { if (!$user_is_admin) { $user_tags = array_flip(tags_get_tags_for_module_search()); if ($user_tags != null) { @@ -1208,7 +1212,7 @@ function events_get_all( } foreach ($tags as $id_tag) { - if (!isset($tags_names[$id_tag])) { + if (isset($tags_names[$id_tag]) === false) { $tags_names[$id_tag] = tags_get_name($id_tag); } @@ -1903,7 +1907,10 @@ function events_delete_event( if (check_acl($config['id_user'], $event_group, 'EM') == 0) { // Check ACL. - db_pandora_audit('ACL Violation', 'Attempted deleting event #'.$event); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Attempted deleting event #'.$event + ); $errors++; } else { $ret = db_process_sql_delete($table_event, ['id_evento' => $event]); @@ -1911,7 +1918,10 @@ function events_delete_event( if (!$ret) { $errors++; } else { - db_pandora_audit('Event deleted', 'Deleted event #'.$event); + db_pandora_audit( + AUDIT_LOG_ALERT_MANAGEMENT, + 'Deleted event #'.$event + ); // ACL didn't fail nor did return. continue; } @@ -1995,7 +2005,10 @@ function events_change_status( } if (check_acl($config['id_user'], $event_group, 'EW') == 0) { - db_pandora_audit('ACL Violation', 'Attempted updating event #'.$id); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Attempted updating event #'.$id + ); unset($id_event[$k]); } @@ -2106,7 +2119,10 @@ function events_change_owner( } if (check_acl($config['id_user'], $event_group, 'EW') == 0) { - db_pandora_audit('ACL Violation', 'Attempted updating event #'.$id); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Attempted updating event #'.$id + ); unset($id_event[$k]); } } @@ -2221,7 +2237,10 @@ function events_comment( } if (check_acl($config['id_user'], $event_group, 'EW') == 0) { - db_pandora_audit('ACL Violation', 'Attempted updating event #'.$id); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Attempted updating event #'.$id + ); unset($id_event[$k]); } diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 9f47cf7b29..b33b68aac7 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -142,7 +142,10 @@ function upload_file($upload_file_or_zip, $default_real_directory, $destination_ check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { - db_pandora_audit('ACL Violation', 'Trying to access File manager'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access File manager' + ); include 'general/noaccess.php'; return; } @@ -257,7 +260,10 @@ function create_text_file($default_real_directory, $destination_directory) check_login(); if (! check_acl($config['id_user'], 0, 'AW')) { - db_pandora_audit('ACL Violation', 'Trying to access File manager'); + db_pandora_audit( + AUDIT_LOG_ACL_VIOLATION, + 'Trying to access File manager' + ); include 'general/noaccess.php'; return; } @@ -1019,7 +1025,10 @@ function filemanager_safe_directory( } if ($forbiddenAttempting === true) { - db_pandora_audit('File manager', 'Attempting to use a forbidden file or directory name'); + db_pandora_audit( + AUDIT_LOG_HACK_ATTEMPT, + 'Attempting to use a forbidden file or directory name' + ); } return $directory; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index da12915fc8..c1c43098da 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -2320,6 +2320,7 @@ function html_print_input_text_extended( 'autocomplete', 'form', 'list', + 'pattern', ]; $output = 'agent()->id_agente(); $id_agent_module = $content['id_agent_module']; - $agent_description = agents_get_description($id_agent); - $agent_group = agents_get_agent_group($id_agent); - $agent_address = agents_get_address($id_agent); - - $module_description = modules_get_agentmodule_descripcion( - $id_agent_module - ); + $agent_alias = $module->agent()->alias(); + $module_name = $module->name(); + $agent_description = $module->agent()->comentarios(); + $agent_group = $module->agent()->group(); + $agent_address = $module->agent()->field['direccion']; + $module_description = $module->descripcion(); $items_label = [ 'type' => $return['type'], @@ -4138,22 +4141,63 @@ function reporting_last_value($report, $content) $return['pagebreak'] = $content['pagebreak']; $return['subtitle'] = $agent_alias.' - '.$module_name; $return['description'] = $content['description']; - $return['date'] = reporting_get_date_text($report, $content); - $return['agent_name_db'] = agents_get_name($id_agent); + $return['agent_name_db'] = $module->agent()->id_agente(); $return['agent_name'] = $agent_alias; $return['module_name'] = $module_name; + $return['date'] = reporting_get_date_text($report, $content); - $sql = sprintf( - 'SELECT * - FROM tagente_estado - WHERE id_agente_modulo = %s', - $content['id_agent_module'] - ); + $result = $module->getStatus()->toArray(); - $result = db_get_row_sql($sql); + if ($result === false + || $result['estado'] == AGENT_MODULE_STATUS_NO_DATA + || $result['estado'] == AGENT_MODULE_STATUS_NOT_INIT + ) { + $result['utimestamp'] = ''; + $result['datos'] = __('No data to display within the selected interval'); + } - if ($result === false) { - $result = []; + if ($datetime < $result['utimestamp']) { + $id_tipo_modulo = $module->id_tipo_modulo(); + $table_data = modules_get_table_data(null, $id_tipo_modulo); + if ($period !== null) { + $sql = sprintf( + 'SELECT datos, utimestamp FROM %s WHERE id_agente_modulo = %d AND utimestamp BETWEEN %d AND %d ORDER BY utimestamp DESC', + $table_data, + $id_agent_module, + ($datetime - $period), + $datetime + ); + } else { + $sql = sprintf( + 'SELECT datos, utimestamp FROM %s WHERE id_agente_modulo = %d AND utimestamp <= %d ORDER BY utimestamp DESC', + $table_data, + $id_agent_module, + $datetime + ); + } + + $search_in_history_db = db_search_in_history_db($datetime); + + try { + $module->connectNode(); + } catch (\Exception $e) { + // Do not link items if failed to find them. + $module->restoreConnection(); + } + + $datos = db_get_row_sql($sql, $search_in_history_db); + + // Restore if needed. + $module->restoreConnection(); + + if ($datos !== false) { + $result['datos'] = $datos['datos']; + $result['utimestamp'] = $datos['utimestamp']; + } else { + $result['utimestamp'] = '-'; + $result['estado'] = AGENT_MODULE_STATUS_NO_DATA; + $result['datos'] = __('No data to display within the selected interval'); + } } $result['agent_name'] = $agent_alias; @@ -4161,10 +4205,6 @@ function reporting_last_value($report, $content) $return['data'] = $result; - if (is_metaconsole()) { - metaconsole_restore_db(); - } - return reporting_check_structure_content($return); } @@ -14500,7 +14540,10 @@ function reporting_email_template( if (empty($destination) === false) { send_email_attachment($destination, $body, $subject, $attachments); } else { - db_pandora_audit('ERROR:', 'Cron jobs mail, empty destination email.'); + db_pandora_audit( + AUDIT_LOG_SYSTEM, + 'Cron jobs mail, empty destination email.' + ); } } } diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 5f98ed9df8..f0bdbbc613 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -546,7 +546,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) && ! check_acl_one_of_groups($config['id_user'], $groups, 'AW', false) ) { db_pandora_audit( - 'ACL Violation', + AUDIT_LOG_ACL_VIOLATION, 'Trying to access Agent General Information' ); include_once 'general/noaccess.php'; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ddf722bfd3..44280b6bb3 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -251,6 +251,7 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t $icon_image = ''; $no_close_bool = false; $force_style = ''; + $force_class = ''; if (is_array($message)) { if (!empty($message['title'])) { $text_title = $message['title']; @@ -271,6 +272,10 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t if (!empty($message['force_style'])) { $force_style = $message['force_style']; } + + if (empty($message['force_class']) === false) { + $force_class = $message['force_class']; + } } else { $text_message = $message; } @@ -319,6 +324,10 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t $id = 'info_box_'.uniqid(); + if (empty($force_class) === false) { + $class = $class.' '.$force_class; + } + // Use the no_meta parameter because this image is only in the base console. $output = ' diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 652d61bfb6..7beef57067 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -33,7 +33,7 @@ function include_javascript_dependencies_flot_graph($return=false, $mobile=false if ($mobile === true) { $output .= ' - '; + '; } // NOTE: jquery.flot.threshold is not te original file. Is patched to allow multiple thresholds and filled area diff --git a/pandora_console/include/javascript/fullcalendar/LICENSE.txt b/pandora_console/include/javascript/fullcalendar/LICENSE.txt new file mode 100644 index 0000000000..18ac6673da --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/LICENSE.txt @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2021 Adam Shaw + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/pandora_console/include/javascript/fullcalendar/locales-all.js b/pandora_console/include/javascript/fullcalendar/locales-all.js new file mode 100644 index 0000000000..eb2c0ad6a6 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales-all.js @@ -0,0 +1,1900 @@ +[].push.apply( + FullCalendar.globalLocales, + (function() { + "use strict"; + + var l0 = { + code: "af", + week: { + dow: 1, // Maandag is die eerste dag van die week. + doy: 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar. + }, + buttonText: { + prev: "Vorige", + next: "Volgende", + today: "Vandag", + year: "Jaar", + month: "Maand", + week: "Week", + day: "Dag", + list: "Agenda" + }, + allDayText: "Heeldag", + moreLinkText: "Addisionele", + noEventsText: "Daar is geen gebeurtenisse nie" + }; + + var l1 = { + code: "ar-dz", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 4 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + var l2 = { + code: "ar-kw", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + var l3 = { + code: "ar-ly", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + var l4 = { + code: "ar-ma", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + var l5 = { + code: "ar-sa", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + var l6 = { + code: "ar-tn", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + var l7 = { + code: "ar", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + var l8 = { + code: "az", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Əvvəl", + next: "Sonra", + today: "Bu Gün", + month: "Ay", + week: "Həftə", + day: "Gün", + list: "Gündəm" + }, + weekText: "Həftə", + allDayText: "Bütün Gün", + moreLinkText: function(n) { + return "+ daha çox " + n; + }, + noEventsText: "Göstərmək üçün hadisə yoxdur" + }; + + var l9 = { + code: "bg", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "назад", + next: "напред", + today: "днес", + month: "Месец", + week: "Седмица", + day: "Ден", + list: "График" + }, + allDayText: "Цял ден", + moreLinkText: function(n) { + return "+още " + n; + }, + noEventsText: "Няма събития за показване" + }; + + var l10 = { + code: "bn", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "পেছনে", + next: "সামনে", + today: "আজ", + month: "মাস", + week: "সপ্তাহ", + day: "দিন", + list: "তালিকা" + }, + weekText: "সপ্তাহ", + allDayText: "সারাদিন", + moreLinkText: function(n) { + return "+অন্যান্য " + n; + }, + noEventsText: "কোনো ইভেন্ট নেই" + }; + + var l11 = { + code: "bs", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Prošli", + next: "Sljedeći", + today: "Danas", + month: "Mjesec", + week: "Sedmica", + day: "Dan", + list: "Raspored" + }, + weekText: "Sed", + allDayText: "Cijeli dan", + moreLinkText: function(n) { + return "+ još " + n; + }, + noEventsText: "Nema događaja za prikazivanje" + }; + + var l12 = { + code: "ca", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Anterior", + next: "Següent", + today: "Avui", + month: "Mes", + week: "Setmana", + day: "Dia", + list: "Agenda" + }, + weekText: "Set", + allDayText: "Tot el dia", + moreLinkText: "més", + noEventsText: "No hi ha esdeveniments per mostrar" + }; + + var l13 = { + code: "cs", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Dříve", + next: "Později", + today: "Nyní", + month: "Měsíc", + week: "Týden", + day: "Den", + list: "Agenda" + }, + weekText: "Týd", + allDayText: "Celý den", + moreLinkText: function(n) { + return "+další: " + n; + }, + noEventsText: "Žádné akce k zobrazení" + }; + + var l14 = { + code: "cy", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Blaenorol", + next: "Nesaf", + today: "Heddiw", + year: "Blwyddyn", + month: "Mis", + week: "Wythnos", + day: "Dydd", + list: "Rhestr" + }, + weekText: "Wythnos", + allDayText: "Trwy'r dydd", + moreLinkText: "Mwy", + noEventsText: "Dim digwyddiadau" + }; + + var l15 = { + code: "da", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Forrige", + next: "Næste", + today: "I dag", + month: "Måned", + week: "Uge", + day: "Dag", + list: "Agenda" + }, + weekText: "Uge", + allDayText: "Hele dagen", + moreLinkText: "flere", + noEventsText: "Ingen arrangementer at vise" + }; + + function affix$1(buttonText) { + return buttonText === "Tag" || buttonText === "Monat" + ? "r" + : buttonText === "Jahr" + ? "s" + : ""; + } + + var l16 = { + code: "de-at", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Zurück", + next: "Vor", + today: "Heute", + year: "Jahr", + month: "Monat", + week: "Woche", + day: "Tag", + list: "Terminübersicht" + }, + weekText: "KW", + weekTextLong: "Woche", + allDayText: "Ganztägig", + moreLinkText: function(n) { + return "+ weitere " + n; + }, + noEventsText: "Keine Ereignisse anzuzeigen", + buttonHints: { + prev(buttonText) { + return `Vorherige${affix$1(buttonText)} ${buttonText}`; + }, + next(buttonText) { + return `Nächste${affix$1(buttonText)} ${buttonText}`; + }, + today(buttonText) { + // → Heute, Diese Woche, Dieser Monat, Dieses Jahr + if (buttonText === "Tag") { + return "Heute"; + } + return `Diese${affix$1(buttonText)} ${buttonText}`; + } + }, + viewHint(buttonText) { + // → Tagesansicht, Wochenansicht, Monatsansicht, Jahresansicht + const glue = + buttonText === "Woche" ? "n" : buttonText === "Monat" ? "s" : "es"; + return buttonText + glue + "ansicht"; + }, + navLinkHint: "Gehe zu $0", + moreLinkHint(eventCnt) { + return ( + "Zeige " + + (eventCnt === 1 + ? "ein weiteres Ereignis" + : eventCnt + " weitere Ereignisse") + ); + }, + closeHint: "Schließen", + timeHint: "Uhrzeit", + eventHint: "Ereignis" + }; + + function affix(buttonText) { + return buttonText === "Tag" || buttonText === "Monat" + ? "r" + : buttonText === "Jahr" + ? "s" + : ""; + } + + var l17 = { + code: "de", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Zurück", + next: "Vor", + today: "Heute", + year: "Jahr", + month: "Monat", + week: "Woche", + day: "Tag", + list: "Terminübersicht" + }, + weekText: "KW", + weekTextLong: "Woche", + allDayText: "Ganztägig", + moreLinkText: function(n) { + return "+ weitere " + n; + }, + noEventsText: "Keine Ereignisse anzuzeigen", + buttonHints: { + prev(buttonText) { + return `Vorherige${affix(buttonText)} ${buttonText}`; + }, + next(buttonText) { + return `Nächste${affix(buttonText)} ${buttonText}`; + }, + today(buttonText) { + // → Heute, Diese Woche, Dieser Monat, Dieses Jahr + if (buttonText === "Tag") { + return "Heute"; + } + return `Diese${affix(buttonText)} ${buttonText}`; + } + }, + viewHint(buttonText) { + // → Tagesansicht, Wochenansicht, Monatsansicht, Jahresansicht + const glue = + buttonText === "Woche" ? "n" : buttonText === "Monat" ? "s" : "es"; + return buttonText + glue + "ansicht"; + }, + navLinkHint: "Gehe zu $0", + moreLinkHint(eventCnt) { + return ( + "Zeige " + + (eventCnt === 1 + ? "ein weiteres Ereignis" + : eventCnt + " weitere Ereignisse") + ); + }, + closeHint: "Schließen", + timeHint: "Uhrzeit", + eventHint: "Ereignis" + }; + + var l18 = { + code: "el", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4st is the first week of the year. + }, + buttonText: { + prev: "Προηγούμενος", + next: "Επόμενος", + today: "Σήμερα", + month: "Μήνας", + week: "Εβδομάδα", + day: "Ημέρα", + list: "Ατζέντα" + }, + weekText: "Εβδ", + allDayText: "Ολοήμερο", + moreLinkText: "περισσότερα", + noEventsText: "Δεν υπάρχουν γεγονότα προς εμφάνιση" + }; + + var l19 = { + code: "en-au", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonHints: { + prev: "Previous $0", + next: "Next $0", + today: "This $0" + }, + viewHint: "$0 view", + navLinkHint: "Go to $0", + moreLinkHint(eventCnt) { + return `Show ${eventCnt} more event${eventCnt === 1 ? "" : "s"}`; + } + }; + + var l20 = { + code: "en-gb", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonHints: { + prev: "Previous $0", + next: "Next $0", + today: "This $0" + }, + viewHint: "$0 view", + navLinkHint: "Go to $0", + moreLinkHint(eventCnt) { + return `Show ${eventCnt} more event${eventCnt === 1 ? "" : "s"}`; + } + }; + + var l21 = { + code: "en-nz", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonHints: { + prev: "Previous $0", + next: "Next $0", + today: "This $0" + }, + viewHint: "$0 view", + navLinkHint: "Go to $0", + moreLinkHint(eventCnt) { + return `Show ${eventCnt} more event${eventCnt === 1 ? "" : "s"}`; + } + }; + + var l22 = { + code: "eo", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Antaŭa", + next: "Sekva", + today: "Hodiaŭ", + month: "Monato", + week: "Semajno", + day: "Tago", + list: "Tagordo" + }, + weekText: "Sm", + allDayText: "Tuta tago", + moreLinkText: "pli", + noEventsText: "Neniuj eventoj por montri" + }; + + var l23 = { + code: "es", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Ant", + next: "Sig", + today: "Hoy", + month: "Mes", + week: "Semana", + day: "Día", + list: "Agenda" + }, + weekText: "Sm", + allDayText: "Todo el día", + moreLinkText: "más", + noEventsText: "No hay eventos para mostrar" + }; + + var l24 = { + code: "es", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Ant", + next: "Sig", + today: "Hoy", + month: "Mes", + week: "Semana", + day: "Día", + list: "Agenda" + }, + buttonHints: { + prev: "$0 antes", + next: "$0 siguiente", + today(buttonText) { + return buttonText === "Día" + ? "Hoy" + : (buttonText === "Semana" ? "Esta" : "Este") + + " " + + buttonText.toLocaleLowerCase(); + } + }, + viewHint(buttonText) { + return ( + "Vista " + + (buttonText === "Semana" ? "de la" : "del") + + " " + + buttonText.toLocaleLowerCase() + ); + }, + weekText: "Sm", + weekTextLong: "Semana", + allDayText: "Todo el día", + moreLinkText: "más", + moreLinkHint(eventCnt) { + return `Mostrar ${eventCnt} eventos más`; + }, + noEventsText: "No hay eventos para mostrar", + navLinkHint: "Ir al $0", + closeHint: "Cerrar", + timeHint: "La hora", + eventHint: "Evento" + }; + + var l25 = { + code: "et", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Eelnev", + next: "Järgnev", + today: "Täna", + month: "Kuu", + week: "Nädal", + day: "Päev", + list: "Päevakord" + }, + weekText: "näd", + allDayText: "Kogu päev", + moreLinkText: function(n) { + return "+ veel " + n; + }, + noEventsText: "Kuvamiseks puuduvad sündmused" + }; + + var l26 = { + code: "eu", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Aur", + next: "Hur", + today: "Gaur", + month: "Hilabetea", + week: "Astea", + day: "Eguna", + list: "Agenda" + }, + weekText: "As", + allDayText: "Egun osoa", + moreLinkText: "gehiago", + noEventsText: "Ez dago ekitaldirik erakusteko" + }; + + var l27 = { + code: "fa", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "قبلی", + next: "بعدی", + today: "امروز", + month: "ماه", + week: "هفته", + day: "روز", + list: "برنامه" + }, + weekText: "هف", + allDayText: "تمام روز", + moreLinkText: function(n) { + return "بیش از " + n; + }, + noEventsText: "هیچ رویدادی به نمایش" + }; + + var l28 = { + code: "fi", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Edellinen", + next: "Seuraava", + today: "Tänään", + month: "Kuukausi", + week: "Viikko", + day: "Päivä", + list: "Tapahtumat" + }, + weekText: "Vk", + allDayText: "Koko päivä", + moreLinkText: "lisää", + noEventsText: "Ei näytettäviä tapahtumia" + }; + + var l29 = { + code: "fr", + buttonText: { + prev: "Précédent", + next: "Suivant", + today: "Aujourd'hui", + year: "Année", + month: "Mois", + week: "Semaine", + day: "Jour", + list: "Mon planning" + }, + weekText: "Sem.", + allDayText: "Toute la journée", + moreLinkText: "en plus", + noEventsText: "Aucun événement à afficher" + }; + + var l30 = { + code: "fr-ch", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Précédent", + next: "Suivant", + today: "Courant", + year: "Année", + month: "Mois", + week: "Semaine", + day: "Jour", + list: "Mon planning" + }, + weekText: "Sm", + allDayText: "Toute la journée", + moreLinkText: "en plus", + noEventsText: "Aucun événement à afficher" + }; + + var l31 = { + code: "fr", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Précédent", + next: "Suivant", + today: "Aujourd'hui", + year: "Année", + month: "Mois", + week: "Semaine", + day: "Jour", + list: "Planning" + }, + weekText: "Sem.", + allDayText: "Toute la journée", + moreLinkText: "en plus", + noEventsText: "Aucun événement à afficher" + }; + + var l32 = { + code: "gl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Ant", + next: "Seg", + today: "Hoxe", + month: "Mes", + week: "Semana", + day: "Día", + list: "Axenda" + }, + weekText: "Sm", + allDayText: "Todo o día", + moreLinkText: "máis", + noEventsText: "Non hai eventos para amosar" + }; + + var l33 = { + code: "he", + direction: "rtl", + buttonText: { + prev: "הקודם", + next: "הבא", + today: "היום", + month: "חודש", + week: "שבוע", + day: "יום", + list: "סדר יום" + }, + allDayText: "כל היום", + moreLinkText: "אחר", + noEventsText: "אין אירועים להצגה", + weekText: "שבוע" + }; + + var l34 = { + code: "hi", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "पिछला", + next: "अगला", + today: "आज", + month: "महीना", + week: "सप्ताह", + day: "दिन", + list: "कार्यसूची" + }, + weekText: "हफ्ता", + allDayText: "सभी दिन", + moreLinkText: function(n) { + return "+अधिक " + n; + }, + noEventsText: "कोई घटनाओं को प्रदर्शित करने के लिए" + }; + + var l35 = { + code: "hr", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Prijašnji", + next: "Sljedeći", + today: "Danas", + month: "Mjesec", + week: "Tjedan", + day: "Dan", + list: "Raspored" + }, + weekText: "Tje", + allDayText: "Cijeli dan", + moreLinkText: function(n) { + return "+ još " + n; + }, + noEventsText: "Nema događaja za prikaz" + }; + + var l36 = { + code: "hu", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "vissza", + next: "előre", + today: "ma", + month: "Hónap", + week: "Hét", + day: "Nap", + list: "Lista" + }, + weekText: "Hét", + allDayText: "Egész nap", + moreLinkText: "további", + noEventsText: "Nincs megjeleníthető esemény" + }; + + var l37 = { + code: "hy-am", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Նախորդ", + next: "Հաջորդ", + today: "Այսօր", + month: "Ամիս", + week: "Շաբաթ", + day: "Օր", + list: "Օրվա ցուցակ" + }, + weekText: "Շաբ", + allDayText: "Ամբողջ օր", + moreLinkText: function(n) { + return "+ ևս " + n; + }, + noEventsText: "Բացակայում է իրադարձությունը ցուցադրելու" + }; + + var l38 = { + code: "id", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "mundur", + next: "maju", + today: "hari ini", + month: "Bulan", + week: "Minggu", + day: "Hari", + list: "Agenda" + }, + weekText: "Mg", + allDayText: "Sehari penuh", + moreLinkText: "lebih", + noEventsText: "Tidak ada acara untuk ditampilkan" + }; + + var l39 = { + code: "is", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Fyrri", + next: "Næsti", + today: "Í dag", + month: "Mánuður", + week: "Vika", + day: "Dagur", + list: "Dagskrá" + }, + weekText: "Vika", + allDayText: "Allan daginn", + moreLinkText: "meira", + noEventsText: "Engir viðburðir til að sýna" + }; + + var l40 = { + code: "it", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Prec", + next: "Succ", + today: "Oggi", + month: "Mese", + week: "Settimana", + day: "Giorno", + list: "Agenda" + }, + weekText: "Sm", + allDayText: "Tutto il giorno", + moreLinkText: function(n) { + return "+altri " + n; + }, + noEventsText: "Non ci sono eventi da visualizzare" + }; + + var l41 = { + code: "ja", + buttonText: { + prev: "前", + next: "次", + today: "今日", + month: "月", + week: "週", + day: "日", + list: "予定リスト" + }, + weekText: "週", + allDayText: "終日", + moreLinkText: function(n) { + return "他 " + n + " 件"; + }, + noEventsText: "表示する予定はありません" + }; + + var l42 = { + code: "ka", + week: { + dow: 1, + doy: 7 + }, + buttonText: { + prev: "წინა", + next: "შემდეგი", + today: "დღეს", + month: "თვე", + week: "კვირა", + day: "დღე", + list: "დღის წესრიგი" + }, + weekText: "კვ", + allDayText: "მთელი დღე", + moreLinkText: function(n) { + return "+ კიდევ " + n; + }, + noEventsText: "ღონისძიებები არ არის" + }; + + var l43 = { + code: "kk", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Алдыңғы", + next: "Келесі", + today: "Бүгін", + month: "Ай", + week: "Апта", + day: "Күн", + list: "Күн тәртібі" + }, + weekText: "Не", + allDayText: "Күні бойы", + moreLinkText: function(n) { + return "+ тағы " + n; + }, + noEventsText: "Көрсету үшін оқиғалар жоқ" + }; + + var l44 = { + code: "km", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "មុន", + next: "បន្ទាប់", + today: "ថ្ងៃនេះ", + year: "ឆ្នាំ", + month: "ខែ", + week: "សប្តាហ៍", + day: "ថ្ងៃ", + list: "បញ្ជី" + }, + weekText: "សប្តាហ៍", + allDayText: "ពេញមួយថ្ងៃ", + moreLinkText: "ច្រើនទៀត", + noEventsText: "គ្មានព្រឹត្តិការណ៍ត្រូវបង្ហាញ" + }; + + var l45 = { + code: "ko", + buttonText: { + prev: "이전달", + next: "다음달", + today: "오늘", + month: "월", + week: "주", + day: "일", + list: "일정목록" + }, + weekText: "주", + allDayText: "종일", + moreLinkText: "개", + noEventsText: "일정이 없습니다" + }; + + var l46 = { + code: "ku", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "پێشتر", + next: "دواتر", + today: "ئەمڕو", + month: "مانگ", + week: "هەفتە", + day: "ڕۆژ", + list: "بەرنامە" + }, + weekText: "هەفتە", + allDayText: "هەموو ڕۆژەکە", + moreLinkText: "زیاتر", + noEventsText: "هیچ ڕووداوێك نیە" + }; + + var l47 = { + code: "lb", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Zréck", + next: "Weider", + today: "Haut", + month: "Mount", + week: "Woch", + day: "Dag", + list: "Terminiwwersiicht" + }, + weekText: "W", + allDayText: "Ganzen Dag", + moreLinkText: "méi", + noEventsText: "Nee Evenementer ze affichéieren" + }; + + var l48 = { + code: "lt", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Atgal", + next: "Pirmyn", + today: "Šiandien", + month: "Mėnuo", + week: "Savaitė", + day: "Diena", + list: "Darbotvarkė" + }, + weekText: "SAV", + allDayText: "Visą dieną", + moreLinkText: "daugiau", + noEventsText: "Nėra įvykių rodyti" + }; + + var l49 = { + code: "lv", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Iepr.", + next: "Nāk.", + today: "Šodien", + month: "Mēnesis", + week: "Nedēļa", + day: "Diena", + list: "Dienas kārtība" + }, + weekText: "Ned.", + allDayText: "Visu dienu", + moreLinkText: function(n) { + return "+vēl " + n; + }, + noEventsText: "Nav notikumu" + }; + + var l50 = { + code: "mk", + buttonText: { + prev: "претходно", + next: "следно", + today: "Денес", + month: "Месец", + week: "Недела", + day: "Ден", + list: "График" + }, + weekText: "Сед", + allDayText: "Цел ден", + moreLinkText: function(n) { + return "+повеќе " + n; + }, + noEventsText: "Нема настани за прикажување" + }; + + var l51 = { + code: "ms", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Sebelum", + next: "Selepas", + today: "hari ini", + month: "Bulan", + week: "Minggu", + day: "Hari", + list: "Agenda" + }, + weekText: "Mg", + allDayText: "Sepanjang hari", + moreLinkText: function(n) { + return "masih ada " + n + " acara"; + }, + noEventsText: "Tiada peristiwa untuk dipaparkan" + }; + + var l52 = { + code: "nb", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Forrige", + next: "Neste", + today: "I dag", + month: "Måned", + week: "Uke", + day: "Dag", + list: "Agenda" + }, + weekText: "Uke", + weekTextLong: "Uke", + allDayText: "Hele dagen", + moreLinkText: "til", + noEventsText: "Ingen hendelser å vise", + buttonHints: { + prev: "Forrige $0", + next: "Neste $0", + today: "Nåværende $0" + }, + viewHint: "$0 visning", + navLinkHint: "Gå til $0", + moreLinkHint(eventCnt) { + return `Vis ${eventCnt} flere hendelse${eventCnt === 1 ? "" : "r"}`; + } + }; + + var l53 = { + code: "ne", // code for nepal + week: { + dow: 7, // Sunday is the first day of the week. + doy: 1 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "अघिल्लो", + next: "अर्को", + today: "आज", + month: "महिना", + week: "हप्ता", + day: "दिन", + list: "सूची" + }, + weekText: "हप्ता", + allDayText: "दिनभरि", + moreLinkText: "थप लिंक", + noEventsText: "देखाउनको लागि कुनै घटनाहरू छैनन्" + }; + + var l54 = { + code: "nl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Vorige", + next: "Volgende", + today: "Vandaag", + year: "Jaar", + month: "Maand", + week: "Week", + day: "Dag", + list: "Agenda" + }, + allDayText: "Hele dag", + moreLinkText: "extra", + noEventsText: "Geen evenementen om te laten zien" + }; + + var l55 = { + code: "nn", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Førre", + next: "Neste", + today: "I dag", + month: "Månad", + week: "Veke", + day: "Dag", + list: "Agenda" + }, + weekText: "Veke", + allDayText: "Heile dagen", + moreLinkText: "til", + noEventsText: "Ingen hendelser å vise" + }; + + var l56 = { + code: "pl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Poprzedni", + next: "Następny", + today: "Dziś", + month: "Miesiąc", + week: "Tydzień", + day: "Dzień", + list: "Plan dnia" + }, + weekText: "Tydz", + allDayText: "Cały dzień", + moreLinkText: "więcej", + noEventsText: "Brak wydarzeń do wyświetlenia" + }; + + var l57 = { + code: "pt-br", + buttonText: { + prev: "Anterior", + next: "Próximo", + today: "Hoje", + month: "Mês", + week: "Semana", + day: "Dia", + list: "Lista" + }, + weekText: "Sm", + allDayText: "dia inteiro", + moreLinkText: function(n) { + return "mais +" + n; + }, + noEventsText: "Não há eventos para mostrar" + }; + + var l58 = { + code: "pt", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Anterior", + next: "Seguinte", + today: "Hoje", + month: "Mês", + week: "Semana", + day: "Dia", + list: "Agenda" + }, + weekText: "Sem", + allDayText: "Todo o dia", + moreLinkText: "mais", + noEventsText: "Não há eventos para mostrar" + }; + + var l59 = { + code: "ro", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "precedentă", + next: "următoare", + today: "Azi", + month: "Lună", + week: "Săptămână", + day: "Zi", + list: "Agendă" + }, + weekText: "Săpt", + allDayText: "Toată ziua", + moreLinkText: function(n) { + return "+alte " + n; + }, + noEventsText: "Nu există evenimente de afișat" + }; + + var l60 = { + code: "ru", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Пред", + next: "След", + today: "Сегодня", + month: "Месяц", + week: "Неделя", + day: "День", + list: "Повестка дня" + }, + weekText: "Нед", + allDayText: "Весь день", + moreLinkText: function(n) { + return "+ ещё " + n; + }, + noEventsText: "Нет событий для отображения" + }; + + var l61 = { + code: "si-lk", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "පෙර", + next: "පසු", + today: "අද", + month: "මාසය", + week: "සතිය", + day: "දවස", + list: "ලැයිස්තුව" + }, + weekText: "සති", + allDayText: "සියලු", + moreLinkText: "තවත්", + noEventsText: "මුකුත් නැත" + }; + + var l62 = { + code: "sk", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Predchádzajúci", + next: "Nasledujúci", + today: "Dnes", + month: "Mesiac", + week: "Týždeň", + day: "Deň", + list: "Rozvrh" + }, + weekText: "Ty", + allDayText: "Celý deň", + moreLinkText: function(n) { + return "+ďalšie: " + n; + }, + noEventsText: "Žiadne akcie na zobrazenie" + }; + + var l63 = { + code: "sl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Prejšnji", + next: "Naslednji", + today: "Trenutni", + month: "Mesec", + week: "Teden", + day: "Dan", + list: "Dnevni red" + }, + weekText: "Teden", + allDayText: "Ves dan", + moreLinkText: "več", + noEventsText: "Ni dogodkov za prikaz" + }; + + var l64 = { + code: "sm", + buttonText: { + prev: "Talu ai", + next: "Mulimuli atu", + today: "Aso nei", + month: "Masina", + week: "Vaiaso", + day: "Aso", + list: "Faasologa" + }, + weekText: "Vaiaso", + allDayText: "Aso atoa", + moreLinkText: "sili atu", + noEventsText: "Leai ni mea na tutupu" + }; + + var l65 = { + code: "sq", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "mbrapa", + next: "Përpara", + today: "sot", + month: "Muaj", + week: "Javë", + day: "Ditë", + list: "Listë" + }, + weekText: "Ja", + allDayText: "Gjithë ditën", + moreLinkText: function(n) { + return "+më tepër " + n; + }, + noEventsText: "Nuk ka evente për të shfaqur" + }; + + var l66 = { + code: "sr-cyrl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Претходна", + next: "следећи", + today: "Данас", + month: "Месец", + week: "Недеља", + day: "Дан", + list: "Планер" + }, + weekText: "Сед", + allDayText: "Цео дан", + moreLinkText: function(n) { + return "+ још " + n; + }, + noEventsText: "Нема догађаја за приказ" + }; + + var l67 = { + code: "sr", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Prethodna", + next: "Sledeći", + today: "Danas", + month: "Mеsеc", + week: "Nеdеlja", + day: "Dan", + list: "Planеr" + }, + weekText: "Sed", + allDayText: "Cеo dan", + moreLinkText: function(n) { + return "+ još " + n; + }, + noEventsText: "Nеma događaja za prikaz" + }; + + var l68 = { + code: "sv", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Förra", + next: "Nästa", + today: "Idag", + month: "Månad", + week: "Vecka", + day: "Dag", + list: "Program" + }, + buttonHints: { + prev(buttonText) { + return `Föregående ${buttonText.toLocaleLowerCase()}`; + }, + next(buttonText) { + return `Nästa ${buttonText.toLocaleLowerCase()}`; + }, + today(buttonText) { + return ( + (buttonText === "Program" ? "Detta" : "Denna") + + " " + + buttonText.toLocaleLowerCase() + ); + } + }, + viewHint: "$0 vy", + navLinkHint: "Gå till $0", + moreLinkHint(eventCnt) { + return `Visa ytterligare ${eventCnt} händelse${ + eventCnt === 1 ? "" : "r" + }`; + }, + weekText: "v.", + weekTextLong: "Vecka", + allDayText: "Heldag", + moreLinkText: "till", + noEventsText: "Inga händelser att visa", + closeHint: "Stäng", + timeHint: "Klockan", + eventHint: "Händelse" + }; + + var l69 = { + code: "ta-in", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "முந்தைய", + next: "அடுத்தது", + today: "இன்று", + month: "மாதம்", + week: "வாரம்", + day: "நாள்", + list: "தினசரி அட்டவணை" + }, + weekText: "வாரம்", + allDayText: "நாள் முழுவதும்", + moreLinkText: function(n) { + return "+ மேலும் " + n; + }, + noEventsText: "காண்பிக்க நிகழ்வுகள் இல்லை" + }; + + var l70 = { + code: "th", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "ก่อนหน้า", + next: "ถัดไป", + prevYear: "ปีก่อนหน้า", + nextYear: "ปีถัดไป", + year: "ปี", + today: "วันนี้", + month: "เดือน", + week: "สัปดาห์", + day: "วัน", + list: "กำหนดการ" + }, + weekText: "สัปดาห์", + allDayText: "ตลอดวัน", + moreLinkText: "เพิ่มเติม", + noEventsText: "ไม่มีกิจกรรมที่จะแสดง" + }; + + var l71 = { + code: "tr", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "geri", + next: "ileri", + today: "bugün", + month: "Ay", + week: "Hafta", + day: "Gün", + list: "Ajanda" + }, + weekText: "Hf", + allDayText: "Tüm gün", + moreLinkText: "daha fazla", + noEventsText: "Gösterilecek etkinlik yok" + }; + + var l72 = { + code: "ug", + buttonText: { + month: "ئاي", + week: "ھەپتە", + day: "كۈن", + list: "كۈنتەرتىپ" + }, + allDayText: "پۈتۈن كۈن" + }; + + var l73 = { + code: "uk", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Попередній", + next: "далі", + today: "Сьогодні", + month: "Місяць", + week: "Тиждень", + day: "День", + list: "Порядок денний" + }, + weekText: "Тиж", + allDayText: "Увесь день", + moreLinkText: function(n) { + return "+ще " + n + "..."; + }, + noEventsText: "Немає подій для відображення" + }; + + var l74 = { + code: "uz", + buttonText: { + month: "Oy", + week: "Xafta", + day: "Kun", + list: "Kun tartibi" + }, + allDayText: "Kun bo'yi", + moreLinkText: function(n) { + return "+ yana " + n; + }, + noEventsText: "Ko'rsatish uchun voqealar yo'q" + }; + + var l75 = { + code: "vi", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Trước", + next: "Tiếp", + today: "Hôm nay", + month: "Tháng", + week: "Tuần", + day: "Ngày", + list: "Lịch biểu" + }, + weekText: "Tu", + allDayText: "Cả ngày", + moreLinkText: function(n) { + return "+ thêm " + n; + }, + noEventsText: "Không có sự kiện để hiển thị" + }; + + var l76 = { + code: "zh-cn", + week: { + // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "上月", + next: "下月", + today: "今天", + month: "月", + week: "周", + day: "日", + list: "日程" + }, + weekText: "周", + allDayText: "全天", + moreLinkText: function(n) { + return "另外 " + n + " 个"; + }, + noEventsText: "没有事件显示" + }; + + var l77 = { + code: "zh-tw", + buttonText: { + prev: "上月", + next: "下月", + today: "今天", + month: "月", + week: "週", + day: "天", + list: "活動列表" + }, + weekText: "周", + allDayText: "整天", + moreLinkText: "顯示更多", + noEventsText: "没有任何活動" + }; + + /* eslint max-len: off */ + + var localesAll = [ + l0, + l1, + l2, + l3, + l4, + l5, + l6, + l7, + l8, + l9, + l10, + l11, + l12, + l13, + l14, + l15, + l16, + l17, + l18, + l19, + l20, + l21, + l22, + l23, + l24, + l25, + l26, + l27, + l28, + l29, + l30, + l31, + l32, + l33, + l34, + l35, + l36, + l37, + l38, + l39, + l40, + l41, + l42, + l43, + l44, + l45, + l46, + l47, + l48, + l49, + l50, + l51, + l52, + l53, + l54, + l55, + l56, + l57, + l58, + l59, + l60, + l61, + l62, + l63, + l64, + l65, + l66, + l67, + l68, + l69, + l70, + l71, + l72, + l73, + l74, + l75, + l76, + l77 + ]; + + return localesAll; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales-all.min.js b/pandora_console/include/javascript/fullcalendar/locales-all.min.js new file mode 100644 index 0000000000..0008512248 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales-all.min.js @@ -0,0 +1 @@ +[].push.apply(FullCalendar.globalLocales,function(){"use strict";function e(e){return"Tag"===e||"Monat"===e?"r":"Jahr"===e?"s":""}function t(e){return"Tag"===e||"Monat"===e?"r":"Jahr"===e?"s":""}return[{code:"af",week:{dow:1,doy:4},buttonText:{prev:"Vorige",next:"Volgende",today:"Vandag",year:"Jaar",month:"Maand",week:"Week",day:"Dag",list:"Agenda"},allDayText:"Heeldag",moreLinkText:"Addisionele",noEventsText:"Daar is geen gebeurtenisse nie"},{code:"ar-dz",week:{dow:0,doy:4},direction:"rtl",buttonText:{prev:"السابق",next:"التالي",today:"اليوم",month:"شهر",week:"أسبوع",day:"يوم",list:"أجندة"},weekText:"أسبوع",allDayText:"اليوم كله",moreLinkText:"أخرى",noEventsText:"أي أحداث لعرض"},{code:"ar-kw",week:{dow:0,doy:12},direction:"rtl",buttonText:{prev:"السابق",next:"التالي",today:"اليوم",month:"شهر",week:"أسبوع",day:"يوم",list:"أجندة"},weekText:"أسبوع",allDayText:"اليوم كله",moreLinkText:"أخرى",noEventsText:"أي أحداث لعرض"},{code:"ar-ly",week:{dow:6,doy:12},direction:"rtl",buttonText:{prev:"السابق",next:"التالي",today:"اليوم",month:"شهر",week:"أسبوع",day:"يوم",list:"أجندة"},weekText:"أسبوع",allDayText:"اليوم كله",moreLinkText:"أخرى",noEventsText:"أي أحداث لعرض"},{code:"ar-ma",week:{dow:6,doy:12},direction:"rtl",buttonText:{prev:"السابق",next:"التالي",today:"اليوم",month:"شهر",week:"أسبوع",day:"يوم",list:"أجندة"},weekText:"أسبوع",allDayText:"اليوم كله",moreLinkText:"أخرى",noEventsText:"أي أحداث لعرض"},{code:"ar-sa",week:{dow:0,doy:6},direction:"rtl",buttonText:{prev:"السابق",next:"التالي",today:"اليوم",month:"شهر",week:"أسبوع",day:"يوم",list:"أجندة"},weekText:"أسبوع",allDayText:"اليوم كله",moreLinkText:"أخرى",noEventsText:"أي أحداث لعرض"},{code:"ar-tn",week:{dow:1,doy:4},direction:"rtl",buttonText:{prev:"السابق",next:"التالي",today:"اليوم",month:"شهر",week:"أسبوع",day:"يوم",list:"أجندة"},weekText:"أسبوع",allDayText:"اليوم كله",moreLinkText:"أخرى",noEventsText:"أي أحداث لعرض"},{code:"ar",week:{dow:6,doy:12},direction:"rtl",buttonText:{prev:"السابق",next:"التالي",today:"اليوم",month:"شهر",week:"أسبوع",day:"يوم",list:"أجندة"},weekText:"أسبوع",allDayText:"اليوم كله",moreLinkText:"أخرى",noEventsText:"أي أحداث لعرض"},{code:"az",week:{dow:1,doy:4},buttonText:{prev:"Əvvəl",next:"Sonra",today:"Bu Gün",month:"Ay",week:"Həftə",day:"Gün",list:"Gündəm"},weekText:"Həftə",allDayText:"Bütün Gün",moreLinkText:function(e){return"+ daha çox "+e},noEventsText:"Göstərmək üçün hadisə yoxdur"},{code:"bg",week:{dow:1,doy:7},buttonText:{prev:"назад",next:"напред",today:"днес",month:"Месец",week:"Седмица",day:"Ден",list:"График"},allDayText:"Цял ден",moreLinkText:function(e){return"+още "+e},noEventsText:"Няма събития за показване"},{code:"bn",week:{dow:0,doy:6},buttonText:{prev:"পেছনে",next:"সামনে",today:"আজ",month:"মাস",week:"সপ্তাহ",day:"দিন",list:"তালিকা"},weekText:"সপ্তাহ",allDayText:"সারাদিন",moreLinkText:function(e){return"+অন্যান্য "+e},noEventsText:"কোনো ইভেন্ট নেই"},{code:"bs",week:{dow:1,doy:7},buttonText:{prev:"Prošli",next:"Sljedeći",today:"Danas",month:"Mjesec",week:"Sedmica",day:"Dan",list:"Raspored"},weekText:"Sed",allDayText:"Cijeli dan",moreLinkText:function(e){return"+ još "+e},noEventsText:"Nema događaja za prikazivanje"},{code:"ca",week:{dow:1,doy:4},buttonText:{prev:"Anterior",next:"Següent",today:"Avui",month:"Mes",week:"Setmana",day:"Dia",list:"Agenda"},weekText:"Set",allDayText:"Tot el dia",moreLinkText:"més",noEventsText:"No hi ha esdeveniments per mostrar"},{code:"cs",week:{dow:1,doy:4},buttonText:{prev:"Dříve",next:"Později",today:"Nyní",month:"Měsíc",week:"Týden",day:"Den",list:"Agenda"},weekText:"Týd",allDayText:"Celý den",moreLinkText:function(e){return"+další: "+e},noEventsText:"Žádné akce k zobrazení"},{code:"cy",week:{dow:1,doy:4},buttonText:{prev:"Blaenorol",next:"Nesaf",today:"Heddiw",year:"Blwyddyn",month:"Mis",week:"Wythnos",day:"Dydd",list:"Rhestr"},weekText:"Wythnos",allDayText:"Trwy'r dydd",moreLinkText:"Mwy",noEventsText:"Dim digwyddiadau"},{code:"da",week:{dow:1,doy:4},buttonText:{prev:"Forrige",next:"Næste",today:"I dag",month:"Måned",week:"Uge",day:"Dag",list:"Agenda"},weekText:"Uge",allDayText:"Hele dagen",moreLinkText:"flere",noEventsText:"Ingen arrangementer at vise"},{code:"de-at",week:{dow:1,doy:4},buttonText:{prev:"Zurück",next:"Vor",today:"Heute",year:"Jahr",month:"Monat",week:"Woche",day:"Tag",list:"Terminübersicht"},weekText:"KW",weekTextLong:"Woche",allDayText:"Ganztägig",moreLinkText:function(e){return"+ weitere "+e},noEventsText:"Keine Ereignisse anzuzeigen",buttonHints:{prev:t=>`Vorherige${e(t)} ${t}`,next:t=>`Nächste${e(t)} ${t}`,today:t=>"Tag"===t?"Heute":`Diese${e(t)} ${t}`},viewHint:e=>e+("Woche"===e?"n":"Monat"===e?"s":"es")+"ansicht",navLinkHint:"Gehe zu $0",moreLinkHint:e=>"Zeige "+(1===e?"ein weiteres Ereignis":e+" weitere Ereignisse"),closeHint:"Schließen",timeHint:"Uhrzeit",eventHint:"Ereignis"},{code:"de",week:{dow:1,doy:4},buttonText:{prev:"Zurück",next:"Vor",today:"Heute",year:"Jahr",month:"Monat",week:"Woche",day:"Tag",list:"Terminübersicht"},weekText:"KW",weekTextLong:"Woche",allDayText:"Ganztägig",moreLinkText:function(e){return"+ weitere "+e},noEventsText:"Keine Ereignisse anzuzeigen",buttonHints:{prev:e=>`Vorherige${t(e)} ${e}`,next:e=>`Nächste${t(e)} ${e}`,today:e=>"Tag"===e?"Heute":`Diese${t(e)} ${e}`},viewHint:e=>e+("Woche"===e?"n":"Monat"===e?"s":"es")+"ansicht",navLinkHint:"Gehe zu $0",moreLinkHint:e=>"Zeige "+(1===e?"ein weiteres Ereignis":e+" weitere Ereignisse"),closeHint:"Schließen",timeHint:"Uhrzeit",eventHint:"Ereignis"},{code:"el",week:{dow:1,doy:4},buttonText:{prev:"Προηγούμενος",next:"Επόμενος",today:"Σήμερα",month:"Μήνας",week:"Εβδομάδα",day:"Ημέρα",list:"Ατζέντα"},weekText:"Εβδ",allDayText:"Ολοήμερο",moreLinkText:"περισσότερα",noEventsText:"Δεν υπάρχουν γεγονότα προς εμφάνιση"},{code:"en-au",week:{dow:1,doy:4},buttonHints:{prev:"Previous $0",next:"Next $0",today:"This $0"},viewHint:"$0 view",navLinkHint:"Go to $0",moreLinkHint:e=>`Show ${e} more event${1===e?"":"s"}`},{code:"en-gb",week:{dow:1,doy:4},buttonHints:{prev:"Previous $0",next:"Next $0",today:"This $0"},viewHint:"$0 view",navLinkHint:"Go to $0",moreLinkHint:e=>`Show ${e} more event${1===e?"":"s"}`},{code:"en-nz",week:{dow:1,doy:4},buttonHints:{prev:"Previous $0",next:"Next $0",today:"This $0"},viewHint:"$0 view",navLinkHint:"Go to $0",moreLinkHint:e=>`Show ${e} more event${1===e?"":"s"}`},{code:"eo",week:{dow:1,doy:4},buttonText:{prev:"Antaŭa",next:"Sekva",today:"Hodiaŭ",month:"Monato",week:"Semajno",day:"Tago",list:"Tagordo"},weekText:"Sm",allDayText:"Tuta tago",moreLinkText:"pli",noEventsText:"Neniuj eventoj por montri"},{code:"es",week:{dow:0,doy:6},buttonText:{prev:"Ant",next:"Sig",today:"Hoy",month:"Mes",week:"Semana",day:"Día",list:"Agenda"},weekText:"Sm",allDayText:"Todo el día",moreLinkText:"más",noEventsText:"No hay eventos para mostrar"},{code:"es",week:{dow:1,doy:4},buttonText:{prev:"Ant",next:"Sig",today:"Hoy",month:"Mes",week:"Semana",day:"Día",list:"Agenda"},buttonHints:{prev:"$0 antes",next:"$0 siguiente",today:e=>"Día"===e?"Hoy":("Semana"===e?"Esta":"Este")+" "+e.toLocaleLowerCase()},viewHint:e=>"Vista "+("Semana"===e?"de la":"del")+" "+e.toLocaleLowerCase(),weekText:"Sm",weekTextLong:"Semana",allDayText:"Todo el día",moreLinkText:"más",moreLinkHint:e=>`Mostrar ${e} eventos más`,noEventsText:"No hay eventos para mostrar",navLinkHint:"Ir al $0",closeHint:"Cerrar",timeHint:"La hora",eventHint:"Evento"},{code:"et",week:{dow:1,doy:4},buttonText:{prev:"Eelnev",next:"Järgnev",today:"Täna",month:"Kuu",week:"Nädal",day:"Päev",list:"Päevakord"},weekText:"näd",allDayText:"Kogu päev",moreLinkText:function(e){return"+ veel "+e},noEventsText:"Kuvamiseks puuduvad sündmused"},{code:"eu",week:{dow:1,doy:7},buttonText:{prev:"Aur",next:"Hur",today:"Gaur",month:"Hilabetea",week:"Astea",day:"Eguna",list:"Agenda"},weekText:"As",allDayText:"Egun osoa",moreLinkText:"gehiago",noEventsText:"Ez dago ekitaldirik erakusteko"},{code:"fa",week:{dow:6,doy:12},direction:"rtl",buttonText:{prev:"قبلی",next:"بعدی",today:"امروز",month:"ماه",week:"هفته",day:"روز",list:"برنامه"},weekText:"هف",allDayText:"تمام روز",moreLinkText:function(e){return"بیش از "+e},noEventsText:"هیچ رویدادی به نمایش"},{code:"fi",week:{dow:1,doy:4},buttonText:{prev:"Edellinen",next:"Seuraava",today:"Tänään",month:"Kuukausi",week:"Viikko",day:"Päivä",list:"Tapahtumat"},weekText:"Vk",allDayText:"Koko päivä",moreLinkText:"lisää",noEventsText:"Ei näytettäviä tapahtumia"},{code:"fr",buttonText:{prev:"Précédent",next:"Suivant",today:"Aujourd'hui",year:"Année",month:"Mois",week:"Semaine",day:"Jour",list:"Mon planning"},weekText:"Sem.",allDayText:"Toute la journée",moreLinkText:"en plus",noEventsText:"Aucun événement à afficher"},{code:"fr-ch",week:{dow:1,doy:4},buttonText:{prev:"Précédent",next:"Suivant",today:"Courant",year:"Année",month:"Mois",week:"Semaine",day:"Jour",list:"Mon planning"},weekText:"Sm",allDayText:"Toute la journée",moreLinkText:"en plus",noEventsText:"Aucun événement à afficher"},{code:"fr",week:{dow:1,doy:4},buttonText:{prev:"Précédent",next:"Suivant",today:"Aujourd'hui",year:"Année",month:"Mois",week:"Semaine",day:"Jour",list:"Planning"},weekText:"Sem.",allDayText:"Toute la journée",moreLinkText:"en plus",noEventsText:"Aucun événement à afficher"},{code:"gl",week:{dow:1,doy:4},buttonText:{prev:"Ant",next:"Seg",today:"Hoxe",month:"Mes",week:"Semana",day:"Día",list:"Axenda"},weekText:"Sm",allDayText:"Todo o día",moreLinkText:"máis",noEventsText:"Non hai eventos para amosar"},{code:"he",direction:"rtl",buttonText:{prev:"הקודם",next:"הבא",today:"היום",month:"חודש",week:"שבוע",day:"יום",list:"סדר יום"},allDayText:"כל היום",moreLinkText:"אחר",noEventsText:"אין אירועים להצגה",weekText:"שבוע"},{code:"hi",week:{dow:0,doy:6},buttonText:{prev:"पिछला",next:"अगला",today:"आज",month:"महीना",week:"सप्ताह",day:"दिन",list:"कार्यसूची"},weekText:"हफ्ता",allDayText:"सभी दिन",moreLinkText:function(e){return"+अधिक "+e},noEventsText:"कोई घटनाओं को प्रदर्शित करने के लिए"},{code:"hr",week:{dow:1,doy:7},buttonText:{prev:"Prijašnji",next:"Sljedeći",today:"Danas",month:"Mjesec",week:"Tjedan",day:"Dan",list:"Raspored"},weekText:"Tje",allDayText:"Cijeli dan",moreLinkText:function(e){return"+ još "+e},noEventsText:"Nema događaja za prikaz"},{code:"hu",week:{dow:1,doy:4},buttonText:{prev:"vissza",next:"előre",today:"ma",month:"Hónap",week:"Hét",day:"Nap",list:"Lista"},weekText:"Hét",allDayText:"Egész nap",moreLinkText:"további",noEventsText:"Nincs megjeleníthető esemény"},{code:"hy-am",week:{dow:1,doy:4},buttonText:{prev:"Նախորդ",next:"Հաջորդ",today:"Այսօր",month:"Ամիս",week:"Շաբաթ",day:"Օր",list:"Օրվա ցուցակ"},weekText:"Շաբ",allDayText:"Ամբողջ օր",moreLinkText:function(e){return"+ ևս "+e},noEventsText:"Բացակայում է իրադարձությունը ցուցադրելու"},{code:"id",week:{dow:1,doy:7},buttonText:{prev:"mundur",next:"maju",today:"hari ini",month:"Bulan",week:"Minggu",day:"Hari",list:"Agenda"},weekText:"Mg",allDayText:"Sehari penuh",moreLinkText:"lebih",noEventsText:"Tidak ada acara untuk ditampilkan"},{code:"is",week:{dow:1,doy:4},buttonText:{prev:"Fyrri",next:"Næsti",today:"Í dag",month:"Mánuður",week:"Vika",day:"Dagur",list:"Dagskrá"},weekText:"Vika",allDayText:"Allan daginn",moreLinkText:"meira",noEventsText:"Engir viðburðir til að sýna"},{code:"it",week:{dow:1,doy:4},buttonText:{prev:"Prec",next:"Succ",today:"Oggi",month:"Mese",week:"Settimana",day:"Giorno",list:"Agenda"},weekText:"Sm",allDayText:"Tutto il giorno",moreLinkText:function(e){return"+altri "+e},noEventsText:"Non ci sono eventi da visualizzare"},{code:"ja",buttonText:{prev:"前",next:"次",today:"今日",month:"月",week:"週",day:"日",list:"予定リスト"},weekText:"週",allDayText:"終日",moreLinkText:function(e){return"他 "+e+" 件"},noEventsText:"表示する予定はありません"},{code:"ka",week:{dow:1,doy:7},buttonText:{prev:"წინა",next:"შემდეგი",today:"დღეს",month:"თვე",week:"კვირა",day:"დღე",list:"დღის წესრიგი"},weekText:"კვ",allDayText:"მთელი დღე",moreLinkText:function(e){return"+ კიდევ "+e},noEventsText:"ღონისძიებები არ არის"},{code:"kk",week:{dow:1,doy:7},buttonText:{prev:"Алдыңғы",next:"Келесі",today:"Бүгін",month:"Ай",week:"Апта",day:"Күн",list:"Күн тәртібі"},weekText:"Не",allDayText:"Күні бойы",moreLinkText:function(e){return"+ тағы "+e},noEventsText:"Көрсету үшін оқиғалар жоқ"},{code:"km",week:{dow:1,doy:4},buttonText:{prev:"មុន",next:"បន្ទាប់",today:"ថ្ងៃនេះ",year:"ឆ្នាំ",month:"ខែ",week:"សប្តាហ៍",day:"ថ្ងៃ",list:"បញ្ជី"},weekText:"សប្តាហ៍",allDayText:"ពេញមួយថ្ងៃ",moreLinkText:"ច្រើនទៀត",noEventsText:"គ្មានព្រឹត្តិការណ៍ត្រូវបង្ហាញ"},{code:"ko",buttonText:{prev:"이전달",next:"다음달",today:"오늘",month:"월",week:"주",day:"일",list:"일정목록"},weekText:"주",allDayText:"종일",moreLinkText:"개",noEventsText:"일정이 없습니다"},{code:"ku",week:{dow:6,doy:12},direction:"rtl",buttonText:{prev:"پێشتر",next:"دواتر",today:"ئەمڕو",month:"مانگ",week:"هەفتە",day:"ڕۆژ",list:"بەرنامە"},weekText:"هەفتە",allDayText:"هەموو ڕۆژەکە",moreLinkText:"زیاتر",noEventsText:"هیچ ڕووداوێك نیە"},{code:"lb",week:{dow:1,doy:4},buttonText:{prev:"Zréck",next:"Weider",today:"Haut",month:"Mount",week:"Woch",day:"Dag",list:"Terminiwwersiicht"},weekText:"W",allDayText:"Ganzen Dag",moreLinkText:"méi",noEventsText:"Nee Evenementer ze affichéieren"},{code:"lt",week:{dow:1,doy:4},buttonText:{prev:"Atgal",next:"Pirmyn",today:"Šiandien",month:"Mėnuo",week:"Savaitė",day:"Diena",list:"Darbotvarkė"},weekText:"SAV",allDayText:"Visą dieną",moreLinkText:"daugiau",noEventsText:"Nėra įvykių rodyti"},{code:"lv",week:{dow:1,doy:4},buttonText:{prev:"Iepr.",next:"Nāk.",today:"Šodien",month:"Mēnesis",week:"Nedēļa",day:"Diena",list:"Dienas kārtība"},weekText:"Ned.",allDayText:"Visu dienu",moreLinkText:function(e){return"+vēl "+e},noEventsText:"Nav notikumu"},{code:"mk",buttonText:{prev:"претходно",next:"следно",today:"Денес",month:"Месец",week:"Недела",day:"Ден",list:"График"},weekText:"Сед",allDayText:"Цел ден",moreLinkText:function(e){return"+повеќе "+e},noEventsText:"Нема настани за прикажување"},{code:"ms",week:{dow:1,doy:7},buttonText:{prev:"Sebelum",next:"Selepas",today:"hari ini",month:"Bulan",week:"Minggu",day:"Hari",list:"Agenda"},weekText:"Mg",allDayText:"Sepanjang hari",moreLinkText:function(e){return"masih ada "+e+" acara"},noEventsText:"Tiada peristiwa untuk dipaparkan"},{code:"nb",week:{dow:1,doy:4},buttonText:{prev:"Forrige",next:"Neste",today:"I dag",month:"Måned",week:"Uke",day:"Dag",list:"Agenda"},weekText:"Uke",weekTextLong:"Uke",allDayText:"Hele dagen",moreLinkText:"til",noEventsText:"Ingen hendelser å vise",buttonHints:{prev:"Forrige $0",next:"Neste $0",today:"Nåværende $0"},viewHint:"$0 visning",navLinkHint:"Gå til $0",moreLinkHint:e=>`Vis ${e} flere hendelse${1===e?"":"r"}`},{code:"ne",week:{dow:7,doy:1},buttonText:{prev:"अघिल्लो",next:"अर्को",today:"आज",month:"महिना",week:"हप्ता",day:"दिन",list:"सूची"},weekText:"हप्ता",allDayText:"दिनभरि",moreLinkText:"थप लिंक",noEventsText:"देखाउनको लागि कुनै घटनाहरू छैनन्"},{code:"nl",week:{dow:1,doy:4},buttonText:{prev:"Vorige",next:"Volgende",today:"Vandaag",year:"Jaar",month:"Maand",week:"Week",day:"Dag",list:"Agenda"},allDayText:"Hele dag",moreLinkText:"extra",noEventsText:"Geen evenementen om te laten zien"},{code:"nn",week:{dow:1,doy:4},buttonText:{prev:"Førre",next:"Neste",today:"I dag",month:"Månad",week:"Veke",day:"Dag",list:"Agenda"},weekText:"Veke",allDayText:"Heile dagen",moreLinkText:"til",noEventsText:"Ingen hendelser å vise"},{code:"pl",week:{dow:1,doy:4},buttonText:{prev:"Poprzedni",next:"Następny",today:"Dziś",month:"Miesiąc",week:"Tydzień",day:"Dzień",list:"Plan dnia"},weekText:"Tydz",allDayText:"Cały dzień",moreLinkText:"więcej",noEventsText:"Brak wydarzeń do wyświetlenia"},{code:"pt-br",buttonText:{prev:"Anterior",next:"Próximo",today:"Hoje",month:"Mês",week:"Semana",day:"Dia",list:"Lista"},weekText:"Sm",allDayText:"dia inteiro",moreLinkText:function(e){return"mais +"+e},noEventsText:"Não há eventos para mostrar"},{code:"pt",week:{dow:1,doy:4},buttonText:{prev:"Anterior",next:"Seguinte",today:"Hoje",month:"Mês",week:"Semana",day:"Dia",list:"Agenda"},weekText:"Sem",allDayText:"Todo o dia",moreLinkText:"mais",noEventsText:"Não há eventos para mostrar"},{code:"ro",week:{dow:1,doy:7},buttonText:{prev:"precedentă",next:"următoare",today:"Azi",month:"Lună",week:"Săptămână",day:"Zi",list:"Agendă"},weekText:"Săpt",allDayText:"Toată ziua",moreLinkText:function(e){return"+alte "+e},noEventsText:"Nu există evenimente de afișat"},{code:"ru",week:{dow:1,doy:4},buttonText:{prev:"Пред",next:"След",today:"Сегодня",month:"Месяц",week:"Неделя",day:"День",list:"Повестка дня"},weekText:"Нед",allDayText:"Весь день",moreLinkText:function(e){return"+ ещё "+e},noEventsText:"Нет событий для отображения"},{code:"si-lk",week:{dow:1,doy:4},buttonText:{prev:"පෙර",next:"පසු",today:"අද",month:"මාසය",week:"සතිය",day:"දවස",list:"ලැයිස්තුව"},weekText:"සති",allDayText:"සියලු",moreLinkText:"තවත්",noEventsText:"මුකුත් නැත"},{code:"sk",week:{dow:1,doy:4},buttonText:{prev:"Predchádzajúci",next:"Nasledujúci",today:"Dnes",month:"Mesiac",week:"Týždeň",day:"Deň",list:"Rozvrh"},weekText:"Ty",allDayText:"Celý deň",moreLinkText:function(e){return"+ďalšie: "+e},noEventsText:"Žiadne akcie na zobrazenie"},{code:"sl",week:{dow:1,doy:7},buttonText:{prev:"Prejšnji",next:"Naslednji",today:"Trenutni",month:"Mesec",week:"Teden",day:"Dan",list:"Dnevni red"},weekText:"Teden",allDayText:"Ves dan",moreLinkText:"več",noEventsText:"Ni dogodkov za prikaz"},{code:"sm",buttonText:{prev:"Talu ai",next:"Mulimuli atu",today:"Aso nei",month:"Masina",week:"Vaiaso",day:"Aso",list:"Faasologa"},weekText:"Vaiaso",allDayText:"Aso atoa",moreLinkText:"sili atu",noEventsText:"Leai ni mea na tutupu"},{code:"sq",week:{dow:1,doy:4},buttonText:{prev:"mbrapa",next:"Përpara",today:"sot",month:"Muaj",week:"Javë",day:"Ditë",list:"Listë"},weekText:"Ja",allDayText:"Gjithë ditën",moreLinkText:function(e){return"+më tepër "+e},noEventsText:"Nuk ka evente për të shfaqur"},{code:"sr-cyrl",week:{dow:1,doy:7},buttonText:{prev:"Претходна",next:"следећи",today:"Данас",month:"Месец",week:"Недеља",day:"Дан",list:"Планер"},weekText:"Сед",allDayText:"Цео дан",moreLinkText:function(e){return"+ још "+e},noEventsText:"Нема догађаја за приказ"},{code:"sr",week:{dow:1,doy:7},buttonText:{prev:"Prethodna",next:"Sledeći",today:"Danas",month:"Mеsеc",week:"Nеdеlja",day:"Dan",list:"Planеr"},weekText:"Sed",allDayText:"Cеo dan",moreLinkText:function(e){return"+ još "+e},noEventsText:"Nеma događaja za prikaz"},{code:"sv",week:{dow:1,doy:4},buttonText:{prev:"Förra",next:"Nästa",today:"Idag",month:"Månad",week:"Vecka",day:"Dag",list:"Program"},buttonHints:{prev:e=>`Föregående ${e.toLocaleLowerCase()}`,next:e=>`Nästa ${e.toLocaleLowerCase()}`,today:e=>("Program"===e?"Detta":"Denna")+" "+e.toLocaleLowerCase()},viewHint:"$0 vy",navLinkHint:"Gå till $0",moreLinkHint:e=>`Visa ytterligare ${e} händelse${1===e?"":"r"}`,weekText:"v.",weekTextLong:"Vecka",allDayText:"Heldag",moreLinkText:"till",noEventsText:"Inga händelser att visa",closeHint:"Stäng",timeHint:"Klockan",eventHint:"Händelse"},{code:"ta-in",week:{dow:1,doy:4},buttonText:{prev:"முந்தைய",next:"அடுத்தது",today:"இன்று",month:"மாதம்",week:"வாரம்",day:"நாள்",list:"தினசரி அட்டவணை"},weekText:"வாரம்",allDayText:"நாள் முழுவதும்",moreLinkText:function(e){return"+ மேலும் "+e},noEventsText:"காண்பிக்க நிகழ்வுகள் இல்லை"},{code:"th",week:{dow:1,doy:4},buttonText:{prev:"ก่อนหน้า",next:"ถัดไป",prevYear:"ปีก่อนหน้า",nextYear:"ปีถัดไป",year:"ปี",today:"วันนี้",month:"เดือน",week:"สัปดาห์",day:"วัน",list:"กำหนดการ"},weekText:"สัปดาห์",allDayText:"ตลอดวัน",moreLinkText:"เพิ่มเติม",noEventsText:"ไม่มีกิจกรรมที่จะแสดง"},{code:"tr",week:{dow:1,doy:7},buttonText:{prev:"geri",next:"ileri",today:"bugün",month:"Ay",week:"Hafta",day:"Gün",list:"Ajanda"},weekText:"Hf",allDayText:"Tüm gün",moreLinkText:"daha fazla",noEventsText:"Gösterilecek etkinlik yok"},{code:"ug",buttonText:{month:"ئاي",week:"ھەپتە",day:"كۈن",list:"كۈنتەرتىپ"},allDayText:"پۈتۈن كۈن"},{code:"uk",week:{dow:1,doy:7},buttonText:{prev:"Попередній",next:"далі",today:"Сьогодні",month:"Місяць",week:"Тиждень",day:"День",list:"Порядок денний"},weekText:"Тиж",allDayText:"Увесь день",moreLinkText:function(e){return"+ще "+e+"..."},noEventsText:"Немає подій для відображення"},{code:"uz",buttonText:{month:"Oy",week:"Xafta",day:"Kun",list:"Kun tartibi"},allDayText:"Kun bo'yi",moreLinkText:function(e){return"+ yana "+e},noEventsText:"Ko'rsatish uchun voqealar yo'q"},{code:"vi",week:{dow:1,doy:4},buttonText:{prev:"Trước",next:"Tiếp",today:"Hôm nay",month:"Tháng",week:"Tuần",day:"Ngày",list:"Lịch biểu"},weekText:"Tu",allDayText:"Cả ngày",moreLinkText:function(e){return"+ thêm "+e},noEventsText:"Không có sự kiện để hiển thị"},{code:"zh-cn",week:{dow:1,doy:4},buttonText:{prev:"上月",next:"下月",today:"今天",month:"月",week:"周",day:"日",list:"日程"},weekText:"周",allDayText:"全天",moreLinkText:function(e){return"另外 "+e+" 个"},noEventsText:"没有事件显示"},{code:"zh-tw",buttonText:{prev:"上月",next:"下月",today:"今天",month:"月",week:"週",day:"天",list:"活動列表"},weekText:"周",allDayText:"整天",moreLinkText:"顯示更多",noEventsText:"没有任何活動"}]}()); \ No newline at end of file diff --git a/pandora_console/include/javascript/fullcalendar/locales/af.js b/pandora_console/include/javascript/fullcalendar/locales/af.js new file mode 100644 index 0000000000..e665e5a600 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/af.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var af = { + code: "af", + week: { + dow: 1, // Maandag is die eerste dag van die week. + doy: 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar. + }, + buttonText: { + prev: "Vorige", + next: "Volgende", + today: "Vandag", + year: "Jaar", + month: "Maand", + week: "Week", + day: "Dag", + list: "Agenda" + }, + allDayText: "Heeldag", + moreLinkText: "Addisionele", + noEventsText: "Daar is geen gebeurtenisse nie" + }; + + return af; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ar-dz.js b/pandora_console/include/javascript/fullcalendar/locales/ar-dz.js new file mode 100644 index 0000000000..b5178e23a8 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ar-dz.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var arDz = { + code: "ar-dz", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 4 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + return arDz; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ar-kw.js b/pandora_console/include/javascript/fullcalendar/locales/ar-kw.js new file mode 100644 index 0000000000..56ddda0e2f --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ar-kw.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var arKw = { + code: "ar-kw", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + return arKw; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ar-ly.js b/pandora_console/include/javascript/fullcalendar/locales/ar-ly.js new file mode 100644 index 0000000000..97b2be5f00 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ar-ly.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var arLy = { + code: "ar-ly", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + return arLy; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ar-ma.js b/pandora_console/include/javascript/fullcalendar/locales/ar-ma.js new file mode 100644 index 0000000000..afce128c86 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ar-ma.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var arMa = { + code: "ar-ma", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + return arMa; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ar-sa.js b/pandora_console/include/javascript/fullcalendar/locales/ar-sa.js new file mode 100644 index 0000000000..a89d7fc871 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ar-sa.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var arSa = { + code: "ar-sa", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + return arSa; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ar-tn.js b/pandora_console/include/javascript/fullcalendar/locales/ar-tn.js new file mode 100644 index 0000000000..2eeef52bf2 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ar-tn.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var arTn = { + code: "ar-tn", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + return arTn; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ar.js b/pandora_console/include/javascript/fullcalendar/locales/ar.js new file mode 100644 index 0000000000..965e354878 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ar.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ar = { + code: "ar", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "السابق", + next: "التالي", + today: "اليوم", + month: "شهر", + week: "أسبوع", + day: "يوم", + list: "أجندة" + }, + weekText: "أسبوع", + allDayText: "اليوم كله", + moreLinkText: "أخرى", + noEventsText: "أي أحداث لعرض" + }; + + return ar; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/az.js b/pandora_console/include/javascript/fullcalendar/locales/az.js new file mode 100644 index 0000000000..a7806dc41c --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/az.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var az = { + code: "az", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Əvvəl", + next: "Sonra", + today: "Bu Gün", + month: "Ay", + week: "Həftə", + day: "Gün", + list: "Gündəm" + }, + weekText: "Həftə", + allDayText: "Bütün Gün", + moreLinkText: function(n) { + return "+ daha çox " + n; + }, + noEventsText: "Göstərmək üçün hadisə yoxdur" + }; + + return az; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/bg.js b/pandora_console/include/javascript/fullcalendar/locales/bg.js new file mode 100644 index 0000000000..bd92db5dfd --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/bg.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var bg = { + code: "bg", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "назад", + next: "напред", + today: "днес", + month: "Месец", + week: "Седмица", + day: "Ден", + list: "График" + }, + allDayText: "Цял ден", + moreLinkText: function(n) { + return "+още " + n; + }, + noEventsText: "Няма събития за показване" + }; + + return bg; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/bn.js b/pandora_console/include/javascript/fullcalendar/locales/bn.js new file mode 100644 index 0000000000..3f49b4df67 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/bn.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var bn = { + code: "bn", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "পেছনে", + next: "সামনে", + today: "আজ", + month: "মাস", + week: "সপ্তাহ", + day: "দিন", + list: "তালিকা" + }, + weekText: "সপ্তাহ", + allDayText: "সারাদিন", + moreLinkText: function(n) { + return "+অন্যান্য " + n; + }, + noEventsText: "কোনো ইভেন্ট নেই" + }; + + return bn; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/bs.js b/pandora_console/include/javascript/fullcalendar/locales/bs.js new file mode 100644 index 0000000000..de5cacfa99 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/bs.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var bs = { + code: "bs", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Prošli", + next: "Sljedeći", + today: "Danas", + month: "Mjesec", + week: "Sedmica", + day: "Dan", + list: "Raspored" + }, + weekText: "Sed", + allDayText: "Cijeli dan", + moreLinkText: function(n) { + return "+ još " + n; + }, + noEventsText: "Nema događaja za prikazivanje" + }; + + return bs; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ca.js b/pandora_console/include/javascript/fullcalendar/locales/ca.js new file mode 100644 index 0000000000..1bbe7d9af3 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ca.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ca = { + code: "ca", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Anterior", + next: "Següent", + today: "Avui", + month: "Mes", + week: "Setmana", + day: "Dia", + list: "Agenda" + }, + weekText: "Set", + allDayText: "Tot el dia", + moreLinkText: "més", + noEventsText: "No hi ha esdeveniments per mostrar" + }; + + return ca; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/cs.js b/pandora_console/include/javascript/fullcalendar/locales/cs.js new file mode 100644 index 0000000000..bafb77f0e5 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/cs.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var cs = { + code: "cs", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Dříve", + next: "Později", + today: "Nyní", + month: "Měsíc", + week: "Týden", + day: "Den", + list: "Agenda" + }, + weekText: "Týd", + allDayText: "Celý den", + moreLinkText: function(n) { + return "+další: " + n; + }, + noEventsText: "Žádné akce k zobrazení" + }; + + return cs; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/cy.js b/pandora_console/include/javascript/fullcalendar/locales/cy.js new file mode 100644 index 0000000000..b1a8a3e863 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/cy.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var cy = { + code: "cy", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Blaenorol", + next: "Nesaf", + today: "Heddiw", + year: "Blwyddyn", + month: "Mis", + week: "Wythnos", + day: "Dydd", + list: "Rhestr" + }, + weekText: "Wythnos", + allDayText: "Trwy'r dydd", + moreLinkText: "Mwy", + noEventsText: "Dim digwyddiadau" + }; + + return cy; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/da.js b/pandora_console/include/javascript/fullcalendar/locales/da.js new file mode 100644 index 0000000000..da1120a604 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/da.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var da = { + code: "da", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Forrige", + next: "Næste", + today: "I dag", + month: "Måned", + week: "Uge", + day: "Dag", + list: "Agenda" + }, + weekText: "Uge", + allDayText: "Hele dagen", + moreLinkText: "flere", + noEventsText: "Ingen arrangementer at vise" + }; + + return da; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/de-at.js b/pandora_console/include/javascript/fullcalendar/locales/de-at.js new file mode 100644 index 0000000000..17e1961788 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/de-at.js @@ -0,0 +1,73 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + function affix(buttonText) { + return buttonText === "Tag" || buttonText === "Monat" + ? "r" + : buttonText === "Jahr" + ? "s" + : ""; + } + + var deAt = { + code: "de-at", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Zurück", + next: "Vor", + today: "Heute", + year: "Jahr", + month: "Monat", + week: "Woche", + day: "Tag", + list: "Terminübersicht" + }, + weekText: "KW", + weekTextLong: "Woche", + allDayText: "Ganztägig", + moreLinkText: function(n) { + return "+ weitere " + n; + }, + noEventsText: "Keine Ereignisse anzuzeigen", + buttonHints: { + prev(buttonText) { + return `Vorherige${affix(buttonText)} ${buttonText}`; + }, + next(buttonText) { + return `Nächste${affix(buttonText)} ${buttonText}`; + }, + today(buttonText) { + // → Heute, Diese Woche, Dieser Monat, Dieses Jahr + if (buttonText === "Tag") { + return "Heute"; + } + return `Diese${affix(buttonText)} ${buttonText}`; + } + }, + viewHint(buttonText) { + // → Tagesansicht, Wochenansicht, Monatsansicht, Jahresansicht + const glue = + buttonText === "Woche" ? "n" : buttonText === "Monat" ? "s" : "es"; + return buttonText + glue + "ansicht"; + }, + navLinkHint: "Gehe zu $0", + moreLinkHint(eventCnt) { + return ( + "Zeige " + + (eventCnt === 1 + ? "ein weiteres Ereignis" + : eventCnt + " weitere Ereignisse") + ); + }, + closeHint: "Schließen", + timeHint: "Uhrzeit", + eventHint: "Ereignis" + }; + + return deAt; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/de.js b/pandora_console/include/javascript/fullcalendar/locales/de.js new file mode 100644 index 0000000000..214b41816c --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/de.js @@ -0,0 +1,73 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + function affix(buttonText) { + return buttonText === "Tag" || buttonText === "Monat" + ? "r" + : buttonText === "Jahr" + ? "s" + : ""; + } + + var de = { + code: "de", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Zurück", + next: "Vor", + today: "Heute", + year: "Jahr", + month: "Monat", + week: "Woche", + day: "Tag", + list: "Terminübersicht" + }, + weekText: "KW", + weekTextLong: "Woche", + allDayText: "Ganztägig", + moreLinkText: function(n) { + return "+ weitere " + n; + }, + noEventsText: "Keine Ereignisse anzuzeigen", + buttonHints: { + prev(buttonText) { + return `Vorherige${affix(buttonText)} ${buttonText}`; + }, + next(buttonText) { + return `Nächste${affix(buttonText)} ${buttonText}`; + }, + today(buttonText) { + // → Heute, Diese Woche, Dieser Monat, Dieses Jahr + if (buttonText === "Tag") { + return "Heute"; + } + return `Diese${affix(buttonText)} ${buttonText}`; + } + }, + viewHint(buttonText) { + // → Tagesansicht, Wochenansicht, Monatsansicht, Jahresansicht + const glue = + buttonText === "Woche" ? "n" : buttonText === "Monat" ? "s" : "es"; + return buttonText + glue + "ansicht"; + }, + navLinkHint: "Gehe zu $0", + moreLinkHint(eventCnt) { + return ( + "Zeige " + + (eventCnt === 1 + ? "ein weiteres Ereignis" + : eventCnt + " weitere Ereignisse") + ); + }, + closeHint: "Schließen", + timeHint: "Uhrzeit", + eventHint: "Ereignis" + }; + + return de; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/el.js b/pandora_console/include/javascript/fullcalendar/locales/el.js new file mode 100644 index 0000000000..ad236b53ae --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/el.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var el = { + code: "el", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4st is the first week of the year. + }, + buttonText: { + prev: "Προηγούμενος", + next: "Επόμενος", + today: "Σήμερα", + month: "Μήνας", + week: "Εβδομάδα", + day: "Ημέρα", + list: "Ατζέντα" + }, + weekText: "Εβδ", + allDayText: "Ολοήμερο", + moreLinkText: "περισσότερα", + noEventsText: "Δεν υπάρχουν γεγονότα προς εμφάνιση" + }; + + return el; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/en-au.js b/pandora_console/include/javascript/fullcalendar/locales/en-au.js new file mode 100644 index 0000000000..87cb873ea1 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/en-au.js @@ -0,0 +1,25 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var enAu = { + code: "en-au", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonHints: { + prev: "Previous $0", + next: "Next $0", + today: "This $0" + }, + viewHint: "$0 view", + navLinkHint: "Go to $0", + moreLinkHint(eventCnt) { + return `Show ${eventCnt} more event${eventCnt === 1 ? "" : "s"}`; + } + }; + + return enAu; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/en-gb.js b/pandora_console/include/javascript/fullcalendar/locales/en-gb.js new file mode 100644 index 0000000000..e5848aa344 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/en-gb.js @@ -0,0 +1,25 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var enGb = { + code: "en-gb", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonHints: { + prev: "Previous $0", + next: "Next $0", + today: "This $0" + }, + viewHint: "$0 view", + navLinkHint: "Go to $0", + moreLinkHint(eventCnt) { + return `Show ${eventCnt} more event${eventCnt === 1 ? "" : "s"}`; + } + }; + + return enGb; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/en-nz.js b/pandora_console/include/javascript/fullcalendar/locales/en-nz.js new file mode 100644 index 0000000000..4f4b9bb333 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/en-nz.js @@ -0,0 +1,25 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var enNz = { + code: "en-nz", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonHints: { + prev: "Previous $0", + next: "Next $0", + today: "This $0" + }, + viewHint: "$0 view", + navLinkHint: "Go to $0", + moreLinkHint(eventCnt) { + return `Show ${eventCnt} more event${eventCnt === 1 ? "" : "s"}`; + } + }; + + return enNz; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/eo.js b/pandora_console/include/javascript/fullcalendar/locales/eo.js new file mode 100644 index 0000000000..528d38e3b8 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/eo.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var eo = { + code: "eo", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Antaŭa", + next: "Sekva", + today: "Hodiaŭ", + month: "Monato", + week: "Semajno", + day: "Tago", + list: "Tagordo" + }, + weekText: "Sm", + allDayText: "Tuta tago", + moreLinkText: "pli", + noEventsText: "Neniuj eventoj por montri" + }; + + return eo; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/es-us.js b/pandora_console/include/javascript/fullcalendar/locales/es-us.js new file mode 100644 index 0000000000..1efb6b294f --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/es-us.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var esUs = { + code: "es", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Ant", + next: "Sig", + today: "Hoy", + month: "Mes", + week: "Semana", + day: "Día", + list: "Agenda" + }, + weekText: "Sm", + allDayText: "Todo el día", + moreLinkText: "más", + noEventsText: "No hay eventos para mostrar" + }; + + return esUs; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/es.js b/pandora_console/include/javascript/fullcalendar/locales/es.js new file mode 100644 index 0000000000..186dda1e5f --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/es.js @@ -0,0 +1,55 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var es = { + code: "es", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Ant", + next: "Sig", + today: "Hoy", + month: "Mes", + week: "Semana", + day: "Día", + list: "Agenda" + }, + buttonHints: { + prev: "$0 antes", + next: "$0 siguiente", + today(buttonText) { + return buttonText === "Día" + ? "Hoy" + : (buttonText === "Semana" ? "Esta" : "Este") + + " " + + buttonText.toLocaleLowerCase(); + } + }, + viewHint(buttonText) { + return ( + "Vista " + + (buttonText === "Semana" ? "de la" : "del") + + " " + + buttonText.toLocaleLowerCase() + ); + }, + weekText: "Sm", + weekTextLong: "Semana", + allDayText: "Todo el día", + moreLinkText: "más", + moreLinkHint(eventCnt) { + return `Mostrar ${eventCnt} eventos más`; + }, + noEventsText: "No hay eventos para mostrar", + navLinkHint: "Ir al $0", + closeHint: "Cerrar", + timeHint: "La hora", + eventHint: "Evento" + }; + + return es; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/et.js b/pandora_console/include/javascript/fullcalendar/locales/et.js new file mode 100644 index 0000000000..eec5315b73 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/et.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var et = { + code: "et", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Eelnev", + next: "Järgnev", + today: "Täna", + month: "Kuu", + week: "Nädal", + day: "Päev", + list: "Päevakord" + }, + weekText: "näd", + allDayText: "Kogu päev", + moreLinkText: function(n) { + return "+ veel " + n; + }, + noEventsText: "Kuvamiseks puuduvad sündmused" + }; + + return et; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/eu.js b/pandora_console/include/javascript/fullcalendar/locales/eu.js new file mode 100644 index 0000000000..09218fe1b2 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/eu.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var eu = { + code: "eu", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Aur", + next: "Hur", + today: "Gaur", + month: "Hilabetea", + week: "Astea", + day: "Eguna", + list: "Agenda" + }, + weekText: "As", + allDayText: "Egun osoa", + moreLinkText: "gehiago", + noEventsText: "Ez dago ekitaldirik erakusteko" + }; + + return eu; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/fa.js b/pandora_console/include/javascript/fullcalendar/locales/fa.js new file mode 100644 index 0000000000..83e9f29bce --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/fa.js @@ -0,0 +1,31 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var fa = { + code: "fa", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "قبلی", + next: "بعدی", + today: "امروز", + month: "ماه", + week: "هفته", + day: "روز", + list: "برنامه" + }, + weekText: "هف", + allDayText: "تمام روز", + moreLinkText: function(n) { + return "بیش از " + n; + }, + noEventsText: "هیچ رویدادی به نمایش" + }; + + return fa; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/fi.js b/pandora_console/include/javascript/fullcalendar/locales/fi.js new file mode 100644 index 0000000000..a1e60bb4cf --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/fi.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var fi = { + code: "fi", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Edellinen", + next: "Seuraava", + today: "Tänään", + month: "Kuukausi", + week: "Viikko", + day: "Päivä", + list: "Tapahtumat" + }, + weekText: "Vk", + allDayText: "Koko päivä", + moreLinkText: "lisää", + noEventsText: "Ei näytettäviä tapahtumia" + }; + + return fi; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/fr-ca.js b/pandora_console/include/javascript/fullcalendar/locales/fr-ca.js new file mode 100644 index 0000000000..54730b7717 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/fr-ca.js @@ -0,0 +1,25 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var frCa = { + code: "fr", + buttonText: { + prev: "Précédent", + next: "Suivant", + today: "Aujourd'hui", + year: "Année", + month: "Mois", + week: "Semaine", + day: "Jour", + list: "Mon planning" + }, + weekText: "Sem.", + allDayText: "Toute la journée", + moreLinkText: "en plus", + noEventsText: "Aucun événement à afficher" + }; + + return frCa; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/fr-ch.js b/pandora_console/include/javascript/fullcalendar/locales/fr-ch.js new file mode 100644 index 0000000000..685572fdae --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/fr-ch.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var frCh = { + code: "fr-ch", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Précédent", + next: "Suivant", + today: "Courant", + year: "Année", + month: "Mois", + week: "Semaine", + day: "Jour", + list: "Mon planning" + }, + weekText: "Sm", + allDayText: "Toute la journée", + moreLinkText: "en plus", + noEventsText: "Aucun événement à afficher" + }; + + return frCh; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/fr.js b/pandora_console/include/javascript/fullcalendar/locales/fr.js new file mode 100644 index 0000000000..a44152ee89 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/fr.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var fr = { + code: "fr", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Précédent", + next: "Suivant", + today: "Aujourd'hui", + year: "Année", + month: "Mois", + week: "Semaine", + day: "Jour", + list: "Planning" + }, + weekText: "Sem.", + allDayText: "Toute la journée", + moreLinkText: "en plus", + noEventsText: "Aucun événement à afficher" + }; + + return fr; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/gl.js b/pandora_console/include/javascript/fullcalendar/locales/gl.js new file mode 100644 index 0000000000..b2b31906ba --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/gl.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var gl = { + code: "gl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Ant", + next: "Seg", + today: "Hoxe", + month: "Mes", + week: "Semana", + day: "Día", + list: "Axenda" + }, + weekText: "Sm", + allDayText: "Todo o día", + moreLinkText: "máis", + noEventsText: "Non hai eventos para amosar" + }; + + return gl; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/he.js b/pandora_console/include/javascript/fullcalendar/locales/he.js new file mode 100644 index 0000000000..a48945c479 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/he.js @@ -0,0 +1,25 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var he = { + code: "he", + direction: "rtl", + buttonText: { + prev: "הקודם", + next: "הבא", + today: "היום", + month: "חודש", + week: "שבוע", + day: "יום", + list: "סדר יום" + }, + allDayText: "כל היום", + moreLinkText: "אחר", + noEventsText: "אין אירועים להצגה", + weekText: "שבוע" + }; + + return he; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/hi.js b/pandora_console/include/javascript/fullcalendar/locales/hi.js new file mode 100644 index 0000000000..e788309243 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/hi.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var hi = { + code: "hi", + week: { + dow: 0, // Sunday is the first day of the week. + doy: 6 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "पिछला", + next: "अगला", + today: "आज", + month: "महीना", + week: "सप्ताह", + day: "दिन", + list: "कार्यसूची" + }, + weekText: "हफ्ता", + allDayText: "सभी दिन", + moreLinkText: function(n) { + return "+अधिक " + n; + }, + noEventsText: "कोई घटनाओं को प्रदर्शित करने के लिए" + }; + + return hi; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/hr.js b/pandora_console/include/javascript/fullcalendar/locales/hr.js new file mode 100644 index 0000000000..eda86ca6c2 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/hr.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var hr = { + code: "hr", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Prijašnji", + next: "Sljedeći", + today: "Danas", + month: "Mjesec", + week: "Tjedan", + day: "Dan", + list: "Raspored" + }, + weekText: "Tje", + allDayText: "Cijeli dan", + moreLinkText: function(n) { + return "+ još " + n; + }, + noEventsText: "Nema događaja za prikaz" + }; + + return hr; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/hu.js b/pandora_console/include/javascript/fullcalendar/locales/hu.js new file mode 100644 index 0000000000..c9d473c7dc --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/hu.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var hu = { + code: "hu", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "vissza", + next: "előre", + today: "ma", + month: "Hónap", + week: "Hét", + day: "Nap", + list: "Lista" + }, + weekText: "Hét", + allDayText: "Egész nap", + moreLinkText: "további", + noEventsText: "Nincs megjeleníthető esemény" + }; + + return hu; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/hy-am.js b/pandora_console/include/javascript/fullcalendar/locales/hy-am.js new file mode 100644 index 0000000000..922f6a994a --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/hy-am.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var hyAm = { + code: "hy-am", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Նախորդ", + next: "Հաջորդ", + today: "Այսօր", + month: "Ամիս", + week: "Շաբաթ", + day: "Օր", + list: "Օրվա ցուցակ" + }, + weekText: "Շաբ", + allDayText: "Ամբողջ օր", + moreLinkText: function(n) { + return "+ ևս " + n; + }, + noEventsText: "Բացակայում է իրադարձությունը ցուցադրելու" + }; + + return hyAm; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/id.js b/pandora_console/include/javascript/fullcalendar/locales/id.js new file mode 100644 index 0000000000..1169f6706f --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/id.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var id = { + code: "id", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "mundur", + next: "maju", + today: "hari ini", + month: "Bulan", + week: "Minggu", + day: "Hari", + list: "Agenda" + }, + weekText: "Mg", + allDayText: "Sehari penuh", + moreLinkText: "lebih", + noEventsText: "Tidak ada acara untuk ditampilkan" + }; + + return id; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/is.js b/pandora_console/include/javascript/fullcalendar/locales/is.js new file mode 100644 index 0000000000..db65c7e67d --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/is.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var is = { + code: "is", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Fyrri", + next: "Næsti", + today: "Í dag", + month: "Mánuður", + week: "Vika", + day: "Dagur", + list: "Dagskrá" + }, + weekText: "Vika", + allDayText: "Allan daginn", + moreLinkText: "meira", + noEventsText: "Engir viðburðir til að sýna" + }; + + return is; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/it.js b/pandora_console/include/javascript/fullcalendar/locales/it.js new file mode 100644 index 0000000000..7dab36b32c --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/it.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var it = { + code: "it", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Prec", + next: "Succ", + today: "Oggi", + month: "Mese", + week: "Settimana", + day: "Giorno", + list: "Agenda" + }, + weekText: "Sm", + allDayText: "Tutto il giorno", + moreLinkText: function(n) { + return "+altri " + n; + }, + noEventsText: "Non ci sono eventi da visualizzare" + }; + + return it; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ja.js b/pandora_console/include/javascript/fullcalendar/locales/ja.js new file mode 100644 index 0000000000..1234b8b48a --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ja.js @@ -0,0 +1,26 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ja = { + code: "ja", + buttonText: { + prev: "前", + next: "次", + today: "今日", + month: "月", + week: "週", + day: "日", + list: "予定リスト" + }, + weekText: "週", + allDayText: "終日", + moreLinkText: function(n) { + return "他 " + n + " 件"; + }, + noEventsText: "表示する予定はありません" + }; + + return ja; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ka.js b/pandora_console/include/javascript/fullcalendar/locales/ka.js new file mode 100644 index 0000000000..2dcfce8723 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ka.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ka = { + code: "ka", + week: { + dow: 1, + doy: 7 + }, + buttonText: { + prev: "წინა", + next: "შემდეგი", + today: "დღეს", + month: "თვე", + week: "კვირა", + day: "დღე", + list: "დღის წესრიგი" + }, + weekText: "კვ", + allDayText: "მთელი დღე", + moreLinkText: function(n) { + return "+ კიდევ " + n; + }, + noEventsText: "ღონისძიებები არ არის" + }; + + return ka; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/kk.js b/pandora_console/include/javascript/fullcalendar/locales/kk.js new file mode 100644 index 0000000000..e82fd64dda --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/kk.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var kk = { + code: "kk", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Алдыңғы", + next: "Келесі", + today: "Бүгін", + month: "Ай", + week: "Апта", + day: "Күн", + list: "Күн тәртібі" + }, + weekText: "Не", + allDayText: "Күні бойы", + moreLinkText: function(n) { + return "+ тағы " + n; + }, + noEventsText: "Көрсету үшін оқиғалар жоқ" + }; + + return kk; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/km.js b/pandora_console/include/javascript/fullcalendar/locales/km.js new file mode 100644 index 0000000000..6c337b85c1 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/km.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var km = { + code: "km", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "មុន", + next: "បន្ទាប់", + today: "ថ្ងៃនេះ", + year: "ឆ្នាំ", + month: "ខែ", + week: "សប្តាហ៍", + day: "ថ្ងៃ", + list: "បញ្ជី" + }, + weekText: "សប្តាហ៍", + allDayText: "ពេញមួយថ្ងៃ", + moreLinkText: "ច្រើនទៀត", + noEventsText: "គ្មានព្រឹត្តិការណ៍ត្រូវបង្ហាញ" + }; + + return km; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ko.js b/pandora_console/include/javascript/fullcalendar/locales/ko.js new file mode 100644 index 0000000000..9fae588d70 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ko.js @@ -0,0 +1,24 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ko = { + code: "ko", + buttonText: { + prev: "이전달", + next: "다음달", + today: "오늘", + month: "월", + week: "주", + day: "일", + list: "일정목록" + }, + weekText: "주", + allDayText: "종일", + moreLinkText: "개", + noEventsText: "일정이 없습니다" + }; + + return ko; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ku.js b/pandora_console/include/javascript/fullcalendar/locales/ku.js new file mode 100644 index 0000000000..a6f0076f23 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ku.js @@ -0,0 +1,29 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ku = { + code: "ku", + week: { + dow: 6, // Saturday is the first day of the week. + doy: 12 // The week that contains Jan 1st is the first week of the year. + }, + direction: "rtl", + buttonText: { + prev: "پێشتر", + next: "دواتر", + today: "ئەمڕو", + month: "مانگ", + week: "هەفتە", + day: "ڕۆژ", + list: "بەرنامە" + }, + weekText: "هەفتە", + allDayText: "هەموو ڕۆژەکە", + moreLinkText: "زیاتر", + noEventsText: "هیچ ڕووداوێك نیە" + }; + + return ku; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/lb.js b/pandora_console/include/javascript/fullcalendar/locales/lb.js new file mode 100644 index 0000000000..38baaec35b --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/lb.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var lb = { + code: "lb", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Zréck", + next: "Weider", + today: "Haut", + month: "Mount", + week: "Woch", + day: "Dag", + list: "Terminiwwersiicht" + }, + weekText: "W", + allDayText: "Ganzen Dag", + moreLinkText: "méi", + noEventsText: "Nee Evenementer ze affichéieren" + }; + + return lb; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/lt.js b/pandora_console/include/javascript/fullcalendar/locales/lt.js new file mode 100644 index 0000000000..955f31a959 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/lt.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var lt = { + code: "lt", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Atgal", + next: "Pirmyn", + today: "Šiandien", + month: "Mėnuo", + week: "Savaitė", + day: "Diena", + list: "Darbotvarkė" + }, + weekText: "SAV", + allDayText: "Visą dieną", + moreLinkText: "daugiau", + noEventsText: "Nėra įvykių rodyti" + }; + + return lt; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/lv.js b/pandora_console/include/javascript/fullcalendar/locales/lv.js new file mode 100644 index 0000000000..890834dea9 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/lv.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var lv = { + code: "lv", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Iepr.", + next: "Nāk.", + today: "Šodien", + month: "Mēnesis", + week: "Nedēļa", + day: "Diena", + list: "Dienas kārtība" + }, + weekText: "Ned.", + allDayText: "Visu dienu", + moreLinkText: function(n) { + return "+vēl " + n; + }, + noEventsText: "Nav notikumu" + }; + + return lv; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/mk.js b/pandora_console/include/javascript/fullcalendar/locales/mk.js new file mode 100644 index 0000000000..359cdd0531 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/mk.js @@ -0,0 +1,26 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var mk = { + code: "mk", + buttonText: { + prev: "претходно", + next: "следно", + today: "Денес", + month: "Месец", + week: "Недела", + day: "Ден", + list: "График" + }, + weekText: "Сед", + allDayText: "Цел ден", + moreLinkText: function(n) { + return "+повеќе " + n; + }, + noEventsText: "Нема настани за прикажување" + }; + + return mk; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ms.js b/pandora_console/include/javascript/fullcalendar/locales/ms.js new file mode 100644 index 0000000000..a1e712ea0e --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ms.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ms = { + code: "ms", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Sebelum", + next: "Selepas", + today: "hari ini", + month: "Bulan", + week: "Minggu", + day: "Hari", + list: "Agenda" + }, + weekText: "Mg", + allDayText: "Sepanjang hari", + moreLinkText: function(n) { + return "masih ada " + n + " acara"; + }, + noEventsText: "Tiada peristiwa untuk dipaparkan" + }; + + return ms; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/nb.js b/pandora_console/include/javascript/fullcalendar/locales/nb.js new file mode 100644 index 0000000000..eeed9e5259 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/nb.js @@ -0,0 +1,39 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var nb = { + code: "nb", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Forrige", + next: "Neste", + today: "I dag", + month: "Måned", + week: "Uke", + day: "Dag", + list: "Agenda" + }, + weekText: "Uke", + weekTextLong: "Uke", + allDayText: "Hele dagen", + moreLinkText: "til", + noEventsText: "Ingen hendelser å vise", + buttonHints: { + prev: "Forrige $0", + next: "Neste $0", + today: "Nåværende $0" + }, + viewHint: "$0 visning", + navLinkHint: "Gå til $0", + moreLinkHint(eventCnt) { + return `Vis ${eventCnt} flere hendelse${eventCnt === 1 ? "" : "r"}`; + } + }; + + return nb; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ne.js b/pandora_console/include/javascript/fullcalendar/locales/ne.js new file mode 100644 index 0000000000..94b3d30787 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ne.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ne = { + code: "ne", // code for nepal + week: { + dow: 7, // Sunday is the first day of the week. + doy: 1 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "अघिल्लो", + next: "अर्को", + today: "आज", + month: "महिना", + week: "हप्ता", + day: "दिन", + list: "सूची" + }, + weekText: "हप्ता", + allDayText: "दिनभरि", + moreLinkText: "थप लिंक", + noEventsText: "देखाउनको लागि कुनै घटनाहरू छैनन्" + }; + + return ne; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/nl.js b/pandora_console/include/javascript/fullcalendar/locales/nl.js new file mode 100644 index 0000000000..715aead2b7 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/nl.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var nl = { + code: "nl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Vorige", + next: "Volgende", + today: "Vandaag", + year: "Jaar", + month: "Maand", + week: "Week", + day: "Dag", + list: "Agenda" + }, + allDayText: "Hele dag", + moreLinkText: "extra", + noEventsText: "Geen evenementen om te laten zien" + }; + + return nl; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/nn.js b/pandora_console/include/javascript/fullcalendar/locales/nn.js new file mode 100644 index 0000000000..32958f1e8c --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/nn.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var nn = { + code: "nn", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Førre", + next: "Neste", + today: "I dag", + month: "Månad", + week: "Veke", + day: "Dag", + list: "Agenda" + }, + weekText: "Veke", + allDayText: "Heile dagen", + moreLinkText: "til", + noEventsText: "Ingen hendelser å vise" + }; + + return nn; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/pl.js b/pandora_console/include/javascript/fullcalendar/locales/pl.js new file mode 100644 index 0000000000..ba8e775ca5 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/pl.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var pl = { + code: "pl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Poprzedni", + next: "Następny", + today: "Dziś", + month: "Miesiąc", + week: "Tydzień", + day: "Dzień", + list: "Plan dnia" + }, + weekText: "Tydz", + allDayText: "Cały dzień", + moreLinkText: "więcej", + noEventsText: "Brak wydarzeń do wyświetlenia" + }; + + return pl; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/pt-br.js b/pandora_console/include/javascript/fullcalendar/locales/pt-br.js new file mode 100644 index 0000000000..62e371b239 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/pt-br.js @@ -0,0 +1,26 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ptBr = { + code: "pt-br", + buttonText: { + prev: "Anterior", + next: "Próximo", + today: "Hoje", + month: "Mês", + week: "Semana", + day: "Dia", + list: "Lista" + }, + weekText: "Sm", + allDayText: "dia inteiro", + moreLinkText: function(n) { + return "mais +" + n; + }, + noEventsText: "Não há eventos para mostrar" + }; + + return ptBr; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/pt.js b/pandora_console/include/javascript/fullcalendar/locales/pt.js new file mode 100644 index 0000000000..70e294c693 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/pt.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var pt = { + code: "pt", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Anterior", + next: "Seguinte", + today: "Hoje", + month: "Mês", + week: "Semana", + day: "Dia", + list: "Agenda" + }, + weekText: "Sem", + allDayText: "Todo o dia", + moreLinkText: "mais", + noEventsText: "Não há eventos para mostrar" + }; + + return pt; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ro.js b/pandora_console/include/javascript/fullcalendar/locales/ro.js new file mode 100644 index 0000000000..95f64698cf --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ro.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ro = { + code: "ro", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "precedentă", + next: "următoare", + today: "Azi", + month: "Lună", + week: "Săptămână", + day: "Zi", + list: "Agendă" + }, + weekText: "Săpt", + allDayText: "Toată ziua", + moreLinkText: function(n) { + return "+alte " + n; + }, + noEventsText: "Nu există evenimente de afișat" + }; + + return ro; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ru.js b/pandora_console/include/javascript/fullcalendar/locales/ru.js new file mode 100644 index 0000000000..5d323bc49f --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ru.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ru = { + code: "ru", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Пред", + next: "След", + today: "Сегодня", + month: "Месяц", + week: "Неделя", + day: "День", + list: "Повестка дня" + }, + weekText: "Нед", + allDayText: "Весь день", + moreLinkText: function(n) { + return "+ ещё " + n; + }, + noEventsText: "Нет событий для отображения" + }; + + return ru; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/si-lk.js b/pandora_console/include/javascript/fullcalendar/locales/si-lk.js new file mode 100644 index 0000000000..8b69c8736d --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/si-lk.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var siLk = { + code: "si-lk", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "පෙර", + next: "පසු", + today: "අද", + month: "මාසය", + week: "සතිය", + day: "දවස", + list: "ලැයිස්තුව" + }, + weekText: "සති", + allDayText: "සියලු", + moreLinkText: "තවත්", + noEventsText: "මුකුත් නැත" + }; + + return siLk; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/sk.js b/pandora_console/include/javascript/fullcalendar/locales/sk.js new file mode 100644 index 0000000000..c5c891bdc0 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/sk.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var sk = { + code: "sk", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Predchádzajúci", + next: "Nasledujúci", + today: "Dnes", + month: "Mesiac", + week: "Týždeň", + day: "Deň", + list: "Rozvrh" + }, + weekText: "Ty", + allDayText: "Celý deň", + moreLinkText: function(n) { + return "+ďalšie: " + n; + }, + noEventsText: "Žiadne akcie na zobrazenie" + }; + + return sk; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/sl.js b/pandora_console/include/javascript/fullcalendar/locales/sl.js new file mode 100644 index 0000000000..782409f183 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/sl.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var sl = { + code: "sl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Prejšnji", + next: "Naslednji", + today: "Trenutni", + month: "Mesec", + week: "Teden", + day: "Dan", + list: "Dnevni red" + }, + weekText: "Teden", + allDayText: "Ves dan", + moreLinkText: "več", + noEventsText: "Ni dogodkov za prikaz" + }; + + return sl; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/sm.js b/pandora_console/include/javascript/fullcalendar/locales/sm.js new file mode 100644 index 0000000000..c6ea92b691 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/sm.js @@ -0,0 +1,24 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var sm = { + code: "sm", + buttonText: { + prev: "Talu ai", + next: "Mulimuli atu", + today: "Aso nei", + month: "Masina", + week: "Vaiaso", + day: "Aso", + list: "Faasologa" + }, + weekText: "Vaiaso", + allDayText: "Aso atoa", + moreLinkText: "sili atu", + noEventsText: "Leai ni mea na tutupu" + }; + + return sm; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/sq.js b/pandora_console/include/javascript/fullcalendar/locales/sq.js new file mode 100644 index 0000000000..d05d12b84b --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/sq.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var sq = { + code: "sq", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "mbrapa", + next: "Përpara", + today: "sot", + month: "Muaj", + week: "Javë", + day: "Ditë", + list: "Listë" + }, + weekText: "Ja", + allDayText: "Gjithë ditën", + moreLinkText: function(n) { + return "+më tepër " + n; + }, + noEventsText: "Nuk ka evente për të shfaqur" + }; + + return sq; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/sr-cyrl.js b/pandora_console/include/javascript/fullcalendar/locales/sr-cyrl.js new file mode 100644 index 0000000000..e751e71ece --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/sr-cyrl.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var srCyrl = { + code: "sr-cyrl", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Претходна", + next: "следећи", + today: "Данас", + month: "Месец", + week: "Недеља", + day: "Дан", + list: "Планер" + }, + weekText: "Сед", + allDayText: "Цео дан", + moreLinkText: function(n) { + return "+ још " + n; + }, + noEventsText: "Нема догађаја за приказ" + }; + + return srCyrl; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/sr.js b/pandora_console/include/javascript/fullcalendar/locales/sr.js new file mode 100644 index 0000000000..5d9030eab9 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/sr.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var sr = { + code: "sr", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Prethodna", + next: "Sledeći", + today: "Danas", + month: "Mеsеc", + week: "Nеdеlja", + day: "Dan", + list: "Planеr" + }, + weekText: "Sed", + allDayText: "Cеo dan", + moreLinkText: function(n) { + return "+ još " + n; + }, + noEventsText: "Nеma događaja za prikaz" + }; + + return sr; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/sv.js b/pandora_console/include/javascript/fullcalendar/locales/sv.js new file mode 100644 index 0000000000..008e1f3915 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/sv.js @@ -0,0 +1,54 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var sv = { + code: "sv", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Förra", + next: "Nästa", + today: "Idag", + month: "Månad", + week: "Vecka", + day: "Dag", + list: "Program" + }, + buttonHints: { + prev(buttonText) { + return `Föregående ${buttonText.toLocaleLowerCase()}`; + }, + next(buttonText) { + return `Nästa ${buttonText.toLocaleLowerCase()}`; + }, + today(buttonText) { + return ( + (buttonText === "Program" ? "Detta" : "Denna") + + " " + + buttonText.toLocaleLowerCase() + ); + } + }, + viewHint: "$0 vy", + navLinkHint: "Gå till $0", + moreLinkHint(eventCnt) { + return `Visa ytterligare ${eventCnt} händelse${ + eventCnt === 1 ? "" : "r" + }`; + }, + weekText: "v.", + weekTextLong: "Vecka", + allDayText: "Heldag", + moreLinkText: "till", + noEventsText: "Inga händelser att visa", + closeHint: "Stäng", + timeHint: "Klockan", + eventHint: "Händelse" + }; + + return sv; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ta-in.js b/pandora_console/include/javascript/fullcalendar/locales/ta-in.js new file mode 100644 index 0000000000..6a43842f7d --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ta-in.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var taIn = { + code: "ta-in", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "முந்தைய", + next: "அடுத்தது", + today: "இன்று", + month: "மாதம்", + week: "வாரம்", + day: "நாள்", + list: "தினசரி அட்டவணை" + }, + weekText: "வாரம்", + allDayText: "நாள் முழுவதும்", + moreLinkText: function(n) { + return "+ மேலும் " + n; + }, + noEventsText: "காண்பிக்க நிகழ்வுகள் இல்லை" + }; + + return taIn; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/th.js b/pandora_console/include/javascript/fullcalendar/locales/th.js new file mode 100644 index 0000000000..2e4c7dbcab --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/th.js @@ -0,0 +1,31 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var th = { + code: "th", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "ก่อนหน้า", + next: "ถัดไป", + prevYear: "ปีก่อนหน้า", + nextYear: "ปีถัดไป", + year: "ปี", + today: "วันนี้", + month: "เดือน", + week: "สัปดาห์", + day: "วัน", + list: "กำหนดการ" + }, + weekText: "สัปดาห์", + allDayText: "ตลอดวัน", + moreLinkText: "เพิ่มเติม", + noEventsText: "ไม่มีกิจกรรมที่จะแสดง" + }; + + return th; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/tr.js b/pandora_console/include/javascript/fullcalendar/locales/tr.js new file mode 100644 index 0000000000..c74b1e7597 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/tr.js @@ -0,0 +1,28 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var tr = { + code: "tr", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "geri", + next: "ileri", + today: "bugün", + month: "Ay", + week: "Hafta", + day: "Gün", + list: "Ajanda" + }, + weekText: "Hf", + allDayText: "Tüm gün", + moreLinkText: "daha fazla", + noEventsText: "Gösterilecek etkinlik yok" + }; + + return tr; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/ug.js b/pandora_console/include/javascript/fullcalendar/locales/ug.js new file mode 100644 index 0000000000..9259a44463 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/ug.js @@ -0,0 +1,18 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var ug = { + code: "ug", + buttonText: { + month: "ئاي", + week: "ھەپتە", + day: "كۈن", + list: "كۈنتەرتىپ" + }, + allDayText: "پۈتۈن كۈن" + }; + + return ug; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/uk.js b/pandora_console/include/javascript/fullcalendar/locales/uk.js new file mode 100644 index 0000000000..36c45d03c9 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/uk.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var uk = { + code: "uk", + week: { + dow: 1, // Monday is the first day of the week. + doy: 7 // The week that contains Jan 1st is the first week of the year. + }, + buttonText: { + prev: "Попередній", + next: "далі", + today: "Сьогодні", + month: "Місяць", + week: "Тиждень", + day: "День", + list: "Порядок денний" + }, + weekText: "Тиж", + allDayText: "Увесь день", + moreLinkText: function(n) { + return "+ще " + n + "..."; + }, + noEventsText: "Немає подій для відображення" + }; + + return uk; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/uz.js b/pandora_console/include/javascript/fullcalendar/locales/uz.js new file mode 100644 index 0000000000..ad663377dd --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/uz.js @@ -0,0 +1,22 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var uz = { + code: "uz", + buttonText: { + month: "Oy", + week: "Xafta", + day: "Kun", + list: "Kun tartibi" + }, + allDayText: "Kun bo'yi", + moreLinkText: function(n) { + return "+ yana " + n; + }, + noEventsText: "Ko'rsatish uchun voqealar yo'q" + }; + + return uz; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/vi.js b/pandora_console/include/javascript/fullcalendar/locales/vi.js new file mode 100644 index 0000000000..13a1f92ad5 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/vi.js @@ -0,0 +1,30 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var vi = { + code: "vi", + week: { + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "Trước", + next: "Tiếp", + today: "Hôm nay", + month: "Tháng", + week: "Tuần", + day: "Ngày", + list: "Lịch biểu" + }, + weekText: "Tu", + allDayText: "Cả ngày", + moreLinkText: function(n) { + return "+ thêm " + n; + }, + noEventsText: "Không có sự kiện để hiển thị" + }; + + return vi; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/zh-cn.js b/pandora_console/include/javascript/fullcalendar/locales/zh-cn.js new file mode 100644 index 0000000000..7749a6ee3e --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/zh-cn.js @@ -0,0 +1,31 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var zhCn = { + code: "zh-cn", + week: { + // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 + dow: 1, // Monday is the first day of the week. + doy: 4 // The week that contains Jan 4th is the first week of the year. + }, + buttonText: { + prev: "上月", + next: "下月", + today: "今天", + month: "月", + week: "周", + day: "日", + list: "日程" + }, + weekText: "周", + allDayText: "全天", + moreLinkText: function(n) { + return "另外 " + n + " 个"; + }, + noEventsText: "没有事件显示" + }; + + return zhCn; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/locales/zh-tw.js b/pandora_console/include/javascript/fullcalendar/locales/zh-tw.js new file mode 100644 index 0000000000..6f1f831d90 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/locales/zh-tw.js @@ -0,0 +1,24 @@ +FullCalendar.globalLocales.push( + (function() { + "use strict"; + + var zhTw = { + code: "zh-tw", + buttonText: { + prev: "上月", + next: "下月", + today: "今天", + month: "月", + week: "週", + day: "天", + list: "活動列表" + }, + weekText: "周", + allDayText: "整天", + moreLinkText: "顯示更多", + noEventsText: "没有任何活動" + }; + + return zhTw; + })() +); diff --git a/pandora_console/include/javascript/fullcalendar/main.css b/pandora_console/include/javascript/fullcalendar/main.css new file mode 100644 index 0000000000..46ef363f43 --- /dev/null +++ b/pandora_console/include/javascript/fullcalendar/main.css @@ -0,0 +1,1439 @@ +/* classes attached to */ +/* TODO: make fc-event selector work when calender in shadow DOM */ +.fc-not-allowed, +.fc-not-allowed .fc-event { + /* override events' custom cursors */ + cursor: not-allowed; +} + +/* TODO: not attached to body. attached to specific els. move */ +.fc-unselectable { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-touch-callout: none; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +.fc { + /* layout of immediate children */ + display: flex; + flex-direction: column; + + font-size: 1em; +} +.fc, +.fc *, +.fc *:before, +.fc *:after { + box-sizing: border-box; +} +.fc table { + border-collapse: collapse; + border-spacing: 0; + font-size: 1em; /* normalize cross-browser */ +} +.fc th { + text-align: center; +} +.fc th, +.fc td { + vertical-align: top; + padding: 0; +} +.fc a[data-navlink] { + cursor: pointer; +} +.fc a[data-navlink]:hover { + text-decoration: underline; +} +.fc-direction-ltr { + direction: ltr; + text-align: left; +} +.fc-direction-rtl { + direction: rtl; + text-align: right; +} +.fc-theme-standard td, +.fc-theme-standard th { + border: 1px solid #ddd; + border: 1px solid var(--fc-border-color, #ddd); +} +/* for FF, which doesn't expand a 100% div within a table cell. use absolute positioning */ +/* inner-wrappers are responsible for being absolute */ +/* TODO: best place for this? */ +.fc-liquid-hack td, +.fc-liquid-hack th { + position: relative; +} + +@font-face { + font-family: "fcicons"; + src: url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBfAAAAC8AAAAYGNtYXAXVtKNAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZgYydxIAAAF4AAAFNGhlYWQUJ7cIAAAGrAAAADZoaGVhB20DzAAABuQAAAAkaG10eCIABhQAAAcIAAAALGxvY2ED4AU6AAAHNAAAABhtYXhwAA8AjAAAB0wAAAAgbmFtZXsr690AAAdsAAABhnBvc3QAAwAAAAAI9AAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpBgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Qb//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAWIAjQKeAskAEwAAJSc3NjQnJiIHAQYUFwEWMjc2NCcCnuLiDQ0MJAz/AA0NAQAMJAwNDcni4gwjDQwM/wANIwz/AA0NDCMNAAAAAQFiAI0CngLJABMAACUBNjQnASYiBwYUHwEHBhQXFjI3AZ4BAA0N/wAMJAwNDeLiDQ0MJAyNAQAMIw0BAAwMDSMM4uINIwwNDQAAAAIA4gC3Ax4CngATACcAACUnNzY0JyYiDwEGFB8BFjI3NjQnISc3NjQnJiIPAQYUHwEWMjc2NCcB87e3DQ0MIw3VDQ3VDSMMDQ0BK7e3DQ0MJAzVDQ3VDCQMDQ3zuLcMJAwNDdUNIwzWDAwNIwy4twwkDA0N1Q0jDNYMDA0jDAAAAgDiALcDHgKeABMAJwAAJTc2NC8BJiIHBhQfAQcGFBcWMjchNzY0LwEmIgcGFB8BBwYUFxYyNwJJ1Q0N1Q0jDA0Nt7cNDQwjDf7V1Q0N1QwkDA0Nt7cNDQwkDLfWDCMN1Q0NDCQMt7gMIw0MDNYMIw3VDQ0MJAy3uAwjDQwMAAADAFUAAAOrA1UAMwBoAHcAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMhMjY1NCYjISIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAAVYRGRkR/qoRGRkRA1UFBAUOCQkVDAsZDf2rDRkLDBUJCA4FBQUFBQUOCQgVDAsZDQJVDRkLDBUJCQ4FBAVVAgECBQMCBwQECAX9qwQJAwQHAwMFAQICAgIBBQMDBwQDCQQCVQUIBAQHAgMFAgEC/oAZEhEZGRESGQAAAAADAFUAAAOrA1UAMwBoAIkAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMzFRQWMzI2PQEzMjY1NCYrATU0JiMiBh0BIyIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAgBkSEhmAERkZEYAZEhIZgBEZGREDVQUEBQ4JCRUMCxkN/asNGQsMFQkIDgUFBQUFBQ4JCBUMCxkNAlUNGQsMFQkJDgUEBVUCAQIFAwIHBAQIBf2rBAkDBAcDAwUBAgICAgEFAwMHBAMJBAJVBQgEBAcCAwUCAQL+gIASGRkSgBkSERmAEhkZEoAZERIZAAABAOIAjQMeAskAIAAAExcHBhQXFjI/ARcWMjc2NC8BNzY0JyYiDwEnJiIHBhQX4uLiDQ0MJAzi4gwkDA0N4uINDQwkDOLiDCQMDQ0CjeLiDSMMDQ3h4Q0NDCMN4uIMIw0MDOLiDAwNIwwAAAABAAAAAQAAa5n0y18PPPUACwQAAAAAANivOVsAAAAA2K85WwAAAAADqwNVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOrAAEAAAAAAAAAAAAAAAAAAAALBAAAAAAAAAAAAAAAAgAAAAQAAWIEAAFiBAAA4gQAAOIEAABVBAAAVQQAAOIAAAAAAAoAFAAeAEQAagCqAOoBngJkApoAAQAAAAsAigADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGZjaWNvbnMAZgBjAGkAYwBvAG4Ac1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGZjaWNvbnMAZgBjAGkAYwBvAG4Ac2ZjaWNvbnMAZgBjAGkAYwBvAG4Ac1JlZ3VsYXIAUgBlAGcAdQBsAGEAcmZjaWNvbnMAZgBjAGkAYwBvAG4Ac0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") + format("truetype"); + font-weight: normal; + font-style: normal; +} + +.fc-icon { + /* added for fc */ + display: inline-block; + width: 1em; + height: 1em; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: "fcicons" !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.fc-icon-chevron-left:before { + content: "\e900"; +} + +.fc-icon-chevron-right:before { + content: "\e901"; +} + +.fc-icon-chevrons-left:before { + content: "\e902"; +} + +.fc-icon-chevrons-right:before { + content: "\e903"; +} + +.fc-icon-minus-square:before { + content: "\e904"; +} + +.fc-icon-plus-square:before { + content: "\e905"; +} + +.fc-icon-x:before { + content: "\e906"; +} +/* +Lots taken from Flatly (MIT): https://bootswatch.com/4/flatly/bootstrap.css + +These styles only apply when the standard-theme is activated. +When it's NOT activated, the fc-button classes won't even be in the DOM. +*/ +.fc { + /* reset */ +} +.fc .fc-button { + border-radius: 0; + overflow: visible; + text-transform: none; + margin: 0; + font-family: inherit; + font-size: inherit; + line-height: inherit; +} +.fc .fc-button:focus { + outline: 1px dotted; + outline: 5px auto -webkit-focus-ring-color; +} +.fc .fc-button { + -webkit-appearance: button; +} +.fc .fc-button:not(:disabled) { + cursor: pointer; +} +.fc .fc-button::-moz-focus-inner { + padding: 0; + border-style: none; +} +.fc { + /* theme */ +} +.fc .fc-button { + display: inline-block; + font-weight: 400; + text-align: center; + vertical-align: middle; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-color: transparent; + border: 1px solid transparent; + padding: 0.4em 0.65em; + font-size: 1em; + line-height: 1.5; + border-radius: 0.25em; +} +.fc .fc-button:hover { + text-decoration: none; +} +.fc .fc-button:focus { + outline: 0; + box-shadow: 0 0 0 0.2rem rgba(44, 62, 80, 0.25); +} +.fc .fc-button:disabled { + opacity: 0.65; +} +.fc { + /* "primary" coloring */ +} +.fc .fc-button-primary { + color: #fff; + color: var(--fc-button-text-color, #fff); + background-color: #2c3e50; + background-color: var(--fc-button-bg-color, #2c3e50); + border-color: #2c3e50; + border-color: var(--fc-button-border-color, #2c3e50); +} +.fc .fc-button-primary:hover { + color: #fff; + color: var(--fc-button-text-color, #fff); + background-color: #1e2b37; + background-color: var(--fc-button-hover-bg-color, #1e2b37); + border-color: #1a252f; + border-color: var(--fc-button-hover-border-color, #1a252f); +} +.fc .fc-button-primary:disabled { + /* not DRY */ + color: #fff; + color: var(--fc-button-text-color, #fff); + background-color: #2c3e50; + background-color: var(--fc-button-bg-color, #2c3e50); + border-color: #2c3e50; + border-color: var(--fc-button-border-color, #2c3e50); /* overrides :hover */ +} +.fc .fc-button-primary:focus { + box-shadow: 0 0 0 0.2rem rgba(76, 91, 106, 0.5); +} +.fc .fc-button-primary:not(:disabled):active, +.fc .fc-button-primary:not(:disabled).fc-button-active { + color: #fff; + color: var(--fc-button-text-color, #fff); + background-color: #1a252f; + background-color: var(--fc-button-active-bg-color, #1a252f); + border-color: #151e27; + border-color: var(--fc-button-active-border-color, #151e27); +} +.fc .fc-button-primary:not(:disabled):active:focus, +.fc .fc-button-primary:not(:disabled).fc-button-active:focus { + box-shadow: 0 0 0 0.2rem rgba(76, 91, 106, 0.5); +} +.fc { + /* icons within buttons */ +} +.fc .fc-button .fc-icon { + vertical-align: middle; + font-size: 1.5em; /* bump up the size (but don't make it bigger than line-height of button, which is 1.5em also) */ +} +.fc .fc-button-group { + position: relative; + display: inline-flex; + vertical-align: middle; +} +.fc .fc-button-group > .fc-button { + position: relative; + flex: 1 1 auto; +} +.fc .fc-button-group > .fc-button:hover { + z-index: 1; +} +.fc .fc-button-group > .fc-button:focus, +.fc .fc-button-group > .fc-button:active, +.fc .fc-button-group > .fc-button.fc-button-active { + z-index: 1; +} +.fc-direction-ltr .fc-button-group > .fc-button:not(:first-child) { + margin-left: -1px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.fc-direction-ltr .fc-button-group > .fc-button:not(:last-child) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.fc-direction-rtl .fc-button-group > .fc-button:not(:first-child) { + margin-right: -1px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} +.fc-direction-rtl .fc-button-group > .fc-button:not(:last-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} +.fc .fc-toolbar { + display: flex; + justify-content: space-between; + align-items: center; +} +.fc .fc-toolbar.fc-header-toolbar { + margin-bottom: 1.5em; +} +.fc .fc-toolbar.fc-footer-toolbar { + margin-top: 1.5em; +} +.fc .fc-toolbar-title { + font-size: 1.75em; + margin: 0; +} +.fc-direction-ltr .fc-toolbar > * > :not(:first-child) { + margin-left: 0.75em; /* space between */ +} +.fc-direction-rtl .fc-toolbar > * > :not(:first-child) { + margin-right: 0.75em; /* space between */ +} +.fc-direction-rtl .fc-toolbar-ltr { + /* when the toolbar-chunk positioning system is explicitly left-to-right */ + flex-direction: row-reverse; +} +.fc .fc-scroller { + -webkit-overflow-scrolling: touch; + position: relative; /* for abs-positioned elements within */ +} +.fc .fc-scroller-liquid { + height: 100%; +} +.fc .fc-scroller-liquid-absolute { + position: absolute; + top: 0; + right: 0; + left: 0; + bottom: 0; +} +.fc .fc-scroller-harness { + position: relative; + overflow: hidden; + direction: ltr; + /* hack for chrome computing the scroller's right/left wrong for rtl. undone below... */ + /* TODO: demonstrate in codepen */ +} +.fc .fc-scroller-harness-liquid { + height: 100%; +} +.fc-direction-rtl .fc-scroller-harness > .fc-scroller { + /* undo above hack */ + direction: rtl; +} +.fc-theme-standard .fc-scrollgrid { + border: 1px solid #ddd; + border: 1px solid var(--fc-border-color, #ddd); /* bootstrap does this. match */ +} +.fc .fc-scrollgrid, +.fc .fc-scrollgrid table { + /* all tables (self included) */ + width: 100%; /* because tables don't normally do this */ + table-layout: fixed; +} +.fc .fc-scrollgrid table { + /* inner tables */ + border-top-style: hidden; + border-left-style: hidden; + border-right-style: hidden; +} +.fc .fc-scrollgrid { + border-collapse: separate; + border-right-width: 0; + border-bottom-width: 0; +} +.fc .fc-scrollgrid-liquid { + height: 100%; +} +.fc .fc-scrollgrid-section { + /* a */ + height: 1px; /* better than 0, for firefox */ +} +.fc .fc-scrollgrid-section > td { + height: 1px; /* needs a height so inner div within grow. better than 0, for firefox */ +} +.fc .fc-scrollgrid-section table { + height: 1px; + /* for most browsers, if a height isn't set on the table, can't do liquid-height within cells */ + /* serves as a min-height. harmless */ +} +.fc .fc-scrollgrid-section-liquid > td { + height: 100%; /* better than `auto`, for firefox */ +} +.fc .fc-scrollgrid-section > * { + border-top-width: 0; + border-left-width: 0; +} +.fc .fc-scrollgrid-section-header > *, +.fc .fc-scrollgrid-section-footer > * { + border-bottom-width: 0; +} +.fc .fc-scrollgrid-section-body table, +.fc .fc-scrollgrid-section-footer table { + border-bottom-style: hidden; /* head keeps its bottom border tho */ +} +.fc { + /* stickiness */ +} +.fc .fc-scrollgrid-section-sticky > * { + background: #fff; + background: var(--fc-page-bg-color, #fff); + position: sticky; + z-index: 3; /* TODO: var */ + /* TODO: box-shadow when sticking */ +} +.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky > * { + top: 0; /* because border-sharing causes a gap at the top */ + /* TODO: give safari -1. has bug */ +} +.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky > * { + bottom: 0; /* known bug: bottom-stickiness doesn't work in safari */ +} +.fc .fc-scrollgrid-sticky-shim { + /* for horizontal scrollbar */ + height: 1px; /* needs height to create scrollbars */ + margin-bottom: -1px; +} +.fc-sticky { + /* no .fc wrap because used as child of body */ + position: sticky; +} +.fc .fc-view-harness { + flex-grow: 1; /* because this harness is WITHIN the .fc's flexbox */ + position: relative; +} +.fc { + /* when the harness controls the height, make the view liquid */ +} +.fc .fc-view-harness-active > .fc-view { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} +.fc .fc-col-header-cell-cushion { + display: inline-block; /* x-browser for when sticky (when multi-tier header) */ + padding: 2px 4px; +} +.fc .fc-bg-event, +.fc .fc-non-business, +.fc .fc-highlight { + /* will always have a harness with position:relative/absolute, so absolutely expand */ + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} +.fc .fc-non-business { + background: rgba(215, 215, 215, 0.3); + background: var(--fc-non-business-color, rgba(215, 215, 215, 0.3)); +} +.fc .fc-bg-event { + background: rgb(143, 223, 130); + background: var(--fc-bg-event-color, rgb(143, 223, 130)); + opacity: 0.3; + opacity: var(--fc-bg-event-opacity, 0.3); +} +.fc .fc-bg-event .fc-event-title { + margin: 0.5em; + font-size: 0.85em; + font-size: var(--fc-small-font-size, 0.85em); + font-style: italic; +} +.fc .fc-highlight { + background: rgba(188, 232, 241, 0.3); + background: var(--fc-highlight-color, rgba(188, 232, 241, 0.3)); +} +.fc .fc-cell-shaded, +.fc .fc-day-disabled { + background: rgba(208, 208, 208, 0.3); + background: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3)); +} +/* link resets */ +/* ---------------------------------------------------------------------------------------------------- */ +a.fc-event, +a.fc-event:hover { + text-decoration: none; +} +/* cursor */ +.fc-event[href], +.fc-event.fc-event-draggable { + cursor: pointer; +} +/* event text content */ +/* ---------------------------------------------------------------------------------------------------- */ +.fc-event .fc-event-main { + position: relative; + z-index: 2; +} +/* dragging */ +/* ---------------------------------------------------------------------------------------------------- */ +.fc-event-dragging:not(.fc-event-selected) { + /* MOUSE */ + opacity: 0.75; +} +.fc-event-dragging.fc-event-selected { + /* TOUCH */ + box-shadow: 0 2px 7px rgba(0, 0, 0, 0.3); +} +/* resizing */ +/* ---------------------------------------------------------------------------------------------------- */ +/* (subclasses should hone positioning for touch and non-touch) */ +.fc-event .fc-event-resizer { + display: none; + position: absolute; + z-index: 4; +} +.fc-event:hover, /* MOUSE */ +.fc-event-selected { + /* TOUCH */ +} +.fc-event:hover .fc-event-resizer, +.fc-event-selected .fc-event-resizer { + display: block; +} +.fc-event-selected .fc-event-resizer { + border-radius: 4px; + border-radius: calc(var(--fc-event-resizer-dot-total-width, 8px) / 2); + border-width: 1px; + border-width: var(--fc-event-resizer-dot-border-width, 1px); + width: 8px; + width: var(--fc-event-resizer-dot-total-width, 8px); + height: 8px; + height: var(--fc-event-resizer-dot-total-width, 8px); + border-style: solid; + border-color: inherit; + background: #fff; + background: var(--fc-page-bg-color, #fff); + + /* expand hit area */ +} +.fc-event-selected .fc-event-resizer:before { + content: ""; + position: absolute; + top: -20px; + left: -20px; + right: -20px; + bottom: -20px; +} +/* selecting (always TOUCH) */ +/* OR, focused by tab-index */ +/* (TODO: maybe not the best focus-styling for .fc-daygrid-dot-event) */ +/* ---------------------------------------------------------------------------------------------------- */ +.fc-event-selected, +.fc-event:focus { + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); + + /* expand hit area (subclasses should expand) */ +} +.fc-event-selected:before, +.fc-event:focus:before { + content: ""; + position: absolute; + z-index: 3; + top: 0; + left: 0; + right: 0; + bottom: 0; +} +.fc-event-selected, +.fc-event:focus { + /* dimmer effect */ +} +.fc-event-selected:after, +.fc-event:focus:after { + content: ""; + background: rgba(0, 0, 0, 0.25); + background: var(--fc-event-selected-overlay-color, rgba(0, 0, 0, 0.25)); + position: absolute; + z-index: 1; + + /* assume there's a border on all sides. overcome it. */ + /* sometimes there's NOT a border, in which case the dimmer will go over */ + /* an adjacent border, which looks fine. */ + top: -1px; + left: -1px; + right: -1px; + bottom: -1px; +} +/* +A HORIZONTAL event +*/ +.fc-h-event { + /* allowed to be top-level */ + display: block; + border: 1px solid #3788d8; + border: 1px solid var(--fc-event-border-color, #3788d8); + background-color: #3788d8; + background-color: var(--fc-event-bg-color, #3788d8); +} +.fc-h-event .fc-event-main { + color: #fff; + color: var(--fc-event-text-color, #fff); +} +.fc-h-event .fc-event-main-frame { + display: flex; /* for make fc-event-title-container expand */ +} +.fc-h-event .fc-event-time { + max-width: 100%; /* clip overflow on this element */ + overflow: hidden; +} +.fc-h-event .fc-event-title-container { + /* serves as a container for the sticky cushion */ + flex-grow: 1; + flex-shrink: 1; + min-width: 0; /* important for allowing to shrink all the way */ +} +.fc-h-event .fc-event-title { + display: inline-block; /* need this to be sticky cross-browser */ + vertical-align: top; /* for not messing up line-height */ + left: 0; /* for sticky */ + right: 0; /* for sticky */ + max-width: 100%; /* clip overflow on this element */ + overflow: hidden; +} +.fc-h-event.fc-event-selected:before { + /* expand hit area */ + top: -10px; + bottom: -10px; +} +/* adjust border and border-radius (if there is any) for non-start/end */ +.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start), +.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + border-left-width: 0; +} +.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end), +.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right-width: 0; +} +/* resizers */ +.fc-h-event:not(.fc-event-selected) .fc-event-resizer { + top: 0; + bottom: 0; + width: 8px; + width: var(--fc-event-resizer-thickness, 8px); +} +.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start, +.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end { + cursor: w-resize; + left: -4px; + left: calc(-0.5 * var(--fc-event-resizer-thickness, 8px)); +} +.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end, +.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start { + cursor: e-resize; + right: -4px; + right: calc(-0.5 * var(--fc-event-resizer-thickness, 8px)); +} +/* resizers for TOUCH */ +.fc-h-event.fc-event-selected .fc-event-resizer { + top: 50%; + margin-top: -4px; + margin-top: calc(-0.5 * var(--fc-event-resizer-dot-total-width, 8px)); +} +.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start, +.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end { + left: -4px; + left: calc(-0.5 * var(--fc-event-resizer-dot-total-width, 8px)); +} +.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end, +.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start { + right: -4px; + right: calc(-0.5 * var(--fc-event-resizer-dot-total-width, 8px)); +} +.fc .fc-popover { + position: absolute; + z-index: 9999; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); +} +.fc .fc-popover-header { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + padding: 3px 4px; +} +.fc .fc-popover-title { + margin: 0 2px; +} +.fc .fc-popover-close { + cursor: pointer; + opacity: 0.65; + font-size: 1.1em; +} +.fc-theme-standard .fc-popover { + border: 1px solid #ddd; + border: 1px solid var(--fc-border-color, #ddd); + background: #fff; + background: var(--fc-page-bg-color, #fff); +} +.fc-theme-standard .fc-popover-header { + background: rgba(208, 208, 208, 0.3); + background: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3)); +} + +:root { + --fc-daygrid-event-dot-width: 8px; +} +/* help things clear margins of inner content */ +.fc-daygrid-day-frame, +.fc-daygrid-day-events, +.fc-daygrid-event-harness { + /* for event top/bottom margins */ +} +.fc-daygrid-day-frame:before, +.fc-daygrid-day-events:before, +.fc-daygrid-event-harness:before { + content: ""; + clear: both; + display: table; +} +.fc-daygrid-day-frame:after, +.fc-daygrid-day-events:after, +.fc-daygrid-event-harness:after { + content: ""; + clear: both; + display: table; +} +.fc .fc-daygrid-body { + /* a
that wraps the table */ + position: relative; + z-index: 1; /* container inner z-index's because
s can't do it */ +} +.fc .fc-daygrid-day.fc-day-today { + background-color: rgba(255, 220, 40, 0.15); + background-color: var(--fc-today-bg-color, rgba(255, 220, 40, 0.15)); +} +.fc .fc-daygrid-day-frame { + position: relative; + min-height: 100%; /* seems to work better than `height` because sets height after rows/cells naturally do it */ +} +.fc { + /* cell top */ +} +.fc .fc-daygrid-day-top { + display: flex; + flex-direction: row-reverse; +} +.fc .fc-day-other .fc-daygrid-day-top { + opacity: 0.3; +} +.fc { + /* day number (within cell top) */ +} +.fc .fc-daygrid-day-number { + position: relative; + z-index: 4; + padding: 4px; +} +.fc { + /* event container */ +} +.fc .fc-daygrid-day-events { + margin-top: 1px; /* needs to be margin, not padding, so that available cell height can be computed */ +} +.fc { + /* positioning for balanced vs natural */ +} +.fc .fc-daygrid-body-balanced .fc-daygrid-day-events { + position: absolute; + left: 0; + right: 0; +} +.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events { + position: relative; /* for containing abs positioned event harnesses */ + min-height: 2em; /* in addition to being a min-height during natural height, equalizes the heights a little bit */ +} +.fc .fc-daygrid-body-natural { + /* can coexist with -unbalanced */ +} +.fc .fc-daygrid-body-natural .fc-daygrid-day-events { + margin-bottom: 1em; +} +.fc { + /* event harness */ +} +.fc .fc-daygrid-event-harness { + position: relative; +} +.fc .fc-daygrid-event-harness-abs { + position: absolute; + top: 0; /* fallback coords for when cannot yet be computed */ + left: 0; /* */ + right: 0; /* */ +} +.fc .fc-daygrid-bg-harness { + position: absolute; + top: 0; + bottom: 0; +} +.fc { + /* bg content */ +} +.fc .fc-daygrid-day-bg .fc-non-business { + z-index: 1; +} +.fc .fc-daygrid-day-bg .fc-bg-event { + z-index: 2; +} +.fc .fc-daygrid-day-bg .fc-highlight { + z-index: 3; +} +.fc { + /* events */ +} +.fc .fc-daygrid-event { + z-index: 6; + margin-top: 1px; +} +.fc .fc-daygrid-event.fc-event-mirror { + z-index: 7; +} +.fc { + /* cell bottom (within day-events) */ +} +.fc .fc-daygrid-day-bottom { + font-size: 0.85em; + padding: 2px 3px 0; +} +.fc .fc-daygrid-day-bottom:before { + content: ""; + clear: both; + display: table; +} +.fc .fc-daygrid-more-link { + position: relative; + z-index: 4; + cursor: pointer; +} +.fc { + /* week number (within frame) */ +} +.fc .fc-daygrid-week-number { + position: absolute; + z-index: 5; + top: 0; + padding: 2px; + min-width: 1.5em; + text-align: center; + background-color: rgba(208, 208, 208, 0.3); + background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3)); + color: #808080; + color: var(--fc-neutral-text-color, #808080); +} +.fc { + /* popover */ +} +.fc .fc-more-popover .fc-popover-body { + min-width: 220px; + padding: 10px; +} +.fc-direction-ltr .fc-daygrid-event.fc-event-start, +.fc-direction-rtl .fc-daygrid-event.fc-event-end { + margin-left: 2px; +} +.fc-direction-ltr .fc-daygrid-event.fc-event-end, +.fc-direction-rtl .fc-daygrid-event.fc-event-start { + margin-right: 2px; +} +.fc-direction-ltr .fc-daygrid-week-number { + left: 0; + border-radius: 0 0 3px 0; +} +.fc-direction-rtl .fc-daygrid-week-number { + right: 0; + border-radius: 0 0 0 3px; +} +.fc-liquid-hack .fc-daygrid-day-frame { + position: static; /* will cause inner absolute stuff to expand to \s*$/g, +jQuery.extend( { - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "
", "
" ], - tr: [ 2, "", "
" ], - col: [ 2, "", "
" ], - td: [ 3, "", "
" ], + Deferred: function( func ) { + var tuples = [ - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; -jQuery.fn.extend({ - text: function( value ) { - return jQuery.access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( _i, tuple ) { - wrapAll: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapAll( html.call(this, i) ); - }); - } + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; - if ( this[0].parentNode ) { - wrap.insertBefore( this[0] ); - } + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } - wrap.map(function() { - var elem = this; + returned = handler.apply( that, args ); - while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { - elem = elem.firstChild; - } + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } - return elem; - }).append( this ); - } + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && - return this; - }, + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapInner( html.call(this, i) ); - }); - } + // Handle a returned thenable + if ( isFunction( then ) ) { - return this.each(function() { - var self = jQuery( this ), - contents = self.contents(); + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); - if ( contents.length ) { - contents.wrapAll( html ); + // Normal processors (resolve) also hook into progress + } else { - } else { - self.append( html ); - } - }); - }, + // ...and disregard older resolution values + maxDepth++; - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } - return this.each(function(i) { - jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); - }); - }, + // Handle all other returned values + } else { - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); - }, + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } - append: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.appendChild( elem ); - } - }); - }, + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, - prepend: function() { - return this.domManip(arguments, true, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.insertBefore( elem, this.firstChild ); - } - }); - }, + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { - before: function() { - return this.domManip( arguments, false, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } - after: function() { - return this.domManip( arguments, false, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { - // keepData is for internal use only--do not document - remove: function( selector, keepData ) { - var elem, - i = 0; + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } - for ( ; (elem = this[i]) != null; i++ ) { - if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) { - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } + deferred.rejectWith( that, args ); + } + } + }; - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function () { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return jQuery.access( this, function( value ) { - var elem = this[0] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function( value ) { - var isFunc = jQuery.isFunction( value ); - - // Make sure that the elements are removed from the DOM before they are inserted - // this can help fix replacing a parent with child elements - if ( !isFunc && typeof value !== "string" ) { - value = jQuery( value ).not( this ).detach(); - } - - return this.domManip( [ value ], true, function( elem ) { - var next = this.nextSibling, - parent = this.parentNode; - - if ( parent ) { - jQuery( this ).remove(); - parent.insertBefore( elem, next ); - } - }); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, table, callback ) { - - // Flatten any nested arrays - args = core_concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, table ? self.html() : undefined ); - } - self.domManip( args, table, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - table = table && jQuery.nodeName( first, "tr" ); - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( - table && jQuery.nodeName( this[i], "table" ) ? - findOrAppend( this[i], "tbody" ) : - this[i], - node, - i - ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Hope ajax is available... - jQuery.ajax({ - url: node.src, - type: "GET", - dataType: "script", - async: false, - global: false, - "throws": true - }); + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the primary Deferred + primary = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + primary.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( primary.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return primary.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); + } + + return primary.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, _key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( _all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); } } } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; } - // Fix #11809: Avoid leaking memory - fragment = first = null; + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var documentElement = document.documentElement; + + + + var isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ); + }, + composed = { composed: true }; + + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only + // Check attachment across shadow DOM boundaries when possible (gh-3504) + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { + isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ) || + elem.getRootNode( composed ) === elem.ownerDocument; + }; + } +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + isAttached( elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // Support: IE <=9 only + // IE <=9 replaces "; + support.option = !!div.lastChild; +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: IE <=9 only +if ( !support.option ) { + wrapMap.optgroup = wrapMap.option = [ 1, "" ]; +} + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, attached, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + attached = isAttached( elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( attached ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 - 11+ +// focus() and blur() are asynchronous, except when they are no-op. +// So expect focus to be synchronous when the element is already active, +// and blur to be synchronous when the element is not already active. +// (focus and blur are always synchronous in other supported browsers, +// this just defines when we can count on it). +function expectSync( elem, type ) { + return ( elem === safeActiveElement() ) === ( type === "focus" ); +} + +// Support: IE <=9 only +// Accessing document.activeElement can throw unexpectedly +// https://bugs.jquery.com/ticket/13393 +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Only attach events to objects that accept data + if ( !acceptData( elem ) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = Object.create( null ); + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; } } - return this; - } -}); + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, -function findOrAppend( elem, tag ) { - return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) ); + dispatch: function( nativeEvent ) { + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), + + handlers = ( + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // If the event is namespaced, then each handler is only invoked if it is + // specially universal or its namespaces are a superset of the event's. + if ( !event.rnamespace || handleObj.namespace === false || + event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + click: { + + // Utilize native event to ensure correct state for checkable inputs + setup: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Claim the first handler + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + // dataPriv.set( el, "click", ... ) + leverageNative( el, "click", returnTrue ); + } + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Force setup before triggering a click + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + leverageNative( el, "click" ); + } + + // Return non-false to allow normal event-path propagation + return true; + }, + + // For cross-browser consistency, suppress native .click() on links + // Also prevent it if we're currently inside a leveraged native-event stack + _default: function( event ) { + var target = event.target; + return rcheckableType.test( target.type ) && + target.click && nodeName( target, "input" ) && + dataPriv.get( target, "click" ) || + nodeName( target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +// Ensure the presence of an event listener that handles manually-triggered +// synthetic events by interrupting progress until reinvoked in response to +// *native* events that it fires directly, ensuring that state changes have +// already occurred before other listeners are invoked. +function leverageNative( el, type, expectSync ) { + + // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add + if ( !expectSync ) { + if ( dataPriv.get( el, type ) === undefined ) { + jQuery.event.add( el, type, returnTrue ); + } + return; + } + + // Register the controller as a special universal handler for all event namespaces + dataPriv.set( el, type, false ); + jQuery.event.add( el, type, { + namespace: false, + handler: function( event ) { + var notAsync, result, + saved = dataPriv.get( this, type ); + + if ( ( event.isTrigger & 1 ) && this[ type ] ) { + + // Interrupt processing of the outer synthetic .trigger()ed event + // Saved data should be false in such cases, but might be a leftover capture object + // from an async native handler (gh-4350) + if ( !saved.length ) { + + // Store arguments for use when handling the inner native event + // There will always be at least one argument (an event object), so this array + // will not be confused with a leftover capture object. + saved = slice.call( arguments ); + dataPriv.set( this, type, saved ); + + // Trigger the native event and capture its result + // Support: IE <=9 - 11+ + // focus() and blur() are asynchronous + notAsync = expectSync( this, type ); + this[ type ](); + result = dataPriv.get( this, type ); + if ( saved !== result || notAsync ) { + dataPriv.set( this, type, false ); + } else { + result = {}; + } + if ( saved !== result ) { + + // Cancel the outer synthetic event + event.stopImmediatePropagation(); + event.preventDefault(); + + // Support: Chrome 86+ + // In Chrome, if an element having a focusout handler is blurred by + // clicking outside of it, it invokes the handler synchronously. If + // that handler calls `.remove()` on the element, the data is cleared, + // leaving `result` undefined. We need to guard against this. + return result && result.value; + } + + // If this is an inner synthetic event for an event with a bubbling surrogate + // (focus or blur), assume that the surrogate already propagated from triggering the + // native event and prevent that from happening again here. + // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the + // bubbling surrogate propagates *after* the non-bubbling base), but that seems + // less bad than duplication. + } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { + event.stopPropagation(); + } + + // If this is a native event triggered above, everything is now in order + // Fire an inner synthetic event with the original arguments + } else if ( saved.length ) { + + // ...and capture the result + dataPriv.set( this, type, { + value: jQuery.event.trigger( + + // Support: IE <=9 - 11+ + // Extend with the prototype to reset the above stopImmediatePropagation() + jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), + saved.slice( 1 ), + this + ) + } ); + + // Abort handling of the native event + event.stopImmediatePropagation(); + } + } + } ); +} + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + code: true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + which: true +}, jQuery.event.addProp ); + +jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { + jQuery.event.special[ type ] = { + + // Utilize native event if possible so blur/focus sequence is correct + setup: function() { + + // Claim the first handler + // dataPriv.set( this, "focus", ... ) + // dataPriv.set( this, "blur", ... ) + leverageNative( this, type, expectSync ); + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function() { + + // Force setup before trigger + leverageNative( this, type ); + + // Return non-false to allow normal event-path propagation + return true; + }, + + // Suppress native focus or blur as it's already being fired + // in leverageNative. + _default: function() { + return true; + }, + + delegateType: delegateType + }; +} ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { - var attr = elem.getAttributeNode("type"); - elem.type = ( attr && attr.specified ) + "/" + elem.type; + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); } else { - elem.removeAttribute("type"); + elem.removeAttribute( "type" ); } + return elem; } -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, udataOld, udataCur, events; - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } - nodeName = dest.nodeName.toLowerCase(); + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.get( src ); + events = pdataOld.events; - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); + if ( events ) { + dataPriv.remove( dest, "handle events" ); - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); } - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } + dataUser.set( dest, udataCur ); + } +} - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); - } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields + // Fails to return the selected option to the default selected state when cloning options } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; +function domManip( collection, args, callback, ignored ) { - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); + // Flatten any nested arrays + args = flat( args ); - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - core_push.apply( ret, elems.get() ); + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; } - return this.pushStack( ret ); - }; -}); + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl && !node.noModule ) { + jQuery._evalUrl( node.src, { + nonce: node.nonce || node.getAttribute( "nonce" ) + }, doc ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); + } + } + } } } } - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; + return collection; } -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( manipulation_rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); } - if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { + if ( node.parentNode ) { + if ( keepData && isAttached( node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html; + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = isAttached( elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); } } @@ -6414,8 +6172,8 @@ jQuery.extend({ srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); } } else { cloneCopyEvent( elem, clone ); @@ -6428,155 +6186,18 @@ jQuery.extend({ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } - destElements = srcElements = node = null; - // Return the cloned set return clone; }, - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, i = 0; - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !jQuery.support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
" && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !jQuery.support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = jQuery.support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { @@ -6589,145 +6210,926 @@ jQuery.extend({ } } - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== core_strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - core_deletedIds.push( id ); - } + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; } } } } -}); -var iframe, getStyles, curCSS, - ralpha = /alpha\([^)]*\)/i, - ropacity = /opacity\s*=\s*([^)]*)/, - rposition = /^(top|right|bottom|left)$/, - // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" - // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rmargin = /^margin/, - rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), - rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), - rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), - elemdisplay = { BODY: "block" }, +} ); - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: 0, - fontWeight: 400 +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); }, - cssExpand = [ "Top", "Right", "Bottom", "Left" ], - cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; + remove: function( selector ) { + return remove( this, selector ); + }, -// return a css property mapped to a potentially vendor prefixed property -function vendorPropName( style, name ) { + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, - // shortcut for names that are not vendor prefixed - if ( name in style ) { - return name; + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var swap = function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; } - // check for vendor prefixed names - var capName = name.charAt(0).toUpperCase() + name.slice(1), - origName = name, + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + // Support: Chrome <=64 + // Don't get tricked when zoom affects offsetWidth (gh-4029) + div.style.position = "absolute"; + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableTrDimensionsVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + }, + + // Support: IE 9 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Behavior in IE 9 is more subtle than in newer versions & it passes + // some versions of this test; make sure not to make it pass there! + // + // Support: Firefox 70+ + // Only Firefox includes border widths + // in computed dimensions. (gh-4529) + reliableTrDimensions: function() { + var table, tr, trChild, trStyle; + if ( reliableTrDimensionsVal == null ) { + table = document.createElement( "table" ); + tr = document.createElement( "tr" ); + trChild = document.createElement( "div" ); + + table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; + tr.style.cssText = "border:1px solid"; + + // Support: Chrome 86+ + // Height set through cssText does not get applied. + // Computed height then comes back as 0. + tr.style.height = "1px"; + trChild.style.height = "9px"; + + // Support: Android 8 Chrome 86+ + // In our bodyBackground.html iframe, + // display for all div elements is set to "inline", + // which causes a problem only in Android 8 Chrome 86. + // Ensuring the div is display: block + // gets around this issue. + trChild.style.display = "block"; + + documentElement + .appendChild( table ) + .appendChild( tr ) + .appendChild( trChild ); + + trStyle = window.getComputedStyle( tr ); + reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + + parseInt( trStyle.borderTopWidth, 10 ) + + parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; + + documentElement.removeChild( table ); + } + return reliableTrDimensionsVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !isAttached( elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style, + vendorProps = {}; + +// Return a vendor-prefixed property or undefined +function vendorPropName( name ) { + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; - if ( name in style ) { + if ( name in emptyStyle ) { return name; } } - - return origName; } -function isHidden( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); +// Return a potentially-mapped jQuery.cssProps or vendor prefixed property +function finalPropName( name ) { + var final = jQuery.cssProps[ name ] || vendorProps[ name ]; + + if ( final ) { + return final; + } + if ( name in emptyStyle ) { + return name; + } + return vendorProps[ name ] = vendorPropName( name ) || name; } -function showHide( elements, show ) { - var display, elem, hidden, - values = [], - index = 0, - length = elements.length; - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }; + +function setPositiveNumber( _elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); } - values[ index ] = jQuery._data( elem, "olddisplay" ); - display = elem.style.display; - if ( show ) { - // Reset the inline display of this element to learn if it is - // being hidden by cascaded rules or not - if ( !values[ index ] && display === "none" ) { - elem.style.display = ""; + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } - // Set elements which have been overridden with display: none - // in a stylesheet to whatever the default browser style is - // for such an element - if ( elem.style.display === "" && isHidden( elem ) ) { - values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); - } + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" } else { - if ( !values[ index ] ) { - hidden = isHidden( elem ); + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } - if ( display && display !== "none" || !hidden ) { - jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + + // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter + // Use an explicit zero to avoid NaN (gh-3964) + ) ) || 0; + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). + // Fake content-box until we know it's needed to know the true value. + boxSizingNeeded = !support.boxSizingReliable() || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox, + + val = curCSS( elem, dimension, styles ), + offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + + // Support: IE 9 - 11 only + // Use offsetWidth/offsetHeight for when box sizing is unreliable. + // In those cases, the computed value can be trusted to be border-box. + if ( ( !support.boxSizingReliable() && isBorderBox || + + // Support: IE 10 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Interestingly, in some cases IE 9 doesn't suffer from this issue. + !support.reliableTrDimensions() && nodeName( elem, "tr" ) || + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + val === "auto" || + + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && + + // Make sure the element is visible & connected + elem.getClientRects().length ) { + + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Where available, offsetWidth/offsetHeight approximate border box dimensions. + // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the + // retrieved value as a content box dimension. + valueIsBorderBox = offsetProp in elem; + if ( valueIsBorderBox ) { + val = elem[ offsetProp ]; + } + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; } } } - } + }, - // Set the display of most of the elements in a second loop - // to avoid the constant reflow - for ( index = 0; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "gridArea": true, + "gridColumn": true, + "gridColumnEnd": true, + "gridColumnStart": true, + "gridRow": true, + "gridRowEnd": true, + "gridRowStart": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; } - if ( !show || elem.style.display === "none" || elem.style.display === "" ) { - elem.style.display = show ? values[ index ] || "" : "none"; + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append + // "px" to a few hardcoded values. + if ( type === "number" && !isCustomProp ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( _i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + + // Only read styles.position if the test has a chance to fail + // to avoid forcing a reflow. + scrollboxSizeBuggy = !support.scrollboxSize() && + styles.position === "absolute", + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) + boxSizingNeeded = scrollboxSizeBuggy || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra ? + boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ) : + 0; + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && scrollboxSizeBuggy ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; } } +); - return elements; -} +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, -jQuery.fn.extend({ + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { css: function( name, value ) { - return jQuery.access( this, function( elem, name, value ) { - var len, styles, + return access( this, function( elem, name, value ) { + var styles, len, map = {}, i = 0; - if ( jQuery.isArray( name ) ) { + if ( Array.isArray( name ) ) { styles = getStyles( elem ); len = name.length; @@ -6742,2264 +7144,9 @@ jQuery.fn.extend({ jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); - }, - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - var bool = typeof state === "boolean"; - - return this.each(function() { - if ( bool ? state : isHidden( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - }); } -}); +} ); -jQuery.extend({ - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Exclude the following css properties to add px - cssNumber: { - "columnCount": true, - "fillOpacity": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - // normalize float css property - "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - style = elem.style; - - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // convert relative number strings (+= or -=) to relative numbers. #7345 - if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); - // Fixes bug #9237 - type = "number"; - } - - // Make sure that NaN and null values aren't set. See: #7116 - if ( value == null || type === "number" && isNaN( value ) ) { - return; - } - - // If a number was passed in, add 'px' to the (except for certain CSS properties) - if ( type === "number" && !jQuery.cssNumber[ origName ] ) { - value += "px"; - } - - // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, - // but it would mean to define eight (for every problematic property) identical functions - if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { - - // Wrapped to prevent IE from throwing errors when 'invalid' values are provided - // Fixes bug #5509 - try { - style[ name ] = value; - } catch(e) {} - } - - } else { - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var num, val, hooks, - origName = jQuery.camelCase( name ); - - // Make sure that we're working with the right name - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - //convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Return, converting to number if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; - } - return val; - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations - swap: function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; - } -}); - -// NOTE: we've included the "window" in window.getComputedStyle -// because jsdom on node.js will break without it. -if ( window.getComputedStyle ) { - getStyles = function( elem ) { - return window.getComputedStyle( elem, null ); - }; - - curCSS = function( elem, name, _computed ) { - var width, minWidth, maxWidth, - computed = _computed || getStyles( elem ), - - // getPropertyValue is only needed for .css('filter') in IE9, see #12537 - ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, - style = elem.style; - - if ( computed ) { - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right - // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values - if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret; - }; -} else if ( document.documentElement.currentStyle ) { - getStyles = function( elem ) { - return elem.currentStyle; - }; - - curCSS = function( elem, name, _computed ) { - var left, rs, rsLeft, - computed = _computed || getStyles( elem ), - ret = computed ? computed[ name ] : undefined, - style = elem.style; - - // Avoid setting ret to empty string here - // so we don't default to auto - if ( ret == null && style && style[ name ] ) { - ret = style[ name ]; - } - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - // but not position css attributes, as those are proportional to the parent element instead - // and we can't measure the parent instead because it might trigger a "stacking dolls" problem - if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { - - // Remember the original values - left = style.left; - rs = elem.runtimeStyle; - rsLeft = rs && rs.left; - - // Put in the new values to get a computed value out - if ( rsLeft ) { - rs.left = elem.currentStyle.left; - } - style.left = name === "fontSize" ? "1em" : ret; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - if ( rsLeft ) { - rs.left = rsLeft; - } - } - - return ret === "" ? "auto" : ret; - }; -} - -function setPositiveNumber( elem, value, subtract ) { - var matches = rnumsplit.exec( value ); - return matches ? - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i = extra === ( isBorderBox ? "border" : "content" ) ? - // If we already have the right measurement, avoid augmentation - 4 : - // Otherwise initialize for horizontal or vertical properties - name === "width" ? 1 : 0, - - val = 0; - - for ( ; i < 4; i += 2 ) { - // both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // at this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - // at this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // at this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with offset property, which is equivalent to the border-box value - var valueIsBorderBox = true, - val = name === "width" ? elem.offsetWidth : elem.offsetHeight, - styles = getStyles( elem ), - isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // some non-html elements return undefined for offsetWidth, so check for null/undefined - // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 - // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 - if ( val <= 0 || val == null ) { - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name, styles ); - if ( val < 0 || val == null ) { - val = elem.style[ name ]; - } - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test(val) ) { - return val; - } - - // we need the check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - } - - // use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -// Try to determine the default display value of an element -function css_defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - // Use the already-created iframe if possible - iframe = ( iframe || - jQuery("