diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index 0ff67a62d3..30fb45624c 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.735, AIX version +# Version 7.0NG.736, 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 c7c6fdd493..fc704fb87b 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.735, FreeBSD Version +# Version 7.0NG.736, 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 1a349583dc..46789e8bea 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.735, HP-UX Version +# Version 7.0NG.736, 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 dc172b7e2f..ce69b462a5 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.735, GNU/Linux +# Version 7.0NG.736, 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 3d76832397..904015a997 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.735, GNU/Linux +# Version 7.0NG.736, 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 9b088eae51..d2d0661065 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.735, Solaris Version +# Version 7.0NG.736, 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 e2c442a520..d0593ebcc9 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.735 +# Version 7.0NG.736 # 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 fea0cb56db..74c397dc94 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.735, AIX version +# Version 7.0NG.736, 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 f0ce5b2519..b7a30f962e 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.735 +# Version 7.0NG.736 # 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 20cdfeff99..9114cd7348 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.735, HPUX Version +# Version 7.0NG.736, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index e8ba9653ce..8eb9c0bbc8 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.735 +# Version 7.0NG.736 # 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 29d13ff75c..24d44d51fc 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.735 +# Version 7.0NG.736 # 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 8ef8a6fdc1..a940b58a89 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.735 +# Version 7.0NG.736 # 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 1ace947818..13611f36c0 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.735, Solaris version +# Version 7.0NG.736, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index c67f64d16c..6a826afd8b 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.735, AIX version +# Version 7.0NG.736, 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 6771606f50..4ca43080d4 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.735-190625 +Version: 7.0NG.736-190704 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 fe7628e999..4d2eb2ad36 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.735-190625" +pandora_version="7.0NG.736-190704" 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 d7ee481255..35a24de477 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.735, GNU/Linux +# Version 7.0NG.736, 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 b02b379470..fba8f9fa24 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.735, FreeBSD Version +# Version 7.0NG.736, 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 57e35c0a03..36164100be 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.735, HP-UX Version +# Version 7.0NG.736, 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 db07876f12..6012f59705 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.735, GNU/Linux +# Version 7.0NG.736, 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 8cda0f8fe0..300c03a3f5 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.735, GNU/Linux +# Version 7.0NG.736, 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 629fe6a6fb..e899eed824 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.735, NetBSD Version +# Version 7.0NG.736, 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 8ff3c52de5..be7904794d 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.735, Solaris Version +# Version 7.0NG.736, 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 6bbb463b49..c4b8c9a482 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.735'; -use constant AGENT_BUILD => '190625'; +use constant AGENT_VERSION => '7.0NG.736'; +use constant AGENT_BUILD => '190704'; # 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 8f580504eb..9ee7dfac59 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.735 -%define release 190625 +%define version 7.0NG.736 +%define release 190704 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 28023a28f3..0adace638a 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.735 -%define release 190625 +%define version 7.0NG.736 +%define release 190704 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 879ff79eac..1650743680 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.735" -PI_BUILD="190625" +PI_VERSION="7.0NG.736" +PI_BUILD="190704" 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 518cd3df0e..9c2fe6d01d 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.735 +# Version 7.0NG.736 # 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 21e38fb13b..6e9c24fdbf 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.735} +{Pandora FMS Windows Agent v7.0NG.736} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190625} +{190704} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 2194b622ac..61557bc15a 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.735(Build 190625)") +#define PANDORA_VERSION ("7.0NG.736(Build 190704)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f328ab299c..6a19940b9b 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.735(Build 190625))" + VALUE "ProductVersion", "(7.0NG.736(Build 190704))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8a166990ab..2f4cba40c0 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.735-190625 +Version: 7.0NG.736-190704 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 2d45e0aa49..9e607576dc 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.735-190625" +pandora_version="7.0NG.736-190704" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/db_status.php b/pandora_console/extensions/db_status.php index d78ff90fc8..5659ed6d9b 100755 --- a/pandora_console/extensions/db_status.php +++ b/pandora_console/extensions/db_status.php @@ -69,7 +69,7 @@ function extension_db_status() echo "
"; html_print_input_hidden('db_status_execute', 1); - html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub"'); + html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub next"'); echo '
'; echo ''; diff --git a/pandora_console/extensions/net_tools.php b/pandora_console/extensions/net_tools.php index e6ec05977b..ba66cae68e 100644 --- a/pandora_console/extensions/net_tools.php +++ b/pandora_console/extensions/net_tools.php @@ -1,26 +1,60 @@ ".__('The agent hasn\'t got IP').''; - return; - } - - echo " - "; - - echo '
'; - echo "
"; - echo ""; - echo ''; - echo ''; - echo "'; - echo '
'; - echo __('Operation'); - ui_print_help_tip( - __('You can set the command path in the menu Administration -> Extensions -> Config Network Tools') - ); - echo ''; - echo "'; - echo ''; - echo __('IP address'); - echo ''; - echo "'; - echo '"; - echo __('SNMP Community').' '; - echo ""; - echo ''; - echo ""; - echo '
'; - echo '
'; - - $operation = get_parameter('operation', 0); - $community = get_parameter('community', 'public'); - $ip = get_parameter('select_ips'); - if (!validate_address($ip)) { - ui_print_error_message(__('The ip or dns name entered cannot be resolved')); + ui_print_error_message(__('The ip or dns name entered cannot be resolved')); } else { switch ($operation) { case 1: @@ -175,7 +147,7 @@ function main_net_tools() } else { echo '

'.__('Traceroute to ').$ip.'

'; echo '
';
-                    echo system("$traceroute $ip");
+                    echo system($traceroute.' '.$ip);
                     echo '
'; } break; @@ -187,7 +159,7 @@ function main_net_tools() } else { echo '

'.__('Ping to %s', $ip).'

'; echo '
';
-                    echo system("$ping -c 5 $ip");
+                    echo system($ping.' -c 5 '.$ip);
                     echo '
'; } break; @@ -199,7 +171,7 @@ function main_net_tools() } else { echo '

'.__('Basic TCP Scan on ').$ip.'

'; echo '
';
-                    echo system("$nmap -F $ip");
+                    echo system($nmap.' -F '.$ip);
                     echo '
'; } break; @@ -212,7 +184,7 @@ function main_net_tools() ui_print_error_message(__('Dig executable does not exist.')); } else { echo '
';
-                    echo system("dig $ip");
+                    echo system('dig '.$ip);
                     echo '
'; } @@ -221,51 +193,227 @@ function main_net_tools() ui_print_error_message(__('Whois executable does not exist.')); } else { echo '
';
-                    echo system("whois $ip");
+                    echo system('whois '.$ip);
                     echo '
'; } break; case 3: + $snmp_obj = [ + 'ip_target' => $ip, + 'snmp_version' => $snmp_version, + 'snmp_community' => $community, + 'format' => '-Oqn', + ]; + + $snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.3.0'; + $result = get_h_snmpwalk($snmp_obj); echo '

'.__('SNMP information for ').$ip.'

'; - - $snmpget = whereis_the_command('snmpget'); - if (empty($snmpget)) { - ui_print_error_message(__('SNMPget executable does not exist.')); + echo '

'.__('Uptime').'

