diff --git a/pandora_agents/Dockerfile b/pandora_agents/Dockerfile new file mode 100644 index 0000000000..109718ae21 --- /dev/null +++ b/pandora_agents/Dockerfile @@ -0,0 +1,49 @@ +FROM centos:centos7 +MAINTAINER Pandora FMS Team + +# Add Pandora FMS agent installer +ADD unix /tmp/pandora_agent/unix + +# Install dependencies +RUN yum -y install \ + epel-release \ + unzip \ + perl \ + sed \ + "perl(Sys::Syslog)" + +# Install Pandora FMS agent +RUN cd /tmp/pandora_agent/unix \ + && ./pandora_agent_installer --install + +# Set default variables +ENV SERVER_IP '127.0.0.1' +ENV REMOTE_CONFIG '0' +ENV GROUP 'Servers' +ENV DEBUG '0' +ENV AGENT_NAME 'agent_docker' +ENV AGENT_ALIAS 'agent_docker' +ENV TIMEZONE 'UTC' +ENV SECONDARY_GROUPS '' + +# Create the entrypoint script. +RUN echo -e '#/bin/bash\n \ +sed -i "s/^server_ip.*$/server_ip $SERVER_IP/g" /etc/pandora/pandora_agent.conf\n \ +sed -i "s/^remote_config.*$/remote_config $REMOTE_CONFIG/g" /etc/pandora/pandora_agent.conf\n \ +sed -i "s/^group.*$/group $GROUP/g" /etc/pandora/pandora_agent.conf\n \ +sed -i "s/^debug.*$/debug $DEBUG/g" /etc/pandora/pandora_agent.conf\n \ +sed -i "s/^#agent_name.*$/agent_name $AGENT_NAME/g" /etc/pandora/pandora_agent.conf\n \ +sed -i "s/^#agent_alias.*$/agent_alias $AGENT_ALIAS/g" /etc/pandora/pandora_agent.conf\n \ +sed -i "s/^# secondary_groups.*$/secondary_groups $SECONDARY_GROUPS/g" /etc/pandora/pandora_agent.conf\n \ +if [ $TIMEZONE != "" ]; then\n \ +\tln -sfn /usr/share/zoneinfo/$TIMEZONE /etc/localtime\n \ +fi\n \ +/etc/init.d/pandora_agent_daemon start\n \ +rm -f $0\n \ +bash' \ +>> /entrypoint.sh && \ +chmod +x /entrypoint.sh + +# Entrypoint + CMD +ENTRYPOINT ["bash"] +CMD ["/entrypoint.sh"] \ No newline at end of file diff --git a/pandora_agents/build_agent_docker.sh b/pandora_agents/build_agent_docker.sh new file mode 100644 index 0000000000..0ebf8ac7a0 --- /dev/null +++ b/pandora_agents/build_agent_docker.sh @@ -0,0 +1,18 @@ +#!/bin/bash +source /root/code/pandorafms/extras/build_vars.sh + +# Set tag for docker build +if [ "$1" == "nightly" ]; then + LOCAL_VERSION="latest" +else + LOCAL_VERSION=$VERSION +fi + +# Build image with code +docker build --rm=true --pull --no-cache -t pandorafms/pandorafms-agent:$LOCAL_VERSION -f $CODEHOME/pandora_agents/Dockerfile $CODEHOME/pandora_agents/ + +# Push image +docker push pandorafms/pandorafms-agent:$LOCAL_VERSION + +# Delete local image +docker image rm -f pandorafms/pandorafms-agent:$LOCAL_VERSION \ No newline at end of file diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index 30fb45624c..11bf99754e 100644 --- a/pandora_agents/pc/AIX/pandora_agent.conf +++ b/pandora_agents/pc/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, AIX version +# Version 7.0NG.737, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index fc704fb87b..59e87c06e4 100644 --- a/pandora_agents/pc/FreeBSD/pandora_agent.conf +++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, FreeBSD Version +# Version 7.0NG.737, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf index 46789e8bea..dec50f14c7 100644 --- a/pandora_agents/pc/HP-UX/pandora_agent.conf +++ b/pandora_agents/pc/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, HP-UX Version +# Version 7.0NG.737, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index ce69b462a5..f2906ff164 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, GNU/Linux +# Version 7.0NG.737, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf index 904015a997..b50fee817f 100644 --- a/pandora_agents/pc/NT4/pandora_agent.conf +++ b/pandora_agents/pc/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, GNU/Linux +# Version 7.0NG.737, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf index d2d0661065..2cf60d6e84 100644 --- a/pandora_agents/pc/SunOS/pandora_agent.conf +++ b/pandora_agents/pc/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, Solaris Version +# Version 7.0NG.737, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index d0593ebcc9..eabd9e48b3 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2010 Artica Soluciones Tecnologicas -# Version 7.0NG.736 +# Version 7.0NG.737 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf index 74c397dc94..ca8612045f 100644 --- a/pandora_agents/shellscript/aix/pandora_agent.conf +++ b/pandora_agents/shellscript/aix/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.736, AIX version +# Version 7.0NG.737, AIX version # General Parameters # ================== diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf index b7a30f962e..2ffcd1c2f4 100644 --- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf +++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.736 +# Version 7.0NG.737 # FreeBSD/IPSO version # Licenced under GPL licence, 2003-2007 Sancho Lerena diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf index 9114cd7348..eac27f9483 100644 --- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf +++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.736, HPUX Version +# Version 7.0NG.737, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index 8eb9c0bbc8..2d3245b9b5 100644 --- a/pandora_agents/shellscript/linux/pandora_agent.conf +++ b/pandora_agents/shellscript/linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736 +# Version 7.0NG.737 # Licensed under GPL license v2, # (c) 2003-2010 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf index 24d44d51fc..8020dee1c9 100644 --- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf +++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736 +# Version 7.0NG.737 # Licensed under GPL license v2, # (c) 2003-2009 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf index a940b58a89..340a8babba 100644 --- a/pandora_agents/shellscript/openWRT/pandora_agent.conf +++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736 +# Version 7.0NG.737 # Licensed under GPL license v2, # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf index 13611f36c0..147dd9d695 100644 --- a/pandora_agents/shellscript/solaris/pandora_agent.conf +++ b/pandora_agents/shellscript/solaris/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.736, Solaris version +# Version 7.0NG.737, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index 6a826afd8b..ce61e6058b 100644 --- a/pandora_agents/unix/AIX/pandora_agent.conf +++ b/pandora_agents/unix/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, AIX version +# Version 7.0NG.737, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index de3a9012ff..df2edab7e3 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.736-190729 +Version: 7.0NG.737-190805 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 5c1e8cd0da..f3ae16bd2d 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.736-190729" +pandora_version="7.0NG.737-190805" 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/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 35a24de477..54066ef691 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, GNU/Linux +# Version 7.0NG.737, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf index fba8f9fa24..75973e7569 100644 --- a/pandora_agents/unix/FreeBSD/pandora_agent.conf +++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, FreeBSD Version +# Version 7.0NG.737, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf index 36164100be..b4a1403e15 100644 --- a/pandora_agents/unix/HP-UX/pandora_agent.conf +++ b/pandora_agents/unix/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, HP-UX Version +# Version 7.0NG.737, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 6012f59705..ac4febe435 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, GNU/Linux +# Version 7.0NG.737, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf index 300c03a3f5..0082f14fda 100644 --- a/pandora_agents/unix/NT4/pandora_agent.conf +++ b/pandora_agents/unix/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, GNU/Linux +# Version 7.0NG.737, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf index e899eed824..181f12dc34 100644 --- a/pandora_agents/unix/NetBSD/pandora_agent.conf +++ b/pandora_agents/unix/NetBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, NetBSD Version +# Version 7.0NG.737, NetBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf index be7904794d..a57865571f 100644 --- a/pandora_agents/unix/SunOS/pandora_agent.conf +++ b/pandora_agents/unix/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.736, Solaris Version +# Version 7.0NG.737, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 8a5f2462ca..76c41a8890 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,8 +41,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.736'; -use constant AGENT_BUILD => '190729'; +use constant AGENT_VERSION => '7.0NG.737'; +use constant AGENT_BUILD => '190805'; # 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 29bd544f5b..32ba5431b3 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.736 -%define release 190729 +%define version 7.0NG.737 +%define release 190805 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 63b84d80f6..9aebda3415 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.736 -%define release 190729 +%define version 7.0NG.737 +%define release 190805 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 6590dc8e02..e1299b9809 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -9,8 +9,8 @@ # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.736" -PI_BUILD="190729" +PI_VERSION="7.0NG.737" +PI_BUILD="190805" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index 9c2fe6d01d..93e2af2faa 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2017 Artica Soluciones Tecnologicas -# Version 7.0NG.736 +# Version 7.0NG.737 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cc88e5a01a..08a988d96f 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -3,7 +3,7 @@ AllowLanguageSelection {Yes} AppName -{Pandora FMS Windows Agent v7.0NG.736} +{Pandora FMS Windows Agent v7.0NG.737} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190729} +{190805} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 464b555618..2b8efa6ad2 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.736(Build 190729)") +#define PANDORA_VERSION ("7.0NG.737(Build 190805)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f1b4c00112..866a8c1f5e 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.736(Build 190729))" + VALUE "ProductVersion", "(7.0NG.737(Build 190805))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index bef84428e1..791d0421a3 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.736-190729 +Version: 7.0NG.737-190805 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 fca73b98b6..62c4b40819 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.736-190729" +pandora_version="7.0NG.737-190805" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/30.sql b/pandora_console/extras/mr/30.sql index 58abf6c562..84e5adfa3e 100644 --- a/pandora_console/extras/mr/30.sql +++ b/pandora_console/extras/mr/30.sql @@ -12,4 +12,40 @@ ALTER TABLE `tmodule_relationship` ADD COLUMN `type` ENUM('direct', 'failover') ALTER TABLE `treport_content` MODIFY COLUMN `name` varchar(300) NULL; -COMMIT; \ No newline at end of file +CREATE TABLE `tagent_repository` ( + `id` SERIAL, + `id_os` INT(10) UNSIGNED DEFAULT 0, + `arch` ENUM('x64', 'x86') DEFAULT 'x64', + `version` VARCHAR(10) DEFAULT '', + `path` text, + `uploaded_by` VARCHAR(100) DEFAULT '', + `uploaded` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was uploaded", + `last_err` text, + PRIMARY KEY (`id`), + FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `tdeployment_hosts` ( + `id` SERIAL, + `id_cs` VARCHAR(100), + `ip` VARCHAR(100) NOT NULL UNIQUE, + `id_os` INT(10) UNSIGNED DEFAULT 0, + `os_version` VARCHAR(100) DEFAULT '' COMMENT "OS version in STR format", + `arch` ENUM('x64', 'x86') DEFAULT 'x64', + `current_agent_version` VARCHAR(100) DEFAULT '' COMMENT "String latest installed agent", + `target_agent_version_id` BIGINT UNSIGNED, + `deployed` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was deployed", + `server_ip` varchar(100) default NULL COMMENT "Where to point target agent", + `last_err` text, + PRIMARY KEY (`id`), + FOREIGN KEY (`id_cs`) REFERENCES `tcredential_store`(`identifier`) + ON UPDATE CASCADE ON DELETE SET NULL, + FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`) + ON UPDATE CASCADE ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +COMMIT; diff --git a/pandora_console/extras/mr/31.sql b/pandora_console/extras/mr/31.sql index 229a39b1fa..3e527bff53 100644 --- a/pandora_console/extras/mr/31.sql +++ b/pandora_console/extras/mr/31.sql @@ -2,4 +2,11 @@ START TRANSACTION; UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields'; +DELETE FROM `talert_commands` WHERE `id` = 11; + +DELETE FROM `tconfig` WHERE `token` LIKE 'integria_enabled'; +DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; +DELETE FROM `tconfig` WHERE `token` LIKE 'integria_inventory'; +DELETE FROM `tconfig` WHERE `token` LIKE 'integria_url'; + COMMIT; \ 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 1b9ef18446..964441c6c1 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 @@ -1225,6 +1225,8 @@ ALTER TABLE `talert_commands` ADD COLUMN `fields_hidden` text; UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1; +DELETE FROM `talert_commands` WHERE `id` = 11; + -- --------------------------------------------------------------------- -- Table `tmap` -- --------------------------------------------------------------------- @@ -1250,6 +1252,10 @@ DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '737'); 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_enabled'; +DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password'; +DELETE FROM `tconfig` WHERE `token` LIKE 'integria_inventory'; +DELETE FROM `tconfig` WHERE `token` LIKE 'integria_url'; -- --------------------------------------------------------------------- -- Table `tconfig_os` @@ -2221,3 +2227,44 @@ CREATE TABLE IF NOT EXISTS `tcredential_store` ( -- Table `treport_content_sla_combined` -- --------------------------------------------------------------------- ALTER TABLE `treport_content_sla_combined` ADD `id_agent_module_failover` int(10) unsigned NOT NULL; + +-- --------------------------------------------------------------------- +-- Table `tagent_repository` +-- --------------------------------------------------------------------- +CREATE TABLE `tagent_repository` ( + `id` SERIAL, + `id_os` INT(10) UNSIGNED DEFAULT 0, + `arch` ENUM('x64', 'x86') DEFAULT 'x64', + `version` VARCHAR(10) DEFAULT '', + `path` text, + `uploaded_by` VARCHAR(100) DEFAULT '', + `uploaded` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was uploaded", + `last_err` text, + PRIMARY KEY (`id`), + FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`) + ON UPDATE CASCADE ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- ---------------------------------------------------------------------- +-- Table `tdeployment_hosts` +-- ---------------------------------------------------------------------- +CREATE TABLE `tdeployment_hosts` ( + `id` SERIAL, + `id_cs` VARCHAR(100), + `ip` VARCHAR(100) NOT NULL UNIQUE, + `id_os` INT(10) UNSIGNED DEFAULT 0, + `os_version` VARCHAR(100) DEFAULT '' COMMENT "OS version in STR format", + `arch` ENUM('x64', 'x86') DEFAULT 'x64', + `current_agent_version` VARCHAR(100) DEFAULT '' COMMENT "String latest installed agent", + `target_agent_version_id` BIGINT UNSIGNED, + `deployed` bigint(20) NOT NULL DEFAULT 0 COMMENT "When it was deployed", + `server_ip` varchar(100) default NULL COMMENT "Where to point target agent", + `last_err` text, + PRIMARY KEY (`id`), + FOREIGN KEY (`id_cs`) REFERENCES `tcredential_store`(`identifier`) + ON UPDATE CASCADE ON DELETE SET NULL, + FOREIGN KEY (`id_os`) REFERENCES `tconfig_os`(`id_os`) + ON UPDATE CASCADE ON DELETE CASCADE, + FOREIGN KEY (`target_agent_version_id`) REFERENCES `tagent_repository`(`id`) + ON UPDATE CASCADE ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index dd2e577fe3..c24478eeb6 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -524,8 +524,10 @@ if (enterprise_installed()) { ); $safe_mode_modules = []; $safe_mode_modules[0] = __('Any'); - foreach ($sql_modules as $m) { - $safe_mode_modules[$m['id_module']] = $m['name']; + if (is_array($sql_modules)) { + foreach ($sql_modules as $m) { + $safe_mode_modules[$m['id_module']] = $m['name']; + } } $table_adv_safe = '

