diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 41321b7837..b3b665370c 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-190604 +Version: 7.0NG.735-190612 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 dcd6e1773d..4068a3039c 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-190604" +pandora_version="7.0NG.735-190612" 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/pandora_agent b/pandora_agents/unix/pandora_agent index 54f76969c7..4ed107c604 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.735'; -use constant AGENT_BUILD => '190604'; +use constant AGENT_BUILD => '190612'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; @@ -3038,10 +3038,10 @@ while (1) { my @address_list; if( -x "/bin/ip" || -x "/sbin/ip" || -x "/usr/sbin/ip" ) { - @address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`; + @address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`; } else { - @address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/[0-9]*\\.[0-9]*\\.[0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`; + @address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`; } for (my $i = 0; $i <= $#address_list; $i++) { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 432fb23bcc..f09e281cfc 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.735 -%define release 190604 +%define release 190612 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 b60141796d..c5f3b47600 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.735 -%define release 190604 +%define release 190612 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 b8bae000eb..27ca5cb3c0 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.735" -PI_BUILD="190604" +PI_BUILD="190612" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/unix/plugins/grep_log b/pandora_agents/unix/plugins/grep_log index 2e17210a51..76661c5230 100755 --- a/pandora_agents/unix/plugins/grep_log +++ b/pandora_agents/unix/plugins/grep_log @@ -6,17 +6,17 @@ # # grep_log Perl script to search log files for a matching pattern. The last # searched position is saved in an index file so that consecutive -# runs do not return the same results. The log file inode number is +# runs do not return the same results. The log file inode number is # also saved to detect log rotation. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU General Public License for more details. # ############################################################################### use strict; @@ -30,7 +30,7 @@ my $Output = 'module'; my $Verbose = 0; # Index file storage directory, with a trailing '/' -my $Idx_dir=($^O =~ /win/i)?'.\\':'/tmp/'; +my $Idx_dir=($^O =~ /win/i)?"$ENV{'TMP'}\\":"/tmp/"; # Log file my $Log_file = ''; @@ -64,7 +64,7 @@ if ( (defined ($ENV{GREP_LOG_TMP})) && (-d $ENV{GREP_LOG_TMP}) ) { } ######################################################################################## -# Erase blank spaces before and after the string +# Erase blank spaces before and after the string ######################################################################################## sub trim($){ my $string = shift; @@ -226,7 +226,7 @@ sub parse_log (;$$) { open(LOGFILE, $Log_file) || error_msg("Error opening file $Log_file: " . $!); - # Go to starting position. + # Go to starting position. seek(LOGFILE, $Idx_pos, 0); # Parse log file @@ -318,7 +318,7 @@ sub print_log ($) { print_summary() if ($summary_flag == 1); return; } - + # Log module if ($Output eq 'log_module') { my $output = "\n"; diff --git a/pandora_agents/win32/bin/util/grep_log.exe b/pandora_agents/win32/bin/util/grep_log.exe index a21e080805..4e4029fb60 100644 Binary files a/pandora_agents/win32/bin/util/grep_log.exe and b/pandora_agents/win32/bin/util/grep_log.exe differ diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2755e2bdea..bbb5ef688d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190604} +{190612} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 0686c724f8..5629c17eb2 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 190604)") +#define PANDORA_VERSION ("7.0NG.735(Build 190612)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 8650b54e46..934b27fdd6 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 190604))" + VALUE "ProductVersion", "(7.0NG.735(Build 190612))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 6d045e7ee0..1fa6b0606e 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.735-190604 +Version: 7.0NG.735-190612 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 13cc28aa57..c9422dc4c7 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-190604" +pandora_version="7.0NG.735-190612" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/db_status.php b/pandora_console/extensions/db_status.php index 2d8669f83f..d78ff90fc8 100755 --- a/pandora_console/extensions/db_status.php +++ b/pandora_console/extensions/db_status.php @@ -215,7 +215,7 @@ function extension_db_check_tables_differences( $diff_tables = array_diff($tables_test, $tables_system); ui_print_result_message( - !empty($diff_tables), + empty($diff_tables), __('Success! %s DB contains all tables', get_product_name()), __( '%s DB could not retrieve all tables. The missing tables are (%s)', diff --git a/pandora_console/extras/mr/29.sql b/pandora_console/extras/mr/29.sql new file mode 100644 index 0000000000..032dd407b1 --- /dev/null +++ b/pandora_console/extras/mr/29.sql @@ -0,0 +1,6 @@ +START TRANSACTION; + +DELETE FROM `ttipo_modulo` WHERE `nombre` LIKE 'log4x'; + + +COMMIT; diff --git a/pandora_console/extras/pandora_diag.php b/pandora_console/extras/pandora_diag.php index c5420c26bd..f3b11177d1 100644 --- a/pandora_console/extras/pandora_diag.php +++ b/pandora_console/extras/pandora_diag.php @@ -139,8 +139,9 @@ function get_logs_size($file) function get_status_logs($path) { $status_server_log = ''; - $size_server_log = get_logs_size($path); - if ($size_server_log <= 1048576) { + $size_server_log = number_format(get_logs_size($path)); + $size_server_log = (0 + str_replace(',', '', $size_server_log)); + if ($size_server_log <= 10485760) { $status_server_log = "Normal Status   You have less than 10 MB of logs"; } else { $status_server_log = "Warning Status   You have more than 10 MB of logs"; 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 4261fdf88b..2c9ff7e7de 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 @@ -1989,6 +1989,33 @@ CREATE TABLE IF NOT EXISTS `tnetwork_matrix` ( UNIQUE (`source`, `destination`, `utimestamp`) ) ENGINE = InnoDB DEFAULT CHARSET=utf8 ; +-- --------------------------------------------------------------------- +-- Table `user_task` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tuser_task` ( + `id` int(20) unsigned NOT NULL auto_increment, + `function_name` varchar(80) NOT NULL default '', + `parameters` text NOT NULL default '', + `name` varchar(60) NOT NULL default '', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `user_task_scheduled` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tuser_task_scheduled` ( + `id` int(20) unsigned NOT NULL auto_increment, + `id_usuario` varchar(60) NOT NULL default '0', + `id_user_task` int(20) unsigned NOT NULL default '0', + `args` TEXT NOT NULL, + `scheduled` enum('no','hourly','daily','weekly','monthly','yearly','custom') default 'no', + `last_run` int(20) unsigned default '0', + `custom_data` int(10) NULL default '0', + `flag_delete` tinyint(1) UNSIGNED NOT NULL default 0, + `id_grupo` int(10) unsigned NOT NULL default 0, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- ----------------------------------------------------- -- Table `tnotification_source` -- ----------------------------------------------------- diff --git a/pandora_console/godmode/gis_maps/configure_gis_map.php b/pandora_console/godmode/gis_maps/configure_gis_map.php index 0e632380ce..8277463e18 100644 --- a/pandora_console/godmode/gis_maps/configure_gis_map.php +++ b/pandora_console/godmode/gis_maps/configure_gis_map.php @@ -357,8 +357,8 @@ function addConnectionMap() { for (var index in connectionMaps) { if (isInt(index)) { if (connectionMaps[index] == idConnectionMap) { - alert(" "' + connectionMapName + '" "); - + alert(" " + connectionMapName + " "); + return; } } diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 44e616977d..e9d8b49176 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -45,6 +45,9 @@ .parent() .addClass('checkselected'); $(".check_delete").prop("checked", true); + $('.check_delete').each(function(){ + $('#hidden-id_report_'+$(this).val()).prop("disabled", false); + }); } else{ $('[id^=checkbox-massive_report_check]') diff --git a/pandora_console/images/groups_small_white/application_osx.png b/pandora_console/images/groups_small_white/application_osx.png new file mode 100644 index 0000000000..409d9742d2 Binary files /dev/null and b/pandora_console/images/groups_small_white/application_osx.png differ diff --git a/pandora_console/images/groups_small_white/application_osx_terminal.png b/pandora_console/images/groups_small_white/application_osx_terminal.png new file mode 100644 index 0000000000..3deb76aa34 Binary files /dev/null and b/pandora_console/images/groups_small_white/application_osx_terminal.png differ diff --git a/pandora_console/images/groups_small_white/applications.png b/pandora_console/images/groups_small_white/applications.png new file mode 100644 index 0000000000..362ed8b98d Binary files /dev/null and b/pandora_console/images/groups_small_white/applications.png differ diff --git a/pandora_console/images/groups_small_white/bricks.png b/pandora_console/images/groups_small_white/bricks.png new file mode 100644 index 0000000000..b68255b88b Binary files /dev/null and b/pandora_console/images/groups_small_white/bricks.png differ diff --git a/pandora_console/images/groups_small_white/chart_organisation.png b/pandora_console/images/groups_small_white/chart_organisation.png new file mode 100644 index 0000000000..d80fc4f65f Binary files /dev/null and b/pandora_console/images/groups_small_white/chart_organisation.png differ diff --git a/pandora_console/images/groups_small_white/clock.png b/pandora_console/images/groups_small_white/clock.png new file mode 100644 index 0000000000..dc16f55773 Binary files /dev/null and b/pandora_console/images/groups_small_white/clock.png differ diff --git a/pandora_console/images/groups_small_white/computer.png b/pandora_console/images/groups_small_white/computer.png new file mode 100644 index 0000000000..5eab00e255 Binary files /dev/null and b/pandora_console/images/groups_small_white/computer.png differ diff --git a/pandora_console/images/groups_small_white/database.png b/pandora_console/images/groups_small_white/database.png new file mode 100644 index 0000000000..397f3fa5d3 Binary files /dev/null and b/pandora_console/images/groups_small_white/database.png differ diff --git a/pandora_console/images/groups_small_white/database_gear.png b/pandora_console/images/groups_small_white/database_gear.png new file mode 100644 index 0000000000..72a6b63d0f Binary files /dev/null and b/pandora_console/images/groups_small_white/database_gear.png differ diff --git a/pandora_console/images/groups_small_white/drive_network.png b/pandora_console/images/groups_small_white/drive_network.png new file mode 100644 index 0000000000..4e1cd615c6 Binary files /dev/null and b/pandora_console/images/groups_small_white/drive_network.png differ diff --git a/pandora_console/images/groups_small_white/email.png b/pandora_console/images/groups_small_white/email.png new file mode 100644 index 0000000000..496991da88 Binary files /dev/null and b/pandora_console/images/groups_small_white/email.png differ diff --git a/pandora_console/images/groups_small_white/eye.png b/pandora_console/images/groups_small_white/eye.png new file mode 100644 index 0000000000..f5c8a4e940 Binary files /dev/null and b/pandora_console/images/groups_small_white/eye.png differ diff --git a/pandora_console/images/groups_small_white/firewall.png b/pandora_console/images/groups_small_white/firewall.png new file mode 100644 index 0000000000..261adbcb1e Binary files /dev/null and b/pandora_console/images/groups_small_white/firewall.png differ diff --git a/pandora_console/images/groups_small_white/heart.png b/pandora_console/images/groups_small_white/heart.png new file mode 100644 index 0000000000..6bfec0298a Binary files /dev/null and b/pandora_console/images/groups_small_white/heart.png differ diff --git a/pandora_console/images/groups_small_white/house.png b/pandora_console/images/groups_small_white/house.png new file mode 100644 index 0000000000..72ab42dd35 Binary files /dev/null and b/pandora_console/images/groups_small_white/house.png differ diff --git a/pandora_console/images/groups_small_white/images.png b/pandora_console/images/groups_small_white/images.png new file mode 100644 index 0000000000..195c7e222b Binary files /dev/null and b/pandora_console/images/groups_small_white/images.png differ diff --git a/pandora_console/images/groups_small_white/lightning.png b/pandora_console/images/groups_small_white/lightning.png new file mode 100644 index 0000000000..31a0670a68 Binary files /dev/null and b/pandora_console/images/groups_small_white/lightning.png differ diff --git a/pandora_console/images/groups_small_white/lock.png b/pandora_console/images/groups_small_white/lock.png new file mode 100644 index 0000000000..522ff71bd6 Binary files /dev/null and b/pandora_console/images/groups_small_white/lock.png differ diff --git a/pandora_console/images/groups_small_white/network.png b/pandora_console/images/groups_small_white/network.png new file mode 100644 index 0000000000..1a8573a729 Binary files /dev/null and b/pandora_console/images/groups_small_white/network.png differ diff --git a/pandora_console/images/groups_small_white/plugin.png b/pandora_console/images/groups_small_white/plugin.png new file mode 100644 index 0000000000..051ec05d6b Binary files /dev/null and b/pandora_console/images/groups_small_white/plugin.png differ diff --git a/pandora_console/images/groups_small_white/printer.png b/pandora_console/images/groups_small_white/printer.png new file mode 100644 index 0000000000..4187e87a00 Binary files /dev/null and b/pandora_console/images/groups_small_white/printer.png differ diff --git a/pandora_console/images/groups_small_white/server_database.png b/pandora_console/images/groups_small_white/server_database.png new file mode 100644 index 0000000000..864e3cb7cb Binary files /dev/null and b/pandora_console/images/groups_small_white/server_database.png differ diff --git a/pandora_console/images/groups_small_white/transmit.png b/pandora_console/images/groups_small_white/transmit.png new file mode 100644 index 0000000000..d27f5c377d Binary files /dev/null and b/pandora_console/images/groups_small_white/transmit.png differ diff --git a/pandora_console/images/groups_small_white/without_group.png b/pandora_console/images/groups_small_white/without_group.png new file mode 100644 index 0000000000..30915bd101 Binary files /dev/null and b/pandora_console/images/groups_small_white/without_group.png differ diff --git a/pandora_console/images/groups_small_white/world.png b/pandora_console/images/groups_small_white/world.png new file mode 100644 index 0000000000..dcfd04139b Binary files /dev/null and b/pandora_console/images/groups_small_white/world.png differ diff --git a/pandora_console/include/ajax/custom_fields.php b/pandora_console/include/ajax/custom_fields.php index 9baacdcdc2..21d3d11085 100644 --- a/pandora_console/include/ajax/custom_fields.php +++ b/pandora_console/include/ajax/custom_fields.php @@ -299,6 +299,7 @@ if (check_login()) { 'status' => "
".$image_status.'
', 'id_agent' => $values['id_tagente'], 'id_server' => $values['id_tmetaconsole_setup'], + 'status_value' => $values['status'], ]; } diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index b9a5ede1e5..5ef2fed828 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -1472,7 +1472,10 @@ function local_ldap_search($ldap_host, $ldap_port=389, $ldap_version=3, $dn, $ac $tls = ' -ZZ '; } - if (stripos($ldap_host, 'ldap') !== false) { + if (stripos($ldap_host, 'ldap://') !== false + || stripos($ldap_host, 'ldaps://') !== false + || stripos($ldap_host, 'ldapi://') !== false + ) { $ldap_host = ' -H '.$ldap_host.':'.$ldap_port; } else { $ldap_host = ' -h '.$ldap_host.' -p '.$ldap_port; diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a91ee7173c..6cade00145 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190604'; +$build_version = 'PC190612'; $pandora_version = 'v7.0NG.735'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 488d6a28cd..87d0601a4f 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2167,9 +2167,9 @@ function config_process_config() if (!isset($config['ad_adv_perms'])) { config_update_value('ad_adv_perms', ''); } else { + $temp_ad_adv_perms = []; if (!json_decode(io_safe_output($config['ad_adv_perms']))) { - $temp_ad_adv_perms = []; - if (!isset($config['ad_adv_perms']) && $config['ad_adv_perms'] != '') { + if ($config['ad_adv_perms'] != '') { $perms = explode(';', io_safe_output($config['ad_adv_perms'])); foreach ($perms as $ad_adv_perm) { if (preg_match('/[\[\]]/', $ad_adv_perm)) { @@ -2232,22 +2232,26 @@ function config_process_config() if (!empty($new_ad_adv_perms)) { $temp_ad_adv_perms = json_encode($new_ad_adv_perms); } + } else { + $temp_ad_adv_perms = ''; } - - config_update_value('ad_adv_perms', $temp_ad_adv_perms); + } else { + $temp_ad_adv_perms = $config['ad_adv_perms']; } + + config_update_value('ad_adv_perms', $temp_ad_adv_perms); } if (!isset($config['ldap_adv_perms'])) { config_update_value('ldap_adv_perms', ''); } else { + $temp_ldap_adv_perms = []; if (!json_decode(io_safe_output($config['ldap_adv_perms']))) { - $temp_ldap_adv_perms = []; - if (!isset($config['ad_adv_perms']) && $config['ldap_adv_perms'] != '') { + if ($config['ldap_adv_perms'] != '') { $perms = explode(';', io_safe_output($config['ldap_adv_perms'])); - foreach ($perms as $ad_adv_perm) { - if (preg_match('/[\[\]]/', $ad_adv_perm)) { - $all_data = explode(',', io_safe_output($ad_adv_perm)); + foreach ($perms as $ldap_adv_perm) { + if (preg_match('/[\[\]]/', $ldap_adv_perm)) { + $all_data = explode(',', io_safe_output($ldap_adv_perm)); $profile = $all_data[0]; $group_pnd = $all_data[1]; $groups_ad = str_replace(['[', ']'], '', $all_data[2]); @@ -2277,7 +2281,7 @@ function config_process_config() 'groups_ldap' => $groups_ldap, ]; } else { - $all_data = explode(',', io_safe_output($ad_adv_perm)); + $all_data = explode(',', io_safe_output($ldap_adv_perm)); $profile = $all_data[0]; $group_pnd = $all_data[1]; $groups_ad = $all_data[2]; @@ -2306,10 +2310,14 @@ function config_process_config() if (!empty($new_ldap_adv_perms)) { $temp_ldap_adv_perms = json_encode($new_ldap_adv_perms); } + } else { + $temp_ldap_adv_perms = ''; } - - config_update_value('ldap_adv_perms', $temp_ldap_adv_perms); + } else { + $temp_ldap_adv_perms = $config['ldap_adv_perms']; } + + config_update_value('ldap_adv_perms', $temp_ldap_adv_perms); } if (!isset($config['rpandora_server'])) { diff --git a/pandora_console/include/functions_custom_fields.php b/pandora_console/include/functions_custom_fields.php index 9570098766..d1f661e874 100644 --- a/pandora_console/include/functions_custom_fields.php +++ b/pandora_console/include/functions_custom_fields.php @@ -188,10 +188,16 @@ function get_custom_fields_data($custom_field_name) } $array_result = []; - if (isset($result_meta) && is_array($result_meta)) { + if (isset($result_meta) === true + && is_array($result_meta) === true + ) { foreach ($result_meta as $result) { - foreach ($result as $k => $v) { - $array_result[$v['description']] = $v['description']; + if (isset($result) === true + && is_array($result) === true + ) { + foreach ($result as $k => $v) { + $array_result[$v['description']] = $v['description']; + } } } } @@ -385,9 +391,13 @@ function agent_counters_custom_fields($filters) // Filter custom data. $custom_data_and = ''; - if (!in_array(-1, $filters['id_custom_fields_data'])) { - $custom_data_array = implode("', '", $filters['id_custom_fields_data']); - $custom_data_and = "AND tcd.description IN ('".$custom_data_array."')"; + if (isset($filters['id_custom_fields_data']) === true + && is_array($filters['id_custom_fields_data']) === true + ) { + if (!in_array(-1, $filters['id_custom_fields_data'])) { + $custom_data_array = implode("', '", $filters['id_custom_fields_data']); + $custom_data_and = "AND tcd.description IN ('".$custom_data_array."')"; + } } // Filter custom name. @@ -693,3 +703,123 @@ function print_counters_cfv( $html_result .= ''; return $html_result; } + + +/** + * Function for export a csv file from Custom Fields View + * + * @param array $filters Status counters for agents and modules. + * @param array $id_status Agent status. + * @param array $module_status Module status. + * + * @return array Returns the data that will be saved in the csv file + */ +function export_custom_fields_csv($filters, $id_status, $module_status) +{ + $data = agent_counters_custom_fields($filters); + $indexed_descriptions = $data['indexed_descriptions']; + + // Table temporary for save array in table + // by order and search custom_field data. + $table_temporary = 'CREATE TEMPORARY TABLE temp_custom_fields ( + id_server int(10), + id_agent int(10), + name_custom_fields varchar(2048), + critical_count int, + warning_count int, + unknown_count int, + notinit_count int, + normal_count int, + total_count int, + `status` int(2), + KEY `data_index_temp_1` (`id_server`, `id_agent`) + )'; + db_process_sql($table_temporary); + + // Insert values array in table temporary. + $values_insert = []; + foreach ($indexed_descriptions as $key => $value) { + $values_insert[] = '('.$value['id_server'].', '.$value['id_agente'].", '".$value['description']."', '".$value['critical_count']."', '".$value['warning_count']."', '".$value['unknown_count']."', '".$value['notinit_count']."', '".$value['normal_count']."', '".$value['total_count']."', ".$value['status'].')'; + } + + $values_insert_implode = implode(',', $values_insert); + $query_insert = 'INSERT INTO temp_custom_fields VALUES '.$values_insert_implode; + db_process_sql($query_insert); + + // Search for status module. + $status_agent_search = ''; + if (isset($id_status) === true && is_array($id_status) === true) { + if (in_array(-1, $id_status) === false) { + if (in_array(AGENT_MODULE_STATUS_NOT_NORMAL, $id_status) === false) { + $status_agent_search = ' AND temp.status IN ('.implode(',', $id_status).')'; + } else { + // Not normal statuses. + $status_agent_search = ' AND temp.status IN (1,2,3,4,5)'; + } + } + } + + // Search for status module. + $status_module_search = ''; + if (isset($module_status) === true && is_array($module_status) === true) { + if (in_array(-1, $module_status) === false) { + if (in_array(AGENT_MODULE_STATUS_NOT_NORMAL, $module_status) === false) { + if (count($module_status) > 0) { + $status_module_search = ' AND ( '; + foreach ($module_status as $key => $value) { + $status_module_search .= ($key != 0) ? ' OR (' : ' ('; + switch ($value) { + default: + case AGENT_STATUS_NORMAL: + $status_module_search .= ' temp.normal_count > 0) '; + break; + case AGENT_STATUS_CRITICAL: + $status_module_search .= ' temp.critical_count > 0) '; + break; + + case AGENT_STATUS_WARNING: + $status_module_search .= ' temp.warning_count > 0) '; + break; + + case AGENT_STATUS_UNKNOWN: + $status_module_search .= ' temp.unknown_count > 0) '; + break; + + case AGENT_STATUS_NOT_INIT: + $status_module_search .= ' temp.notinit_count > 0) '; + break; + } + } + + $status_module_search .= ' ) '; + } + } else { + // Not normal. + $status_module_search = ' AND ( temp.critical_count > 0 OR temp.warning_count > 0 OR temp.unknown_count > 0 AND temp.notinit_count > 0 )'; + } + } + } + + // Query all fields result. + $query = sprintf( + 'SELECT + temp.name_custom_fields, + tma.alias, + tma.direccion, + tma.server_name, + temp.status + FROM tmetaconsole_agent tma + INNER JOIN temp_custom_fields temp + ON temp.id_agent = tma.id_tagente + AND temp.id_server = tma.id_tmetaconsole_setup + WHERE tma.disabled = 0 + %s + %s + ', + $status_agent_search, + $status_module_search + ); + + $result = db_get_all_rows_sql($query); + return $result; +} diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 86de873965..cde59c52bb 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -289,7 +289,7 @@ function grafico_modulo_sparse_data( } } - if ($array_data === false || (!$params['graph_combined'] + if ($array_data === false && (!$params['graph_combined'] && !isset($array_data['sum1']['data'][0][1]) && !$params['baseline']) ) { return false; diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index d20daecb46..ca2b2d055b 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -261,138 +261,47 @@ function snmp_browser_get_tree( ) { global $config; - if ($target_ip == '') { - return __('Target IP cannot be blank.'); - } + $output = get_snmpwalk( + $target_ip, + $version, + $community, + $snmp3_auth_user, + $snmp3_security_level, + $snmp3_auth_method, + $snmp3_auth_pass, + $snmp3_privacy_method, + $snmp3_privacy_pass, + 0, + $starting_oid, + '', + $server_to_exec, + '', + '' + ); - // Call snmpwalk - if (empty($config['snmpwalk'])) { - switch (PHP_OS) { - case 'FreeBSD': - $snmpwalk_bin = '/usr/local/bin/snmpwalk'; - break; - - case 'NetBSD': - $snmpwalk_bin = '/usr/pkg/bin/snmpwalk'; - break; - - default: - $snmpwalk_bin = 'snmpwalk'; - break; - } - } else { - $snmpwalk_bin = $config['snmpwalk']; - } - - switch (PHP_OS) { - case 'WIN32': - case 'WINNT': - case 'Windows': - $error_redir_dir = 'NUL'; - break; - - default: - $error_redir_dir = '/dev/null'; - break; - } - - if ($server_to_exec != 0) { - $sql = sprintf('SELECT ip_address FROM tserver WHERE id_server = %d', $server_to_exec); - $server_data = db_get_row_sql($sql); - - if (enterprise_installed()) { - enterprise_include_once('include/functions_satellite.php'); - - $oid_tree = ['__LEAVES__' => []]; - if ($version == '3') { - switch ($snmp3_security_level) { - case 'authPriv': - $command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir; - break; - - case 'authNoPriv': - $command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir; - break; - - case 'noAuthNoPriv': - $command = $snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir; - break; - } - } else { - $command = $snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir; - } - - exec('ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"', $output, $rc); - } else { - $oid_tree = ['__LEAVES__' => []]; - if ($version == '3') { - switch ($snmp3_security_level) { - case 'authPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - - case 'authNoPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - - case 'noAuthNoPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - } - } else { - exec($snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - } - } - } else { - $oid_tree = ['__LEAVES__' => []]; - if ($version == '3') { - switch ($snmp3_security_level) { - case 'authPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - - case 'authNoPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - - case 'noAuthNoPriv': - exec($snmpwalk_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - break; - } - } else { - exec($snmpwalk_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -Cc -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($starting_oid).' 2> '.$error_redir_dir, $output, $rc); - } - } - - foreach ($output as $line) { - // Separate the OID from the value - $full_oid = explode('=', $line); - if (! isset($full_oid[1])) { - continue; - } - - $oid = trim($full_oid[0]); - $value = trim($full_oid[1]); - - // Parse the OID + // Build the tree. + $oid_tree = ['__LEAVES__' => []]; + foreach ($output as $oid => $value) { + // Parse the OID. + $oid_len = strlen($oid); $group = 0; $sub_oid = ''; $ptr = &$oid_tree['__LEAVES__']; - for ($i = 0; $i < strlen($oid); $i++) { + for ($i = 0; $i < $oid_len; $i++) { // "X.Y.Z" if ($oid[$i] == '"') { $group = ($group ^ 1); } - // Move to the next element of the OID + // Move to the next element of the OID. if ($group == 0 && ($oid[$i] == '.' || ($oid[$i] == ':' && $oid[($i + 1)] == ':'))) { - // Skip the next : + // Skip the next ":". if ($oid[$i] == ':') { $i++; } - // Starting dot + // Starting dot. if ($sub_oid == '') { continue; } @@ -410,7 +319,7 @@ function snmp_browser_get_tree( } } - // The last element will contain the full OID + // The last element will contain the full OID. $ptr[$sub_oid] = [ '__OID__' => $oid, '__VALUE__' => $value, @@ -459,83 +368,27 @@ function snmp_browser_get_oid( return; } + $output = get_snmpwalk( + $target_ip, + $version, + $community, + $snmp3_auth_user, + $snmp3_security_level, + $snmp3_auth_method, + $snmp3_auth_pass, + $snmp3_privacy_method, + $snmp3_privacy_pass, + 0, + $target_oid, + '', + $server_to_exec, + '', + '-On' + ); + $oid_data['oid'] = $target_oid; - if (empty($config['snmpget'])) { - switch (PHP_OS) { - case 'FreeBSD': - $snmpget_bin = '/usr/local/bin/snmpget'; - break; - - case 'NetBSD': - $snmpget_bin = '/usr/pkg/bin/snmpget'; - break; - - default: - $snmpget_bin = 'snmpget'; - break; - } - } else { - $snmpget_bin = $config['snmpget']; - } - - switch (PHP_OS) { - case 'WIN32': - case 'WINNT': - case 'Windows': - $error_redir_dir = 'NUL'; - break; - - default: - $error_redir_dir = '/dev/null'; - break; - } - - if ($server_to_exec != 0) { - $sql = sprintf( - 'SELECT ip_address FROM tserver WHERE id_server = %d', - $server_to_exec - ); - $server_data = db_get_row_sql($sql); - - if ($version == '3') { - $command = $snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir; - } else { - $command = $snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir; - } - - exec( - 'ssh pandora_exec_proxy@'.$server_data['ip_address'].' "'.$command.'"', - $output, - $rc - ); - } else { - if ($version == '3') { - exec( - $snmpget_bin.' -m ALL -v 3 -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir, - $output, - $rc - ); - } else { - exec( - $snmpget_bin.' -m ALL -M +'.escapeshellarg($config['homedir'].'/attachment/mibs').' -On -c '.escapeshellarg(io_safe_output($community)).' -v '.escapeshellarg($version).' '.escapeshellarg($target_ip).' '.escapeshellarg($target_oid).' 2> '.$error_redir_dir, - $output, - $rc - ); - } - } - - if ($rc != 0) { - return $oid_data; - } - - foreach ($output as $line) { - // Separate the OID from the value. - $full_oid = explode('=', $line); - if (! isset($full_oid[1])) { - break; - } - - $oid = trim($full_oid[0]); + foreach ($output as $oid => $value) { + $oid = trim($oid); $oid_data['numeric_oid'] = $oid; // Translate the OID. @@ -594,16 +447,19 @@ function snmp_browser_get_oid( $oid_data['description'] = $custom_data['description']; } - $full_value = explode(':', trim($full_oid[1])); + $full_value = explode(':', trim($value)); if (! isset($full_value[1])) { - $oid_data['value'] = trim($full_oid[1]); + $oid_data['value'] = trim($value); } else { $oid_data['type'] = trim($full_value[0]); $oid_data['value'] = trim($full_value[1]); } - return $oid_data; + // There should only be one OID. + break; } + + return $oid_data; } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 59b76ba00f..c81148b9c9 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4364,7 +4364,7 @@ function ui_print_agent_autocomplete_input($parameters) function '.$javascript_on_blur_function_name.'() { input_value = $("#'.$input_id.'").val(); - if (input_value.length == 0) { + if (input_value.length < 2) { if (('.((int) $print_hidden_input_idagent).') || ('.((int) $use_hidden_input_idagent).')) { $("#'.$hidden_input_idagent_id.'").val(0); @@ -4415,7 +4415,7 @@ function ui_print_agent_autocomplete_input($parameters) url: action="'.$javascript_ajax_page.'", dataType: "json", success: function (data) { - if (data.length == 0) { + if (data.length < 2) { //Set icon $("#'.$input_id.'") .css("background", diff --git a/pandora_console/include/javascript/buttons.html5.min.js b/pandora_console/include/javascript/buttons.html5.min.js new file mode 100644 index 0000000000..deee7fee68 --- /dev/null +++ b/pandora_console/include/javascript/buttons.html5.min.js @@ -0,0 +1,35 @@ +/*! + HTML5 export buttons for Buttons and DataTables. + 2016 SpryMedia Ltd - datatables.net/license + + FileSaver.js (1.3.3) - MIT license + Copyright © 2016 Eli Grey - http://eligrey.com +*/ +(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(g){return f(g,window,document)}):"object"===typeof exports?module.exports=function(g,p,z,t){g||(g=window);p&&p.fn.dataTable||(p=require("datatables.net")(g,p).$);p.fn.dataTable.Buttons||require("datatables.net-buttons")(g,p);return f(p,g,g.document,z,t)}:f(jQuery,window,document)})(function(f,g,p,z,t,w){function A(a){for(var b="";0<=a;)b=String.fromCharCode(a%26+65)+b,a=Math.floor(a/ +26)-1;return b}function E(a,b){y===w&&(y=-1===C.serializeToString(f.parseXML(F["xl/worksheets/sheet1.xml"])).indexOf("xmlns:r"));f.each(b,function(b,c){if(f.isPlainObject(c))b=a.folder(b),E(b,c);else{if(y){var d=c.childNodes[0],e,h=[];for(e=d.attributes.length-1;0<=e;e--){var m=d.attributes[e].nodeName;var k=d.attributes[e].nodeValue;-1!==m.indexOf(":")&&(h.push({name:m,value:k}),d.removeAttribute(m))}e=0;for(m=h.length;e'+c),c=c.replace(/_dt_b_namespace_token_/g,":"),c=c.replace(/xmlns:NS[\d]+="" NS[\d]+:/g,""));c=c.replace(/<([^<>]*?) xmlns=""([^<>]*?)>/g,"<$1 $2>");a.file(b,c)}})}function r(a,b,d){var c=a.createElement(b);d&&(d.attr&&f(c).attr(d.attr),d.children&&f.each(d.children,function(a,b){c.appendChild(b)}),null!==d.text&&d.text!==w&&c.appendChild(a.createTextNode(d.text))); +return c}function L(a,b){var d=a.header[b].length;a.footer&&a.footer[b].length>d&&(d=a.footer[b].length);for(var c=0,f=a.body.length;cd&&(d=e);if(401*a[1]?!0:!1};try{var C=new XMLSerializer,y}catch(a){}var F={"_rels/.rels":'', +"xl/_rels/workbook.xml.rels":'',"[Content_Types].xml":'', +"xl/workbook.xml":'', +"xl/worksheets/sheet1.xml":'',"xl/styles.xml":''}, +K=[{match:/^\-?\d+\.\d%$/,style:60,fmt:function(a){return a/100}},{match:/^\-?\d+\.?\d*%$/,style:56,fmt:function(a){return a/100}},{match:/^\-?\$[\d,]+.?\d*$/,style:57},{match:/^\-?£[\d,]+.?\d*$/,style:58},{match:/^\-?€[\d,]+.?\d*$/,style:59},{match:/^\-?\d+$/,style:65},{match:/^\-?\d+\.\d{2}$/,style:66},{match:/^\([\d,]+\)$/,style:61,fmt:function(a){return-1*a.replace(/[\(\)]/g,"")}},{match:/^\([\d,]+\.\d{2}\)$/,style:62,fmt:function(a){return-1*a.replace(/[\(\)]/g,"")}},{match:/^\-?[\d,]+$/,style:63}, +{match:/^\-?[\d,]+\.\d{2}$/,style:64}];v.ext.buttons.copyHtml5={className:"buttons-copy buttons-html5",text:function(a){return a.i18n("buttons.copy","Copy")},action:function(a,b,d,c){this.processing(!0);var g=this;a=I(b,c);var e=b.buttons.exportInfo(c),h=H(c),m=a.str;d=f("
").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0});e.title&&(m=e.title+h+h+m);e.messageTop&&(m=e.messageTop+h+h+m);e.messageBottom&&(m=m+h+h+e.messageBottom);c.customize&&(m=c.customize(m,c,b));c=f("