'; + echo '
';
+                if (empty($result)) {
+                    ui_print_error_message(__('Target unreachable.'));
+                    break;
                 } else {
-                    echo '

'.__('Uptime').'

'; - echo '
';
-                    echo exec("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.3.0 ");
-                    echo '
'; - echo '

'.__('Device info').'

'; - echo '
';
-
-                    echo system("$snmpget -Ounv -v1 -c $community $ip .1.3.6.1.2.1.1.1.0 ");
-                    echo '
'; - - echo '

Interface Information

'; - echo ''; - echo '
'.__('Interface'); - echo ''.__('Status'); - - $int_max = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.1.0 "); - - for ($ax = 0; $ax < $int_max; $ax++) { - $interface = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.2.$ax "); - $estado = exec("$snmpget -Oqunv -v1 -c $community $ip .1.3.6.1.2.1.2.2.1.8.$ax "); - echo "
$interface$estado"; - } - - echo '
'; + echo array_pop($result); } + + echo '
'; + echo '

'.__('Device info').'

'; + echo '
';
+                $snmp_obj['base_oid'] = '.1.3.6.1.2.1.1.1.0';
+                $result = get_h_snmpwalk($snmp_obj);
+                if (empty($result)) {
+                    ui_print_error_message(__('Target unreachable.'));
+                    break;
+                } else {
+                    echo array_pop($result);
+                }
+
+                echo '
'; + + echo '

Interface Information

'; + + $table = new StdClass(); + $table->class = 'databox'; + $table->head = []; + $table->head[] = __('Interface'); + $table->head[] = __('Status'); + + $i = 0; + + $base_oid = '.1.3.6.1.2.1.2.2.1'; + $idx_oids = '.1'; + $names_oids = '.2'; + $status_oids = '.8'; + + $snmp_obj['base_oid'] = $base_oid.$idx_oids; + $idx = get_h_snmpwalk($snmp_obj); + + $snmp_obj['base_oid'] = $base_oid.$names_oids; + $names = get_h_snmpwalk($snmp_obj); + + $snmp_obj['base_oid'] = $base_oid.$status_oids; + $statuses = get_h_snmpwalk($snmp_obj); + + foreach ($idx as $k => $v) { + $index = str_replace($base_oid.$idx_oids, '', $k); + $name = $names[$base_oid.$names_oids.$index]; + + $status = $statuses[$base_oid.$status_oids.$index]; + + $table->data[$i][0] = $name; + $table->data[$i++][1] = $status; + } + + html_print_table($table); + break; + + default: + // Ignore. break; } } +} + + +/** + * Main function. + * + * @return void + */ +function main_net_tools() +{ + $operation = get_parameter('operation', 0); + $community = get_parameter('community', 'public'); + $ip = get_parameter('select_ips'); + $snmp_version = get_parameter('select_version'); + + // Show form. + $id_agente = get_parameter('id_agente', 0); + $principal_ip = db_get_sql( + sprintf( + 'SELECT direccion FROM tagente WHERE id_agente = %d', + $id_agente + ) + ); + + $list_address = db_get_all_rows_sql( + sprintf( + 'SELECT id_a FROM taddress_agent WHERE id_agent = %d', + $id_agente + ) + ); + foreach ($list_address as $address) { + $ids[] = join(',', $address); + } + + $ips = db_get_all_rows_sql( + sprintf( + 'SELECT ip FROM taddress WHERE id_a IN (%s)', + join($ids) + ) + ); + + if ($ips == '') { + echo "
".__('The agent hasn\'t got IP').'
'; + return; + } + + // Javascript. + ?> + + '; + echo "
"; + echo ""; + echo ''; + echo ''; + echo "'; + echo '
'; + echo __('Operation'); + ui_print_help_tip( + __('You can set the command path in the menu Administration -> Extensions -> Config Network Tools') + ); + echo ''; + + html_print_select( + [ + 1 => __('Traceroute'), + 2 => __('Ping host & Latency'), + 3 => __('SNMP Interface status'), + 4 => __('Basic TCP Port Scan'), + 5 => __('DiG/Whois Lookup'), + ], + 'operation', + $operation, + 'mostrarColumns(this.value)', + __('Please select') + ); + + echo ''; + echo __('IP address'); + echo ''; + + $ips_for_select = array_reduce( + $ips, + function ($carry, $item) { + $carry[$item['ip']] = $item['ip']; + return $carry; + } + ); + + html_print_select( + $ips_for_select, + 'select_ips', + $principal_ip + ); + echo '"; + echo __('SNMP Version'); + html_print_select( + [ + '1' => 'v1', + '2c' => 'v2c', + ], + 'select_version', + $snmp_version + ); + echo ''; + echo __('SNMP Community').' '; + html_print_input_text('community', $community); + echo ''; + echo ""; + echo '
'; + echo '
'; + + if ($operation) { + // Execute form. + net_tools_execute($operation, $ip, $community, $snmp_version); + } + echo '
'; } +/** + * Add option. + * + * @return void + */ function godmode_net_tools() { global $config; diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index cea09fe4d5..e487d49ee5 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -173,7 +173,7 @@ function pandora_realtime_graphs() $table->colspan[2]['snmp_oid'] = 2; $data['snmp_ver'] = __('Version').'  '.html_print_select($snmp_versions, 'snmp_version', $snmp_ver, '', '', 0, true); - $data['snmp_ver'] .= '  '.html_print_button(__('SNMP walk'), 'snmp_walk', false, 'javascript:realtimeGraphs.snmpBrowserWindow();', 'class="sub next"', true); + $data['snmp_ver'] .= '  '.html_print_button(__('SNMP walk'), 'snmp_walk', false, 'javascript:snmpBrowserWindow();', 'class="sub next"', true); $table->colspan[2]['snmp_ver'] = 2; $table->data[] = $data; diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.js b/pandora_console/extensions/realtime_graphs/realtime_graphs.js index 7140d245d4..b5d6c1eaa8 100644 --- a/pandora_console/extensions/realtime_graphs/realtime_graphs.js +++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.js @@ -10,7 +10,9 @@ var plot; var plotOptions = { - legend: { container: $("#chartLegend") }, + legend: { + container: $("#chartLegend") + }, xaxis: { tickFormatter: function(timestamp, axis) { var date = new Date(timestamp * 1000); @@ -131,47 +133,6 @@ resetDataPooling(); } - // Set the form OID to the value selected in the SNMP browser - function setOID() { - if ($("#snmp_browser_version").val() == "3") { - $("#text-snmp_oid").val($("#table1-0-1").text()); - } else { - $("#text-snmp_oid").val($("#snmp_selected_oid").text()); - } - - // Close the SNMP browser - $(".ui-dialog-titlebar-close").trigger("click"); - } - - // Show the SNMP browser window - function snmpBrowserWindow() { - // Keep elements in the form and the SNMP browser synced - $("#text-target_ip").val($("#text-ip_target").val()); - $("#text-community").val($("#text-snmp_community").val()); - $("#snmp_browser_version").val($("#snmp_version").val()); - $("#snmp3_browser_auth_user").val($("#snmp3_auth_user").val()); - $("#snmp3_browser_security_level").val($("#snmp3_security_level").val()); - $("#snmp3_browser_auth_method").val($("#snmp3_auth_method").val()); - $("#snmp3_browser_auth_pass").val($("#snmp3_auth_pass").val()); - $("#snmp3_browser_privacy_method").val($("#snmp3_privacy_method").val()); - $("#snmp3_browser_privacy_pass").val($("#snmp3_privacy_pass").val()); - - $("#snmp_browser_container") - .show() - .dialog({ - title: "", - resizable: true, - draggable: true, - modal: true, - overlay: { - opacity: 0.5, - background: "black" - }, - width: 920, - height: 500 - }); - } - function shortNumber(number) { if (Math.round(number) != number) return number; number = Number.parseInt(number); @@ -187,6 +148,7 @@ return number + " " + shorts[pos]; } + function roundToTwo(num) { return +(Math.round(num + "e+2") + "e-2"); } diff --git a/pandora_console/extras/mr/29.sql b/pandora_console/extras/mr/29.sql index 032dd407b1..2bc8b9a8c9 100644 --- a/pandora_console/extras/mr/29.sql +++ b/pandora_console/extras/mr/29.sql @@ -1,6 +1,28 @@ START TRANSACTION; +ALTER TABLE `tmetaconsole_agent` ADD INDEX `id_tagente_idx` (`id_tagente`); + DELETE FROM `ttipo_modulo` WHERE `nombre` LIKE 'log4x'; +CREATE TABLE IF NOT EXISTS `tcredential_store` ( + `identifier` varchar(100) NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0, + `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM', + `username` text, + `password` text, + `extra_1` text, + `extra_2` text, + PRIMARY KEY (`identifier`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +INSERT INTO `tcredential_store` (`identifier`, `id_group`, `product`, `username`, `password`) VALUES ("imported_aws_account", 0, "AWS", (SELECT `value` FROM `tconfig` WHERE `token` = "aws_access_key_id" LIMIT 1), (SELECT `value` FROM `tconfig` WHERE `token` = "aws_secret_access_key" LIMIT 1)); +DELETE FROM `tcredential_store` WHERE `username` IS NULL AND `password` IS NULL; + +UPDATE `tagente` ta INNER JOIN `tagente` taa on ta.`id_parent` = taa.`id_agente` AND taa.`nombre` IN ("us-east-1", "us-east-2", "us-west-1", "us-west-2", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "ap-northeast-1", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "sa-east-1") SET ta.nombre = md5(concat((SELECT `username` FROM `tcredential_store` WHERE `identifier` = "imported_aws_account" LIMIT 1), ta.`nombre`)); + +UPDATE `tagente` SET `nombre` = md5(concat((SELECT `username` FROM `tcredential_store` WHERE `identifier` = "imported_aws_account" LIMIT 1), `nombre`)) WHERE `nombre` IN ("Aws", "us-east-1", "us-east-2", "us-west-1", "us-west-2", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "ap-northeast-1", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "sa-east-1"); + +UPDATE `trecon_task` SET `auth_strings` = "imported_aws_account" WHERE `type` IN (2,6,7); COMMIT; 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 2c9ff7e7de..4bad7b3652 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 @@ -1007,10 +1007,12 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` ( `agent_version` varchar(100) default '', `ultimo_contacto_remoto` datetime default '1970-01-01 00:00:00', `disabled` tinyint(2) NOT NULL default '0', + `remote` tinyint(1) NOT NULL default '0', `id_parent` int(10) unsigned default '0', `custom_id` varchar(255) default '', `server_name` varchar(100) default '', `cascade_protection` tinyint(2) NOT NULL default '0', + `cascade_protection_module` int(10) unsigned default '0', `timezone_offset` TINYINT(2) NULL DEFAULT '0' COMMENT 'number of hours of diference with the server timezone' , `icon_path` VARCHAR(127) NULL DEFAULT NULL COMMENT 'path in the server to the image of the icon representing the agent' , `update_gis_data` TINYINT(1) NOT NULL DEFAULT '1' COMMENT 'set it to one to update the position data (altitude, longitude, latitude) when getting information from the agent or to 0 to keep the last value and do not update it' , @@ -1025,19 +1027,21 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` ( `fired_count` bigint(20) NOT NULL default '0', `update_module_count` tinyint(1) NOT NULL default '0', `update_alert_count` tinyint(1) NOT NULL default '0', + `update_secondary_groups` tinyint(1) NOT NULL default '0', + `transactional_agent` tinyint(1) NOT NULL default '0', + `alias` varchar(600) BINARY NOT NULL default '', + `alias_as_name` tinyint(2) NOT NULL default '0', + `safe_mode_module` int(10) unsigned NOT NULL default '0', + `cps` int NOT NULL default 0, PRIMARY KEY (`id_agente`), KEY `nombre` (`nombre`(255)), KEY `direccion` (`direccion`), + KEY `id_tagente_idx` (`id_tagente`), KEY `disabled` (`disabled`), KEY `id_grupo` (`id_grupo`), FOREIGN KEY (`id_tmetaconsole_setup`) REFERENCES tmetaconsole_setup(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE tmetaconsole_agent ADD COLUMN `remote` tinyint(1) NOT NULL default '0'; -ALTER TABLE tmetaconsole_agent ADD COLUMN `cascade_protection_module` int(10) default '0'; -ALTER TABLE tmetaconsole_agent ADD COLUMN `transactional_agent` tinyint(1) NOT NULL default '0'; -ALTER TABLE tmetaconsole_agent ADD COLUMN `alias` VARCHAR(600) not null DEFAULT ''; - -- --------------------------------------------------------------------- -- Table `ttransaction` -- --------------------------------------------------------------------- @@ -1235,13 +1239,13 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned; 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', 28); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 29); 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_enterprise', '735'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '736'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'); -- --------------------------------------------------------------------- @@ -2192,3 +2196,16 @@ CREATE TABLE `tvisual_console_elements_cache` ( ON UPDATE CASCADE ) engine=InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tcredential_store` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tcredential_store` ( + `identifier` varchar(100) NOT NULL, + `id_group` mediumint(4) unsigned NOT NULL DEFAULT 0, + `product` enum('CUSTOM', 'AWS', 'AZURE', 'GOOGLE') default 'CUSTOM', + `username` text, + `password` text, + `extra_1` text, + `extra_2` text, + PRIMARY KEY (`identifier`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/general/firts_task/recon_view.php b/pandora_console/general/firts_task/recon_view.php index 282a6b75be..8c59b23f64 100755 --- a/pandora_console/general/firts_task/recon_view.php +++ b/pandora_console/general/firts_task/recon_view.php @@ -35,6 +35,7 @@ ui_require_css_file('firts_task');

+
diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 7c6a3ab03b..3ea3a7f0c2 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -777,7 +777,7 @@ $table_adv_options = ' '.$adv_secondary_groups_right.' -
+
'.$table_adv_parent.$table_adv_module_mode.$table_adv_cascade; if ($new_agent) { @@ -788,7 +788,7 @@ if ($new_agent) { $table_adv_options .= '
'; $table_adv_options .= ' -
+
'.$table_adv_gis.$table_adv_agent_icon.$table_adv_url.$table_adv_quiet.$table_adv_status.$table_adv_remote.$table_adv_safe.'
'; diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php index b08dc62c4f..2dca9353ac 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php @@ -23,7 +23,6 @@ $idAgent = (int) get_parameter('id_agente', 0); $ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent); check_login(); - $ip_target = (string) get_parameter('ip_target', $ipAgent); $use_agent = get_parameter('use_agent'); $snmp_community = (string) get_parameter('snmp_community', 'public'); @@ -469,6 +468,9 @@ if (enterprise_installed()) { if ($row['server_type'] != 13) { $s_type = ' (Standard)'; } else { + // Check if satellite server has remote configuration enabled + $satellite_remote = config_agents_has_remote_configuration($id_agent); + $id_satellite = $row['id_server']; $s_type = ' (Satellite)'; } @@ -477,7 +479,17 @@ if (enterprise_installed()) { } $table->data[1][2] = ''.__('Server to execute command').''; -$table->data[1][3] = html_print_select($servers_to_exec, 'server_to_exec', $server_to_exec, '', '', '', true); +$table->data[1][2] .= ''.ui_print_help_tip(__('In order to use remote executions you need to enable remote execution in satellite server'), true, 'images/tip_help.png', false, 'display:').''; +$table->data[1][4] = html_print_select( + $servers_to_exec, + 'server_to_exec', + $server_to_exec, + 'satellite_remote_warn('.$id_satellite.','.$satellite_remote.') +', + '', + '', + true +); $snmp_versions['1'] = 'v. 1'; $snmp_versions['2'] = 'v. 2'; @@ -607,8 +619,12 @@ ui_require_jquery_file('bgiframe'); /* */ diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 22410b0e23..d5f6f1fcfd 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1213,7 +1213,7 @@ if ($update_module || $create_module) { $max_timeout = (int) get_parameter('max_timeout'); $max_retries = (int) get_parameter('max_retries'); - $min = (int) get_parameter_post('min'); + $min = (int) get_parameter('min'); $max = (int) get_parameter('max'); $interval = (int) get_parameter('module_interval', $intervalo); $ff_interval = (int) get_parameter('module_ff_interval'); diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 9e7ce18c4e..ba5ac4f2be 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -163,7 +163,7 @@ echo ''; echo __('Group').' '; $own_info = get_user_info($config['id_user']); -if (!$own_info['is_admin'] && check_acl($config['id_user'], 0, 'AW')) { +if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_acl($config['id_user'], 0, 'AW')) { $return_all_group = false; } else { $return_all_group = true; @@ -680,7 +680,7 @@ if ($agents !== false) { } echo ''; - ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset, 0, false, 'offset', true, 'pagination-bottom'); + ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset); echo "
"; } else { ui_print_info_message(['no_close' => true, 'message' => __('There are no defined agents') ]); diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index b340761265..13c313892a 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -267,10 +267,10 @@ if ($id_agent_module) { $cron_interval = explode(' ', $module['cron_interval']); if (isset($cron_interval[4])) { $minute_from = $cron_interval[0]; - $min = explode('-', $minute_from); - $minute_from = $min[0]; - if (isset($min[1])) { - $minute_to = $min[1]; + $minute = explode('-', $minute_from); + $minute_from = $minute[0]; + if (isset($minute[1])) { + $minute_to = $minute[1]; } $hour_from = $cron_interval[1]; diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 306e5f9804..c0a6181a8e 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -506,45 +506,5 @@ $(document).ready (function () { }); }); -// Show the SNMP browser window -function snmpBrowserWindow () { - - // Keep elements in the form and the SNMP browser synced - $('#text-target_ip').val($('#text-ip_target').val()); - $('#text-community').val($('#text-snmp_community').val()); - $('#snmp_browser_version').val($('#snmp_version').val()); - $('#text-snmp3_browser_auth_user').val($('#text-snmp3_auth_user').val()); - $('#snmp3_browser_security_level').val($('#snmp3_security_level').val()); - $('#snmp3_browser_auth_method').val($('#snmp3_auth_method').val()); - $('#password-snmp3_browser_auth_pass').val($('#password-snmp3_auth_pass').val()); - $('#snmp3_browser_privacy_method').val($('#snmp3_privacy_method').val()); - $('#password-snmp3_browser_privacy_pass').val($('#password-snmp3_privacy_pass').val()); - - $("#snmp_browser_container").show().dialog ({ - title: '', - resizable: true, - draggable: true, - modal: true, - overlay: { - opacity: 0.5, - background: "black" - }, - width: 920, - height: 500 - }); -} - -// Set the form OID to the value selected in the SNMP browser -function setOID () { - - if($('#snmp_browser_version').val() == '3'){ - $('#text-snmp_oid').val($('#table1-0-1').text()); - } else { - $('#text-snmp_oid').val($('#snmp_selected_oid').text()); - } - - // Close the SNMP browser - $('.ui-dialog-titlebar-close').trigger('click'); -} diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php index 961ea1f7d0..49a72f125d 100755 --- a/pandora_console/godmode/agentes/planned_downtime.list.php +++ b/pandora_console/godmode/agentes/planned_downtime.list.php @@ -52,7 +52,7 @@ if ($migrate_malformed) { // Header. ui_print_page_header( - __('Planned Downtime'), + __('Scheduled Downtime'), 'images/gm_monitoring.png', false, 'planned_downtime', @@ -136,9 +136,6 @@ $table_form = new StdClass(); $table_form->class = 'databox filters'; $table_form->width = '100%'; $table_form->rowstyle = []; -$table_form->rowstyle[0] = 'background-color: #f9faf9;'; -$table_form->rowstyle[1] = 'background-color: #f9faf9;'; -$table_form->rowstyle[2] = 'background-color: #f9faf9;'; $table_form->data = []; $row = []; diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index bfb0e8c64d..fb4b6f9ab1 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -113,6 +113,8 @@ $fields_available['instructions'] = __('Instructions'); $fields_available['server_name'] = __('Server Name'); $fields_available['data'] = __('Data'); $fields_available['module_status'] = __('Module Status'); +$fields_available['mini_severity'] = __('Severity mini'); + // Remove fields already selected. foreach ($fields_available as $key => $available) { @@ -124,7 +126,7 @@ foreach ($fields_available as $key => $available) { $table->data[0][0] = ''.__('Fields available').''; $table->data[1][0] = html_print_select($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px'); $table->data[1][1] = ''.html_print_image( - 'images/darrowright.png', + 'images/darrowright_green.png', true, [ 'id' => 'right', @@ -132,7 +134,7 @@ $table->data[1][1] = ''.html_print_image( ] ).''; $table->data[1][1] .= '



'.html_print_image( - 'images/darrowleft.png', + 'images/darrowleft_green.png', true, [ 'id' => 'left', diff --git a/pandora_console/godmode/events/events.php b/pandora_console/godmode/events/events.php index c937ad281c..72ae001fe1 100644 --- a/pandora_console/godmode/events/events.php +++ b/pandora_console/godmode/events/events.php @@ -50,17 +50,10 @@ if (check_acl($config['id_user'], 0, 'PM')) { 'text' => ''.html_print_image('images/event_responses.png', true, ['title' => __('Event responses')]).'', ]; - if (!is_metaconsole()) { - $buttons['fields'] = [ - 'active' => false, - 'text' => ''.html_print_image('images/custom_columns.png', true, ['title' => __('Custom fields')]).'', - ]; - } else { - $buttons['fields'] = [ - 'active' => false, - 'text' => ''.html_print_image('images/custom_columns.png', true, ['title' => __('Custom fields')]).'', - ]; - } + $buttons['fields'] = [ + 'active' => false, + 'text' => ''.html_print_image('images/custom_columns.png', true, ['title' => __('Custom fields')]).'', + ]; } switch ($section) { diff --git a/pandora_console/godmode/groups/credential_store.php b/pandora_console/godmode/groups/credential_store.php new file mode 100644 index 0000000000..9a822dc986 --- /dev/null +++ b/pandora_console/godmode/groups/credential_store.php @@ -0,0 +1,632 @@ + 'noaccess']; + } + + include 'general/noaccess.php'; + return; +} + +// Required files. +ui_require_css_file('credential_store'); +require_once $config['homedir'].'/include/functions_credential_store.php'; +require_once $config['homedir'].'/include/functions_io.php'; + +if (is_ajax()) { + $draw = get_parameter('draw', 0); + $filter = get_parameter('filter', []); + $get_key = get_parameter('get_key', 0); + $new_form = get_parameter('new_form', 0); + $new_key = get_parameter('new_key', 0); + $update_key = get_parameter('update_key', 0); + $delete_key = get_parameter('delete_key', 0); + + if ($new_form) { + echo print_inputs(); + exit; + } + + if ($delete_key) { + $identifier = get_parameter('identifier', null); + + if (empty($identifier)) { + ajax_msg('error', __('identifier cannot be empty')); + } + + if (db_process_sql_delete( + 'tcredential_store', + ['identifier' => $identifier] + ) === false + ) { + ajax_msg('error', $config['dbconnection']->error, true); + } else { + ajax_msg('result', $identifier, true); + } + } + + if ($update_key) { + $data = get_parameter('values', null); + + if ($data === null || !is_array($data)) { + echo json_encode(['error' => __('Invalid parameters, please retry')]); + exit; + } + + $values = []; + foreach ($data as $key => $value) { + if ($key == 'identifier') { + $identifier = base64_decode($value); + } else if ($key == 'product') { + $product = base64_decode($value); + } else { + $values[$key] = base64_decode($value); + } + } + + if (empty($identifier)) { + ajax_msg('error', __('identifier cannot be empty')); + } + + if (empty($product)) { + ajax_msg('error', __('product cannot be empty')); + } + + if (db_process_sql_update( + 'tcredential_store', + $values, + ['identifier' => $identifier] + ) === false + ) { + ajax_msg('error', $config['dbconnection']->error); + } else { + ajax_msg('result', $identifier); + } + + exit; + } + + if ($new_key) { + $data = get_parameter('values', null); + + if ($data === null || !is_array($data)) { + echo json_encode(['error' => __('Invalid parameters, please retry')]); + exit; + } + + $values = []; + foreach ($data as $key => $value) { + $values[$key] = base64_decode($value); + if ($key == 'identifier') { + $values[$key] = preg_replace('/\s+/', '-', trim($values[$key])); + } + } + + $identifier = $values['identifier']; + + if (empty($identifier)) { + ajax_msg('error', __('identifier cannot be empty')); + } + + if (empty($values['product'])) { + ajax_msg('error', __('product cannot be empty')); + } + + if (db_process_sql_insert('tcredential_store', $values) === false) { + ajax_msg('error', $config['dbconnection']->error); + } else { + ajax_msg('result', $identifier); + } + + exit; + } + + if ($get_key) { + $identifier = get_parameter('identifier', null); + + $key = get_key($identifier); + echo print_inputs($key); + + exit; + } + + if ($draw) { + // Datatables offset, limit and order. + $start = get_parameter('start', 0); + $length = get_parameter('length', $config['block_size']); + $order = get_datatable_order(true); + try { + ob_start(); + + $fields = [ + 'cs.*', + 'tg.nombre as `group`', + ]; + + // Retrieve data. + $data = credentials_get_all( + // Fields. + $fields, + // Filter. + $filter, + // Offset. + $start, + // Limit. + $length, + // Order. + $order['direction'], + // Sort field. + $order['field'] + ); + + // Retrieve counter. + $count = credentials_get_all( + 'count', + $filter + ); + + if ($data) { + $data = array_reduce( + $data, + function ($carry, $item) { + // Transforms array of arrays $data into an array + // of objects, making a post-process of certain fields. + $tmp = (object) $item; + $tmp->username = io_safe_output($tmp->username); + + if (empty($tmp->group)) { + $tmp->group = __('All'); + } else { + $tmp->group = io_safe_output($tmp->group); + } + + $carry[] = $tmp; + return $carry; + } + ); + } + + // Datatables format: RecordsTotal && recordsfiltered. + echo json_encode( + [ + 'data' => $data, + 'recordsTotal' => $count, + 'recordsFiltered' => $count, + ] + ); + // Capture output. + $response = ob_get_clean(); + } catch (Exception $e) { + return json_encode(['error' => $e->getMessage()]); + } + + // If not valid, show error with issue. + json_decode($response); + if (json_last_error() == JSON_ERROR_NONE) { + // If valid dump. + echo $response; + } else { + echo json_encode( + ['error' => $response] + ); + } + + + exit; + } + + exit; +} + +// Datatables list. +try { + $columns = [ + 'group', + 'identifier', + 'product', + 'username', + 'options', + ]; + + $column_names = [ + __('Group'), + __('Identifier'), + __('Product'), + __('User'), + [ + 'text' => __('Options'), + 'class' => 'action_buttons', + ], + ]; + + $table_id = 'keystore'; + // Load datatables user interface. + ui_print_datatable( + [ + 'id' => $table_id, + 'class' => 'info_table', + 'style' => 'width: 100%', + 'columns' => $columns, + 'column_names' => $column_names, + 'ajax_url' => 'godmode/groups/credential_store', + 'ajax_postprocess' => 'process_datatables_item(item)', + 'no_sortable_columns' => [-1], + 'order' => [ + 'field' => 'identifier', + 'direction' => 'asc', + ], + 'search_button_class' => 'sub filter float-right', + 'form' => [ + 'inputs' => [ + [ + 'label' => __('Group'), + 'type' => 'select', + 'id' => 'filter_id_group', + 'name' => 'filter_id_group', + 'options' => users_get_groups_for_select( + $config['id_user'], + 'AR', + true, + true, + false + ), + ], + [ + 'label' => __('Free search'), + 'type' => 'text', + 'class' => 'mw250px', + 'id' => 'free_search', + 'name' => 'free_search', + ], + ], + ], + ] + ); +} catch (Exception $e) { + echo $e->getMessage(); +} + +// Auxiliar div. +$new = ''; +$details = ''; +$aux = ''; + + +echo $new.$details.$aux; + +// Create button. +echo '
'; +html_print_submit_button( + __('Add key'), + 'create', + false, + 'class="sub next"' +); +echo '
'; + +?> + + diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index ee61cdaf79..8cb3c106c1 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -1,20 +1,36 @@ $v) { $agents[$keys_prefix.$k] = $v; unset($agents[$k]); if ($all_agents) { - // Unserialize to get the status + // Unserialize to get the status. if ($serialized && is_metaconsole()) { $agent_info = explode($serialized_separator, $k); $agent_disabled = db_get_value_filter( @@ -174,7 +193,8 @@ if (is_ajax()) { ['id_agente' => $agent_info[1]] ); } else if (!$serialized && is_metaconsole()) { - // Cannot retrieve the disabled status. Mark all as not disabled + // Cannot retrieve the disabled status. + // Mark all as not disabled. $agent_disabled = 0; } else { $agent_disabled = db_get_value_filter( @@ -226,11 +246,13 @@ if (! check_acl($config['id_user'], 0, 'PM')) { } $sec = defined('METACONSOLE') ? 'advanced' : 'gagente'; -$url_tree = "index.php?sec=$sec&sec2=godmode/groups/group_list&tab=tree"; -$url_groups = "index.php?sec=$sec&sec2=godmode/groups/group_list&tab=groups"; +$url_credbox = 'index.php?sec='.$sec.'&sec2=godmode/groups/group_list&tab=credbox'; +$url_tree = 'index.php?sec='.$sec.'&sec2=godmode/groups/group_list&tab=tree'; +$url_groups = 'index.php?sec='.$sec.'&sec2=godmode/groups/group_list&tab=groups'; + $buttons['tree'] = [ 'active' => false, - 'text' => "".html_print_image( + 'text' => ''.html_print_image( 'images/gm_massive_operations.png', true, [ @@ -241,7 +263,7 @@ $buttons['tree'] = [ $buttons['groups'] = [ 'active' => false, - 'text' => "".html_print_image( + 'text' => ''.html_print_image( 'images/group.png', true, [ @@ -250,21 +272,38 @@ $buttons['groups'] = [ ).'', ]; +$buttons['credbox'] = [ + 'active' => false, + 'text' => ''.html_print_image( + 'images/key.png', + true, + [ + 'title' => __('Credential Store'), + ] + ).'', +]; + $tab = (string) get_parameter('tab', 'groups'); -// Marks correct tab +$title = __('Groups defined in %s', get_product_name()); +// Marks correct tab. switch ($tab) { case 'tree': $buttons['tree']['active'] = true; break; + case 'credbox': + $buttons['credbox']['active'] = true; + $title = __('Credential store'); + break; + case 'groups': default: $buttons['groups']['active'] = true; break; } -// Header +// Header. if (defined('METACONSOLE')) { agents_meta_print_header(); echo '
'; @@ -272,7 +311,7 @@ if (defined('METACONSOLE')) { echo '
'; } else { ui_print_page_header( - __('Groups defined in %s', get_product_name()), + $title, 'images/group.png', false, 'group_list_tab', @@ -281,12 +320,19 @@ if (defined('METACONSOLE')) { ); } +// Load credential store view before parse list-tree forms. +if ($tab == 'credbox') { + include_once __DIR__.'/credential_store.php'; + // Stop script. + return; +} + $create_group = (bool) get_parameter('create_group'); $update_group = (bool) get_parameter('update_group'); $delete_group = (bool) get_parameter('delete_group'); $pure = get_parameter('pure', 0); -// Create group +// Create group. if (($create_group) && (check_acl($config['id_user'], 0, 'PM'))) { $name = (string) get_parameter('name'); $icon = (string) get_parameter('icon'); @@ -301,7 +347,7 @@ if (($create_group) && (check_acl($config['id_user'], 0, 'PM'))) { $check = db_get_value('nombre', 'tgrupo', 'nombre', $name); $propagate = (bool) get_parameter('propagate'); - // Check if name field is empty + // Check if name field is empty. if ($name != '') { if (!$check) { $values = [ @@ -328,12 +374,11 @@ if (($create_group) && (check_acl($config['id_user'], 0, 'PM'))) { ui_print_error_message(__('Each group must have a different name')); } } else { - // $result = false; ui_print_error_message(__('Group must have a name')); } } -// Update group +// Update group. if ($update_group) { $id_group = (int) get_parameter('id_group'); $name = (string) get_parameter('name'); @@ -349,49 +394,35 @@ if ($update_group) { $contact = (string) get_parameter('contact'); $other = (string) get_parameter('other'); - // Check if name field is empty + // Check if name field is empty. if ($name != '') { - switch ($config['dbtype']) { - case 'mysql': - $sql = sprintf( - 'UPDATE tgrupo SET nombre = "%s", - icon = "%s", disabled = %d, parent = %d, custom_id = "%s", propagate = %d, id_skin = %d, description = "%s", contact = "%s", other = "%s", password = "%s" - WHERE id_grupo = %d', - $name, - empty($icon) ? '' : substr($icon, 0, -4), - !$alerts_enabled, - $id_parent, - $custom_id, - $propagate, - $skin, - $description, - $contact, - $other, - $group_pass, - $id_group - ); - break; - - case 'postgresql': - case 'oracle': - $sql = sprintf( - 'UPDATE tgrupo SET nombre = \'%s\', - icon = \'%s\', disabled = %d, parent = %d, custom_id = \'%s\', propagate = %d, id_skin = %d, description = \'%s\', contact = \'%s\', other = \'%s\' - WHERE id_grupo = %d', - $name, - substr($icon, 0, -4), - !$alerts_enabled, - $id_parent, - $custom_id, - $propagate, - $skin, - $description, - $contact, - $other, - $id_group - ); - break; - } + $sql = sprintf( + 'UPDATE tgrupo + SET nombre = "%s", + icon = "%s", + disabled = %d, + parent = %d, + custom_id = "%s", + propagate = %d, + id_skin = %d, + description = "%s", + contact = "%s", + other = "%s", + password = "%s" + WHERE id_grupo = %d', + $name, + empty($icon) ? '' : substr($icon, 0, -4), + !$alerts_enabled, + $id_parent, + $custom_id, + $propagate, + $skin, + $description, + $contact, + $other, + $group_pass, + $id_group + ); $result = db_process_sql($sql); } else { @@ -405,7 +436,7 @@ if ($update_group) { } } -// Delete group +// Delete group. if (($delete_group) && (check_acl($config['id_user'], 0, 'PM'))) { $id_group = (int) get_parameter('id_group'); @@ -445,7 +476,14 @@ if (($delete_group) && (check_acl($config['id_user'], 0, 'PM'))) { } } + +// Credential store is loaded previously in this document to avoid +// process group tree - list forms. if ($tab == 'tree') { + /* + * Group tree view. + */ + echo html_print_image( 'images/spinner.gif', true, @@ -456,6 +494,10 @@ if ($tab == 'tree') { ); echo "
"; } else { + /* + * Group list view. + */ + $acl = ''; $search_name = ''; $offset = (int) get_parameter('offset', 0); @@ -463,17 +505,22 @@ if ($tab == 'tree') { $block_size = $config['block_size']; if (!empty($search)) { - $search_name = "AND t.nombre LIKE '%$search%'"; + $search_name = 'AND t.nombre LIKE "%'.$search.'%"'; } if (!users_can_manage_group_all('AR')) { $user_groups_acl = users_get_groups(false, 'AR'); $groups_acl = implode(',', $user_groups_ACL); if (empty($groups_acl)) { - return ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups') ]); + return ui_print_info_message( + [ + 'no_close' => true, + 'message' => __('There are no defined groups'), + ] + ); } - $acl = "AND t.id_grupo IN ($groups_acl)"; + $acl = 'AND t.id_grupo IN ('.$groups_acl.')'; } $form = "
"; @@ -488,29 +535,37 @@ if ($tab == 'tree') { echo $form; - $groups_sql = "SELECT t.*, + $groups_sql = sprintf( + 'SELECT t.*, p.nombre AS parent_name, IF(t.parent=p.id_grupo, 1, 0) AS has_child - FROM tgrupo t - LEFT JOIN tgrupo p + FROM tgrupo t + LEFT JOIN tgrupo p ON t.parent=p.id_grupo - WHERE 1=1 - $acl - $search_name + WHERE 1=1 + %s + %s ORDER BY nombre - LIMIT $offset, $block_size - "; + LIMIT %d, %d', + $acl, + $search_name, + $offset, + $block_size + ); $groups = db_get_all_rows_sql($groups_sql); if (!empty($groups)) { - // Count all groups for pagination only saw user and filters - $groups_sql_count = "SELECT count(*) + // Count all groups for pagination only saw user and filters. + $groups_sql_count = sprintf( + 'SELECT count(*) FROM tgrupo t WHERE 1=1 - $acl - $search_name - "; + %s + %s', + $acl, + $search_name + ); $groups_count = db_get_value_sql($groups_sql_count); $table = new StdClass(); @@ -545,7 +600,7 @@ if ($tab == 'tree') { $url = 'index.php?sec=gagente&sec2=godmode/groups/configure_group&id_group='.$group['id_grupo']; $url_delete = 'index.php?sec=gagente&sec2=godmode/groups/group_list&delete_group=1&id_group='.$group['id_grupo']; $table->data[$key][0] = $group['id_grupo']; - $table->data[$key][1] = "".$group['nombre'].''; + $table->data[$key][1] = ''.$group['nombre'].''; if ($group['icon'] != '') { $table->data[$key][2] = html_print_image( 'images/groups_small/'.$group['icon'].'.png', @@ -553,22 +608,25 @@ if ($tab == 'tree') { [ 'style' => '', 'class' => 'bot', - 'alt' => $group['nombre'], + 'alt' => $group['nombre'], 'title' => $group['nombre'], - false, false, false, true - ] + ], + false, + false, + false, + true ); } else { $table->data[$key][2] = ''; } - // reporting_get_group_stats - $table->data[$key][3] = $group['disabled'] ? __('Disabled') : __('Enabled'); + // Reporting_get_group_stats. + $table->data[$key][3] = ($group['disabled']) ? __('Disabled') : __('Enabled'); $table->data[$key][4] = $group['parent_name']; $table->data[$key][5] = $group['description']; $table->cellclass[$key][6] = 'action_buttons'; - $table->data[$key][6] = "".html_print_image( + $table->data[$key][6] = ''.html_print_image( 'images/config.png', true, [ diff --git a/pandora_console/godmode/massive/massive_copy_modules.php b/pandora_console/godmode/massive/massive_copy_modules.php index b79a64460e..5ca25ebc11 100755 --- a/pandora_console/godmode/massive/massive_copy_modules.php +++ b/pandora_console/godmode/massive/massive_copy_modules.php @@ -177,6 +177,9 @@ $table->data['operations'][1] .= html_print_checkbox('copy_alerts', 1, true, tru $table->data['operations'][1] .= html_print_label(__('Copy alerts'), 'checkbox-copy_alerts', true); $table->data['operations'][1] .= ''; +$table->data['form_modules_filter'][0] = __('Filter Modules'); +$table->data['form_modules_filter'][1] = html_print_input_text('filter_modules', '', '', 20, 255, true); + $table->data[1][0] = __('Modules'); $table->data[1][1] = ''; $table->data[1][1] .= html_print_select( @@ -302,6 +305,8 @@ echo ''; ui_require_jquery_file('form'); ui_require_jquery_file('pandora.controls'); ?> + + '; + $output .= ''; + } else { + // This is for public link on the dashboard + $sql_count_event = 'SELECT SQL_NO_CACHE COUNT(id_evento) FROM tevento '; + if ($config['event_view_hr']) { + $sql_count_event .= 'WHERE utimestamp > (UNIX_TIMESTAMP(NOW()) - '.($config['event_view_hr'] * SECONDS_1HOUR).')'; + } - return $output; + $system_events = db_get_value_sql($sql_count_event); + + $output .= ''; + } + + return $output; } diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index 8e916166df..dded175af5 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -597,7 +597,7 @@ function snmp_browser_print_oid( * * @return string The container div. */ -function snmp_browser_print_container($return=false, $width='100%', $height='500px', $display='') +function snmp_browser_print_container($return=false, $width='100%', $height='60%', $display='') { // Target selection $table = new stdClass(); @@ -773,7 +773,7 @@ function snmp_browser_print_container($return=false, $width='100%', $height='500 $output .= ''; $output .= ''; - $output .= '
'; + $output .= '
'; $output .= '
'; $output .= ''; $output .= ''; diff --git a/pandora_console/include/functions_tactical.php b/pandora_console/include/functions_tactical.php index c10f194386..39f44a9beb 100644 --- a/pandora_console/include/functions_tactical.php +++ b/pandora_console/include/functions_tactical.php @@ -444,7 +444,7 @@ function tactical_monitor_fired_alerts($group_array, $strict_user=false, $id_gro WHERE tagente.id_grupo IN $group_clause_strict AND tagente_modulo.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo - AND times_fired > 0 "; + AND times_fired > 0 AND talert_template_modules.disabled = 0"; $count = db_get_sql($sql); return $count; @@ -456,7 +456,7 @@ function tactical_monitor_fired_alerts($group_array, $strict_user=false, $id_gro WHERE tagente.id_grupo IN $group_clause AND tagente_modulo.id_agente = tagente.id_agente AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo - AND times_fired > 0" + AND times_fired > 0 AND talert_template_modules.disabled = 0" ); } diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 6d0211f89d..aad6d78efd 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -745,7 +745,8 @@ function tags_get_acl_tags( $meta=false, $childrens_ids=[], $force_group_and_tag=false, - $id_grupo_table_pretag='' + $id_grupo_table_pretag='', + $alt_id_grupo_table_pretag='' ) { global $config; @@ -820,7 +821,8 @@ function tags_get_acl_tags( $meta, $force_group_and_tag, false, - $id_grupo_table_pretag + $id_grupo_table_pretag, + $alt_id_grupo_table_pretag ); if (!empty($condition)) { @@ -917,7 +919,8 @@ function tags_get_acl_tags_event_condition( $meta=false, $force_group_and_tag=false, $force_equal=false, - $id_grupo_table_pretag='' + $id_grupo_table_pretag='', + $alt_id_grupo_table_pretag='' ) { global $config; $condition = []; @@ -935,7 +938,7 @@ function tags_get_acl_tags_event_condition( // Group condition (The module belongs to an agent of the group X) // $group_condition = sprintf('id_grupo IN (%s)', implode(',', array_values(groups_get_id_recursive($group_id, true))));. - $group_condition = '('.$id_grupo_table_pretag.'id_grupo = '.$group_id.' OR id_group = '.$group_id.')'; + $group_condition = '('.$id_grupo_table_pretag.'id_grupo = '.$group_id.' OR '.$alt_id_grupo_table_pretag.'id_group = '.$group_id.')'; // Tags condition (The module has at least one of the restricted tags). $tags_condition = ''; @@ -971,7 +974,7 @@ function tags_get_acl_tags_event_condition( } $in_group = implode(',', $without_tags); - $condition .= sprintf('('.$id_grupo_table_pretag.'id_grupo IN (%s) OR id_group IN (%s))', $in_group, $in_group); + $condition .= sprintf('('.$id_grupo_table_pretag.'id_grupo IN (%s) OR '.$alt_id_grupo_table_pretag.'id_group IN (%s))', $in_group, $in_group); } $condition = !empty($condition) ? "($condition)" : ''; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index ea07c20d6a..ef8089ac3a 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -760,6 +760,12 @@ function ui_print_os_icon( $subfolder .= '/so_big_icons'; } + if (is_metaconsole()) { + $no_in_meta = true; + } else { + $no_in_meta = false; + } + $icon = (string) db_get_value('icon_name', 'tconfig_os', 'id_os', (int) $id_os); $os_name = get_os_name($id_os); if (empty($icon)) { @@ -770,7 +776,7 @@ function ui_print_os_icon( $options, true, $relative, - false, + $no_in_meta, true ); } else { @@ -778,13 +784,13 @@ function ui_print_os_icon( } } else if ($apply_skin) { if ($only_src) { - $output = html_print_image('images/'.$subfolder.'/'.$icon, true, $options, true, $relative, false, true); + $output = html_print_image('images/'.$subfolder.'/'.$icon, true, $options, true, $relative, $no_in_meta, true); } else { if (!isset($options['title'])) { $options['title'] = $os_name; } - $output = html_print_image('images/'.$subfolder.'/'.$icon, true, $options, false, $relative, false, true); + $output = html_print_image('images/'.$subfolder.'/'.$icon, true, $options, false, $relative, $no_in_meta, true); } } else { // $output = "" . $os_name . ""; @@ -2907,8 +2913,10 @@ function ui_print_datatable(array $parameters) if (isset($parameters['id'])) { $table_id = $parameters['id']; + $form_id = 'form_'.$parameters['id']; } else { $table_id = uniqid('datatable_'); + $form_id = uniqid('datatable_filter_'); } if (!isset($parameters['columns']) || !is_array($parameters['columns'])) { @@ -2936,15 +2944,15 @@ function ui_print_datatable(array $parameters) } if (!isset($parameters['order']['field'])) { - $order = 1; + $order = 0; } else { $order = array_search( $parameters['order']['field'], $parameters['columns'] ); - if (empty($order)) { - $order = 1; + if ($order === false) { + $order = 0; } } @@ -2995,8 +3003,6 @@ function ui_print_datatable(array $parameters) if (isset($parameters['form']) && is_array($parameters['form'])) { if (isset($parameters['form']['id'])) { $form_id = $parameters['form']['id']; - } else { - $form_id = uniqid('datatable_filter_'); } if (isset($parameters['form']['class'])) { @@ -3026,27 +3032,35 @@ function ui_print_datatable(array $parameters) $filter .= $parameters['form']['html']; } - $filter .= '
    '; + $filter .= '
      '; foreach ($parameters['form']['inputs'] as $input) { $filter .= '
    • '; $filter .= ''; if ($input['type'] != 'select') { $filter .= ''; } else { // Select. - $filter .= ''; @@ -3074,7 +3088,7 @@ function ui_print_datatable(array $parameters) $filter .= '
    • '; - $filter .= '
    '; + $filter .= '
'; $filter = ui_toggle( $filter, __('Filter'), @@ -3220,8 +3234,10 @@ function ui_print_datatable(array $parameters) $.extend(data, { filter: values,'."\n"; - foreach ($parameters['ajax_data'] as $k => $v) { - $js .= $k.':'.json_encode($v).",\n"; + if (is_array($parameters['ajax_data'])) { + foreach ($parameters['ajax_data'] as $k => $v) { + $js .= $k.':'.json_encode($v).",\n"; + } } $js .= 'page: "'.$parameters['ajax_url'].'" diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index 3b4af210d0..d461ca9754 100755 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -293,7 +293,7 @@ function users_get_groups( } // Per-group permissions. else { - $query = 'SELECT * FROM tgrupo ORDER BY parent,id_grupo DESC'; + $query = 'SELECT * FROM tgrupo ORDER BY nombre'; $raw_groups = db_get_all_rows_sql($query); $query = sprintf( diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 38b7f75f1c..f7af997508 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -869,7 +869,7 @@ function pandoraFlotSlicebar( var datas = new Array(); - for (i = 0; i < values.length; i++) { + for (var i = 0; i < values.length; i++) { var serie = values[i].split(separator); var aux = new Array(); @@ -1938,6 +1938,8 @@ function pandoraFlotArea( switch (type) { case "line": case 2: + stacked = null; + filled_s = false; break; case 3: stacked = "stack"; diff --git a/pandora_console/include/graphs/functions_flot.php b/pandora_console/include/graphs/functions_flot.php index 4492da7834..8e32673b48 100644 --- a/pandora_console/include/graphs/functions_flot.php +++ b/pandora_console/include/graphs/functions_flot.php @@ -279,6 +279,12 @@ function flot_area_graph( // Trick to get translated string from javascript. $return .= html_print_input_hidden('unknown_text', __('Unknown'), true); + // To use the js document ready event or not. Default true. + $document_ready = true; + if (isset($params['document_ready']) === true) { + $document_ready = $params['document_ready']; + } + $values = json_encode($array_data); $legend = json_encode($legend); @@ -295,9 +301,28 @@ function flot_area_graph( } $return .= "'; // Parent layer. @@ -428,11 +453,9 @@ function flot_pie_chart( include_javascript_dependencies_flot_graph(); $return .= "'; return $return; @@ -508,11 +531,9 @@ function flot_custom_pie_chart( $colors = implode($separator, $temp_colors); $return .= "'; return $return; @@ -608,10 +629,8 @@ function flot_hcolumn_chart($graph_data, $width, $height, $water_mark, $font='', // Javascript code $return .= "'; return $return; @@ -701,7 +720,6 @@ function flot_vcolumn_chart($graph_data, $width, $height, $color, $legend, $long // Javascript code $return .= "'; return $return; @@ -887,9 +904,7 @@ function flot_slicesbar_graph( // Javascript code $return .= "'; diff --git a/pandora_console/include/help/clippy/module_unknow.php b/pandora_console/include/help/clippy/module_unknow.php index 28656c9ba2..d3a6245032 100644 --- a/pandora_console/include/help/clippy/module_unknow.php +++ b/pandora_console/include/help/clippy/module_unknow.php @@ -32,7 +32,7 @@ function clippy_module_unknow() $return_tours['tours']['module_unknow']['steps'] = []; $return_tours['tours']['module_unknow']['steps'][] = [ 'init_step_context' => true, - 'intro' => ''.''.''.''.''.''.''.'
'.__('You have unknown modules in this agent.').'
'.__('Unknown modules are modules which receive data normally at least in one occassion, but at this time are not receving data. Please check our troubleshoot help page to help you determine why you have unknown modules.').ui_print_help_icon('context_module_unknow', true, '', 'images/help.png').'
', + 'intro' => ''.''.''.''.''.''.''.'
'.__('You have unknown modules in this agent.').'
'.__('Unknown modules are modules which receive data normally at least in one occassion, but at this time are not receving data. Please check our troubleshoot help page to help you determine why you have unknown modules.').'
', ]; $return_tours['tours']['module_unknow']['conf'] = []; $return_tours['tours']['module_unknow']['conf']['autostart'] = false; diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index 9e0b3447af..ed75400386 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -1,386 +1,405 @@ (function($) { - $.fn.check = function () { - return this.each (function () { - this.checked = true; - });}; + $.fn.check = function() { + return this.each(function() { + this.checked = true; + }); + }; - $.fn.uncheck = function () { - return this.each (function () { - this.checked = false; - });}; + $.fn.uncheck = function() { + return this.each(function() { + this.checked = false; + }); + }; - $.fn.enable = function () { - return $(this).removeAttr ("disabled"); - }; + $.fn.enable = function() { + return $(this).removeAttr("disabled"); + }; - $.fn.disable = function () { - return $(this).attr ("disabled", "disabled"); - }; + $.fn.disable = function() { + return $(this).attr("disabled", "disabled"); + }; - $.fn.pulsate = function () { - var i = 0; - for (i = 0; i <= 2; i++) { - $(this).fadeOut ("slow").fadeIn ("slow"); - } - }; + $.fn.pulsate = function() { + var i = 0; + for (i = 0; i <= 2; i++) { + $(this) + .fadeOut("slow") + .fadeIn("slow"); + } + }; - $.fn.showMessage = function (msg) { - return $(this).hide ().empty () - // here, previously .text (msg) - .html (msg) - .slideDown (); - }; -}) (jQuery); + $.fn.showMessage = function(msg) { + return ( + $(this) + .hide() + .empty() + // here, previously .text (msg) + .html(msg) + .slideDown() + ); + }; +})(jQuery); -$(document).ready (function () { - $("a#show_messages_dialog").click (function () { - jQuery.post ("ajax.php", - { - "page": "operation/messages/message_list" - }, - function (data, status) { - $("#dialog_messages").hide () - .empty () - .append (data) - .dialog ({ - title: $("a#show_messages_dialog").attr ("title"), - resizable: false, - modal: true, - overlay: { - opacity: 0.5, - background: "black" - }, - width: 700, - height: 300 - }).show (); - }, - "html" - ); +$(document).ready(function() { + $("a#show_messages_dialog").click(function() { + jQuery.post( + "ajax.php", + { + page: "operation/messages/message_list" + }, + function(data, status) { + $("#dialog_messages") + .hide() + .empty() + .append(data) + .dialog({ + title: $("a#show_messages_dialog").attr("title"), + resizable: false, + modal: true, + overlay: { + opacity: 0.5, + background: "black" + }, + width: 700, + height: 300 + }) + .show(); + }, + "html" + ); - return false; - }); + return false; + }); - $("a.show_systemalert_dialog").click (function () { - $('body').append( "
" ); - $("#opacidad").css('opacity', 0.5); + $("a.show_systemalert_dialog").click(function() { + $("body").append( + "
" + ); + $("#opacidad").css("opacity", 0.5); - jQuery.post ("ajax.php", - { - "page": "operation/system_alert"}, - function (data, status) { - $("#alert_messages").show(); - $("#alert_messages").empty ().append (data); - $("#alert_messages").css('opacity', 1); + jQuery.post( + "ajax.php", + { + page: "operation/system_alert" + }, + function(data, status) { + $("#alert_messages").show(); + $("#alert_messages") + .empty() + .append(data); + $("#alert_messages").css("opacity", 1); + }, + "html" + ); + }); - }, - "html" - ); - }); - - $("a.modalpopup").click (function () { - var elem = $(this).attr("id"); - $('body').append( "
" ); - $("#opacidad").css('opacity', 0.5); + $("a.modalpopup").click(function() { + var elem = $(this).attr("id"); + $("body").append( + "
" + ); + $("#opacidad").css("opacity", 0.5); - jQuery.post ("ajax.php", - { - "page": "general/alert_enterprise", - "message": elem - }, - function (data, status) { - $("#alert_messages").show(); - $("#alert_messages").empty ().append (data); - $("#alert_messages").css('opacity', 1); - }, - "html" - ); - return false; - }); + jQuery.post( + "ajax.php", + { + page: "general/alert_enterprise", + message: elem + }, + function(data, status) { + $("#alert_messages").show(); + $("#alert_messages") + .empty() + .append(data); + $("#alert_messages").css("opacity", 1); + }, + "html" + ); + return false; + }); - // Creacion de ventana modal y botones - $(".publienterprise").click (function () { - var elem = $(this).attr("id"); - $('body').append( "
" ); - $("#opacidad").css('opacity', 0.5); + // Creacion de ventana modal y botones + $(".publienterprise").click(function() { + var elem = $(this).attr("id"); + $("body").append( + "
" + ); + $("#opacidad").css("opacity", 0.5); - jQuery.post ("ajax.php", - { - "page": "general/alert_enterprise", - "message": elem - }, - function (data, status) { - $("#alert_messages").show(); - $("#alert_messages").empty ().append (data); - $("#alert_messages").css('opacity', 1); - }, - "html" - ); - return false; - }); - - - $(".publienterprisehide").click (function () { - var elem = $(this).attr("id"); - $('body').append( "
" ); - $("#opacidad").css('opacity', 0.5); + jQuery.post( + "ajax.php", + { + page: "general/alert_enterprise", + message: elem + }, + function(data, status) { + $("#alert_messages").show(); + $("#alert_messages") + .empty() + .append(data); + $("#alert_messages").css("opacity", 1); + }, + "html" + ); + return false; + }); - jQuery.post ("ajax.php", - { - "page": "general/alert_enterprise", - "message": elem - }, - function (data, status) { - $("#alert_messages").show(); - $("#alert_messages").empty ().append (data); - $("#alert_messages").css('opacity', 1); - }, - "html" - ); - return false; - }); + $(".publienterprisehide").click(function() { + var elem = $(this).attr("id"); + $("body").append( + "
" + ); + $("#opacidad").css("opacity", 0.5); + jQuery.post( + "ajax.php", + { + page: "general/alert_enterprise", + message: elem + }, + function(data, status) { + $("#alert_messages").show(); + $("#alert_messages") + .empty() + .append(data); + $("#alert_messages").css("opacity", 1); + }, + "html" + ); + return false; + }); + if ($("#license_error_msg_dialog").length) { + if (typeof process_login_ok == "undefined") process_login_ok = 0; - if ($('#license_error_msg_dialog').length) { - if (typeof(process_login_ok) == "undefined") - process_login_ok = 0; + if (typeof show_error_license == "undefined") show_error_license = 0; - if (typeof(show_error_license) == "undefined") - show_error_license = 0; + if (process_login_ok || show_error_license) { + $("#license_error_msg_dialog").dialog({ + dialogClass: "no-close", + closeOnEscape: false, + resizable: false, + draggable: true, + modal: true, + height: 470, + width: 850, + overlay: { + opacity: 0.5, + background: "black" + }, + open: function() { + var remaining = 30; - if (process_login_ok || show_error_license) { + // Timeout counter. + var count = function() { + if (remaining > 0) { + $("#license_error_remaining").text(remaining); + remaining -= 1; + } else { + $("#license_error_remaining").hide(); + $("#ok_buttom").show(); + clearInterval(count); + } + }; - $( "#license_error_msg_dialog" ).dialog({ - dialogClass: "no-close", - closeOnEscape: false, - resizable: false, - draggable: true, - modal: true, - height: 450, - width: 850, - overlay: { - opacity: 0.5, - background: "black" - }, - open: function() { - var remaining = 30; + setInterval(count, 1000); + } + }); - // Timeout counter. - var count = function() { - if (remaining > 0) { - $("#license_error_remaining").text(remaining); - remaining -= 1; - } else { - $("#license_error_remaining").hide(); - $("#ok_buttom").show(); - clearInterval(count); - } - } + $("#submit-hide-license-error-msg").click(function() { + $("#license_error_msg_dialog").dialog("close"); + }); + } + } - setInterval(count, 1000); - } - }); + if ($("#msg_change_password").length) { + $("#msg_change_password").dialog({ + resizable: false, + draggable: true, + modal: true, + height: 450, + width: 620, + overlay: { + opacity: 0.5, + background: "black" + } + }); + } - $("#submit-hide-license-error-msg").click (function () { - $("#license_error_msg_dialog" ).dialog('close') - }); + if ($("#login_blocked").length) { + $("#login_blocked").dialog({ + resizable: true, + draggable: true, + modal: true, + height: 200, + width: 520, + overlay: { + opacity: 0.5, + background: "black" + } + }); + } - } - } + if ($("#login_correct_pass").length) { + $("#login_correct_pass").dialog({ + resizable: true, + draggable: true, + modal: true, + height: 200, + width: 520, + overlay: { + opacity: 0.5, + background: "black" + } + }); + } + forced_title_callback(); - if ($('#msg_change_password').length) { + $(document).on("scroll", function() { + if ( + document.documentElement.scrollTop != 0 || + document.body.scrollTop != 0 + ) { + if ($("#head").css("position") == "fixed") { + if ($("#menu").css("position") == "fixed") { + $("#menu").css("top", "80px"); + } else { + $("#menu").css("top", "60px"); + } + } else { + if ($("#menu").css("position") == "fixed") { + $("#menu").css("top", "20px"); + } else { + $("#menu").css("top", "80px"); + } + } + } else { + if ($("#head").css("position") == "fixed") { + if ($("#menu").css("position") == "fixed") { + $("#menu").css("top", "80px"); + } else { + $("#menu").css("top", "60px"); + } + } else { + if ($("#menu").css("position") == "fixed") { + $("#menu").css("top", "80px"); + } else { + $("#menu").css("top", "80px"); + } + } + } - $( "#msg_change_password" ).dialog({ - resizable: false, - draggable: true, - modal: true, - height: 350, - width: 620, - overlay: { - opacity: 0.5, - background: "black" - } - }); + // if((document.documentElement.scrollTop != 0 || document.body.scrollTop != 0) && $('#menu').css('position') =='fixed'){ + // if($('#head').css('position') =='fixed'){ + // $('#menu').css('top','80px'); + // } + // else{ + // $('#menu').css('top','20px'); + // } + // } + // else{ + // if($('#head').css('position') =='fixed'){ + // if(document.documentElement.scrollTop != 0 || document.body.scrollTop != 0){ + // $('#menu').css('top','60px'); + // }else{ + // $('#menu').css('top','80px'); + // } + // + // } + // else{ + // $('#menu').css('top','60px'); + // } + // } + }); - } - - if ($('#login_blocked').length) { - - $( "#login_blocked" ).dialog({ - resizable: true, - draggable: true, - modal: true, - height: 200, - width: 520, - overlay: { - opacity: 0.5, - background: "black" - } - }); - - } - - if ($('#login_correct_pass').length) { - - $( "#login_correct_pass" ).dialog({ - resizable: true, - draggable: true, - modal: true, - height: 200, - width: 520, - overlay: { - opacity: 0.5, - background: "black" - } - }); - - } - - forced_title_callback(); - - - $(document).on("scroll", function(){ - - if(document.documentElement.scrollTop != 0 || document.body.scrollTop != 0){ - if($('#head').css('position') =='fixed'){ - if($('#menu').css('position') =='fixed'){ - $('#menu').css('top','80px'); - } else { - $('#menu').css('top','60px'); - } - } else { - if($('#menu').css('position') =='fixed'){ - $('#menu').css('top','20px'); - } else { - $('#menu').css('top','80px'); - } - } - } else { - if($('#head').css('position') =='fixed'){ - if($('#menu').css('position') =='fixed'){ - $('#menu').css('top','80px'); - } else { - $('#menu').css('top','60px'); - } - } else { - if($('#menu').css('position') =='fixed'){ - $('#menu').css('top','80px'); - } else { - $('#menu').css('top','80px'); - } - } - } - - // if((document.documentElement.scrollTop != 0 || document.body.scrollTop != 0) && $('#menu').css('position') =='fixed'){ - // if($('#head').css('position') =='fixed'){ - // $('#menu').css('top','80px'); - // } - // else{ - // $('#menu').css('top','20px'); - // } - // } - // else{ - // if($('#head').css('position') =='fixed'){ - // if(document.documentElement.scrollTop != 0 || document.body.scrollTop != 0){ - // $('#menu').css('top','60px'); - // }else{ - // $('#menu').css('top','80px'); - // } - // - // } - // else{ - // $('#menu').css('top','60px'); - // } - // } - }); - - $("#alert_messages").draggable(); - $("#alert_messages").css({'left':+parseInt(screen.width/2)-parseInt($("#alert_messages").css('width'))/2+'px'}); - + $("#alert_messages").draggable(); + $("#alert_messages").css({ + left: + +parseInt(screen.width / 2) - + parseInt($("#alert_messages").css("width")) / 2 + + "px" + }); }); - - - function forced_title_callback() { - // Forced title code - $('body').on('mouseenter', '.forced_title', function() { - /////////////////////////////////////////// - // Put the layer in the left-top corner to fill it - /////////////////////////////////////////// - $('#forced_title_layer').css('left', 0); - $('#forced_title_layer').css('top', 0); + // Forced title code + $("body").on("mouseenter", ".forced_title", function() { + /////////////////////////////////////////// + // Put the layer in the left-top corner to fill it + /////////////////////////////////////////// + $("#forced_title_layer").css("left", 0); + $("#forced_title_layer").css("top", 0); - /////////////////////////////////////////// - // Get info of the image - /////////////////////////////////////////// + /////////////////////////////////////////// + // Get info of the image + /////////////////////////////////////////// - var img_top = $(this).offset().top; - var img_width = $(this).width(); - var img_height = $(this).height(); - var img_id = $(this).attr('id'); - var img_left_mid = $(this).offset().left + (img_width / 2); + var img_top = $(this).offset().top; + var img_width = $(this).width(); + var img_height = $(this).height(); + var img_id = $(this).attr("id"); + var img_left_mid = $(this).offset().left + img_width / 2; - /////////////////////////////////////////// - // Put title in the layer - /////////////////////////////////////////// + /////////////////////////////////////////// + // Put title in the layer + /////////////////////////////////////////// - // If the '.forced_title' element has 'use_title_for_force_title' = 1 - // into their 'data' prop, the element title will be used for the - // content. - if ($(this).data("use_title_for_force_title")) { - var title = $(this).data("title"); - } - else { - var title = $('#forced_title_'+img_id).html(); - } + // If the '.forced_title' element has 'use_title_for_force_title' = 1 + // into their 'data' prop, the element title will be used for the + // content. + if ($(this).data("use_title_for_force_title")) { + var title = $(this).data("title"); + } else { + var title = $("#forced_title_" + img_id).html(); + } - $('#forced_title_layer').html(title); + $("#forced_title_layer").html(title); - /////////////////////////////////////////// - // Get info of the layer - /////////////////////////////////////////// + /////////////////////////////////////////// + // Get info of the layer + /////////////////////////////////////////// - var layer_width = $('#forced_title_layer').width(); - var layer_height = $('#forced_title_layer').height(); + var layer_width = $("#forced_title_layer").width(); + var layer_height = $("#forced_title_layer").height(); - /////////////////////////////////////////// - // Obtain the new position of the layer - /////////////////////////////////////////// + /////////////////////////////////////////// + // Obtain the new position of the layer + /////////////////////////////////////////// - // Jquery doesnt know the padding of the layer - var layer_padding = 4; + // Jquery doesnt know the padding of the layer + var layer_padding = 4; - // Deduct padding of both sides - var layer_top = img_top - layer_height - (layer_padding * 2) - 5; - if (layer_top < 0) { - layer_top = img_top + img_height + (layer_padding * 2); - } + // Deduct padding of both sides + var layer_top = img_top - layer_height - layer_padding * 2 - 5; + if (layer_top < 0) { + layer_top = img_top + img_height + layer_padding * 2; + } - // Deduct padding of one side - var layer_left = img_left_mid - (layer_width / 2) - layer_padding; - if (layer_left < 0) { - layer_left = 0; - } + // Deduct padding of one side + var layer_left = img_left_mid - layer_width / 2 - layer_padding; + if (layer_left < 0) { + layer_left = 0; + } - var real_layer_width = layer_width + (layer_padding * 2) + 5; - var layer_right = layer_left + real_layer_width; - var screen_width = $(window).width(); - if (screen_width < layer_right) { - layer_left = screen_width - real_layer_width; - } + var real_layer_width = layer_width + layer_padding * 2 + 5; + var layer_right = layer_left + real_layer_width; + var screen_width = $(window).width(); + if (screen_width < layer_right) { + layer_left = screen_width - real_layer_width; + } - /////////////////////////////////////////// - // Set the layer position and show - /////////////////////////////////////////// + /////////////////////////////////////////// + // Set the layer position and show + /////////////////////////////////////////// - $('#forced_title_layer').css('left', layer_left); - $('#forced_title_layer').css('top', layer_top); - $('#forced_title_layer').show(); - }); - $('body').on('mouseout', '.forced_title', function () { - $('#forced_title_layer').hide().empty(); - }); + $("#forced_title_layer").css("left", layer_left); + $("#forced_title_layer").css("top", layer_top); + $("#forced_title_layer").show(); + }); + $("body").on("mouseout", ".forced_title", function() { + $("#forced_title_layer") + .hide() + .empty(); + }); } - diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index d0a83bd6e8..94dadb6fbb 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -231,7 +231,6 @@ function get_response(response_id) { type: "POST", url: $("#hidden-ajax_file").val(), async: false, - timeout: 10000, dataType: "json", success: function(data) { response = data; @@ -255,7 +254,6 @@ function get_response_params(response_id) { type: "POST", url: $("#hidden-ajax_file").val(), async: false, - timeout: 10000, dataType: "json", success: function(data) { response_params = data; @@ -279,7 +277,6 @@ function get_response_description(response_id) { type: "POST", url: $("#hidden-ajax_file").val(), async: false, - timeout: 10000, dataType: "html", success: function(data) { response_description = data; @@ -305,7 +302,6 @@ function get_event_name(event_id, meta, history) { type: "POST", url: $("#hidden-ajax_file").val(), async: false, - timeout: 10000, dataType: "html", success: function(data) { name = data; @@ -349,7 +345,6 @@ function get_response_target( type: "POST", url: $("#hidden-ajax_file").val(), async: false, - timeout: 10000, dataType: "html", success: function(data) { target = data; @@ -394,7 +389,6 @@ function perform_response(target, response_id) { type: "POST", url: $("#hidden-ajax_file").val(), async: true, - timeout: 10000, dataType: "html", success: function(data) { var out = data.replace(/[\n|\r]/g, "
"); @@ -424,7 +418,6 @@ function perform_response_massive(target, response_id, out_iterator) { type: "POST", url: $("#hidden-ajax_file").val(), async: true, - timeout: 10000, dataType: "html", success: function(data) { var out = data.replace(/[\n|\r]/g, "
"); @@ -460,7 +453,6 @@ function event_change_status(event_ids) { type: "POST", url: $("#hidden-ajax_file").val(), async: true, - timeout: 10000, dataType: "html", success: function(data) { $("#button-status_button").removeAttr("disabled"); @@ -499,7 +491,6 @@ function event_change_owner() { type: "POST", url: $("#hidden-ajax_file").val(), async: true, - timeout: 10000, dataType: "html", success: function(data) { $("#button-owner_button").removeAttr("disabled"); @@ -553,13 +544,11 @@ function event_comment() { type: "POST", url: $("#hidden-ajax_file").val(), async: true, - timeout: 10000, dataType: "html", success: function(data) { $("#button-comment_button").removeAttr("disabled"); - $("#response_loading").show(); - dt_events.draw(false); - show_event_dialog(current_event, "comments", data); + $("#response_loading").hide(); + $("#link_comments").click(); } }); @@ -681,7 +670,6 @@ function update_event(table, id_evento, type, event_rep, row) { // Update events matching current filters and id_evento selected. $.ajax({ async: true, - timeout: 10000, type: "POST", url: $("#hidden-ajax_file").val(), data: { @@ -700,7 +688,7 @@ function update_event(table, id_evento, type, event_rep, row) { var diff_s = diff_g / 1000; if (processed >= $(".chk_val:checked").length) { // If operation takes less than 2 seconds, redraw. - if (diff_s < 2) { + if (diff_s < 2 || $(".chk_val:checked").length > 1) { redraw = true; } if (redraw) { @@ -722,6 +710,7 @@ function validate_event(table, id_evento, event_rep, row) { var button = document.getElementById("val-" + id_evento); if (!button) { // Button does not exist. Ignore. + processed += 1; return; } @@ -734,6 +723,7 @@ function in_process_event(table, id_evento, event_rep, row) { var button = document.getElementById("proc-" + id_evento); if (!button) { // Button does not exist. Ignore. + processed += 1; return; } @@ -752,6 +742,7 @@ function delete_event(table, id_evento, event_rep, row) { var button = document.getElementById("del-" + id_evento); if (!button) { // Button does not exist. Ignore. + processed += 1; return; } diff --git a/pandora_console/include/javascript/pandora_modules.js b/pandora_console/include/javascript/pandora_modules.js index 0487923b38..049bb9e96b 100644 --- a/pandora_console/include/javascript/pandora_modules.js +++ b/pandora_console/include/javascript/pandora_modules.js @@ -1223,3 +1223,42 @@ function get_explanation_recon_script(id, id_rt, url) { taskManager.addTask(xhr); } + +// Filter modules in a select (bulk operations) +function filterByText(selectbox, textbox, textNoData) { + return selectbox.each(function() { + var select = selectbox; + var options = []; + $(select) + .find("option") + .each(function() { + options.push({ value: $(this).val(), text: $(this).text() }); + }); + $(select).data("options", options); + $(textbox).bind("change keyup", function() { + var options = $(select) + .empty() + .scrollTop(0) + .data("options"); + var search = $(this).val(); + var regex = new RegExp(search, "gi"); + $.each(options, function(i) { + var option = options[i]; + if (option.text.match(regex) !== null) { + $(select).append( + $("
'last_fired', + 'order' => 'ASC', + ]; + break; + + case 'down': + $selectLastFiredDown = $selected; + $order = [ + 'field' => 'last_fired', + 'order' => 'DESC', + ]; + break; + } + break; + default: if ($print_agent) { $selectDisabledUp = ''; @@ -300,6 +323,8 @@ switch ($sortField) { $selectModuleDown = false; $selectTemplateUp = false; $selectTemplateDown = false; + $selectLastFiredUp = false; + $selectLastFiredDown = false; $order = [ 'field' => 'agent_module_name', 'order' => 'ASC', @@ -313,6 +338,8 @@ switch ($sortField) { $selectModuleDown = false; $selectTemplateUp = false; $selectTemplateDown = false; + $selectLastFiredUp = false; + $selectLastFiredDown = false; $order = [ 'field' => 'agent_module_name', 'order' => 'ASC', @@ -449,6 +476,8 @@ $url_up_module = $url.'&sort_field=module&sort=up'; $url_down_module = $url.'&sort_field=module&sort=down'; $url_up_template = $url.'&sort_field=template&sort=up'; $url_down_template = $url.'&sort_field=template&sort=down'; +$url_up_lastfired = $url.'&sort_field=last_fired&sort=up'; +$url_down_lastfired = $url.'&sort_field=last_fired&sort=down'; $table = new stdClass(); $table->width = '100%'; @@ -494,6 +523,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { $table->head[3] .= ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown); $table->head[4] .= ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown); $table->head[5] .= ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown); + $table->head[7] .= ui_get_sorting_arrows($url_up_lastfired, $url_down_lastfired, $selectLastFiredUp, $selectLastFiredDown); } } else { if (!is_metaconsole()) { @@ -528,6 +558,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if (!is_metaconsole()) { $table->head[3] .= ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown); $table->head[4] .= ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown); + $table->head[6] .= ui_get_sorting_arrows($url_up_lastfired, $url_down_lastfired, $selectLastFiredUp, $selectLastFiredDown); } } } else { @@ -562,6 +593,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { $table->head[3] .= ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown); $table->head[4] .= ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown); $table->head[5] .= ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown); + $table->head[6] .= ui_get_sorting_arrows($url_up_lastfired, $url_down_lastfired, $selectLastFiredUp, $selectLastFiredDown); } } else { if (!is_metaconsole()) { @@ -592,6 +624,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if (!is_metaconsole()) { $table->head[2] .= ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown); $table->head[3] .= ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown); + $table->head[5] .= ui_get_sorting_arrows($url_up_lastfired, $url_down_lastfired, $selectLastFiredUp, $selectLastFiredDown); } } } diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 5f7f29f916..b9b2a2128d 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -68,15 +68,16 @@ if (is_ajax()) { if ($refresh_contact) { $id_agente = get_parameter('id_agente', 0); if ($id_agente > 0) { - $d = db_get_row( - 'tagente', - 'id_agente', - $id_agente + $last_contact = db_get_value_sql( + sprintf( + 'SELECT intervalo - (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(IF(ultimo_contacto > ultimo_contacto_remoto, ultimo_contacto, ultimo_contacto_remoto))) + FROM `tagente` + WHERE id_agente = %d ', + $id_agente + ) ); $progress = agents_get_next_contact($id_agente); - $last_contact = floor(($d['intervalo'] * (100 - $progress) / 100)); - if ($progress < 0 || $progress > 100) { $progress = 100; } diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 7e8ce16ec3..da7123e728 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -1,7 +1,6 @@ EVENT_NO_VALIDATED, + 'event_view_hr' => $config['event_view_hr'], + 'group_rep' => 1, + 'tag_with' => [], + 'tag_without' => [], + 'history' => false, +]; + +$fb64 = get_parameter('fb64', null); +if (isset($fb64)) { + $filter = json_decode(base64_decode($fb64), true); +} else { + $filter = get_parameter( + 'filter', + $default_filter + ); +} + +$id_group = get_parameter( + 'filter[id_group]', + $filter['id_group'] +); +$event_type = get_parameter( + 'filter[event_type]', + $filter['event_type'] +); +$severity = get_parameter( + 'filter[severity]', + $filter['severity'] +); +$status = get_parameter( + 'filter[status]', + $filter['status'] +); +$search = get_parameter( + 'filter[search]', + $filter['search'] +); +$text_agent = get_parameter( + 'filter[text_agent]', + $filter['text_agent'] +); +$id_agent = get_parameter( + 'filter[id_agent]', + $filter['id_agent'] +); +$id_agent_module = get_parameter( + 'filter[id_agent_module]', + $filter['id_agent_module'] +); +$pagination = get_parameter( + 'filter[pagination]', + $filter['pagination'] +); +$event_view_hr = get_parameter( + 'filter[event_view_hr]', + $filter['event_view_hr'] +); +$id_user_ack = get_parameter( + 'filter[id_user_ack]', + $filter['id_user_ack'] +); +$group_rep = get_parameter( + 'filter[group_rep]', + $filter['group_rep'] +); +$tag_with = get_parameter( + 'filter[tag_with]', + $filter['tag_with'] +); +$tag_without = get_parameter( + 'filter[tag_without]', + $filter['tag_without'] +); +$filter_only_alert = get_parameter( + 'filter[filter_only_alert]', + $filter['filter_only_alert'] +); +$id_group_filter = get_parameter( + 'filter[id_group_filter]', + $filter['id_group_filter'] +); +$date_from = get_parameter( + 'filter[date_from]', + $filter['date_from'] +); +$date_to = get_parameter( + 'filter[date_to]', + $filter['date_to'] +); +$source = get_parameter( + 'filter[source]', + $filter['source'] +); +$id_extra = get_parameter( + 'filter[id_extra]', + $filter['id_extra'] +); +$user_comment = get_parameter( + 'filter[user_comment]', + $filter['user_comment'] +); +$history = get_parameter( + 'history', + $filter['history'] +); +$section = get_parameter('section', false); // Ajax responses. if (is_ajax()) { $get_events = get_parameter('get_events', 0); - $filter = get_parameter('filter', []); // Datatables offset, limit. $start = get_parameter('start', 0); $length = get_parameter('length', $config['block_size']); @@ -123,6 +209,10 @@ if (is_ajax()) { ob_start(); $order = get_datatable_order(true); + if (is_array($order) && $order['field'] == 'mini_severity') { + $order['field'] = 'te.criticity'; + } + $fields = [ 'te.id_evento', 'te.id_agente', @@ -151,11 +241,17 @@ if (is_ajax()) { 'tg.nombre as group_name', ]; if (!is_metaconsole()) { - $fields[] = 'am.nombre as id_agentmodule'; + $fields[] = 'am.nombre as module_name'; + $fields[] = 'am.id_agente_modulo as id_agentmodule'; + $fields[] = 'ta.server_name as server_name'; + } else { + $fields[] = 'ts.server_name as server_name'; } $events = events_get_all( + // Fields. $fields, + // Filter. $filter, // Offset. $start, @@ -164,7 +260,9 @@ if (is_ajax()) { // Order. $order['direction'], // Sort field. - $order['field'] + $order['field'], + // History. + $history ); $count = events_get_all( 'count', @@ -181,6 +279,11 @@ if (is_ajax()) { function ($carry, $item) { $tmp = (object) $item; $tmp->evento = io_safe_output($tmp->evento); + if ($tmp->module_name) { + $tmp->module_name = io_safe_output($tmp->module_name); + } + + $tmp->agent_name = io_safe_output($tmp->agent_name); $tmp->ack_utimestamp = ui_print_timestamp( $tmp->ack_utimestamp, true @@ -191,6 +294,9 @@ if (is_ajax()) { ); $tmp->data = format_numeric($tmp->data, 1); + + $tmp->b64 = base64_encode(json_encode($tmp)); + $carry[] = $tmp; return $carry; } @@ -487,34 +593,34 @@ if ($pure) { // Fullscreen. $fullscreen['active'] = false; - $fullscreen['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen')]).''; + $fullscreen['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen')]).''; // Event list. $list['active'] = false; - $list['text'] = ''.html_print_image('images/events_list.png', true, ['title' => __('Event list')]).''; + $list['text'] = ''.html_print_image('images/events_list.png', true, ['title' => __('Event list')]).''; // History event list. $history_list['active'] = false; - $history_list['text'] = ''.html_print_image('images/books.png', true, ['title' => __('History event list')]).''; + $history_list['text'] = ''.html_print_image('images/books.png', true, ['title' => __('History event list')]).''; // RSS. $rss['active'] = false; - $rss['text'] = ''.html_print_image('images/rss.png', true, ['title' => __('RSS Events')]).''; + $rss['text'] = ''.html_print_image('images/rss.png', true, ['title' => __('RSS Events')]).''; // Marquee. $marquee['active'] = false; - $marquee['text'] = ''.html_print_image('images/heart.png', true, ['title' => __('Marquee display')]).''; + $marquee['text'] = ''.html_print_image('images/heart.png', true, ['title' => __('Marquee display')]).''; // CSV. $csv['active'] = false; - $csv['text'] = ''.html_print_image('images/csv_mc.png', true, ['title' => __('Export to CSV file')]).''; + $csv['text'] = ''.html_print_image('images/csv_mc.png', true, ['title' => __('Export to CSV file')]).''; // Sound events. $sound_event['active'] = false; $sound_event['text'] = ''.html_print_image('images/sound.png', true, ['title' => __('Sound events')]).''; // If the user has administrator permission display manage tab. - if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'EM')) { + if ($event_w || $event_m) { // Manage events. $manage_events['active'] = false; $manage_events['text'] = ''.html_print_image('images/setup.png', true, ['title' => __('Manage events')]).''; @@ -791,12 +897,14 @@ $buttons[] = [ 'onclick' => '', ]; -$buttons[] = [ - 'id' => 'save-filter', - 'class' => 'float-left margin-right-2 sub wand', - 'text' => __('Save filter'), - 'onclick' => '', -]; +if ($event_w || $event_m) { + $buttons[] = [ + 'id' => 'save-filter', + 'class' => 'float-left margin-right-2 sub wand', + 'text' => __('Save filter'), + 'onclick' => '', + ]; +} /* * Advanced filter. @@ -1067,6 +1175,10 @@ try { 'text' => 'evento', 'class' => 'mw120px', ], + [ + 'text' => 'mini_severity', + 'class' => 'no-padding', + ], 'id_evento', // 'id_agente', // 'id_usuario', @@ -1112,6 +1224,12 @@ try { $fields = $default_fields; } + if (in_array('mini_severity', $fields) > 0) { + $fields[array_search('mini_severity', $fields)] = [ + 'text' => 'mini_severity', + 'class' => 'no-padding-imp', + ]; + } $evento_id = array_search('evento', $fields); if ($evento_id !== false) { @@ -1219,6 +1337,7 @@ try { $active_filters_div .= '
'; $table_id = 'events'; + $form_id = 'events_form'; // Print datatable. ui_print_datatable( @@ -1227,9 +1346,12 @@ try { 'class' => 'info_table events', 'style' => 'width: 100%;', 'ajax_url' => 'operation/events/events', - 'ajax_data' => ['get_events' => 1], + 'ajax_data' => [ + 'get_events' => 1, + 'history' => (int) $history, + ], 'form' => [ - 'id' => 'events_form', + 'id' => $form_id, 'class' => 'flex-row', 'html' => $filter, 'inputs' => [], @@ -1280,39 +1402,41 @@ try { $sql_event_resp = "SELECT id, name FROM tevent_response WHERE type LIKE 'command'"; $event_responses = db_get_all_rows_sql($sql_event_resp); -if (check_acl($config['id_user'], 0, 'EW') == 1 && !$readonly) { - $array_events_actions['in_progress_selected'] = __('In progress selected'); - $array_events_actions['validate_selected'] = __('Validate selected'); -} +if ($config['event_replication'] != 1) { + if ($event_w && !$readonly) { + $array_events_actions['in_progress_selected'] = __('In progress selected'); + $array_events_actions['validate_selected'] = __('Validate selected'); + } -if (check_acl($config['id_user'], 0, 'EM') == 1 && !$readonly) { - $array_events_actions['delete_selected'] = __('Delete selected'); + if ($event_m == 1 && !$readonly) { + $array_events_actions['delete_selected'] = __('Delete selected'); + } } foreach ($event_responses as $val) { $array_events_actions[$val['id']] = $val['name']; } -if ($config['event_replication'] != 1) { - echo '
'; - echo '
'; - echo ''; - html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); - echo '  '; - html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"'); - echo "'; - echo '
'; - echo ''; - echo ''; - echo '
'; -} + +echo '
'; +echo '
'; +echo ''; +html_print_select($array_events_actions, 'response_id', '', '', '', 0, false, false, false); +echo '  '; +html_print_button(__('Execute event response'), 'submit_event_response', false, 'execute_event_response(true);', 'class="sub next"'); +echo "'; +echo '
'; +echo ''; +echo ''; +echo '
'; + // Close viewer. enterprise_hook('close_meta_frame'); @@ -1477,16 +1601,17 @@ function process_datatables_item(item) { output += ''; // Add event severity to end of text. - evn = '' + evn += item.evento+''; + + item.mini_severity = '
'; + item.mini_severity += output; + item.mini_severity += '
'; criticity = '
' + text + "
"; @@ -1517,7 +1642,7 @@ function process_datatables_item(item) { case "": case "": - $tex = ""; + text = ""; color = ""; break; @@ -1580,42 +1705,10 @@ function process_datatables_item(item) { module_status = '
' + text + "
"; - - /* Agent name link */ - if (item.id_agente > 0) { - item.agent_name = '' + item.agent_name + ''; - } else { - item.agent_name = ''; - } - - /* Agent ID link */ - if (item.id_agente > 0) { - - item.id_agente = '' + item.id_agente + ''; - - item.id_agente = '' + item.agent_name + ''; - - } else { - item.id_agente = ''; - } - - /* Group name */ - if (item.id_grupo == "0") { - item.id_grupo = ""; - } else { - item.id_grupo = item.group_name; - } - /* Options */ // Show more. item.options = ' __('Show more')]); ?>'; __('Delete event')]); ?>'; } } + // Multi select. item.m = ' /* Status */ img = ' __('Unknown'), 'class' => 'forced-title']); ?>'; switch (item.estado) { - case "0": + case "": img = ' __('New event'), 'class' => 'forced-title']); ?>'; break; - case "1": + case "": img = ' __('Event validated'), 'class' => 'forced-title']); ?>'; break; - case "2": + case "": img = ' __('Event in process'), 'class' => 'forced-title']); ?>'; break; } /* Update column content now to avoid json poisoning. */ + + /* Agent name link */ + if (item.id_agente > 0) { + item.agent_name = '' + item.agent_name + ''; + } else { + item.agent_name = ''; + } + + /* Agent ID link */ + if (item.id_agente > 0) { + + item.id_agente = '' + item.id_agente + ''; + + item.id_agente = '' + item.agent_name + ''; + + } else { + item.id_agente = ''; + } + item.estado = '
'; item.estado += img; item.estado += '
'; @@ -1708,6 +1826,15 @@ function process_datatables_item(item) { // Add event severity format to itself. item.evento = evn; + /* Group name */ + if (item.id_grupo == "0") { + item.id_grupo = ""; + } else { + item.id_grupo = item.group_name; + } + + /* Module name */ + item.id_agentmodule = item.module_name; } /* Datatables auxiliary functions ends */ @@ -1957,6 +2084,23 @@ function reorder_tags_inputs() { } /* Tag management ends */ $(document).ready( function() { + /* Filter to a href */ + $('.events_link').on('click', function(e) { + e.preventDefault(); + + inputs = $("# :input"); + values = {}; + inputs.each(function() { + values[this.name] = $(this).val(); + }) + + values['history'] = ""; + + var url = e.currentTarget.href; + url += 'fb64=' + btoa(JSON.stringify(values)); + document.location = url; + + }); /* Multi select handler */ $('#checkbox-all_validate_box').on('change', function() { diff --git a/pandora_console/operation/events/events_rss.php b/pandora_console/operation/events/events_rss.php index 2a38643a9c..95ce7cd07b 100644 --- a/pandora_console/operation/events/events_rss.php +++ b/pandora_console/operation/events/events_rss.php @@ -1,18 +1,37 @@ '; + $output .= ''; + $output .= ''; + return $output."\n"; } -// Check user credentials -$user = get_parameter('user'); -$hashup = get_parameter('hashup'); -$pss = get_user_info($user); -$hashup2 = md5($user.$pss['password']); +/** + * Escape entities for XML. + * + * @param string $str String. + * + * @return string Escaped string. + */ +function xml_entities($str) +{ + if (!is_string($str)) { + return ''; + } -if ($hashup != $hashup2) { - rss_error_handler( - null, - null, - null, - null, - __('The URL of your feed has bad hash.') - ); + if (preg_match_all('/(&[^;]+;)/', $str, $matches) != 0) { + $matches = $matches[0]; - exit; + foreach ($matches as $entity) { + $char = html_entity_decode($entity, (ENT_COMPAT | ENT_HTML401), 'UTF-8'); + + $html_entity_numeric = '&#'.uniord($char).';'; + + $str = str_replace($entity, $html_entity_numeric, $str); + } + } + + return $str; } -header('Content-Type: application/xml; charset=UTF-8'); -// Send header before starting to output + +/** + * Undocumented function. + * + * @param string $u U. + * + * @return integer Ord. + */ +function uniord($u) +{ + $k = mb_convert_encoding($u, 'UCS-2LE', 'UTF-8'); + $k1 = ord(substr($k, 0, 1)); + $k2 = ord(substr($k, 1, 1)); + + return ($k2 * 256 + $k1); +} + + +/** + * Generate RSS header. + * + * @param integer $lastbuild Date, last build. + * + * @return string RSS header. + */ +function rss_header($lastbuild=0) +{ + $selfurl = ui_get_full_url('?'.$_SERVER['QUERY_STRING'], false, true); + + // ' '."\n"; + $rss_feed .= ''."\n"; + $rss_feed .= ''."\n"; + $rss_feed .= ''.io_safe_output(get_product_name()).' Events Feed'."\n"; + $rss_feed .= 'Latest events on '.get_product_name().''."\n"; + $rss_feed .= ''.date(DATE_RFC822, $lastbuild).''."\n"; + // Last build date is the last event - that way readers won't mark it as having new posts. + $rss_feed .= ''.$url.''."\n"; + // Link back to the main Pandora page. + $rss_feed .= ''."\n"; + + return $rss_feed; +} + + +/** + * RSS error handler. + * + * @param string $errno Errno. + * @param string $errstr Errstr. + * @param string $errfile Errfile. + * @param string $errline Errline. + * @param string $error_human_description Error_human_description. + * + * @return void + */ function rss_error_handler($errno, $errstr, $errfile, $errline, $error_human_description=null) { $url = ui_get_full_url(false); $selfurl = ui_get_full_url('?'.$_SERVER['QUERY_STRING'], false, true); - $rss_feed = ''; - // ' Fixes certain highlighters freaking out on the PHP closing tag - $rss_feed .= "\n"; - $rss_feed .= ''; - $rss_feed .= "\n"; - $rss_feed .= ''; - $rss_feed .= "\n"; - $rss_feed .= ''.get_product_name().' RSS Feed'; - $rss_feed .= "\n"; - $rss_feed .= 'Latest events on '.get_product_name().''; - $rss_feed .= "\n"; - $rss_feed .= ''.date(DATE_RFC822, 0).''; - $rss_feed .= "\n"; - $rss_feed .= ''.$url.''; - // Link back to the main Pandora page - $rss_feed .= "\n"; - $rss_feed .= ''; - // Alternative for Atom feeds. It's the same. + // ' Fixes certain highlighters freaking out on the PHP closing tag. + $rss_feed = rss_header(0); $rss_feed .= "\n"; $rss_feed .= ''; $rss_feed .= "\n"; @@ -104,169 +173,206 @@ function rss_error_handler($errno, $errstr, $errfile, $errline, $error_human_des $rss_feed .= "\n"; $rss_feed .= ''; - exit($rss_feed); - // Exit by displaying the feed + echo $rss_feed; } +// Errors output as RSS. set_error_handler('rss_error_handler', E_ERROR); -// Errors output as RSS -$id_group = get_parameter('id_group', 0); -// group -$event_type = get_parameter('event_type', ''); -// 0 all -$severity = (int) get_parameter('severity', -1); -// -1 all -$status = (int) get_parameter('status', 0); -// -1 all, 0 only red, 1 only green -$id_agent = (int) get_parameter('id_agent', -1); -$id_event = (int) get_parameter('id_event', -1); -// This will allow to select only 1 event (eg. RSS) -$event_view_hr = (int) get_parameter('event_view_hr', 0); -$id_user_ack = get_parameter('id_user_ack', 0); -$search = io_safe_output(preg_replace('/&([A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/', '&', rawurldecode(get_parameter('search')))); -$text_agent = (string) get_parameter('text_agent', __('All')); +// Send header before starting to output. +header('Content-Type: application/xml; charset=UTF-8'); -$tag_with_json = base64_decode(get_parameter('tag_with', '')); -$tag_with_json_clean = io_safe_output($tag_with_json); -$tag_with_base64 = base64_encode($tag_with_json_clean); -$tag_with = json_decode($tag_with_json_clean, true); -if (empty($tag_with)) { - $tag_with = []; +$ipOrigin = $_SERVER['REMOTE_ADDR']; + +// Uncoment this to activate ACL on RSS Events. +if (!isInACL($ipOrigin)) { + rss_error_handler( + null, + null, + null, + null, + __('Your IP is not into the IP list with API access.') + ); + + exit; } -$tag_with = array_diff($tag_with, [0 => 0]); +// Check user credentials. +$user = get_parameter('user'); +$hashup = get_parameter('hashup'); -$tag_without_json = base64_decode(get_parameter('tag_without', '')); -$tag_without_json_clean = io_safe_output($tag_without_json); -$tag_without_base64 = base64_encode($tag_without_json_clean); -$tag_without = json_decode($tag_without_json_clean, true); -if (empty($tag_without)) { - $tag_without = []; +$pss = get_user_info($user); +$hashup2 = md5($user.$pss['password']); + +if ($hashup != $hashup2) { + rss_error_handler( + null, + null, + null, + null, + __('The URL of your feed has bad hash.') + ); + + exit; } -$tag_without = array_diff($tag_without, [0 => 0]); - -$filter_only_alert = (int) get_parameter('filter_only_alert', -1); - -// -// Build the condition of the events query -$sql_post = ''; -$meta = false; - -$id_user = $user; - -require 'events.build_query.php'; - -// Now $sql_post have all the where condition -// -$sql = 'SELECT * - FROM tevento te LEFT JOIN tagent_secondary_group tasg - ON te.id_grupo = tasg.id_group - WHERE 1=1 '.$sql_post.' - ORDER BY utimestamp DESC'; - -$result = db_get_all_rows_sql($sql); - -$url = ui_get_full_url(false); -$selfurl = ui_get_full_url('?'.$_SERVER['QUERY_STRING'], false, true); - -if (empty($result)) { - $lastbuild = 0; - // Last build in 1970 -} else { - $lastbuild = (int) $result[0]['utimestamp']; +$reset_session = false; +if (empty($config['id_user'])) { + $config['id_user'] = $user; + $reset_session = true; } -$rss_feed = ''."\n"; -// ' '."\n"; -$rss_feed .= ''."\n"; -$rss_feed .= ''.get_product_name().' RSS Feed'."\n"; -$rss_feed .= 'Latest events on '.get_product_name().''."\n"; -$rss_feed .= ''.date(DATE_RFC822, $lastbuild).''."\n"; -// Last build date is the last event - that way readers won't mark it as having new posts -$rss_feed .= ''.$url.''."\n"; -// Link back to the main Pandora page -$rss_feed .= ''."\n"; -; -// Alternative for Atom feeds. It's the same. -if (empty($result)) { - $result = []; - $rss_feed .= ''.xml_entities(io_safe_input($url.'/index.php?sec=eventos&sec2=operation/events/events')).'No results'; - $rss_feed .= 'There are no results. Click on the link to see all Pending events'; - $rss_feed .= ''.xml_entities(io_safe_input($url.'/index.php?sec=eventos&sec2=operation/events/events')).''."\n"; -} +$column_names = [ + 'id_evento', + 'evento', + 'timestamp', + 'estado', + 'event_type', + 'utimestamp', + 'id_agente', + 'agent_name', + 'id_usuario', + 'id_grupo', + 'id_agentmodule', + 'id_alert_am', + 'criticity', + 'user_comment', + 'tags', + 'source', + 'id_extra', + 'critical_instructions', + 'warning_instructions', + 'unknown_instructions', + 'owner_user', + 'ack_utimestamp', + 'custom_data', + 'data', + 'module_status', +]; -foreach ($result as $row) { - if (!check_acl($user, $row['id_grupo'], 'ER')) { - continue; +$fields = [ + 'te.id_evento', + 'te.evento', + 'te.timestamp', + 'te.estado', + 'te.event_type', + 'te.utimestamp', + 'te.id_agente', + 'ta.alias as agent_name', + 'te.id_usuario', + 'te.id_grupo', + 'te.id_agentmodule', + 'am.nombre as module_name', + 'te.id_alert_am', + 'te.criticity', + 'te.user_comment', + 'te.tags', + 'te.source', + 'te.id_extra', + 'te.critical_instructions', + 'te.warning_instructions', + 'te.unknown_instructions', + 'te.owner_user', + 'te.ack_utimestamp', + 'te.custom_data', + 'te.data', + 'te.module_status', + 'tg.nombre as group_name', +]; + + +try { + $fb64 = get_parameter('fb64', null); + $plain_filter = base64_decode($fb64); + $filter = json_decode($plain_filter, true); + if (json_last_error() != JSON_ERROR_NONE) { + throw new Exception('Invalid filter. ['.$plain_filter.']'); } - if ($row['event_type'] == 'system') { - $agent_name = __('System'); - } else if ($row['id_agente'] > 0) { - // Agent name - $agent_name = agents_get_alias($row['id_agente']); - } else { - $agent_name = __('Alert').__('SNMP'); + // Dump events. + $limit = get_parameter('limit', 20); + $offset = get_parameter('offset', 0); + $events = events_get_all( + $fields, + $filter, + $offset, + $limit, + 'desc', + 'timestamp', + $filter['history'] + ); + + $last_timestamp = 0; + if (is_array($events)) { + $last_timestamp = $events[0]['utimestamp']; } - // This is mandatory - $rss_feed .= ''; - $rss_feed .= xml_entities(io_safe_input($url.'/index.php?sec=eventos&sec2=operation/events/events&id_event='.$row['id_evento'])); - $rss_feed .= ''; - $rss_feed .= xml_entities($agent_name); - $rss_feed .= ''; - $rss_feed .= xml_entities($row['evento']); - if ($row['estado'] == 1) { - $rss_feed .= xml_entities(io_safe_input('

'.'Validated by '.$row['id_usuario'])); - } + // Dump headers. + $rss = rss_header($last_timestamp); + $url = ui_get_full_url(false); - $rss_feed .= '
'; - $rss_feed .= xml_entities(io_safe_input($url.'/index.php?sec=eventos&sec2=operation/events/events&id_event='.$row['id_evento'])); - $rss_feed .= ''; + if (is_array($events)) { + foreach ($events as $row) { + $rss .= ''; + $rss .= xml_entry('title', $row['evento']); + if (!empty($row['id_agente'])) { + $rss .= xml_entry('link', $url.'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row['id_agente']); + } - // The rest is optional - $rss_feed .= ''.date(DATE_RFC822, $row['utimestamp']).''; + $rss .= xml_entry('comments', $row['']); + $rss .= xml_entry('pubDate', $row['timestamp']); + $rss .= xml_entry('category', $row['source']); + foreach ($column_names as $val) { + $key = $val; + if ($val == 'id_grupo') { + $key = 'group_name'; + } else if ($val == 'id_agentmodule') { + $key = 'module_name'; + } - // This is mandatory again - $rss_feed .= ''."\n"; -} + switch ($key) { + case 'module_status': + $value = events_translate_module_status( + $row[$key] + ); + break; -$rss_feed .= "
\n
\n"; + case 'event_type': + $value = events_translate_event_type( + $row[$key] + ); + break; -echo $rss_feed; + case 'criticity': + $value = events_translate_event_criticity( + $row[$key] + ); + break; + default: + $value = $row[$key]; + break; + } -function xml_entities($str) -{ - if (!is_string($str)) { - return ''; - } + $rss .= xml_entry($key, $value); + } - if (preg_match_all('/(&[^;]+;)/', $str, $matches) != 0) { - $matches = $matches[0]; - - foreach ($matches as $entity) { - $char = html_entity_decode($entity, (ENT_COMPAT | ENT_HTML401), 'UTF-8'); - - $html_entity_numeric = '&#'.uniord($char).';'; - - $str = str_replace($entity, $html_entity_numeric, $str); + $rss .= ''; } + } else { + $rss .= ''.xml_entities(io_safe_input($url.'/index.php?sec=eventos&sec2=operation/events/events')).'No results'; + $rss .= 'There are no results. Click on the link to see all Pending events'; + $rss .= ''.xml_entities(io_safe_input($url.'/index.php?sec=eventos&sec2=operation/events/events')).''."\n"; } - return $str; + $rss .= "\n\n"; + + echo $rss; +} catch (Exception $e) { + echo rss_error_handler(200, 'Controlled error', '', '', $e->getMessage()); } - -function uniord($u) -{ - $k = mb_convert_encoding($u, 'UCS-2LE', 'UTF-8'); - $k1 = ord(substr($k, 0, 1)); - $k2 = ord(substr($k, 1, 1)); - - return ($k2 * 256 + $k1); +if ($reset_session) { + unset($config['id_user']); } diff --git a/pandora_console/operation/events/export_csv.php b/pandora_console/operation/events/export_csv.php index dbc20abb6a..0c16a16f9d 100644 --- a/pandora_console/operation/events/export_csv.php +++ b/pandora_console/operation/events/export_csv.php @@ -1,18 +1,34 @@ load_tables(); } -$offset = (int) get_parameter('offset'); -$id_group = (int) get_parameter('id_group'); -// group -$event_type = (string) get_parameter('event_type', 'all'); -// 0 all -$severity = (int) get_parameter('severity', -1); -// -1 all -$status = (int) get_parameter('status', -1); -// -1 all, 0 only red, 1 only green -$id_agent = (int) get_parameter('id_agent', -1); +$column_names = [ + 'id_evento', + 'evento', + 'timestamp', + 'estado', + 'event_type', + 'utimestamp', + 'id_agente', + 'agent_name', + 'id_usuario', + 'id_grupo', + 'id_agentmodule', + 'id_alert_am', + 'criticity', + 'user_comment', + 'tags', + 'source', + 'id_extra', + 'critical_instructions', + 'warning_instructions', + 'unknown_instructions', + 'owner_user', + 'ack_utimestamp', + 'custom_data', + 'data', + 'module_status', +]; -$id_event = (int) get_parameter('id_event', -1); -$event_view_hr = (int) get_parameter('event_view_hr', $config['event_view_hr']); -$id_user_ack = get_parameter('id_user_ack', 0); -$search = io_safe_output(preg_replace('/&([A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/', '&', rawurldecode(get_parameter('search')))); -$text_agent = (string) get_parameter('text_agent', __('All')); - -$tag_with_json = base64_decode(get_parameter('tag_with', '')); -$tag_with_json_clean = io_safe_output($tag_with_json); -$tag_with_base64 = base64_encode($tag_with_json_clean); -$tag_with = json_decode($tag_with_json_clean, true); -if (empty($tag_with)) { - $tag_with = []; -} - -$tag_with = array_diff($tag_with, [0 => 0]); - -$tag_without_json = base64_decode(get_parameter('tag_without', '')); -$tag_without_json_clean = io_safe_output($tag_without_json); -$tag_without_base64 = base64_encode($tag_without_json_clean); -$tag_without = json_decode($tag_without_json_clean, true); -if (empty($tag_without)) { - $tag_without = []; -} - -$tag_without = array_diff($tag_without, [0 => 0]); - -$filter_only_alert = (int) get_parameter('filter_only_alert', -1); - -// -// Build the condition of the events query -$sql_post = ''; -$meta = false; - -$id_user = $config['id_user']; - -require 'events.build_query.php'; - -// Now $sql_post have all the where condition -// -switch ($config['dbtype']) { - case 'mysql': - case 'postgresql': - case 'oracle': - $sql = 'SELECT * - FROM tevento te - LEFT JOIN tagent_secondary_group tasg - ON te.id_grupo = tasg.id_group - WHERE 1=1 '.$sql_post.' - ORDER BY utimestamp DESC'; - break; -} +$fields = [ + 'te.id_evento', + 'te.evento', + 'te.timestamp', + 'te.estado', + 'te.event_type', + 'te.utimestamp', + 'te.id_agente', + 'ta.alias as agent_name', + 'te.id_usuario', + 'te.id_grupo', + 'te.id_agentmodule', + 'am.nombre as module_name', + 'te.id_alert_am', + 'te.criticity', + 'te.user_comment', + 'te.tags', + 'te.source', + 'te.id_extra', + 'te.critical_instructions', + 'te.warning_instructions', + 'te.unknown_instructions', + 'te.owner_user', + 'te.ack_utimestamp', + 'te.custom_data', + 'te.data', + 'te.module_status', + 'tg.nombre as group_name', +]; $now = date('Y-m-d'); -// Show contentype header +// Download header. header('Content-type: text/txt'); header('Content-Disposition: attachment; filename="pandora_export_event'.$now.'.csv"'); -echo 'timestamp'; -echo $config['csv_divider']; -echo 'agent'; -echo $config['csv_divider']; -echo 'group'; -echo $config['csv_divider']; -echo 'event'; -echo $config['csv_divider']; -echo 'status'; -echo $config['csv_divider']; -echo 'user'; -echo $config['csv_divider']; -echo 'event_type'; -echo $config['csv_divider']; -echo 'severity'; -echo $config['csv_divider']; -echo 'id'; -echo chr(13); - -$new = true; -while ($event = db_get_all_row_by_steps_sql($new, $result, $sql)) { - $new = false; - $alias = db_get_value('alias', 'tagente', 'id_agente', $event['id_agente']); - if ((!check_acl($config['id_user'], $event['id_grupo'], 'ER') - && !check_acl($config['id_user'], $event['id_grupo'], 'EW') && !check_acl($config['id_user'], $event['id_grupo'], 'EM') ) - || (!check_acl($config['id_user'], 0, 'PM') && $event['event_type'] == 'system') - ) { - continue; +try { + $fb64 = get_parameter('fb64', null); + $plain_filter = base64_decode($fb64); + $filter = json_decode($plain_filter, true); + if (json_last_error() != JSON_ERROR_NONE) { + throw new Exception('Invalid filter. ['.$plain_filter.']'); + } + + $names = events_get_column_names($column_names); + + // Dump headers. + foreach ($names as $n) { + echo io_safe_output($n).$config['csv_divider']; } - echo date($config['date_format'], $event['utimestamp']); - echo $config['csv_divider']; - echo io_safe_output($alias); - echo $config['csv_divider']; - echo io_safe_output(groups_get_name($event['id_grupo'])); - echo $config['csv_divider']; - echo io_safe_output($event['evento']); - echo $config['csv_divider']; - echo io_safe_output($event['estado']); - echo $config['csv_divider']; - echo io_safe_output($event['id_usuario']); - echo $config['csv_divider']; - echo io_safe_output($event['event_type']); - echo $config['csv_divider']; - echo $event['criticity']; - echo $config['csv_divider']; - echo $event['id_evento']; echo chr(13); + + // Dump events. + $events_per_step = 1000; + $step = 0; + while (1) { + $events = events_get_all( + $fields, + $filter, + (($step++) * $events_per_step), + $events_per_step, + 'desc', + 'timestamp', + $filter['history'] + ); + + if ($events === false) { + break; + } + + foreach ($events as $row) { + foreach ($column_names as $val) { + $key = $val; + if ($val == 'id_grupo') { + $key = 'group_name'; + } else if ($val == 'id_agentmodule') { + $key = 'module_name'; + } + + switch ($key) { + case 'module_status': + echo events_translate_module_status( + $row[$key] + ); + break; + + case 'event_type': + echo events_translate_event_type( + $row[$key] + ); + break; + + case 'criticity': + echo events_translate_event_criticity( + $row[$key] + ); + break; + + default: + echo io_safe_output($row[$key]); + break; + } + + echo $config['csv_divider']; + } + + echo chr(13); + } + } +} catch (Exception $e) { + echo 'ERROR'.chr(13); + echo $e->getMessage(); + exit; } + +exit; diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 5daf40d310..936cb6a814 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -373,10 +373,36 @@ if (check_acl($config['id_user'], 0, 'ER') $pss = get_user_info($config['id_user']); $hashup = md5($config['id_user'].$pss['password']); + $user_filter = db_get_row_sql( + sprintf( + 'SELECT f.id_filter, f.id_name + FROM tevent_filter f + INNER JOIN tusuario u + ON u.default_event_filter=f.id_filter + WHERE u.id_user = "%s" ', + $config['id_user'] + ) + ); + if ($user_filter !== false) { + $filter = events_get_event_filter($user_filter['id_filter']); + } else { + // Default. + $filter = [ + 'status' => EVENT_NO_VALIDATED, + 'event_view_hr' => $config['event_view_hr'], + 'group_rep' => 1, + 'tag_with' => [], + 'tag_without' => [], + 'history' => false, + ]; + } + + $fb64 = base64_encode(json_encode($filter)); + // RSS. - $sub['operation/events/events_rss.php?user='.$config['id_user'].'&hashup='.$hashup.'&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure=']['text'] = __('RSS'); - $sub['operation/events/events_rss.php?user='.$config['id_user'].'&hashup='.$hashup.'&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure=']['id'] = 'RSS'; - $sub['operation/events/events_rss.php?user='.$config['id_user'].'&hashup='.$hashup.'&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure=']['type'] = 'direct'; + $sub['operation/events/events_rss.php?user='.$config['id_user'].'&hashup='.$hashup.'&fb64='.$fb64]['text'] = __('RSS'); + $sub['operation/events/events_rss.php?user='.$config['id_user'].'&hashup='.$hashup.'&fb64='.$fb64]['id'] = 'RSS'; + $sub['operation/events/events_rss.php?user='.$config['id_user'].'&hashup='.$hashup.'&fb64='.$fb64]['type'] = 'direct'; // Marquee. $sub['operation/events/events_marquee.php']['text'] = __('Marquee'); diff --git a/pandora_console/operation/network/network_report.php b/pandora_console/operation/network/network_report.php index c9f3edf408..d590e224fb 100644 --- a/pandora_console/operation/network/network_report.php +++ b/pandora_console/operation/network/network_report.php @@ -62,7 +62,7 @@ $style_period = ($is_period) ? '' : 'display: none;'; // Build the table. $table = new stdClass(); -$table->class = 'databox'; +$table->class = 'databox filters'; $table->styleTable = 'width: 100%'; $table->data['0']['0'] = __('Data to show').'  '; $table->data['0']['0'] .= html_print_select( diff --git a/pandora_console/operation/network/network_usage_map.php b/pandora_console/operation/network/network_usage_map.php index 046cc1fcc4..764cd4eae3 100644 --- a/pandora_console/operation/network/network_usage_map.php +++ b/pandora_console/operation/network/network_usage_map.php @@ -67,7 +67,7 @@ $style_period = ($is_period) ? '' : 'display: none;'; // Build the table. $table = new stdClass(); -$table->class = 'databox'; +$table->class = 'databox filters'; $table->styleTable = 'width: 100%'; $table->data['0']['0'] = '
'; diff --git a/pandora_console/operation/users/webchat.php b/pandora_console/operation/users/webchat.php index db97864863..7e6e58712c 100644 --- a/pandora_console/operation/users/webchat.php +++ b/pandora_console/operation/users/webchat.php @@ -79,10 +79,10 @@ $table->class = 'databox filters'; $table->style[0][1] = 'text-align: right; vertical-align: top;'; $table->data[0][0] = '
'; $table->data[0][1] = '

'.__('Users Online').'

'.'
'; $table->data[1][0] = ''.__('Message').'   '.html_print_input_text( 'message_box', diff --git a/pandora_console/operation/visual_console/legacy_view.php b/pandora_console/operation/visual_console/legacy_view.php index f5eec24096..62ed4fbd18 100644 --- a/pandora_console/operation/visual_console/legacy_view.php +++ b/pandora_console/operation/visual_console/legacy_view.php @@ -15,6 +15,7 @@ global $config; // Login check require_once $config['homedir'].'/include/functions_visual_map.php'; +ui_require_css_file('visual_maps'); check_login(); diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index 1122daf285..029ef9eb25 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -83,7 +83,7 @@ echo '
'; echo '
'; echo '