'.__('Safe operation mode').': '.ui_print_help_tip( diff --git a/pandora_console/godmode/groups/credential_store.php b/pandora_console/godmode/groups/credential_store.php index 8c9540d581..3273e1c038 100644 --- a/pandora_console/godmode/groups/credential_store.php +++ b/pandora_console/godmode/groups/credential_store.php @@ -369,7 +369,7 @@ echo '

'; text = err.message; failed = 1; } - if (!failed && data['error']) { + if (!failed && data['error'] != undefined) { title = ""; text = data['error']; failed = 1; @@ -522,12 +522,10 @@ echo ''; function calculate_inputs() { if ($('#product :selected').val() == "CUSTOM") { - $('#div-username label').text(''); + $('#div-username label').text(''); $('#div-password label').text(''); - $('#div-extra_1 label').text(''); - $('#div-extra_2 label').text(''); - $('#div-extra_1').show(); - $('#div-extra_2').show(); + $('#div-extra_1').hide(); + $('#div-extra_2').hide(); } else if ($('#product :selected').val() == "AWS") { $('#div-username label').text(''); $('#div-password label').text(''); @@ -557,8 +555,8 @@ echo ''; success: function(data) { $('#form_new').html(data); $('#id_group').val(0); - // By default AWS. - $('#product').val('AWS'); + // By default CUSTOM. + $('#product').val('CUSTOM'); calculate_inputs(); $('#product').on('change', function() { @@ -590,9 +588,6 @@ echo ''; text: 'OK', click: function(e) { var values = {}; - - console.log($('#form_new')); - $('#form_new :input').each(function() { values[this.name] = btoa($(this).val()); }); diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 09a2aff770..000a105257 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -24,23 +24,24 @@ $menu_godmode['class'] = 'godmode'; if (check_acl($config['id_user'], 0, 'PM')) { $sub = []; - $sub['godmode/servers/discovery&wiz=main']['text'] = __('Discovery Main'); + $sub['godmode/servers/discovery&wiz=main']['text'] = __('Main'); $sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery'; $sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list'); $sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist'; - $sub['godmode/servers/discovery&wiz=app']['text'] = __('Applications'); - $sub['godmode/servers/discovery&wiz=app']['id'] = 'app'; - - $sub['godmode/servers/discovery&wiz=cloud']['text'] = __('Cloud'); - $sub['godmode/servers/discovery&wiz=cloud']['id'] = 'cloud'; - - $sub['godmode/servers/discovery&wiz=ctask']['text'] = __('Console task'); - $sub['godmode/servers/discovery&wiz=ctask']['id'] = 'ctask'; - + $sub2 = []; + $sub2['godmode/servers/discovery&wiz=hd&mode=netscan']['text'] = __('Network scan'); + enterprise_hook('hostdevices_submenu'); + $sub2['godmode/servers/discovery&wiz=hd&mode=customnetscan']['text'] = __('Custom network scan'); + $sub2['godmode/servers/discovery&wiz=hd&mode=managenetscanscripts']['text'] = __('Manage scan scripts'); $sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices'); $sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd'; + $sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2; + + enterprise_hook('applications_menu'); + enterprise_hook('cloud_menu'); + enterprise_hook('console_task_menu'); // Add to menu. $menu_godmode['discovery']['text'] = __('Discovery'); @@ -128,6 +129,7 @@ if (check_acl($config['id_user'], 0, 'PM')) { $sub['godmode/modules/manage_network_templates']['id'] = 'Module templates'; enterprise_hook('inventory_submenu'); enterprise_hook('autoconfiguration_menu'); + enterprise_hook('agent_repository_menu'); } if (check_acl($config['id_user'], 0, 'AW')) { diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index a2c0abd5d6..3f2166bb39 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -42,7 +42,19 @@ function get_wiz_class($str) return 'ConsoleTasks'; default: - // Ignore. + // Main, show header. + ui_print_page_header( + __('Discovery'), + '', + false, + '', + true, + '', + false, + '', + GENERIC_SIZE_TEXT, + '' + ); return null; } } @@ -81,7 +93,7 @@ function cl_load_cmp($a, $b) $classes = glob($config['homedir'].'/godmode/wizards/*.class.php'); if (enterprise_installed()) { $ent_classes = glob( - $config['homedir'].'/enterprise/godmode/wizards/*.class.php' + $config['homedir'].'/'.ENTERPRISE_DIR.'/godmode/wizards/*.class.php' ); if ($ent_classes === false) { $ent_classes = []; @@ -130,7 +142,7 @@ if ($classname_selected === null) { } } - // Show hints if there is no task + // Show hints if there is no task. if (get_parameter('discovery_hint', 0)) { ui_require_css_file('discovery-hint'); ui_print_info_message(__('You must create a task first')); diff --git a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php index 586f24335b..ed7e1f3b10 100644 --- a/pandora_console/godmode/wizards/DiscoveryTaskList.class.php +++ b/pandora_console/godmode/wizards/DiscoveryTaskList.class.php @@ -418,6 +418,7 @@ class DiscoveryTaskList extends Wizard $table->align[9] = 'left'; foreach ($recon_tasks as $task) { + $no_operations = false; $data = []; $server_name = servers_get_name($task['id_recon_server']); @@ -552,6 +553,17 @@ class DiscoveryTaskList extends Wizard $data[6] .= __('Discovery.App.Oracle'); break; + case DISCOVERY_DEPLOY_AGENTS: + // Internal deployment task. + $no_operations = true; + $data[6] = html_print_image( + 'images/deploy.png', + true, + ['title' => __('Agent deployment')] + ).'  '; + $data[6] .= __('Discovery.Agent.Deployment'); + break; + case DISCOVERY_HOSTDEVICES: default: if ($task['id_recon_script'] == 0) { @@ -595,71 +607,75 @@ class DiscoveryTaskList extends Wizard $data[8] = __('Not executed yet'); } - if ($task['disabled'] != 2) { - $data[9] = ''; - $data[9] .= html_print_image( - 'images/eye.png', - true - ); - $data[9] .= ''; - } - - if ($task['disabled'] != 2 && $task['utimestamp'] > 0 - && $task['type'] != DISCOVERY_APP_MYSQL - && $task['type'] != DISCOVERY_APP_ORACLE - && $task['type'] != DISCOVERY_CLOUD_AWS_RDS - ) { - $data[9] .= ''; - $data[9] .= html_print_image( - 'images/dynamic_network_icon.png', - true - ); - $data[9] .= ''; - } - - if (check_acl( - $config['id_user'], - $task['id_group'], - 'PM' - ) - ) { - if ($ipam === true) { - $data[9] .= ''.html_print_image( - 'images/config.png', + if (!$no_operations) { + if ($task['disabled'] != 2) { + $data[9] = ''; + $data[9] .= html_print_image( + 'images/eye.png', true - ).''; - $data[9] .= ''.html_print_image( - 'images/cross.png', + ); + $data[9] .= ''; + } + + if ($task['disabled'] != 2 && $task['utimestamp'] > 0 + && $task['type'] != DISCOVERY_APP_MYSQL + && $task['type'] != DISCOVERY_APP_ORACLE + && $task['type'] != DISCOVERY_CLOUD_AWS_RDS + ) { + $data[9] .= ''; + $data[9] .= html_print_image( + 'images/dynamic_network_icon.png', true - ).''; + ); + $data[9] .= ''; + } + + if (check_acl( + $config['id_user'], + $task['id_group'], + 'PM' + ) + ) { + if ($ipam === true) { + $data[9] .= ''.html_print_image( + 'images/config.png', + true + ).''; + $data[9] .= ''.html_print_image( + 'images/cross.png', + true + ).''; + } else { + // Check if is a H&D, Cloud or Application or IPAM. + $data[9] .= ''.html_print_image( + 'images/config.png', + true + ).''; + $data[9] .= ''.html_print_image( + 'images/cross.png', + true + ).''; + } } else { - // Check if is a H&D, Cloud or Application or IPAM. - $data[9] .= ''.html_print_image( - 'images/config.png', - true - ).''; - $data[9] .= ''.html_print_image( - 'images/cross.png', - true - ).''; + $data[9] = ''; } } else { - $data[9] = ''; + $data[9] = '-'; } $table->cellclass[][9] = 'action_buttons'; diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 3cc2e3f71d..fb9fba2cdd 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -32,6 +32,7 @@ require_once $config['homedir'].'/include/class/CustomNetScan.class.php'; require_once $config['homedir'].'/include/class/ManageNetScanScripts.class.php'; enterprise_include_once('include/class/CSVImportAgents.class.php'); +enterprise_include_once('include/class/DeploymentCenter.class.php'); enterprise_include_once('include/functions_hostdevices.php'); /** @@ -127,6 +128,12 @@ class HostDevices extends Wizard 'icon' => ENTERPRISE_DIR.'/images/wizard/csv.png', 'label' => __('Import CSV'), ]; + + $buttons[] = [ + 'url' => $this->url.'&mode=deploy', + 'icon' => ENTERPRISE_DIR.'/images/wizard/deployment.png', + 'label' => __('Agent deployment'), + ]; } $buttons[] = [ @@ -149,11 +156,30 @@ class HostDevices extends Wizard ), 'label' => __('Discovery'), ], + [ + 'link' => ui_get_full_url( + 'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd' + ), + 'label' => __('Host & Devices'), + 'selected' => true, + ], ], true ); - ui_print_page_header(__('Host & devices'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true)); + ui_print_page_header( + __('Host & devices'), + '', + false, + '', + true, + '', + false, + '', + GENERIC_SIZE_TEXT, + '', + $this->printHeader(true) + ); $this->printBigButtonsList($buttons); return; @@ -167,6 +193,14 @@ class HostDevices extends Wizard ); return $csv_importer->runCSV(); } + + if ($mode === 'deploy') { + $deployObject = new DeploymentCenter( + $this->page, + $this->breadcrum + ); + return $deployObject->run(); + } } if ($mode === 'customnetscan') { @@ -785,6 +819,7 @@ class HostDevices extends Wizard }).change();'; $this->printFormAsGrid($form); + $this->printGoBackButton($this->url.'&page='.($this->page - 1)); } } @@ -877,6 +912,7 @@ class HostDevices extends Wizard ]; $this->printFormAsList($form); + $this->printGoBackButton($this->url.'&mode=netscan&task='.$this->task['id_rt'].'&page='.($this->page - 1)); } if ($this->page == 2) { diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index 2524f6d93c..3a65560285 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -296,241 +296,20 @@ class Wizard */ public function printInput($data) { + global $config; + + include_once $config['homedir'].'/include/functions_html.php'; + if (is_array($data) === false) { return ''; } - switch ($data['type']) { - case 'text': - return html_print_input_text( - $data['name'], - $data['value'], - ((isset($data['alt']) === true) ? $data['alt'] : ''), - ((isset($data['size']) === true) ? $data['size'] : 50), - ((isset($data['maxlength']) === true) ? $data['maxlength'] : 255), - ((isset($data['return']) === true) ? $data['return'] : true), - ((isset($data['disabled']) === true) ? $data['disabled'] : false), - ((isset($data['required']) === true) ? $data['required'] : false), - ((isset($data['function']) === true) ? $data['function'] : ''), - ((isset($data['class']) === true) ? $data['class'] : ''), - ((isset($data['onChange']) === true) ? $data['onChange'] : ''), - ((isset($data['autocomplete']) === true) ? $data['autocomplete'] : '') - ); - - case 'image': - return html_print_input_image( - $data['name'], - $data['src'], - $data['value'], - ((isset($data['style']) === true) ? $data['style'] : ''), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['options']) === true) ? $data['options'] : false) - ); - - case 'text_extended': - return html_print_input_text_extended( - $data['name'], - $data['value'], - $data['id'], - $data['alt'], - $data['size'], - $data['maxlength'], - $data['disabled'], - $data['script'], - $data['attributes'], - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['password']) === true) ? $data['password'] : false), - ((isset($data['function']) === true) ? $data['function'] : '') - ); - - case 'password': - return html_print_input_password( - $data['name'], - $data['value'], - ((isset($data['alt']) === true) ? $data['alt'] : ''), - ((isset($data['size']) === true) ? $data['size'] : 50), - ((isset($data['maxlength']) === true) ? $data['maxlength'] : 255), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['disabled']) === true) ? $data['disabled'] : false), - ((isset($data['required']) === true) ? $data['required'] : false), - ((isset($data['class']) === true) ? $data['class'] : '') - ); - - case 'text': - return html_print_input_text( - $data['name'], - $data['value'], - ((isset($data['alt']) === true) ? $data['alt'] : ''), - ((isset($data['size']) === true) ? $data['size'] : 50), - ((isset($data['maxlength']) === true) ? $data['maxlength'] : 255), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['disabled']) === true) ? $data['disabled'] : false), - ((isset($data['required']) === true) ? $data['required'] : false), - ((isset($data['function']) === true) ? $data['function'] : ''), - ((isset($data['class']) === true) ? $data['class'] : ''), - ((isset($data['onChange']) === true) ? $data['onChange'] : ''), - ((isset($data['autocomplete']) === true) ? $data['autocomplete'] : '') - ); - - case 'image': - return html_print_input_image( - $data['name'], - $data['src'], - $data['value'], - ((isset($data['style']) === true) ? $data['style'] : ''), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['options']) === true) ? $data['options'] : false) - ); - - case 'hidden': - return html_print_input_hidden( - $data['name'], - $data['value'], - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['class']) === true) ? $data['class'] : false) - ); - - case 'hidden_extended': - return html_print_input_hidden_extended( - $data['name'], - $data['value'], - $data['id'], - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['class']) === true) ? $data['class'] : false) - ); - - case 'color': - return html_print_input_color( - $data['name'], - $data['value'], - ((isset($data['class']) === true) ? $data['class'] : false), - ((isset($data['return']) === true) ? $data['return'] : false) - ); - - case 'file': - return html_print_input_file( - $data['name'], - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['options']) === true) ? $data['options'] : false) - ); - - case 'select': - return html_print_select( - $data['fields'], - $data['name'], - ((isset($data['selected']) === true) ? $data['selected'] : ''), - ((isset($data['script']) === true) ? $data['script'] : ''), - ((isset($data['nothing']) === true) ? $data['nothing'] : ''), - ((isset($data['nothing_value']) === true) ? $data['nothing_value'] : 0), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['multiple']) === true) ? $data['multiple'] : false), - ((isset($data['sort']) === true) ? $data['sort'] : true), - ((isset($data['class']) === true) ? $data['class'] : ''), - ((isset($data['disabled']) === true) ? $data['disabled'] : false), - ((isset($data['style']) === true) ? $data['style'] : false), - ((isset($data['option_style']) === true) ? $data['option_style'] : false), - ((isset($data['size']) === true) ? $data['size'] : false), - ((isset($data['modal']) === true) ? $data['modal'] : false), - ((isset($data['message']) === true) ? $data['message'] : ''), - ((isset($data['select_all']) === true) ? $data['select_all'] : false) - ); - - case 'select_from_sql': - return html_print_select_from_sql( - $data['sql'], - $data['name'], - ((isset($data['selected']) === true) ? $data['selected'] : ''), - ((isset($data['script']) === true) ? $data['script'] : ''), - ((isset($data['nothing']) === true) ? $data['nothing'] : ''), - ((isset($data['nothing_value']) === true) ? $data['nothing_value'] : '0'), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['multiple']) === true) ? $data['multiple'] : false), - ((isset($data['sort']) === true) ? $data['sort'] : true), - ((isset($data['disabled']) === true) ? $data['disabled'] : false), - ((isset($data['style']) === true) ? $data['style'] : false), - ((isset($data['size']) === true) ? $data['size'] : false), - ((isset($data['trucate_size']) === true) ? $data['trucate_size'] : GENERIC_SIZE_TEXT) - ); - - case 'select_groups': - return html_print_select_groups( - ((isset($data['id_user']) === true) ? $data['id_user'] : false), - ((isset($data['privilege']) === true) ? $data['privilege'] : 'AR'), - ((isset($data['returnAllGroup']) === true) ? $data['returnAllGroup'] : true), - $data['name'], - ((isset($data['selected']) === true) ? $data['selected'] : ''), - ((isset($data['script']) === true) ? $data['script'] : ''), - ((isset($data['nothing']) === true) ? $data['nothing'] : ''), - ((isset($data['nothing_value']) === true) ? $data['nothing_value'] : 0), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['multiple']) === true) ? $data['multiple'] : false), - ((isset($data['sort']) === true) ? $data['sort'] : true), - ((isset($data['class']) === true) ? $data['class'] : ''), - ((isset($data['disabled']) === true) ? $data['disabled'] : false), - ((isset($data['style']) === true) ? $data['style'] : false), - ((isset($data['option_style']) === true) ? $data['option_style'] : false), - ((isset($data['id_group']) === true) ? $data['id_group'] : false), - ((isset($data['keys_field']) === true) ? $data['keys_field'] : 'id_grupo'), - ((isset($data['strict_user']) === true) ? $data['strict_user'] : false), - ((isset($data['delete_groups']) === true) ? $data['delete_groups'] : false), - ((isset($data['include_groups']) === true) ? $data['include_groups'] : false), - ((isset($data['size']) === true) ? $data['size'] : false), - ((isset($data['simple_multiple_options']) === true) ? $data['simple_multiple_options'] : false) - ); - - case 'submit': - return '
'.html_print_submit_button( - ((isset($data['label']) === true) ? $data['label'] : 'OK'), - ((isset($data['name']) === true) ? $data['name'] : ''), - ((isset($data['disabled']) === true) ? $data['disabled'] : false), - ((isset($data['attributes']) === true) ? $data['attributes'] : ''), - ((isset($data['return']) === true) ? $data['return'] : false) - ).'
'; - - case 'checkbox': - return html_print_checkbox( - $data['name'], - $data['value'], - ((isset($data['checked']) === true) ? $data['checked'] : false), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['disabled']) === true) ? $data['disabled'] : false), - ((isset($data['script']) === true) ? $data['script'] : ''), - ((isset($data['disabled_hidden']) === true) ? $data['disabled_hidden'] : false) - ); - - case 'switch': - return html_print_switch($data); - - case 'interval': - return html_print_extended_select_for_time( - $data['name'], - $data['value'], - ((isset($data['script']) === true) ? $data['script'] : ''), - ((isset($data['nothing']) === true) ? $data['nothing'] : ''), - ((isset($data['nothing_value']) === true) ? $data['nothing_value'] : 0), - ((isset($data['size']) === true) ? $data['size'] : false), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['style']) === true) ? $data['selected'] : false), - ((isset($data['unique']) === true) ? $data['unique'] : false) - ); - - case 'textarea': - return html_print_textarea( - $data['name'], - $data['rows'], - $data['columns'], - ((isset($data['value']) === true) ? $data['value'] : ''), - ((isset($data['attributes']) === true) ? $data['attributes'] : ''), - ((isset($data['return']) === true) ? $data['return'] : false), - ((isset($data['class']) === true) ? $data['class'] : '') - ); - - default: - // Ignore. - break; + $input = html_print_input(($data + ['return' => true]), 'div', true); + if ($input === false) { + return ''; } - return ''; + return $input; } @@ -556,6 +335,7 @@ class Wizard ], 'inputs' => [ [ + 'class' => 'w100p', 'arguments' => [ 'name' => 'submit', 'label' => __('Go back'), @@ -594,13 +374,24 @@ class Wizard if (is_array($input['block_content']) === true) { // Print independent block of inputs. - $output .= '
  • '; - $output .= ''; + } else { + $output .= '
  • '; + } } else { if ($input['arguments']['type'] != 'hidden') { $output .= '
  • '; @@ -648,7 +439,7 @@ class Wizard if (is_array($input['block_content']) === true) { // Print independent block of inputs. $output .= '
  • '; - $output .= '