diff --git a/extras/android-event-viewer/.idea/misc.xml b/extras/android-event-viewer/.idea/misc.xml index 38041c7cc6..a4aaf9f97e 100644 --- a/extras/android-event-viewer/.idea/misc.xml +++ b/extras/android-event-viewer/.idea/misc.xml @@ -1,8 +1,5 @@ - - - - - - - - - - - - - - + diff --git a/extras/android-event-viewer/app/build.gradle b/extras/android-event-viewer/app/build.gradle index 92924f93b3..d9a280d817 100644 --- a/extras/android-event-viewer/app/build.gradle +++ b/extras/android-event-viewer/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 8 - buildToolsVersion "25.0.2" + buildToolsVersion "26.0.2" defaultConfig { applicationId "pandroid_event_viewer.pandorafms" diff --git a/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/EventList.java b/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/EventList.java index 15ca771bad..b208855e0b 100644 --- a/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/EventList.java +++ b/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/EventList.java @@ -159,8 +159,14 @@ public class EventList extends ListActivity { } }); - - + ImageButton btnSettings = (ImageButton) findViewById(R.id.settings_icon_button_list); + // Open the settings + btnSettings.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + startActivity(new Intent(v.getContext(), Options.class)); + } + }); + registerReceiver(onBroadcast, new IntentFilter("eventlist.java")); this.toggleLoadingLayout(); diff --git a/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/Main.java b/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/Main.java index 6ab57371e9..2548b8023b 100644 --- a/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/Main.java +++ b/extras/android-event-viewer/app/src/main/java/pandroid_event_viewer/pandorafms/Main.java @@ -96,10 +96,29 @@ public class Main extends Activity { Activity.MODE_PRIVATE); setContentView(R.layout.main); + final ImageButton btnSettings = (ImageButton) findViewById(R.id.settings_icon_button_main); + final ImageButton btnFilter = (ImageButton) findViewById(R.id.filter_icon_button_main); final Button buttonSetAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher); final ImageButton buttonSearch = (ImageButton) findViewById(R.id.refresh_icon_button_main); final ImageButton buttonDeleteProfile = (ImageButton) findViewById(R.id.button_delete_profile); final ImageButton buttonSaveProfile = (ImageButton) findViewById(R.id.button_save_profile); + + // Open the settings + btnSettings.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + startActivity(new Intent(v.getContext(), Options.class)); + } + }); + + // Go to the events list + btnFilter.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + Activity a = (Activity) v.getContext(); + TabActivity ta = (TabActivity) a.getParent(); + ta.getTabHost().setCurrentTab(1); + } + }); + // Check if the user preferences it is set. if (object.user.length() == 0 || object.password.length() == 0 || object.url.length() == 0) { diff --git a/extras/android-event-viewer/app/src/main/res/layout/list_view_layout.xml b/extras/android-event-viewer/app/src/main/res/layout/list_view_layout.xml index 9b32dfe1dc..b0135b4489 100644 --- a/extras/android-event-viewer/app/src/main/res/layout/list_view_layout.xml +++ b/extras/android-event-viewer/app/src/main/res/layout/list_view_layout.xml @@ -63,8 +63,22 @@ android:layout_weight="0" android:padding="0dp" android:src="@drawable/filter_icon_button" + android:background="@null" /> + + + + + android:tint="@android:color/white" + android:src="@android:drawable/ic_menu_preferences" /> + + + + + + /dev/null diff --git a/pandora_agents/unix/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 723b17232c..aaf29acb8f 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.714, GNU/Linux +# Version 7.0NG.715, 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 8a8ecd3451..817432efa6 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.714, FreeBSD Version +# Version 7.0NG.715, 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 f31d7e6cd0..d0f28e9943 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.714, HP-UX Version +# Version 7.0NG.715, 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 59ea7ed59d..d9876734df 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.714, GNU/Linux +# Version 7.0NG.715, 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 ee6b7bb18d..c4665aaa94 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.714, GNU/Linux +# Version 7.0NG.715, 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 aa64beba39..8100e76026 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.714, NetBSD Version +# Version 7.0NG.715, 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 3dada142de..9a5432057a 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.714, Solaris Version +# Version 7.0NG.715, 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 8d48365a14..1b10febbfa 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -40,8 +40,8 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.714'; -use constant AGENT_BUILD => '171031'; +use constant AGENT_VERSION => '7.0NG.715'; +use constant AGENT_BUILD => '171114'; # 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 a8e50d570d..3f3d8e00d8 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.714 -%define release 171031 +%define version 7.0NG.715 +%define release 171114 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 7c920391e9..b8b8aea986 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.714 -%define release 171031 +%define version 7.0NG.715 +%define release 171114 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 2ea278fd66..137280aec7 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.714" -PI_BUILD="171031" +PI_VERSION="7.0NG.715" +PI_BUILD="171114" 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 c8c32e84d0..90626fedbc 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-2014 Artica Soluciones Tecnologicas -# Version 7.0NG.714 +# Version 7.0NG.715 # 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 3964a08708..6389736802 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.714} +{Pandora FMS Windows Agent v7.0NG.715} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{171031} +{171114} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 10c9f9a9a0..dd96e3893f 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.714(Build 171031)") +#define PANDORA_VERSION ("7.0NG.715(Build 171114)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 59e5f0f15d..70cefab4ca 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.714(Build 171031))" + VALUE "ProductVersion", "(7.0NG.715(Build 171114))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 67a1519e82..5d11b3e8dd 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.714-171031 +Version: 7.0NG.715-171114 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 48c5d593d7..0c8c82c4d4 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.714-171031" +pandora_version="7.0NG.715-171114" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/8.sql b/pandora_console/extras/mr/8.sql index 591574e07b..402fb7e82c 100644 --- a/pandora_console/extras/mr/8.sql +++ b/pandora_console/extras/mr/8.sql @@ -6,4 +6,16 @@ ALTER TABLE treport_content ADD COLUMN visual_format tinyint(1) default '0'; ALTER TABLE treport_content_template ADD COLUMN lapse_calc tinyint(1) default '0'; ALTER TABLE treport_content_template ADD COLUMN lapse int(11) default '300'; ALTER TABLE treport_content_template ADD COLUMN visual_format tinyint(1) default '0'; + +UPDATE `talert_commands` +SET `description` = 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using: _field1_ as destination email address, and _field2_ as subject for message. _field3_ as text of message. _field4_ as content type (text/plain or html/text).', + `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"Content Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', + `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' +WHERE id=1; + +UPDATE `talert_actions` +SET `field4` = 'text/html', + `field4_recovery` = 'text/html' +WHERE id = 1; + COMMIT; \ No newline at end of file diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index a7f25b24b9..9fcc5f70c4 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 @@ -1137,6 +1137,10 @@ ALTER TABLE talert_actions ADD COLUMN `field15_recovery` TEXT NOT NULL DEFAULT " -- --------------------------------------------------------------------- UPDATE `talert_commands` SET `fields_descriptions` = '[\"Integria IMS API path\",\"Integria IMS API pass\",\"Integria IMS user\",\"Integria IMS user pass\",\"Ticket title\",\"Ticket group ID\",\"Ticket priority\",\"Email copy\",\"Ticket owner\",\"Ticket description\"]', `fields_values` = '[\"\",\"\",\"\",\"\",\"\",\"\",\"10,Maintenance;0,Informative;1,Low;2,Medium;3,Serious;4,Very Serious\",\"\",\"\",\"\"]' WHERE `id` = 11 AND `name` = 'Integria IMS Ticket'; +UPDATE `talert_commands` SET `description` = 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using: _field1_ as destination email address, and _field2_ as subject for message. _field3_ as text of message. _field4_ as content type (text/plain or html/text).', `fields_descriptions` = '[\"Destination address\",\"Subject\",\"Text\",\"Content Type\",\"\",\"\",\"\",\"\",\"\",\"\"]', `fields_values` = '[\"\",\"\",\"_html_editor_\",\"_content_type_\",\"\",\"\",\"\",\"\",\"\",\"\"]' WHERE id=1; + +UPDATE `talert_actions` SET `field4` = 'text/html', `field4_recovery` = 'text/html' WHERE id = 1; + -- --------------------------------------------------------------------- -- Table `tmap` -- --------------------------------------------------------------------- diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php index 0577f8e838..246d5b0290 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_explorer.php @@ -35,12 +35,12 @@ $use_agent = get_parameter ('use_agent'); $snmp_community = (string) get_parameter ('snmp_community', 'public'); $snmp_version = get_parameter('snmp_version', '1'); $server_to_exec = get_parameter('server_to_exec', 0); -$snmp3_auth_user = get_parameter('snmp3_auth_user'); +$snmp3_auth_user = io_safe_output(get_parameter('snmp3_auth_user')); $snmp3_security_level = get_parameter('snmp3_security_level'); $snmp3_auth_method = get_parameter('snmp3_auth_method'); -$snmp3_auth_pass = get_parameter('snmp3_auth_pass'); +$snmp3_auth_pass = io_safe_output(get_parameter('snmp3_auth_pass')); $snmp3_privacy_method = get_parameter('snmp3_privacy_method'); -$snmp3_privacy_pass = get_parameter('snmp3_privacy_pass'); +$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass')); $tcp_port = (string) get_parameter ('tcp_port'); //See if id_agente is set (either POST or GET, otherwise -1 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 f422f1ea40..fbd1e842ed 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php @@ -32,12 +32,12 @@ $use_agent = get_parameter ('use_agent'); $snmp_community = (string) get_parameter ('snmp_community', 'public'); $server_to_exec = get_parameter('server_to_exec', 0); $snmp_version = get_parameter('snmp_version', '1'); -$snmp3_auth_user = get_parameter('snmp3_auth_user'); +$snmp3_auth_user = io_safe_output(get_parameter('snmp3_auth_user')); $snmp3_security_level = get_parameter('snmp3_security_level'); $snmp3_auth_method = get_parameter('snmp3_auth_method'); -$snmp3_auth_pass = get_parameter('snmp3_auth_pass'); +$snmp3_auth_pass = io_safe_output(get_parameter('snmp3_auth_pass')); $snmp3_privacy_method = get_parameter('snmp3_privacy_method'); -$snmp3_privacy_pass = get_parameter('snmp3_privacy_pass'); +$snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass')); $tcp_port = (string) get_parameter ('tcp_port'); //See if id_agente is set (either POST or GET, otherwise -1 diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 090011dae9..cc5349182e 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -201,13 +201,13 @@ switch ($sortField) { switch ($sort) { case 'up': $selectRemoteUp = $selected; - $order = array('field' => 'remote ' . $order_collation, + $order = array('field' => 'remote ', 'field2' => 'nombre ' . $order_collation, 'order' => 'ASC'); break; case 'down': $selectRemoteDown = $selected; - $order = array('field' => 'remote ' . $order_collation, + $order = array('field' => 'remote ', 'field2' => 'nombre ' . $order_collation, 'order' => 'DESC'); break; diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index e2739aee29..921296545d 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -111,12 +111,12 @@ if (is_ajax ()) { else $snmp_community = (string) get_parameter ('snmp_community'); $snmp_version = get_parameter('snmp_version'); - $snmp3_auth_user = get_parameter('snmp3_auth_user'); + $snmp3_auth_user = io_safe_output(get_parameter('snmp3_auth_user')); $snmp3_security_level = get_parameter('snmp3_security_level'); $snmp3_auth_method = get_parameter('snmp3_auth_method'); - $snmp3_auth_pass = get_parameter('snmp3_auth_pass'); + $snmp3_auth_pass = io_safe_output(get_parameter('snmp3_auth_pass')); $snmp3_privacy_method = get_parameter('snmp3_privacy_method'); - $snmp3_privacy_pass = get_parameter('snmp3_privacy_pass'); + $snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_privacy_pass')); $snmp_port = get_parameter('snmp_port'); $snmpwalk = get_snmpwalk($ip_target, $snmp_version, $snmp_community, diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 24d0105d42..b640243cfe 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -398,12 +398,12 @@ function snmpBrowserWindow () { $('#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()); + $('#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()); - $('#snmp3_browser_auth_pass').val($('#snmp3_auth_pass').val()); + $('#password-snmp3_browser_auth_pass').val($('#password-snmp3_auth_pass').val()); $('#snmp3_browser_privacy_method').val($('#snmp3_privacy_method').val()); - $('#snmp3_browser_privacy_pass').val($('#snmp3_privacy_pass').val()); + $('#password-snmp3_browser_privacy_pass').val($('#password-snmp3_privacy_pass').val()); $("#snmp_browser_container").show().dialog ({ title: '', diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index d4106e3460..10edc6bead 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -165,8 +165,26 @@ if (is_ajax ()) { $rfield = $editor_type_chkbx; $rfield .= html_print_textarea ('field'.$i.'_recovery_value', 1, 1, '', 'class="fields_recovery"', true); } + elseif(preg_match ("/^_content_type_$/i", $field_value)){ + $editor_type_chkbx = "
"; + $editor_type_chkbx .= __('Text/plain') . ui_print_help_tip (__("For sending emails only text plain"), true); + $editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_value', 'text/plain', '', '', false, '', '', true); + $editor_type_chkbx .= "    "; + $editor_type_chkbx .= __('Text/html') . "  "; + $editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_value', 'text/html', '', 'text/html', false, '', '', true); + $editor_type_chkbx .= "
"; + $ffield = $editor_type_chkbx; + + $editor_type_chkbx = "
"; + $editor_type_chkbx .= __('Text/plain') . ui_print_help_tip (__("For sending emails only text plain"), true); + $editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_recovery_value', 'text/plain', '', '', false, '', '', true); + $editor_type_chkbx .= "    "; + $editor_type_chkbx .= __('Text/html') . "  "; + $editor_type_chkbx .= html_print_radio_button_extended ('field'.$i.'_recovery_value', 'text/html', '', 'text/html', false, '', '', true); + $editor_type_chkbx .= "
"; + $rfield = $editor_type_chkbx; // Select type - else { + }else { $fields_value_select = array(); $fv = explode(';', $field_value); diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php index bef56c026c..990653f19f 100644 --- a/pandora_console/godmode/alerts/configure_alert_action.php +++ b/pandora_console/godmode/alerts/configure_alert_action.php @@ -305,8 +305,33 @@ $(document).ready (function () { // Replace the old column with the new $table_macros_field.replaceWith(field_row); if (old_value != '' || old_recovery_value != '') { - $("[name=field" + i + "_value]").val(old_value); - $("[name=field" + i + "_recovery_value]").val(old_recovery_value); + var inputType = $("[name=field" + i + "_value]").attr('type') + if (inputType == 'radio') { + if(old_value == 'text/plain'){ + if ($("[name=field" + i + "_value]").val() == 'text/plain') { + $("[name=field" + i + "_value]").attr('checked','checked'); + } + } + else{ + if($("[name=field" + i + "_value]").val() == 'text/html') { + $("[name=field" + i + "_value]").attr('checked','checked'); + } + } + if(old_recovery_value == 'text/plain'){ + if ($("[name=field" + i + "_recovery_value]").val() == 'text/plain') { + $("[name=field" + i + "_recovery_value]").attr('checked','checked'); + } + } + else{ + if ($("[name=field" + i + "_recovery_value]").val() == 'text/html') { + $("[name=field" + i + "_recovery_value]").attr('checked','checked'); + } + } + } + else { + $("[name=field" + i + "_value]").val(old_value); + $("[name=field" + i + "_recovery_value]").val(old_recovery_value); + } } else { $("[name=field" + i + "_value]") diff --git a/pandora_console/godmode/modules/manage_network_components.php b/pandora_console/godmode/modules/manage_network_components.php index ec448f0cf4..e2f3cdab26 100644 --- a/pandora_console/godmode/modules/manage_network_components.php +++ b/pandora_console/godmode/modules/manage_network_components.php @@ -129,7 +129,7 @@ else { } $snmp_version = (string) get_parameter('snmp_version'); -$snmp3_auth_user = (string) get_parameter('snmp3_auth_user'); +$snmp3_auth_user = (string) io_safe_output(get_parameter('snmp3_auth_user')); $snmp3_auth_pass = io_input_password((string) get_parameter('snmp3_auth_pass')); $snmp3_auth_method = (string) get_parameter('snmp3_auth_method'); $snmp3_privacy_method = (string) get_parameter('snmp3_privacy_method'); diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js index dbac5adb4b..caa88bbca1 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.editor.js +++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js @@ -32,8 +32,6 @@ var SIZE_GRID = 16; //Const the size (for width and height) of grid. var img_handler_start; var img_handler_end; -var font; - function toggle_advance_options_palette(close) { if ($("#advance_options").css('display') == 'none') { $("#advance_options").css('display', ''); @@ -59,23 +57,6 @@ function visual_map_main() { img_handler_end = data; }); - //Get the actual system font. - parameter = Array(); - parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); - parameter.push ({name: "action", value: "get_font"}); - parameter.push ({name: "id_visual_console", - value: id_visual_console}); - jQuery.ajax({ - url: get_url_ajax(), - data: parameter, - type: "POST", - dataType: 'json', - success: function (data) - { - font = data['font']; - } - }); - //Get the list of posible parents parents = Base64.decode($("input[name='parents_load']").val()); parents = eval("(" + parents + ")"); @@ -108,7 +89,7 @@ function visual_map_main() { if($('#process_value').val() != '0'){ $('#period_row').css('display','table-row'); } - } + } else{ $('#data_image_container').css('display','inline'); $('#data_image_check').css('display','inline'); @@ -289,6 +270,157 @@ function update_button_palette_callback() { } break; case 'group_item': + if((values['image'] == '' || values['image'] == 'none') && (values['label'] == '') && (values['show_statistics'] == false)){ + alert('Undefined image'); + return false; + } + + $("#text_" + idItem).html(values['label']); + + if(values['show_statistics'] == 1){ + + if (!$('#image_'+idItem).length) { + + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png"); + + } + + + $('#'+idItem).append($image); + + } + + if ((values['width'] == 0) || (values['height'] == 0)) { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 520); + $("#image_" + idItem).attr('height', 80); + $("#image_" + idItem).css('width', '520px'); + $("#image_" + idItem).css('height', '80px'); + $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png'); + + } + else { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', values['width']); + $("#image_" + idItem).attr('height', values['height']); + $("#image_" + idItem).css('width', values['width'] + 'px'); + $("#image_" + idItem).css('height', values['height'] + 'px'); + $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png'); + } + + } + else{ + + if ((values['width'] == 0) || (values['height'] == 0)) { + + if(values['image'] != '' && values['image'] != 'none'){ + + if (!$('#image_'+idItem).length) { + + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png"); + + } + + + $('#'+idItem).append($image); + + } + + + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 70); + $("#image_" + idItem).attr('height', 70); + $("#image_" + idItem).css('width', '70px'); + $("#image_" + idItem).css('height', '70px'); + } + else{ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + + $("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight); + $("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight); + $("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px'); + $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px'); + + + } + + } + else{ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 70); + $("#image_" + idItem).attr('height', 70); + $("#image_" + idItem).css('width', '70px'); + $("#image_" + idItem).css('height', '70px'); + $("#image_" + idItem).remove(); + } + + } + else { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', values['width']); + $("#image_" + idItem).attr('height', values['height']); + $("#image_" + idItem).css('width', values['width'] + 'px'); + $("#image_" + idItem).css('height', values['height'] + 'px'); + } + + } + + + + break; case 'static_graph': if($('input[name=width]').val() == ''){ @@ -299,7 +431,7 @@ function update_button_palette_callback() { alert('Undefined height'); return false; } - if(((values['image'] == '') && (values['show_statistics']) == false)){ + if(((values['image'] == '' || values['image'] == 'none') && (values['label'] == ''))){ alert('Undefined image'); return false; } @@ -333,22 +465,75 @@ function update_button_palette_callback() { else{ if ((values['width'] == 0) || (values['height'] == 0)) { - if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + + if(values['image'] != '' && values['image'] != 'none'){ + + if (!$('#image_'+idItem).length) { + + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png") + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + idItem) + .attr('class', 'image') + .attr('src', 'images/console/icons/'+values["image"]+".png"); + + } + + + $('#'+idItem).append($image); + + } + + + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 70); + $("#image_" + idItem).attr('height', 70); + $("#image_" + idItem).css('width', '70px'); + $("#image_" + idItem).css('height', '70px'); + } + else{ + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + + $("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight); + $("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight); + $("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px'); + $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px'); + + + } + + } + else{ $("#image_" + idItem).removeAttr('width'); $("#image_" + idItem).removeAttr('height'); $("#image_" + idItem).attr('width', 70); $("#image_" + idItem).attr('height', 70); $("#image_" + idItem).css('width', '70px'); $("#image_" + idItem).css('height', '70px'); + $("#image_" + idItem).remove(); } - else{ - $("#image_" + idItem).removeAttr('width'); - $("#image_" + idItem).removeAttr('height'); - $("#image_" + idItem).attr('width', $('#preview > img')[0].naturalHeight); - $("#image_" + idItem).attr('height', $('#preview > img')[0].naturalHeight); - $("#image_" + idItem).css('width', $('#preview > img')[0].naturalHeight+'px'); - $("#image_" + idItem).css('height', $('#preview > img')[0].naturalHeight+'px'); - } + } else { $("#image_" + idItem).removeAttr('width'); @@ -430,6 +615,11 @@ function update_button_palette_callback() { alert('Undefined width'); return false; } + + if($('input[name=bars_graph_height]').val() == ''){ + alert('Undefined height'); + return false; + } $("#text_" + idItem).html(values['label']); $("#image_" + idItem).attr("src", "images/spinner.gif"); @@ -457,21 +647,19 @@ function update_button_palette_callback() { break; case 'simple_value': $("#" + idItem).html(values['label']); - if( (values['label'].replace( /<.*?>/g, '' ) != '_VALUE_') - && (values['label'].replace( /<.*?>/g, '' ) != '(_VALUE_)') ){ - + + if($("#data_image_check").html() == "On"){ $("#text_" + idItem).html(''); $("#" + idItem).html(''); } else{ $("#text_" + idItem).html( - '
'+values["label"]+'
' + '
'+values["label"]+'
' ) $("#" + idItem).html( - '
'+values["label"]+'
' + '
'+values["label"]+'
' ) } - setModuleValue(idItem,values['process_simple_value'], values['period'],values['width']); break; case 'label': $("#text_" + idItem).html(values['label']); @@ -485,7 +673,7 @@ function update_button_palette_callback() { alert('Undefined height'); return false; } - if(values['image'] == ''){ + if(values['image'] == '' || values['image'] == 'none'){ alert('Undefined image'); return false; } @@ -559,7 +747,6 @@ function update_button_palette_callback() { $("#" + idItem + ' img').css('margin-top',(parseInt($("#" + idItem).css('height'))/2)-(parseInt($("#" + idItem + " img").css('height'))/2)+'px'); $("#" + idItem + ' > p').remove(); } - else if(values['label_position']=='down'){ $("#" + idItem + ' table').css('float',''); $("#" + idItem + ' img').css('float',''); @@ -567,15 +754,16 @@ function update_button_palette_callback() { $('#' + idItem + ' table').remove(); $('#' + idItem).append(tempoimg); $("#" + idItem + ' table').css('height',''); - $("#" + idItem + ' table').css('width','70'); - $("#" + idItem + ' span').css('width','70'); + if (selectedItem != 'simple_value') { + $("#" + idItem + ' table').css('width','70'); + $("#" + idItem + ' span').css('width','70'); + } + else { + $("#" + idItem + ' table').css('width',''); + $("#" + idItem + ' table').css('text-align','center'); + $("#" + idItem + ' span').css('width',''); + } $("#" + idItem + ' img').css('margin-top',''); - //if(parseInt($("#" + idItem).css('width'))-parseInt($("#" + idItem + " img").css('width'))/2 == 0 || values['height'] == 0 || values['width'] == 0){ - //$("#" + idItem + ' img').css('margin-left',(parseInt($("#" + idItem).css('width'))/2)-(parseInt($("#" + idItem + " img").css('width'))/2)+'px'); - //} - //else{ - //$("#" + idItem + ' img').css('margin-left',''); - //} $("#" + idItem + ' > p').remove(); } @@ -586,19 +774,19 @@ function update_button_palette_callback() { $('#' + idItem + ' img').remove(); $('#' + idItem).append(tempoimg); $("#" + idItem + ' table').css('height',''); - $("#" + idItem + ' table').css('width','70'); - $("#" + idItem + ' span').css('width','70'); + if (selectedItem != 'simple_value') { + $("#" + idItem + ' table').css('width','70'); + $("#" + idItem + ' span').css('width','70'); + } + else { + $("#" + idItem + ' table').css('width',''); + $("#" + idItem + ' table').css('text-align','center'); + $("#" + idItem + ' span').css('width',''); + } $("#" + idItem + ' img').css('margin-top',''); - //if(parseInt($("#" + idItem).css('width'))-parseInt($("#" + idItem + " img").css('width'))/2 == 0 || values['height'] == 0 || values['width'] == 0){ - //$("#" + idItem + ' img').css('margin-left',''); - - //} - //else{ - //$("#" + idItem + ' img').css('margin-left',(parseInt($("#" + idItem).css('width'))/2)-(parseInt($("#" + idItem + " img").css('width'))/2)+'px'); - //} + $("#" + idItem + ' > p').remove(); } - } function readFields() { @@ -617,6 +805,8 @@ function readFields() { values['top'] = $("input[name=top]").val(); values['agent'] = $("input[name=agent]").val(); values['id_agent'] = $("input[name=id_agent]").val(); + values['agent_string'] = $("input[name=agent_string]").val(); + values['id_agent_string'] = $("input[name=id_agent_string]").val(); values['module'] = $("select[name=module]").val(); values['process_simple_value'] = $("select[name=process_value]").val(); values['background'] = $("#background_image").val(); @@ -633,6 +823,7 @@ function readFields() { values['parent'] = $("select[name=parent]").val(); values['map_linked'] = $("select[name=map_linked]").val(); values['width_percentile'] = $("input[name=width_percentile]").val(); + values['bars_graph_height'] = $("input[name=bars_graph_height]").val(); values['max_percentile'] = parseInt($("input[name=max_percentile]").val()); values['width_module_graph'] = $("input[name=width_module_graph]").val(); values['height_module_graph'] = $("input[name=height_module_graph]").val(); @@ -652,6 +843,8 @@ function readFields() { values['height_box'] = parseInt( $("input[name='height_box']").val()); values['border_color'] = $("input[name='border_color']").val(); + values['resume_color'] = $("input[name='resume_color']").val(); + values['grid_color'] = $("input[name='grid_color']").val(); values['border_width'] = parseInt( $("input[name='border_width']").val()); values['fill_color'] = $("input[name='fill_color']").val(); @@ -697,6 +890,11 @@ function create_button_palette_callback() { } break; case 'group_item': + if((values['image'] == '' || values['image'] == 'none') && (values['label'] == '') && (values['show_statistics'] == false)){ + alert('Undefined images'); + validate = false; + } + break; case 'static_graph': if ((values['width'] == '')) { alert('Undefined width'); @@ -706,10 +904,11 @@ function create_button_palette_callback() { alert('Undefined height'); validate = false; } - if((values['image'] == '') && (values['show_statistics']) == false){ + if((values['image'] == '' || values['image'] == 'none') && (values['label']) == false){ alert('Undefined image'); validate = false; } + break; case 'auto_sla_graph': @@ -719,7 +918,7 @@ function create_button_palette_callback() { } break; case 'donut_graph': - if ((values['agent'] == '')) { + if ((values['agent_string'] == '')) { alert($("#message_alert_no_agent").html()); validate = false; } @@ -739,7 +938,7 @@ function create_button_palette_callback() { alert('Undefined height'); validate = false; } - if ((values['image'] == '')) { + if ((values['image'] == '' || values['image'] == 'none')) { alert($("#message_alert_no_image").html()); validate = false; } @@ -792,7 +991,7 @@ function create_button_palette_callback() { } break; case 'bars_graph': - if ((values['agent'] == '')) { + if ((values['agent_string'] == '')) { alert($("#message_alert_no_agent").html()); validate = false; } @@ -800,6 +999,14 @@ function create_button_palette_callback() { alert($("#message_alert_no_module").html()); validate = false; } + if ((values['width_percentile'] == '')) { + alert($("#message_alert_no_width_percentile").html()); + validate = false; + } + if ((values['bars_graph_height'] == '')) { + alert($("#message_alert_no_bars_graph_height").html()); + validate = false; + } break; case 'simple_value': if ((values['agent'] == '')) { @@ -1251,11 +1458,16 @@ function loadFieldsFromDB(item) { if (key == 'pos_y') $("input[name=top]").val(val); if (key == 'agent_name') { $("input[name=agent]").val(val); + $("input[name=agent_string]").val(val); //Reload no-sincrone the select of modules } + if (key == 'id_agent') { $("input[name=id_agent]").val(val); } + if (key == 'id_agent_string') { + $("input[name=id_agent_string]").val(val); + } if (key == 'modules_html') { $("select[name=module]").empty().html(val); $("select[name=module]").val(moduleId); @@ -1300,6 +1512,8 @@ function loadFieldsFromDB(item) { $("select[name=map_linked]").val(val); if (key == 'width_percentile') $("input[name=width_percentile]").val(val); + if (key == 'bars_graph_height') + $("input[name=bars_graph_height]").val(val); if (key == 'max_percentile') $("input[name=max_percentile]").val(val); if (key == 'width_module_graph') @@ -1324,14 +1538,7 @@ function loadFieldsFromDB(item) { } if (key == 'value_show') { - if (val == 'percent') { - $("input[name=value_show][value=percent]") - .attr("checked", "checked"); - } - else { - $("input[name=value_show][value=value]") - .attr("checked", "checked"); - } + $("select[name=value_show]").val(val); } if (key == 'id_group') { @@ -1357,6 +1564,16 @@ function loadFieldsFromDB(item) { $("#border_color_row .ColorPickerDivSample") .css('background-color', val); } + if (key == 'grid_color') { + $("input[name='grid_color']").val(val); + $("#grid_color_row .ColorPickerDivSample") + .css('background-color', val); + } + if (key == 'resume_color') { + $("input[name='resume_color']").val(val); + $("#resume_color_row .ColorPickerDivSample") + .css('background-color', val); + } if (key == 'border_width') $("input[name='border_width']").val(val); if (key == 'fill_color') { @@ -1520,6 +1737,9 @@ function hiddenFields(item) { $("#agent_row").css('display', 'none'); $("#agent_row." + item).css('display', ''); + $("#agent_row_string").css('display', 'none'); + $("#agent_row_string." + item).css('display', ''); + $("#module_row").css('display', 'none'); $("#module_row." + item).css('display', ''); @@ -1547,6 +1767,9 @@ function hiddenFields(item) { $("#percentile_bar_row_1").css('display', 'none'); $("#percentile_bar_row_1." + item).css('display', ''); + $("#height_bars_graph_row").css('display', 'none'); + $("#height_bars_graph_row." + item).css('display', ''); + $("#percentile_bar_row_2").css('display', 'none'); $("#percentile_bar_row_2." + item).css('display', ''); @@ -1601,6 +1824,12 @@ function hiddenFields(item) { $("#border_color_row").css('display', 'none'); $("#border_color_row." + item).css('display', ''); + $("#grid_color_row").css('display', 'none'); + $("#grid_color_row." + item).css('display', ''); + + $("#resume_color_row").css('display', 'none'); + $("#resume_color_row." + item).css('display', ''); + $("#border_width_row").css('display', 'none'); $("#border_width_row." + item).css('display', ''); @@ -1638,10 +1867,12 @@ function cleanFields(item) { $("input[name=left]").val(0); $("input[name=top]").val(0); $("input[name=agent]").val(''); + $("input[name=agent_string]").val(''); $("select[name=module]").val(''); $("select[name=process_value]").val(0); $("select[name=background_image]").val(''); $("input[name=width_percentile]").val(''); + $("input[name=bars_graph_height]").val(''); $("input[name=max_percentile]").val(''); $("select[name=period]").val(''); $("input[name=width]").val(0); @@ -1653,6 +1884,8 @@ function cleanFields(item) { $("input[name='width_box']").val(300); $("input[name='height_box']").val(180); $("input[name='border_color']").val('#000000'); + $("input[name='grid_color']").val('#000000'); + $("input[name='resume_color']").val('#000000'); $("input[name='border_width']").val(3); $("input[name='fill_color']").val('#ffffff'); $("input[name='line_width']").val(3); @@ -1811,12 +2044,13 @@ function setBarsGraph(id_data, values) { } width_percentile = values['width_percentile']; + bars_graph_height = values['bars_graph_height']; parameter = Array(); parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); parameter.push ({name: "action", value: "get_module_type_string"}); - parameter.push ({name: "id_agent", value: values['id_agent']}); + parameter.push ({name: "id_agent", value: values['id_agent_string']}); parameter.push ({name: "module", value: values['module']}); parameter.push ({name: "id_element", value: id_data}); parameter.push ({name: "id_visual_console", value: id_visual_console}); @@ -1826,28 +2060,16 @@ function setBarsGraph(id_data, values) { type: "POST", dataType: 'json', success: function (data) { - if (data['no_data'] == true) { - if (values['width_percentile'] == "0") { - $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras-no.png'); - } - else { - $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras-no.png'); - $("#" + id_data + " img").css('width', width_percentile + 'px'); - $("#" + id_data + " img").css('height', width_percentile + 'px'); - } + $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras.png'); + + if (values['width_percentile'] == "0" && values["bars_graph_height"] == "0") { + // Image size } - else { - $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/barras.png'); - - if (values['width_percentile'] == "0") { - // Image size - } - else{ - $("#" + id_data + " img").css('width', width_percentile+'px'); - $("#" + id_data + " img").css('height', width_percentile+'px'); - } + else{ + $("#" + id_data + " img").css('width', width_percentile + 'px'); + $("#" + id_data + " img").css('height', bars_graph_height + 'px'); } - + if($('#'+id_data+' table').css('float') == 'right' || $('#'+id_data+ ' table').css('float') == 'left'){ $('#'+id_data+ ' img').css('margin-top', parseInt($('#'+id_data).css('height'))/2 - parseInt($('#'+id_data+ ' img').css('height'))/2); } @@ -1951,7 +2173,7 @@ function setModuleGraph(id_data) { } -function setModuleValue(id_data, process_simple_value, period,width_data_image) { +function setModuleValue(id_data, process_simple_value, period, width_data_image) { var parameter = Array(); parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); parameter.push ({name: "action", value: "get_module_value"}); @@ -1969,12 +2191,9 @@ function setModuleValue(id_data, process_simple_value, period,width_data_image) type: "POST", dataType: 'json', success: function (data) { + var currentValue = $("#text_" + id_data).html(); - var currentValue = $("#text_" + id_data).html(); - - //currentValue = currentValue.replace(/_VALUE_/gi, data.value); $("#text_" + id_data).html(currentValue); - //$("#text_" + id_data).html('Data value'); } }); } @@ -2027,9 +2246,9 @@ function setPercentileBar(id_data, values) { value_text = module_value + " " + unit_text; } - var img = url_hack_metaconsole + 'include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar&height=15&' + + var img = url_hack_metaconsole + 'include/graphs/fgraph.php?graph_type=progressbar&height=15&' + 'width=' + width_percentile + '&mode=1&progress=' + percentile + - '&font=' + font + '&value_text=' + value_text + '&colorRGB=' + colorRGB; + '&value_text=' + value_text + '&colorRGB=' + colorRGB; $("#"+ id_data).attr('src', img); @@ -2253,7 +2472,7 @@ function setDonutsGraph (id_data, values) { parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); parameter.push ({name: "action", value: "get_module_type_string"}); - parameter.push ({name: "id_agent", value: values['id_agent']}); + parameter.push ({name: "id_agent", value: values['id_agent_string']}); parameter.push ({name: "module", value: values['module']}); parameter.push ({name: "id_element", value: id_data}); parameter.push ({name: "id_visual_console", value: id_visual_console}); @@ -2276,7 +2495,7 @@ function setDonutsGraph (id_data, values) { else { $("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/donut-graph.png'); - if($('#text-width').val() == 0 || $('#text-height').val() == 0){ + if($('#text-width_percentile').val() == 0){ // Image size } else{ @@ -2333,9 +2552,9 @@ function setPercentileBubble(id_data, values) { value_text = module_value + " " + unit_text; } - var img = url_hack_metaconsole + 'include/graphs/fgraph.php?homeurl=../../&graph_type=progressbubble&height=' + width_percentile + '&' + + var img = url_hack_metaconsole + 'include/graphs/fgraph.php?graph_type=progressbubble&height=' + width_percentile + '&' + 'width=' + width_percentile + '&mode=1&progress=' + percentile + - '&font=' + font + '&value_text=' + value_text + '&colorRGB=' + colorRGB; + '&value_text=' + value_text + '&colorRGB=' + colorRGB; $("#image_" + id_data).attr('src', img); @@ -2478,6 +2697,262 @@ function createItem(type, values, id_data) { break; case 'group_item': + + switch (type) { + case 'group_item': + class_type = "group_item"; + break; + case 'static_graph': + class_type = "static_graph"; + break; + } + + img_src = "images/spinner.gif"; + + item = $('
') + .attr('id', id_data) + .attr('class', 'item ' + class_type) + .css('text-align', 'left') + .css('position', 'absolute') + .css('display', 'inline-block') + .css('top', values['top'] + 'px') + .css('left', values['left'] + 'px'); + + + + if(values['show_statistics'] != 1){ + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', 'images/console/signes/group_status.png') + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', 'images/console/signes/group_status.png') + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', 'images/console/signes/group_status.png'); + + } + } + else{ + if(values['label_position'] == 'left'){ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', img_src) + .attr('style','float:right;'); + + } + else if(values['label_position'] == 'right'){ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', img_src) + .attr('style','float:left;'); + + } + else{ + + var $image = $('') + .attr('id', 'image_' + id_data) + .attr('class', 'image') + .attr('src', img_src); + + } + } + + + + if(values['show_statistics'] != 1){ + + if ((values['width'] == 0) || (values['height'] == 0)) { + // Do none + if(values['image'] != '' && values['image'] != 'none'){ + + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $image.attr('width', '70') + .attr('height', '70'); + } + else{ + $image.attr('width', $('#preview > img')[0].naturalWidth) + .attr('height', $('#preview > img')[0].naturalHeight); + } + + + } + else{ + $image.attr('width', '70') + .attr('height', '70'); + } + + + } + else { + $image.attr('width', values['width']) + .attr('height', values['height']); + } + } + + var $input = $('') + .attr('id', 'hidden-status_' + id_data) + .attr('type', 'hidden') + .attr('value', -1) + .attr('name', 'status_' + id_data); + + if(values['label_position'] == 'up'){ + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append('
'+values['label']+'
') + .append($input); + } + else{ + item + .append('
'+values['label']+'
') + .append($image) + .append($image) + .append($input); + } + + } + else if(values['label_position'] == 'down'){ + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append('
'+values['label']+'
') + .append($input); + + } + else{ + item + .append($image) + .append($image) + .append('
'+values['label']+'
') + .append($input); + } + + } + else if(values['label_position'] == 'left'){ + + if(values['height'] == 0){ + item + .append('
'+values['label']+'
'); + } + else{ + item + .append('
'+values['label']+'
') + } + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append($input); + } + else{ + item + .append($image) + .append($image) + .append($input); + } + + + } + else if(values['label_position'] == 'right'){ + if(values['height'] == 0){ + item + .append('
'+values['label']+'
'); + } + else{ + item + .append('
'+values['label']+'
') + } + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append($input); + } + else{ + item + .append($image) + .append($image) + .append($input); + } + + + + } + + if(values['show_statistics'] != 1){ + set_static_graph_status(id_data, values['image']); + } + else{ + set_static_graph_status(id_data, 'show_statistics'); + } + + if(values['show_statistics'] != 1){ + + if ((values['width'] == 0) || (values['height'] == 0)) { + + if(values['image'] != '' && values['image'] != 'none'){ + // Do none + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $image.attr('width', '70') + .attr('height', '70'); + } + else{ + $image.attr('width', $('#preview > img')[0].naturalWidth) + .attr('height', $('#preview > img')[0].naturalHeight); + } + } + else{ + $image.attr('width', '70') + .attr('height', '70'); + } + } + else { + $image.attr('width', values['width']) + .attr('height', values['height']); + } + } + else{ + if ((values['width'] == 0) || (values['height'] == 0)) { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', 520); + $("#image_" + idItem).attr('height', 80); + $("#image_" + idItem).css('width', '520px'); + $("#image_" + idItem).css('height', '80px'); + $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png'); + + } + else { + $("#image_" + idItem).removeAttr('width'); + $("#image_" + idItem).removeAttr('height'); + $("#image_" + idItem).attr('width', values['width']); + $("#image_" + idItem).attr('height', values['height']); + $("#image_" + idItem).css('width', values['width'] + 'px'); + $("#image_" + idItem).css('height', values['height'] + 'px'); + $("#image_" + idItem).attr('src', 'images/console/signes/group_status.png'); + } + } + + break; + case 'static_graph': switch (type) { case 'group_item': @@ -2532,6 +3007,8 @@ function createItem(type, values, id_data) { if ((values['width'] == 0) || (values['height'] == 0)) { // Do none + if(values['image'] != '' && values['image'] != 'none'){ + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ $image.attr('width', '70') .attr('height', '70'); @@ -2539,7 +3016,16 @@ function createItem(type, values, id_data) { else{ $image.attr('width', $('#preview > img')[0].naturalWidth) .attr('height', $('#preview > img')[0].naturalHeight); - } + } + + + } + else{ + $image.attr('width', '70') + .attr('height', '70'); + } + + } else { $image.attr('width', values['width']) @@ -2564,19 +3050,37 @@ function createItem(type, values, id_data) { .attr('name', 'status_' + id_data); if(values['label_position'] == 'up'){ - item - .append('
'+values['label']+'
') - .append($image) - .append($image) - .append($input); + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append('
'+values['label']+'
') + .append($input); + } + else{ + item + .append('
'+values['label']+'
') + .append($image) + .append($image) + .append($input); + } } else if(values['label_position'] == 'down'){ - item - .append($image) - .append($image) - .append('
'+values['label']+'
') - .append($input); + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append('
'+values['label']+'
') + .append($input); + + } + else{ + item + .append($image) + .append($image) + .append('
'+values['label']+'
') + .append($input); + } + } else if(values['label_position'] == 'left'){ @@ -2588,10 +3092,19 @@ function createItem(type, values, id_data) { item .append('
'+values['label']+'
') } + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append($input); + } + else{ item .append($image) .append($image) - .append($input); + .append($input); + } + + } else if(values['label_position'] == 'right'){ if(values['height'] == 0){ @@ -2602,10 +3115,20 @@ function createItem(type, values, id_data) { item .append('
'+values['label']+'
') } + + if(values['image'] == '' || values['image'] == 'none'){ + item + .append($input); + } + else{ item .append($image) .append($image) - .append($input); + .append($input); + } + + + } if(values['show_statistics'] != 1){ @@ -2618,15 +3141,22 @@ function createItem(type, values, id_data) { if(values['show_statistics'] != 1){ if ((values['width'] == 0) || (values['height'] == 0)) { + + if(values['image'] != '' && values['image'] != 'none'){ // Do none - if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ - $image.attr('width', '70') - .attr('height', '70'); + if($('#preview > img')[0].naturalWidth > 150 || $('#preview > img')[0].naturalHeight > 150){ + $image.attr('width', '70') + .attr('height', '70'); + } + else{ + $image.attr('width', $('#preview > img')[0].naturalWidth) + .attr('height', $('#preview > img')[0].naturalHeight); + } } else{ - $image.attr('width', $('#preview > img')[0].naturalWidth) - .attr('height', $('#preview > img')[0].naturalHeight); - } + $image.attr('width', '70') + .attr('height', '70'); + } } else { $image.attr('width', values['width']) @@ -2881,7 +3411,6 @@ function createItem(type, values, id_data) { item = $('
' + ' ' + values['label'] + ' ' + '
' ); - setModuleValue(id_data,values.process_simple_value,values.period,values.width_data_image); break; case 'label': item = $('
0){ - $("#data_image_check").css('display','inline'); - $("#data_image_check_label").css('display','inline'); - $('#data_image_container').css('display','inline'); - $("#data_image_check").html('On'); - $('.block_tinymce').remove(); - $('#label_row').append('
'); - $('#process_value_row').css('display','none'); - $('#period_row').css('display','none'); - } - else{ - $("#data_image_check").html('Off'); - $("#data_image_check").css('display','none'); - $("#data_image_check_label").css('display','none'); - $('#data_image_container').css('display','none'); - $('.block_tinymce').remove(); - $('#process_value_row').css('display','table-row'); - if($('#process_value').val() != 0){ - $('#period_row').css('display','table-row'); + + parameter = Array(); + parameter.push ({name: "page", value: "include/ajax/visual_console_builder.ajax"}); + parameter.push ({name: "action", value: "get_image_from_module"}); + parameter.push ({name: "id_element", value: idItem}); + parameter.push ({name: "id_visual_console", value: id_visual_console}); + + jQuery.ajax({ + url: "ajax.php", + data: parameter, + type: "POST", + dataType: "json", + success: function(data) { + if(!data['correct']){ + $("#data_image_check").html('Off'); + $('#data_image_container').css('display','none'); + $('#data_image_check').css('display','none'); + $('#data_image_check_label').css('display','none'); + $('.block_tinymce').remove(); + $('#process_value_row').css('display','table-row'); + if($('#process_value').val() != '0'){ + $('#period_row').css('display','table-row'); + } + } + else{ + $('#data_image_container').css('display','inline'); + $('#data_image_check').css('display','inline'); + $('#data_image_check_label').css('display','inline'); + $("#data_image_check").html('On'); + $('#process_value_row').css('display','none'); + $('#period_row').css('display','none'); + $('#text-label_ifr').contents().find('#tinymce').html('_VALUE_'); + $('.block_tinymce').remove(); + $('#label_row').append('
'); + } } - } + }); } else{ $("#data_image_check").css('display','none'); @@ -4226,7 +4763,7 @@ function showPreviewStaticGraph(staticGraph) { .css('text-align', 'right') .append($spinner); - if(staticGraph == ''){ + if(staticGraph == '' || staticGraph == 'none'){ if (is_metaconsole()) { $spinner.prop("src", "../../images/image_problem_area.png"); @@ -4282,7 +4819,7 @@ function showPreviewIcon(icon) { .append($spinner); - if (icon == '') { + if (icon == '' || icon == 'none') { if (is_metaconsole()) { $spinner.prop("src", "../../images/image_problem_area.png"); } diff --git a/pandora_console/images/groups_small/application_osx_terminal.bad.png b/pandora_console/images/groups_small/application_osx_terminal.bad.png index ccc8f3f04d..3862246d9e 100644 Binary files a/pandora_console/images/groups_small/application_osx_terminal.bad.png and b/pandora_console/images/groups_small/application_osx_terminal.bad.png differ diff --git a/pandora_console/images/groups_small/application_osx_terminal.default.png b/pandora_console/images/groups_small/application_osx_terminal.default.png index 85f0016ce2..7ddaec3117 100644 Binary files a/pandora_console/images/groups_small/application_osx_terminal.default.png and b/pandora_console/images/groups_small/application_osx_terminal.default.png differ diff --git a/pandora_console/images/groups_small/application_osx_terminal.ok.png b/pandora_console/images/groups_small/application_osx_terminal.ok.png index 0678cb09a1..1da9e887bf 100644 Binary files a/pandora_console/images/groups_small/application_osx_terminal.ok.png and b/pandora_console/images/groups_small/application_osx_terminal.ok.png differ diff --git a/pandora_console/images/groups_small/application_osx_terminal.warning.png b/pandora_console/images/groups_small/application_osx_terminal.warning.png index e95f210a5f..41fcb8eaf0 100644 Binary files a/pandora_console/images/groups_small/application_osx_terminal.warning.png and b/pandora_console/images/groups_small/application_osx_terminal.warning.png differ diff --git a/pandora_console/images/groups_small/bricks.bad.png b/pandora_console/images/groups_small/bricks.bad.png index 0a0cd5459f..5f22537353 100644 Binary files a/pandora_console/images/groups_small/bricks.bad.png and b/pandora_console/images/groups_small/bricks.bad.png differ diff --git a/pandora_console/images/groups_small/bricks.default.png b/pandora_console/images/groups_small/bricks.default.png index 14d8bab5ca..1fccda728d 100644 Binary files a/pandora_console/images/groups_small/bricks.default.png and b/pandora_console/images/groups_small/bricks.default.png differ diff --git a/pandora_console/images/groups_small/bricks.ok.png b/pandora_console/images/groups_small/bricks.ok.png index 931d1a389c..304efe93df 100644 Binary files a/pandora_console/images/groups_small/bricks.ok.png and b/pandora_console/images/groups_small/bricks.ok.png differ diff --git a/pandora_console/images/groups_small/bricks.png b/pandora_console/images/groups_small/bricks.png index c234efafb6..d197f3fd56 100644 Binary files a/pandora_console/images/groups_small/bricks.png and b/pandora_console/images/groups_small/bricks.png differ diff --git a/pandora_console/images/groups_small/bricks.warning.png b/pandora_console/images/groups_small/bricks.warning.png index bbfeb0ce3f..0345d612f3 100644 Binary files a/pandora_console/images/groups_small/bricks.warning.png and b/pandora_console/images/groups_small/bricks.warning.png differ diff --git a/pandora_console/images/groups_small/chart_organisation.bad.png b/pandora_console/images/groups_small/chart_organisation.bad.png index 410cd5116c..51771a4664 100644 Binary files a/pandora_console/images/groups_small/chart_organisation.bad.png and b/pandora_console/images/groups_small/chart_organisation.bad.png differ diff --git a/pandora_console/images/groups_small/chart_organisation.default.png b/pandora_console/images/groups_small/chart_organisation.default.png index 53619a608b..597c229fa0 100644 Binary files a/pandora_console/images/groups_small/chart_organisation.default.png and b/pandora_console/images/groups_small/chart_organisation.default.png differ diff --git a/pandora_console/images/groups_small/chart_organisation.ok.png b/pandora_console/images/groups_small/chart_organisation.ok.png index ca7f04061b..5d34f43765 100644 Binary files a/pandora_console/images/groups_small/chart_organisation.ok.png and b/pandora_console/images/groups_small/chart_organisation.ok.png differ diff --git a/pandora_console/images/groups_small/chart_organisation.warning.png b/pandora_console/images/groups_small/chart_organisation.warning.png index c9ba529187..7dac5502fc 100644 Binary files a/pandora_console/images/groups_small/chart_organisation.warning.png and b/pandora_console/images/groups_small/chart_organisation.warning.png differ diff --git a/pandora_console/images/groups_small/clock.bad.png b/pandora_console/images/groups_small/clock.bad.png index f281439c87..c1241ce275 100644 Binary files a/pandora_console/images/groups_small/clock.bad.png and b/pandora_console/images/groups_small/clock.bad.png differ diff --git a/pandora_console/images/groups_small/clock.default.png b/pandora_console/images/groups_small/clock.default.png index 2b7a58aa20..b8d58d6dec 100644 Binary files a/pandora_console/images/groups_small/clock.default.png and b/pandora_console/images/groups_small/clock.default.png differ diff --git a/pandora_console/images/groups_small/clock.ok.png b/pandora_console/images/groups_small/clock.ok.png index a3cb173d9e..1ab3c8383f 100644 Binary files a/pandora_console/images/groups_small/clock.ok.png and b/pandora_console/images/groups_small/clock.ok.png differ diff --git a/pandora_console/images/groups_small/clock.warning.png b/pandora_console/images/groups_small/clock.warning.png index 20880b31df..a06ceda51f 100644 Binary files a/pandora_console/images/groups_small/clock.warning.png and b/pandora_console/images/groups_small/clock.warning.png differ diff --git a/pandora_console/images/groups_small/drive.network.bad.png b/pandora_console/images/groups_small/drive.network.bad.png new file mode 100644 index 0000000000..886ca44d2b Binary files /dev/null and b/pandora_console/images/groups_small/drive.network.bad.png differ diff --git a/pandora_console/images/groups_small/drive_network.default.png b/pandora_console/images/groups_small/drive_network.default.png index 428b2eb2a4..2fd2519029 100644 Binary files a/pandora_console/images/groups_small/drive_network.default.png and b/pandora_console/images/groups_small/drive_network.default.png differ diff --git a/pandora_console/images/groups_small/drive_network.ok.png b/pandora_console/images/groups_small/drive_network.ok.png index dbe58f007c..c84acaa7f4 100644 Binary files a/pandora_console/images/groups_small/drive_network.ok.png and b/pandora_console/images/groups_small/drive_network.ok.png differ diff --git a/pandora_console/images/groups_small/drive_network.warning.png b/pandora_console/images/groups_small/drive_network.warning.png index 0dbdd4b2a5..3abda093e3 100644 Binary files a/pandora_console/images/groups_small/drive_network.warning.png and b/pandora_console/images/groups_small/drive_network.warning.png differ diff --git a/pandora_console/images/groups_small/email.bad.png b/pandora_console/images/groups_small/email.bad.png index 064222d63e..78a2ed0913 100644 Binary files a/pandora_console/images/groups_small/email.bad.png and b/pandora_console/images/groups_small/email.bad.png differ diff --git a/pandora_console/images/groups_small/email.default.png b/pandora_console/images/groups_small/email.default.png index 1486cd82a0..e07d9c3022 100644 Binary files a/pandora_console/images/groups_small/email.default.png and b/pandora_console/images/groups_small/email.default.png differ diff --git a/pandora_console/images/groups_small/email.ok.png b/pandora_console/images/groups_small/email.ok.png index 681fc2ddfa..5d5fca4f0c 100644 Binary files a/pandora_console/images/groups_small/email.ok.png and b/pandora_console/images/groups_small/email.ok.png differ diff --git a/pandora_console/images/groups_small/email.warning.png b/pandora_console/images/groups_small/email.warning.png index b08c99d7c1..10662435e1 100644 Binary files a/pandora_console/images/groups_small/email.warning.png and b/pandora_console/images/groups_small/email.warning.png differ diff --git a/pandora_console/images/groups_small/eye.bad.png b/pandora_console/images/groups_small/eye.bad.png index f8191a1b17..9c08baf0a3 100644 Binary files a/pandora_console/images/groups_small/eye.bad.png and b/pandora_console/images/groups_small/eye.bad.png differ diff --git a/pandora_console/images/groups_small/eye.default.png b/pandora_console/images/groups_small/eye.default.png index cd852b7502..a8dc65e8be 100644 Binary files a/pandora_console/images/groups_small/eye.default.png and b/pandora_console/images/groups_small/eye.default.png differ diff --git a/pandora_console/images/groups_small/eye.ok.png b/pandora_console/images/groups_small/eye.ok.png index 0da4304f71..abf8578709 100644 Binary files a/pandora_console/images/groups_small/eye.ok.png and b/pandora_console/images/groups_small/eye.ok.png differ diff --git a/pandora_console/images/groups_small/eye.warning.png b/pandora_console/images/groups_small/eye.warning.png index 65a5722201..2bd3af45f8 100644 Binary files a/pandora_console/images/groups_small/eye.warning.png and b/pandora_console/images/groups_small/eye.warning.png differ diff --git a/pandora_console/images/groups_small/heart.bad.png b/pandora_console/images/groups_small/heart.bad.png index ff3008fcc4..f9da31b2c5 100644 Binary files a/pandora_console/images/groups_small/heart.bad.png and b/pandora_console/images/groups_small/heart.bad.png differ diff --git a/pandora_console/images/groups_small/heart.default.png b/pandora_console/images/groups_small/heart.default.png index a7cfff0cc3..73a101809a 100644 Binary files a/pandora_console/images/groups_small/heart.default.png and b/pandora_console/images/groups_small/heart.default.png differ diff --git a/pandora_console/images/groups_small/heart.ok.png b/pandora_console/images/groups_small/heart.ok.png index 0f0798523d..0b2b4e0653 100644 Binary files a/pandora_console/images/groups_small/heart.ok.png and b/pandora_console/images/groups_small/heart.ok.png differ diff --git a/pandora_console/images/groups_small/heart.warning.png b/pandora_console/images/groups_small/heart.warning.png index 66b8583393..f97cc1251b 100644 Binary files a/pandora_console/images/groups_small/heart.warning.png and b/pandora_console/images/groups_small/heart.warning.png differ diff --git a/pandora_console/images/groups_small/house.bad.png b/pandora_console/images/groups_small/house.bad.png index 815f719f7c..a7dcd9b6fd 100644 Binary files a/pandora_console/images/groups_small/house.bad.png and b/pandora_console/images/groups_small/house.bad.png differ diff --git a/pandora_console/images/groups_small/house.default.png b/pandora_console/images/groups_small/house.default.png index fac912b267..07b9842b2d 100644 Binary files a/pandora_console/images/groups_small/house.default.png and b/pandora_console/images/groups_small/house.default.png differ diff --git a/pandora_console/images/groups_small/house.ok.png b/pandora_console/images/groups_small/house.ok.png index c3a2e9053e..9190bfd075 100644 Binary files a/pandora_console/images/groups_small/house.ok.png and b/pandora_console/images/groups_small/house.ok.png differ diff --git a/pandora_console/images/groups_small/house.warning.png b/pandora_console/images/groups_small/house.warning.png index cf76552f5f..27ba33bca9 100644 Binary files a/pandora_console/images/groups_small/house.warning.png and b/pandora_console/images/groups_small/house.warning.png differ diff --git a/pandora_console/images/groups_small/images.bad.png b/pandora_console/images/groups_small/images.bad.png index 454b36e1d5..cdcb423d83 100644 Binary files a/pandora_console/images/groups_small/images.bad.png and b/pandora_console/images/groups_small/images.bad.png differ diff --git a/pandora_console/images/groups_small/images.default.png b/pandora_console/images/groups_small/images.default.png index 501a97fe27..04b186e57f 100644 Binary files a/pandora_console/images/groups_small/images.default.png and b/pandora_console/images/groups_small/images.default.png differ diff --git a/pandora_console/images/groups_small/images.ok.png b/pandora_console/images/groups_small/images.ok.png index 530af4f4c4..0936d2f2e0 100644 Binary files a/pandora_console/images/groups_small/images.ok.png and b/pandora_console/images/groups_small/images.ok.png differ diff --git a/pandora_console/images/groups_small/images.warning.png b/pandora_console/images/groups_small/images.warning.png index 46cd29d989..f735403dc8 100644 Binary files a/pandora_console/images/groups_small/images.warning.png and b/pandora_console/images/groups_small/images.warning.png differ diff --git a/pandora_console/images/groups_small/lightning.bad.png b/pandora_console/images/groups_small/lightning.bad.png index a6ec10a2bc..dc4de71df3 100644 Binary files a/pandora_console/images/groups_small/lightning.bad.png and b/pandora_console/images/groups_small/lightning.bad.png differ diff --git a/pandora_console/images/groups_small/lightning.default.png b/pandora_console/images/groups_small/lightning.default.png index 47447d48be..b50d496caa 100644 Binary files a/pandora_console/images/groups_small/lightning.default.png and b/pandora_console/images/groups_small/lightning.default.png differ diff --git a/pandora_console/images/groups_small/lightning.ok.png b/pandora_console/images/groups_small/lightning.ok.png index 7dee1c4a81..7b134afecf 100644 Binary files a/pandora_console/images/groups_small/lightning.ok.png and b/pandora_console/images/groups_small/lightning.ok.png differ diff --git a/pandora_console/images/groups_small/lightning.warning.png b/pandora_console/images/groups_small/lightning.warning.png index 020cfe9ac7..3182a8aa72 100644 Binary files a/pandora_console/images/groups_small/lightning.warning.png and b/pandora_console/images/groups_small/lightning.warning.png differ diff --git a/pandora_console/images/groups_small/lock.bad.png b/pandora_console/images/groups_small/lock.bad.png index 29fecde26d..0f25d5361b 100644 Binary files a/pandora_console/images/groups_small/lock.bad.png and b/pandora_console/images/groups_small/lock.bad.png differ diff --git a/pandora_console/images/groups_small/lock.default.png b/pandora_console/images/groups_small/lock.default.png index d462751473..b3958972ed 100644 Binary files a/pandora_console/images/groups_small/lock.default.png and b/pandora_console/images/groups_small/lock.default.png differ diff --git a/pandora_console/images/groups_small/lock.ok.png b/pandora_console/images/groups_small/lock.ok.png index fb9a8749bd..06e639a7bf 100644 Binary files a/pandora_console/images/groups_small/lock.ok.png and b/pandora_console/images/groups_small/lock.ok.png differ diff --git a/pandora_console/images/groups_small/lock.warning.png b/pandora_console/images/groups_small/lock.warning.png index bfb2826d31..9cd24bc69b 100644 Binary files a/pandora_console/images/groups_small/lock.warning.png and b/pandora_console/images/groups_small/lock.warning.png differ diff --git a/pandora_console/images/groups_small/network.bad.png b/pandora_console/images/groups_small/network.bad.png index f3293d77ac..fec08fa66b 100644 Binary files a/pandora_console/images/groups_small/network.bad.png and b/pandora_console/images/groups_small/network.bad.png differ diff --git a/pandora_console/images/groups_small/network.default.png b/pandora_console/images/groups_small/network.default.png index c330e90893..6b2107017f 100644 Binary files a/pandora_console/images/groups_small/network.default.png and b/pandora_console/images/groups_small/network.default.png differ diff --git a/pandora_console/images/groups_small/network.ok.png b/pandora_console/images/groups_small/network.ok.png index edd8831666..ce767cf880 100644 Binary files a/pandora_console/images/groups_small/network.ok.png and b/pandora_console/images/groups_small/network.ok.png differ diff --git a/pandora_console/images/groups_small/network.warning.png b/pandora_console/images/groups_small/network.warning.png index 6ddd996e56..66a55e22b4 100644 Binary files a/pandora_console/images/groups_small/network.warning.png and b/pandora_console/images/groups_small/network.warning.png differ diff --git a/pandora_console/images/groups_small/old/application_osx_terminal.bad.png b/pandora_console/images/groups_small/old/application_osx_terminal.bad.png new file mode 100644 index 0000000000..ccc8f3f04d Binary files /dev/null and b/pandora_console/images/groups_small/old/application_osx_terminal.bad.png differ diff --git a/pandora_console/images/groups_small/old/application_osx_terminal.default.png b/pandora_console/images/groups_small/old/application_osx_terminal.default.png new file mode 100644 index 0000000000..85f0016ce2 Binary files /dev/null and b/pandora_console/images/groups_small/old/application_osx_terminal.default.png differ diff --git a/pandora_console/images/groups_small/old/application_osx_terminal.ok.png b/pandora_console/images/groups_small/old/application_osx_terminal.ok.png new file mode 100644 index 0000000000..0678cb09a1 Binary files /dev/null and b/pandora_console/images/groups_small/old/application_osx_terminal.ok.png differ diff --git a/pandora_console/images/groups_small/old/application_osx_terminal.warning.png b/pandora_console/images/groups_small/old/application_osx_terminal.warning.png new file mode 100644 index 0000000000..e95f210a5f Binary files /dev/null and b/pandora_console/images/groups_small/old/application_osx_terminal.warning.png differ diff --git a/pandora_console/images/groups_small/applications.bad_old.png b/pandora_console/images/groups_small/old/applications.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/applications.bad_old.png rename to pandora_console/images/groups_small/old/applications.bad_old.png diff --git a/pandora_console/images/groups_small/applications.default_old.png b/pandora_console/images/groups_small/old/applications.default_old.png similarity index 100% rename from pandora_console/images/groups_small/applications.default_old.png rename to pandora_console/images/groups_small/old/applications.default_old.png diff --git a/pandora_console/images/groups_small/applications.ok_old.png b/pandora_console/images/groups_small/old/applications.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/applications.ok_old.png rename to pandora_console/images/groups_small/old/applications.ok_old.png diff --git a/pandora_console/images/groups_small/applications.warning_old.png b/pandora_console/images/groups_small/old/applications.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/applications.warning_old.png rename to pandora_console/images/groups_small/old/applications.warning_old.png diff --git a/pandora_console/images/groups_small/old/bricks.bad.png b/pandora_console/images/groups_small/old/bricks.bad.png new file mode 100644 index 0000000000..0a0cd5459f Binary files /dev/null and b/pandora_console/images/groups_small/old/bricks.bad.png differ diff --git a/pandora_console/images/groups_small/old/bricks.default.png b/pandora_console/images/groups_small/old/bricks.default.png new file mode 100644 index 0000000000..14d8bab5ca Binary files /dev/null and b/pandora_console/images/groups_small/old/bricks.default.png differ diff --git a/pandora_console/images/groups_small/old/bricks.ok.png b/pandora_console/images/groups_small/old/bricks.ok.png new file mode 100644 index 0000000000..931d1a389c Binary files /dev/null and b/pandora_console/images/groups_small/old/bricks.ok.png differ diff --git a/pandora_console/images/groups_small/old/bricks.warning.png b/pandora_console/images/groups_small/old/bricks.warning.png new file mode 100644 index 0000000000..bbfeb0ce3f Binary files /dev/null and b/pandora_console/images/groups_small/old/bricks.warning.png differ diff --git a/pandora_console/images/groups_small/old/chart_organisation.bad.png b/pandora_console/images/groups_small/old/chart_organisation.bad.png new file mode 100644 index 0000000000..410cd5116c Binary files /dev/null and b/pandora_console/images/groups_small/old/chart_organisation.bad.png differ diff --git a/pandora_console/images/groups_small/old/chart_organisation.default.png b/pandora_console/images/groups_small/old/chart_organisation.default.png new file mode 100644 index 0000000000..53619a608b Binary files /dev/null and b/pandora_console/images/groups_small/old/chart_organisation.default.png differ diff --git a/pandora_console/images/groups_small/old/chart_organisation.ok.png b/pandora_console/images/groups_small/old/chart_organisation.ok.png new file mode 100644 index 0000000000..ca7f04061b Binary files /dev/null and b/pandora_console/images/groups_small/old/chart_organisation.ok.png differ diff --git a/pandora_console/images/groups_small/old/chart_organisation.warning.png b/pandora_console/images/groups_small/old/chart_organisation.warning.png new file mode 100644 index 0000000000..c9ba529187 Binary files /dev/null and b/pandora_console/images/groups_small/old/chart_organisation.warning.png differ diff --git a/pandora_console/images/groups_small/old/clock.bad.png b/pandora_console/images/groups_small/old/clock.bad.png new file mode 100644 index 0000000000..f281439c87 Binary files /dev/null and b/pandora_console/images/groups_small/old/clock.bad.png differ diff --git a/pandora_console/images/groups_small/old/clock.default.png b/pandora_console/images/groups_small/old/clock.default.png new file mode 100644 index 0000000000..2b7a58aa20 Binary files /dev/null and b/pandora_console/images/groups_small/old/clock.default.png differ diff --git a/pandora_console/images/groups_small/old/clock.ok.png b/pandora_console/images/groups_small/old/clock.ok.png new file mode 100644 index 0000000000..a3cb173d9e Binary files /dev/null and b/pandora_console/images/groups_small/old/clock.ok.png differ diff --git a/pandora_console/images/groups_small/old/clock.warning.png b/pandora_console/images/groups_small/old/clock.warning.png new file mode 100644 index 0000000000..20880b31df Binary files /dev/null and b/pandora_console/images/groups_small/old/clock.warning.png differ diff --git a/pandora_console/images/groups_small/computer.bad_old.png b/pandora_console/images/groups_small/old/computer.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/computer.bad_old.png rename to pandora_console/images/groups_small/old/computer.bad_old.png diff --git a/pandora_console/images/groups_small/computer.default_old.png b/pandora_console/images/groups_small/old/computer.default_old.png similarity index 100% rename from pandora_console/images/groups_small/computer.default_old.png rename to pandora_console/images/groups_small/old/computer.default_old.png diff --git a/pandora_console/images/groups_small/computer.ok_old.png b/pandora_console/images/groups_small/old/computer.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/computer.ok_old.png rename to pandora_console/images/groups_small/old/computer.ok_old.png diff --git a/pandora_console/images/groups_small/computer.warning_old.png b/pandora_console/images/groups_small/old/computer.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/computer.warning_old.png rename to pandora_console/images/groups_small/old/computer.warning_old.png diff --git a/pandora_console/images/groups_small/database_gear.bad_old.png b/pandora_console/images/groups_small/old/database_gear.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/database_gear.bad_old.png rename to pandora_console/images/groups_small/old/database_gear.bad_old.png diff --git a/pandora_console/images/groups_small/database_gear.default_old.png b/pandora_console/images/groups_small/old/database_gear.default_old.png similarity index 100% rename from pandora_console/images/groups_small/database_gear.default_old.png rename to pandora_console/images/groups_small/old/database_gear.default_old.png diff --git a/pandora_console/images/groups_small/database_gear.ok_old.png b/pandora_console/images/groups_small/old/database_gear.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/database_gear.ok_old.png rename to pandora_console/images/groups_small/old/database_gear.ok_old.png diff --git a/pandora_console/images/groups_small/database_gear.warning_old.png b/pandora_console/images/groups_small/old/database_gear.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/database_gear.warning_old.png rename to pandora_console/images/groups_small/old/database_gear.warning_old.png diff --git a/pandora_console/images/groups_small/drive_network.bad.png b/pandora_console/images/groups_small/old/drive_network.bad.png similarity index 100% rename from pandora_console/images/groups_small/drive_network.bad.png rename to pandora_console/images/groups_small/old/drive_network.bad.png diff --git a/pandora_console/images/groups_small/old/drive_network.default.png b/pandora_console/images/groups_small/old/drive_network.default.png new file mode 100644 index 0000000000..428b2eb2a4 Binary files /dev/null and b/pandora_console/images/groups_small/old/drive_network.default.png differ diff --git a/pandora_console/images/groups_small/old/drive_network.ok.png b/pandora_console/images/groups_small/old/drive_network.ok.png new file mode 100644 index 0000000000..dbe58f007c Binary files /dev/null and b/pandora_console/images/groups_small/old/drive_network.ok.png differ diff --git a/pandora_console/images/groups_small/old/drive_network.png b/pandora_console/images/groups_small/old/drive_network.png new file mode 100644 index 0000000000..952cf5352c Binary files /dev/null and b/pandora_console/images/groups_small/old/drive_network.png differ diff --git a/pandora_console/images/groups_small/old/drive_network.warning.png b/pandora_console/images/groups_small/old/drive_network.warning.png new file mode 100644 index 0000000000..0dbdd4b2a5 Binary files /dev/null and b/pandora_console/images/groups_small/old/drive_network.warning.png differ diff --git a/pandora_console/images/groups_small/old/email.bad.png b/pandora_console/images/groups_small/old/email.bad.png new file mode 100644 index 0000000000..064222d63e Binary files /dev/null and b/pandora_console/images/groups_small/old/email.bad.png differ diff --git a/pandora_console/images/groups_small/old/email.default.png b/pandora_console/images/groups_small/old/email.default.png new file mode 100644 index 0000000000..1486cd82a0 Binary files /dev/null and b/pandora_console/images/groups_small/old/email.default.png differ diff --git a/pandora_console/images/groups_small/old/email.ok.png b/pandora_console/images/groups_small/old/email.ok.png new file mode 100644 index 0000000000..681fc2ddfa Binary files /dev/null and b/pandora_console/images/groups_small/old/email.ok.png differ diff --git a/pandora_console/images/groups_small/old/email.warning.png b/pandora_console/images/groups_small/old/email.warning.png new file mode 100644 index 0000000000..b08c99d7c1 Binary files /dev/null and b/pandora_console/images/groups_small/old/email.warning.png differ diff --git a/pandora_console/images/groups_small/old/eye.bad.png b/pandora_console/images/groups_small/old/eye.bad.png new file mode 100644 index 0000000000..f8191a1b17 Binary files /dev/null and b/pandora_console/images/groups_small/old/eye.bad.png differ diff --git a/pandora_console/images/groups_small/old/eye.default.png b/pandora_console/images/groups_small/old/eye.default.png new file mode 100644 index 0000000000..cd852b7502 Binary files /dev/null and b/pandora_console/images/groups_small/old/eye.default.png differ diff --git a/pandora_console/images/groups_small/old/eye.ok.png b/pandora_console/images/groups_small/old/eye.ok.png new file mode 100644 index 0000000000..0da4304f71 Binary files /dev/null and b/pandora_console/images/groups_small/old/eye.ok.png differ diff --git a/pandora_console/images/groups_small/old/eye.warning.png b/pandora_console/images/groups_small/old/eye.warning.png new file mode 100644 index 0000000000..65a5722201 Binary files /dev/null and b/pandora_console/images/groups_small/old/eye.warning.png differ diff --git a/pandora_console/images/groups_small/firewall.bad_old.png b/pandora_console/images/groups_small/old/firewall.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/firewall.bad_old.png rename to pandora_console/images/groups_small/old/firewall.bad_old.png diff --git a/pandora_console/images/groups_small/firewall.default_old.png b/pandora_console/images/groups_small/old/firewall.default_old.png similarity index 100% rename from pandora_console/images/groups_small/firewall.default_old.png rename to pandora_console/images/groups_small/old/firewall.default_old.png diff --git a/pandora_console/images/groups_small/firewall.ok_old.png b/pandora_console/images/groups_small/old/firewall.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/firewall.ok_old.png rename to pandora_console/images/groups_small/old/firewall.ok_old.png diff --git a/pandora_console/images/groups_small/firewall.warning_old.png b/pandora_console/images/groups_small/old/firewall.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/firewall.warning_old.png rename to pandora_console/images/groups_small/old/firewall.warning_old.png diff --git a/pandora_console/images/groups_small/old/heart.bad.png b/pandora_console/images/groups_small/old/heart.bad.png new file mode 100644 index 0000000000..ff3008fcc4 Binary files /dev/null and b/pandora_console/images/groups_small/old/heart.bad.png differ diff --git a/pandora_console/images/groups_small/old/heart.default.png b/pandora_console/images/groups_small/old/heart.default.png new file mode 100644 index 0000000000..a7cfff0cc3 Binary files /dev/null and b/pandora_console/images/groups_small/old/heart.default.png differ diff --git a/pandora_console/images/groups_small/old/heart.ok.png b/pandora_console/images/groups_small/old/heart.ok.png new file mode 100644 index 0000000000..0f0798523d Binary files /dev/null and b/pandora_console/images/groups_small/old/heart.ok.png differ diff --git a/pandora_console/images/groups_small/old/heart.warning.png b/pandora_console/images/groups_small/old/heart.warning.png new file mode 100644 index 0000000000..66b8583393 Binary files /dev/null and b/pandora_console/images/groups_small/old/heart.warning.png differ diff --git a/pandora_console/images/groups_small/old/house.bad.png b/pandora_console/images/groups_small/old/house.bad.png new file mode 100644 index 0000000000..815f719f7c Binary files /dev/null and b/pandora_console/images/groups_small/old/house.bad.png differ diff --git a/pandora_console/images/groups_small/old/house.default.png b/pandora_console/images/groups_small/old/house.default.png new file mode 100644 index 0000000000..fac912b267 Binary files /dev/null and b/pandora_console/images/groups_small/old/house.default.png differ diff --git a/pandora_console/images/groups_small/old/house.ok.png b/pandora_console/images/groups_small/old/house.ok.png new file mode 100644 index 0000000000..c3a2e9053e Binary files /dev/null and b/pandora_console/images/groups_small/old/house.ok.png differ diff --git a/pandora_console/images/groups_small/old/house.warning.png b/pandora_console/images/groups_small/old/house.warning.png new file mode 100644 index 0000000000..cf76552f5f Binary files /dev/null and b/pandora_console/images/groups_small/old/house.warning.png differ diff --git a/pandora_console/images/groups_small/old/images.bad.png b/pandora_console/images/groups_small/old/images.bad.png new file mode 100644 index 0000000000..454b36e1d5 Binary files /dev/null and b/pandora_console/images/groups_small/old/images.bad.png differ diff --git a/pandora_console/images/groups_small/old/images.default.png b/pandora_console/images/groups_small/old/images.default.png new file mode 100644 index 0000000000..501a97fe27 Binary files /dev/null and b/pandora_console/images/groups_small/old/images.default.png differ diff --git a/pandora_console/images/groups_small/old/images.ok.png b/pandora_console/images/groups_small/old/images.ok.png new file mode 100644 index 0000000000..530af4f4c4 Binary files /dev/null and b/pandora_console/images/groups_small/old/images.ok.png differ diff --git a/pandora_console/images/groups_small/old/images.warning.png b/pandora_console/images/groups_small/old/images.warning.png new file mode 100644 index 0000000000..46cd29d989 Binary files /dev/null and b/pandora_console/images/groups_small/old/images.warning.png differ diff --git a/pandora_console/images/groups_small/old/lightning.bad.png b/pandora_console/images/groups_small/old/lightning.bad.png new file mode 100644 index 0000000000..a6ec10a2bc Binary files /dev/null and b/pandora_console/images/groups_small/old/lightning.bad.png differ diff --git a/pandora_console/images/groups_small/old/lightning.default.png b/pandora_console/images/groups_small/old/lightning.default.png new file mode 100644 index 0000000000..47447d48be Binary files /dev/null and b/pandora_console/images/groups_small/old/lightning.default.png differ diff --git a/pandora_console/images/groups_small/old/lightning.ok.png b/pandora_console/images/groups_small/old/lightning.ok.png new file mode 100644 index 0000000000..7dee1c4a81 Binary files /dev/null and b/pandora_console/images/groups_small/old/lightning.ok.png differ diff --git a/pandora_console/images/groups_small/old/lightning.warning.png b/pandora_console/images/groups_small/old/lightning.warning.png new file mode 100644 index 0000000000..020cfe9ac7 Binary files /dev/null and b/pandora_console/images/groups_small/old/lightning.warning.png differ diff --git a/pandora_console/images/groups_small/old/lock.bad.png b/pandora_console/images/groups_small/old/lock.bad.png new file mode 100644 index 0000000000..29fecde26d Binary files /dev/null and b/pandora_console/images/groups_small/old/lock.bad.png differ diff --git a/pandora_console/images/groups_small/old/lock.default.png b/pandora_console/images/groups_small/old/lock.default.png new file mode 100644 index 0000000000..d462751473 Binary files /dev/null and b/pandora_console/images/groups_small/old/lock.default.png differ diff --git a/pandora_console/images/groups_small/old/lock.ok.png b/pandora_console/images/groups_small/old/lock.ok.png new file mode 100644 index 0000000000..fb9a8749bd Binary files /dev/null and b/pandora_console/images/groups_small/old/lock.ok.png differ diff --git a/pandora_console/images/groups_small/old/lock.warning.png b/pandora_console/images/groups_small/old/lock.warning.png new file mode 100644 index 0000000000..bfb2826d31 Binary files /dev/null and b/pandora_console/images/groups_small/old/lock.warning.png differ diff --git a/pandora_console/images/groups_small/old/network.bad.png b/pandora_console/images/groups_small/old/network.bad.png new file mode 100644 index 0000000000..f3293d77ac Binary files /dev/null and b/pandora_console/images/groups_small/old/network.bad.png differ diff --git a/pandora_console/images/groups_small/old/network.default.png b/pandora_console/images/groups_small/old/network.default.png new file mode 100644 index 0000000000..c330e90893 Binary files /dev/null and b/pandora_console/images/groups_small/old/network.default.png differ diff --git a/pandora_console/images/groups_small/old/network.ok.png b/pandora_console/images/groups_small/old/network.ok.png new file mode 100644 index 0000000000..edd8831666 Binary files /dev/null and b/pandora_console/images/groups_small/old/network.ok.png differ diff --git a/pandora_console/images/groups_small/old/network.warning.png b/pandora_console/images/groups_small/old/network.warning.png new file mode 100644 index 0000000000..6ddd996e56 Binary files /dev/null and b/pandora_console/images/groups_small/old/network.warning.png differ diff --git a/pandora_console/images/groups_small/old/plugin.bad.png b/pandora_console/images/groups_small/old/plugin.bad.png new file mode 100644 index 0000000000..6d156e363f Binary files /dev/null and b/pandora_console/images/groups_small/old/plugin.bad.png differ diff --git a/pandora_console/images/groups_small/old/plugin.default.png b/pandora_console/images/groups_small/old/plugin.default.png new file mode 100644 index 0000000000..d97051dec6 Binary files /dev/null and b/pandora_console/images/groups_small/old/plugin.default.png differ diff --git a/pandora_console/images/groups_small/old/plugin.ok.png b/pandora_console/images/groups_small/old/plugin.ok.png new file mode 100644 index 0000000000..ff830a1475 Binary files /dev/null and b/pandora_console/images/groups_small/old/plugin.ok.png differ diff --git a/pandora_console/images/groups_small/old/plugin.warning.png b/pandora_console/images/groups_small/old/plugin.warning.png new file mode 100644 index 0000000000..58104424a0 Binary files /dev/null and b/pandora_console/images/groups_small/old/plugin.warning.png differ diff --git a/pandora_console/images/groups_small/old/printer.bad.png b/pandora_console/images/groups_small/old/printer.bad.png new file mode 100644 index 0000000000..9b2d285e85 Binary files /dev/null and b/pandora_console/images/groups_small/old/printer.bad.png differ diff --git a/pandora_console/images/groups_small/old/printer.default.png b/pandora_console/images/groups_small/old/printer.default.png new file mode 100644 index 0000000000..859c2474af Binary files /dev/null and b/pandora_console/images/groups_small/old/printer.default.png differ diff --git a/pandora_console/images/groups_small/old/printer.ok.png b/pandora_console/images/groups_small/old/printer.ok.png new file mode 100644 index 0000000000..8f17c7a050 Binary files /dev/null and b/pandora_console/images/groups_small/old/printer.ok.png differ diff --git a/pandora_console/images/groups_small/old/printer.warning.png b/pandora_console/images/groups_small/old/printer.warning.png new file mode 100644 index 0000000000..7eb19cf180 Binary files /dev/null and b/pandora_console/images/groups_small/old/printer.warning.png differ diff --git a/pandora_console/images/groups_small/server_database.bad_old.png b/pandora_console/images/groups_small/old/server_database.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/server_database.bad_old.png rename to pandora_console/images/groups_small/old/server_database.bad_old.png diff --git a/pandora_console/images/groups_small/server_database.default_old.png b/pandora_console/images/groups_small/old/server_database.default_old.png similarity index 100% rename from pandora_console/images/groups_small/server_database.default_old.png rename to pandora_console/images/groups_small/old/server_database.default_old.png diff --git a/pandora_console/images/groups_small/server_database.ok_old.png b/pandora_console/images/groups_small/old/server_database.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/server_database.ok_old.png rename to pandora_console/images/groups_small/old/server_database.ok_old.png diff --git a/pandora_console/images/groups_small/server_database.warning_old.png b/pandora_console/images/groups_small/old/server_database.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/server_database.warning_old.png rename to pandora_console/images/groups_small/old/server_database.warning_old.png diff --git a/pandora_console/images/groups_small/transmit.bad_old.png b/pandora_console/images/groups_small/old/transmit.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/transmit.bad_old.png rename to pandora_console/images/groups_small/old/transmit.bad_old.png diff --git a/pandora_console/images/groups_small/transmit.default_old.png b/pandora_console/images/groups_small/old/transmit.default_old.png similarity index 100% rename from pandora_console/images/groups_small/transmit.default_old.png rename to pandora_console/images/groups_small/old/transmit.default_old.png diff --git a/pandora_console/images/groups_small/transmit.ok_old.png b/pandora_console/images/groups_small/old/transmit.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/transmit.ok_old.png rename to pandora_console/images/groups_small/old/transmit.ok_old.png diff --git a/pandora_console/images/groups_small/transmit.warning_old.png b/pandora_console/images/groups_small/old/transmit.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/transmit.warning_old.png rename to pandora_console/images/groups_small/old/transmit.warning_old.png diff --git a/pandora_console/images/groups_small/without_group.bad_old.png b/pandora_console/images/groups_small/old/without_group.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/without_group.bad_old.png rename to pandora_console/images/groups_small/old/without_group.bad_old.png diff --git a/pandora_console/images/groups_small/without_group.default_old.png b/pandora_console/images/groups_small/old/without_group.default_old.png similarity index 100% rename from pandora_console/images/groups_small/without_group.default_old.png rename to pandora_console/images/groups_small/old/without_group.default_old.png diff --git a/pandora_console/images/groups_small/without_group.ok_old.png b/pandora_console/images/groups_small/old/without_group.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/without_group.ok_old.png rename to pandora_console/images/groups_small/old/without_group.ok_old.png diff --git a/pandora_console/images/groups_small/without_group.warning_old.png b/pandora_console/images/groups_small/old/without_group.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/without_group.warning_old.png rename to pandora_console/images/groups_small/old/without_group.warning_old.png diff --git a/pandora_console/images/groups_small/world.bad_old.png b/pandora_console/images/groups_small/old/world.bad_old.png similarity index 100% rename from pandora_console/images/groups_small/world.bad_old.png rename to pandora_console/images/groups_small/old/world.bad_old.png diff --git a/pandora_console/images/groups_small/world.default_old.png b/pandora_console/images/groups_small/old/world.default_old.png similarity index 100% rename from pandora_console/images/groups_small/world.default_old.png rename to pandora_console/images/groups_small/old/world.default_old.png diff --git a/pandora_console/images/groups_small/world.ok_old.png b/pandora_console/images/groups_small/old/world.ok_old.png similarity index 100% rename from pandora_console/images/groups_small/world.ok_old.png rename to pandora_console/images/groups_small/old/world.ok_old.png diff --git a/pandora_console/images/groups_small/world.warning_old.png b/pandora_console/images/groups_small/old/world.warning_old.png similarity index 100% rename from pandora_console/images/groups_small/world.warning_old.png rename to pandora_console/images/groups_small/old/world.warning_old.png diff --git a/pandora_console/images/groups_small/plugin.bad.png b/pandora_console/images/groups_small/plugin.bad.png index 6d156e363f..7004df6a1e 100644 Binary files a/pandora_console/images/groups_small/plugin.bad.png and b/pandora_console/images/groups_small/plugin.bad.png differ diff --git a/pandora_console/images/groups_small/plugin.default.png b/pandora_console/images/groups_small/plugin.default.png index d97051dec6..d815c117ba 100644 Binary files a/pandora_console/images/groups_small/plugin.default.png and b/pandora_console/images/groups_small/plugin.default.png differ diff --git a/pandora_console/images/groups_small/plugin.ok.png b/pandora_console/images/groups_small/plugin.ok.png index ff830a1475..dfa215c35e 100644 Binary files a/pandora_console/images/groups_small/plugin.ok.png and b/pandora_console/images/groups_small/plugin.ok.png differ diff --git a/pandora_console/images/groups_small/plugin.warning.png b/pandora_console/images/groups_small/plugin.warning.png index 58104424a0..957bedbc15 100644 Binary files a/pandora_console/images/groups_small/plugin.warning.png and b/pandora_console/images/groups_small/plugin.warning.png differ diff --git a/pandora_console/images/groups_small/printer.bad.png b/pandora_console/images/groups_small/printer.bad.png index 9b2d285e85..79ad2126d4 100644 Binary files a/pandora_console/images/groups_small/printer.bad.png and b/pandora_console/images/groups_small/printer.bad.png differ diff --git a/pandora_console/images/groups_small/printer.default.png b/pandora_console/images/groups_small/printer.default.png index 859c2474af..c16416c149 100644 Binary files a/pandora_console/images/groups_small/printer.default.png and b/pandora_console/images/groups_small/printer.default.png differ diff --git a/pandora_console/images/groups_small/printer.ok.png b/pandora_console/images/groups_small/printer.ok.png index 8f17c7a050..4f2cd88e81 100644 Binary files a/pandora_console/images/groups_small/printer.ok.png and b/pandora_console/images/groups_small/printer.ok.png differ diff --git a/pandora_console/images/groups_small/printer.warning.png b/pandora_console/images/groups_small/printer.warning.png index 7eb19cf180..f3aaa8ef07 100644 Binary files a/pandora_console/images/groups_small/printer.warning.png and b/pandora_console/images/groups_small/printer.warning.png differ diff --git a/pandora_console/include/ajax/snmp_browser.ajax.php b/pandora_console/include/ajax/snmp_browser.ajax.php index 3376245093..63053e1919 100644 --- a/pandora_console/include/ajax/snmp_browser.ajax.php +++ b/pandora_console/include/ajax/snmp_browser.ajax.php @@ -25,12 +25,12 @@ if(is_ajax()){ $target_ip = (string) get_parameter ("target_ip", ''); $community = (string) get_parameter ("community", ''); $snmp_version = (string) get_parameter ("snmp_browser_version", ''); - $snmp3_auth_user = get_parameter('snmp3_browser_auth_user'); + $snmp3_auth_user = io_safe_output(get_parameter('snmp3_browser_auth_user')); $snmp3_security_level = get_parameter('snmp3_browser_security_level'); $snmp3_auth_method = get_parameter('snmp3_browser_auth_method'); - $snmp3_auth_pass = get_parameter('snmp3_browser_auth_pass'); + $snmp3_auth_pass = io_safe_output(get_parameter('snmp3_browser_auth_pass')); $snmp3_privacy_method = get_parameter('snmp3_browser_privacy_method'); - $snmp3_privacy_pass = get_parameter('snmp3_browser_privacy_pass'); + $snmp3_privacy_pass = io_safe_output(get_parameter('snmp3_browser_privacy_pass')); $targets_oids = get_parameter ("oids", ""); $targets_oids = explode(",", $targets_oids); diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php index b4bdc4f0fb..5e1d9cafd5 100755 --- a/pandora_console/include/ajax/visual_console_builder.ajax.php +++ b/pandora_console/include/ajax/visual_console_builder.ajax.php @@ -101,6 +101,7 @@ $height = get_parameter('height', null); $parent = get_parameter('parent', null); $map_linked = get_parameter('map_linked', null); $width_percentile = get_parameter('width_percentile', null); +$bars_graph_height = get_parameter('bars_graph_height', null); $max_percentile = get_parameter('max_percentile', null); $height_module_graph = get_parameter('height_module_graph', null); $width_module_graph = get_parameter('width_module_graph', null); @@ -113,14 +114,17 @@ $metaconsole = get_parameter('metaconsole', 0); $server_name = get_parameter('server_name', null); $server_id = (int)get_parameter('server_id', 0); $id_agent = get_parameter('id_agent', null); +$id_agent_string = get_parameter('id_agent_string', null); $id_metaconsole = get_parameter('id_metaconsole', null); $id_group = (int)get_parameter('id_group', 0); $id_custom_graph = get_parameter('id_custom_graph', null); $border_width = (int)get_parameter('border_width', 0); $border_color = get_parameter('border_color', ''); +$grid_color = get_parameter('grid_color', ''); +$resume_color = get_parameter('resume_color', ''); $fill_color = get_parameter('fill_color', ''); $percentile_color = get_parameter('percentile_color', ''); -$percentile_label = get_parameter('percentile_label', ''); +$percentile_label = io_safe_output(get_parameter('percentile_label', '')); $percentile_label_color = get_parameter('percentile_label_color', ''); $width_box = (int)get_parameter('width_box', 0); $height_box = (int)get_parameter('height_box', 0); @@ -145,6 +149,24 @@ switch ($action) { echo json_encode($return); break; + case 'get_image_from_module': + $layoutData = db_get_row_filter('tlayout_data', array('id' => $id_element)); + $sql = 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = '.$layoutData['id_agente_modulo']; + ob_clean(); + $result = db_get_sql($sql); + $image = strpos($result, 'data:image'); + + if($image === false){ + $return['correct'] = false; + } + else{ + $return['correct'] = true; + } + + echo json_encode($return); + + break; + case 'get_module_type_string': $data = array (); @@ -489,12 +511,6 @@ switch ($action) { echo (int)$result; break; case 'simple_value': - if ($action == 'update') { - $values['type'] = visual_map_get_simple_value_type( - $process_simple_value); - $values['period'] = $period; - $values['width'] = $width; - } case 'percentile_bar': case 'percentile_item': case 'static_graph': @@ -595,8 +611,9 @@ switch ($action) { $values['width'] = $width_percentile; $values['height'] = $width_percentile; } + $values['border_color'] = $resume_color; $values['type'] = DONUT_GRAPH; - + $values['id_agent'] = $id_agent_string; break; case 'box_item': $values['border_width'] = $border_width; @@ -639,12 +656,19 @@ switch ($action) { if ($width_percentile !== null) { $values['width'] = $width_percentile; } + if ($bars_graph_height !== null) { + $values['height'] = $bars_graph_height; + } if ($bars_graph_type !== null) { $values['type_graph'] = $bars_graph_type; } if ($background_color !== null) { $values['image'] = $background_color; } + if ($grid_color !== null) { + $values['border_color'] = $grid_color; + } + $values['id_agent'] = $id_agent_string; break; case 'percentile_item': case 'percentile_bar': @@ -670,11 +694,7 @@ switch ($action) { $values['type'] = PERCENTILE_BUBBLE; } - //Check the field's value for back compatibility - $values['image'] = 'percent'; - if (($value_show == 'percent') || - ($value_show == 'value')) - $values['image'] = $value_show; + $values['image'] = $value_show; $values['border_color'] = $percentile_color; $values['fill_color'] = $percentile_label_color; @@ -692,6 +712,15 @@ switch ($action) { if ($height !== null) { $values['height'] = $height; } + break; + case 'simple_value': + if ($action == 'update') { + $values['type'] = visual_map_get_simple_value_type( + $process_simple_value); + $values['period'] = $period; + $values['width'] = $width; + } + break; default: if (enterprise_installed()) { @@ -721,6 +750,15 @@ switch ($action) { case 'bars_graph': unset($values['image']); unset($values['type_graph']); + unset($values['border_color']); + unset($values['width']); + unset($values['id_agent']); + unset($values['height']); + break; + case 'donut_graph': + unset($values['border_color']); + unset($values['width']); + unset($values['id_agent']); break; case 'box_item': unset($values['border_width']); @@ -842,11 +880,8 @@ switch ($action) { case 'percentile_bar': $elementFields['width_percentile'] = $elementFields['width']; $elementFields['max_percentile'] = $elementFields['height']; - //Check the field's value for back compatibility - $elementFields['value_show'] = 'percent'; - if (($elementFields['image'] == 'percent') || - ($elementFields['image'] == 'value')) - $elementFields['value_show'] = $elementFields['image']; + + $elementFields['value_show'] = $elementFields['image']; $elementFields['type_percentile'] = 'percentile'; if ($elementFields['type'] == PERCENTILE_BAR) { @@ -867,6 +902,21 @@ switch ($action) { break; case 'donut_graph': $elementFields['width_percentile'] = $elementFields['width']; + $elementFields['resume_color'] = $elementFields['border_color']; + $elementFields['id_agent_string'] = $elementFields['id_agent']; + if (($elementFields['id_agent_string'] != 0) + && ($elementFields['id_layout_linked'] == 0)) { + $modules = agents_get_modules( + $elementFields['id_agent'], false, + array('disabled' => 0, + 'id_agente' => $elementFields['id_agent'], + 'tagente_modulo.id_tipo_modulo IN' => "(17,23,3,10,33)")); + + $elementFields['modules_html'] = ''; + foreach ($modules as $id => $name) { + $elementFields['modules_html'] .= ''; + } + } break; case 'module_graph': @@ -875,7 +925,23 @@ switch ($action) { break; case 'bars_graph': $elementFields['width_percentile'] = $elementFields['width']; + $elementFields['bars_graph_height'] = $elementFields['height']; $elementFields['bars_graph_type'] = $elementFields['type_graph']; + $elementFields['grid_color'] = $elementFields['border_color']; + $elementFields['id_agent_string'] = $elementFields['id_agent']; + if (($elementFields['id_agent_string'] != 0) + && ($elementFields['id_layout_linked'] == 0)) { + $modules = agents_get_modules( + $elementFields['id_agent'], false, + array('disabled' => 0, + 'id_agente' => $elementFields['id_agent'], + 'tagente_modulo.id_tipo_modulo IN' => "(17,23,3,10,33)")); + + $elementFields['modules_html'] = ''; + foreach ($modules as $id => $name) { + $elementFields['modules_html'] .= ''; + } + } break; case 'box_item': $elementFields['width_box'] = $elementFields['width']; @@ -983,8 +1049,10 @@ switch ($action) { break; case 'donut_graph': $values['type'] = DONUT_GRAPH; - $values['width'] = $width; - $values['height'] = $height; + $values['width'] = $width_percentile; + $values['height'] = $width_percentile; + $values['border_color'] = $resume_color; + $values['id_agent'] = $id_agent_string; break; case 'module_graph': $values['type'] = MODULE_GRAPH; @@ -1020,14 +1088,12 @@ switch ($action) { break; case 'bars_graph': $values['type'] = BARS_GRAPH; - if ($width_percentile == null) { - $values['width'] = 0; - } - else { - $values['width'] = $width_percentile; - } + $values['width'] = $width_percentile; + $values['height'] = $bars_graph_height; $values['type_graph'] = $bars_graph_type; $values['image'] = $background_color; + $values['border_color'] = $grid_color; + $values['id_agent'] = $id_agent_string; break; case 'auto_sla_graph': $values['type'] = AUTO_SLA_GRAPH; diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 69f31d2bd1..372f9dfc58 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -693,10 +693,10 @@ function ldap_process_user_login ($login, $password) { } } - $dc = $config["ldap_base_dn"]; + $dc = io_safe_output($config["ldap_base_dn"]); #Search group of this user it belong. - $filter="(" . $config['ldap_login_attr'] . io_safe_output($login) . ")"; + $filter="(" . $config['ldap_login_attr'] . "=" . io_safe_output($login) . ")"; $justthese = array("objectclass=group"); $sr = ldap_search($ds, $dc, $filter, $justthese); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index aae9bf0736..2ce2204360 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,8 +22,8 @@ /** * Pandora build version and version */ -$build_version = 'PC171031'; -$pandora_version = 'v7.0NG.714'; +$build_version = 'PC171114'; +$pandora_version = 'v7.0NG.715'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 5e0ef6c718..1297ea50b2 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -720,6 +720,17 @@ function filemanager_file_explorer($real_directory, $relative_directory, $hash = md5($relative_path . $config['dbpass']); $data[1] = ''.$fileinfo['name'].''; } + + // Notice that uploaded php files could be dangerous + if (pathinfo($fileinfo['realpath'], PATHINFO_EXTENSION) == 'php' && + (is_readable($fileinfo['realpath']) || is_executable($fileinfo['realpath']))) { + $error_message = __('This file could be executed by any user'); + $error_message .= '. ' . __('Make sure it can\'t perform dangerous tasks'); + $data[1] = '' + . $data[1] + . ''; + } + $data[2] = ui_print_timestamp ($fileinfo['last_modified'], true, array ('prominent' => true)); if ($fileinfo['is_dir']) { diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index c999674f3c..ccad237208 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -2160,14 +2160,14 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $height, $color, $module_name_list, $long_index, ui_get_full_url("images/image_problem_area_small.png", false, false, false), "", "", $water_mark, $config['fontpath'], $fixed_font_size, - "", $ttl, $homeurl, $background_color); + "", $ttl, $homeurl, $background_color, 'black'); break; case CUSTOM_GRAPH_VBARS: return vbar_graph($flash_charts, $graph_values, $width, $height, $color, $module_name_list, $long_index, ui_get_full_url("images/image_problem_area_small.png", false, false, false), "", "", $water_mark, $config['fontpath'], $fixed_font_size, - "", $ttl, $homeurl, $background_color, true); + "", $ttl, $homeurl, $background_color, true, false, "black"); break; case CUSTOM_GRAPH_PIE: return ring_graph($flash_charts, $graph_values, $width, $height, @@ -2510,10 +2510,10 @@ function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value require_once("include_graph_dependencies.php"); include_graphs_dependencies($config['homedir'].'/'); $src = ui_get_full_url( - "/include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar" . - "&width=".$width."&homedir=".$config['homedir']."&height=".$height."&progress=".$progress. + "/include/graphs/fgraph.php?graph_type=progressbar" . + "&width=".$width."&height=".$height."&progress=".$progress. "&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str . - "&title=".$title."&font=".$config['fontpath']."&value_text=". $value_text . + "&title=".$title."&value_text=". $value_text . "&colorRGB=". $colorRGB, false, false, false ); @@ -2545,10 +2545,10 @@ function progress_bubble($progress, $width, $height, $title = '', $mode = 1, $va include_graphs_dependencies($config['homedir'].'/'); return "" . $title . ""; } @@ -2832,7 +2832,9 @@ function grafico_db_agentes_paquetes($width = 380, $height = 300) { return hbar_graph($config['flash_charts'], $data, $width, $height, array(), $legend, "", "", true, "", $water_mark, - $config['fontpath'], $config['font_size'], false); + $config['fontpath'], $config['font_size'], false, 1, $config['homeurl'], + 'white', + 'black'); } /** @@ -2899,7 +2901,9 @@ function graph_db_agentes_modulos($width, $height) { $data, $width, $height, array(), array(), "", "", true, "", $water_mark, - $config['fontpath'], $config['font_size'], false); + $config['fontpath'], $config['font_size'], false, 1, $config['homeurl'], + 'white', + 'black'); } /** @@ -3674,12 +3678,14 @@ function graph_custom_sql_graph ($id, $width, $height, case 'sql_graph_vbar': // vertical bar return vbar_graph($flash_charts, $data, $width, $height, array(), array(), "", "", $homeurl, $water_mark, - $config['fontpath'], $config['font_size'], false, $ttl); + $config['fontpath'], $config['font_size'], false, $ttl, "", "white", false, false, "black"); break; case 'sql_graph_hbar': // horizontal bar return hbar_graph($flash_charts, $data, $width, $height, array(), array(), "", "", true, $homeurl, $water_mark, - $config['fontpath'], $config['font_size'], false, $ttl); + $config['fontpath'], $config['font_size'], false, $ttl,$config['homeurl'], + 'white', + 'black'); break; case 'sql_graph_pie': // Pie return pie3d_graph($flash_charts, $data, $width, $height, __("other"), $homeurl, diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index e1417ceec1..34ca395db0 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -1060,8 +1060,8 @@ function networkmap_create_agent_node ($agent, $simple = 0, $font_size = 10, $cu } // Short name - $name = io_safe_output($agent["nombre"]); - if ((strlen ($name) > 16) && ($cut_names)) { + $name = $agent["nombre"]; + if ($cut_names) { $name = ui_print_truncate_text($name, 16, false, true, false); } @@ -1111,7 +1111,7 @@ function networkmap_create_agent_node ($agent, $simple = 0, $font_size = 10, $cu } $node = "\n" . $agent['id_node'].' [ parent="' . $agent['id_parent'] . '", color="'.$status_color.'", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.40, height=0.40, label=< -
' . $img_node . '
'.io_safe_output($name).'
>, + '.$name.'>, shape="doublecircle", URL="'.$url.'", tooltip="' . $url_tooltip . '"];' . "\n"; } @@ -1174,7 +1174,7 @@ function networkmap_create_module_group_node ($module_group, $simple = 0, $font_ '", fontsize='.$font_size.', style="filled", ' . 'fixedsize=true, width=0.30, height=0.30, ' . 'label=<
' . - io_safe_output($module_group['name']) . '
>, + $module_group['name'] . '>, shape="square", URL="' . $url . '", tooltip="' . $url_tooltip . '"];'; } @@ -1268,7 +1268,7 @@ function networkmap_create_module_node ($module, $simple = 0, $font_size = 10, $ 'fixedsize=true, width=0.30, height=0.30, ' . 'label=< -
' . $img_node . '
' . io_safe_output($module['nombre']) . '
>, + ' . $module['nombre'] . '>, shape="circle", URL="' . $url . '", tooltip="' . $url_tooltip . '"];'; } diff --git a/pandora_console/include/functions_pandora_networkmap.php b/pandora_console/include/functions_pandora_networkmap.php index 0bbb4dd124..e09a20f3bc 100644 --- a/pandora_console/include/functions_pandora_networkmap.php +++ b/pandora_console/include/functions_pandora_networkmap.php @@ -374,6 +374,7 @@ function networkmap_db_node_to_js_node($node, &$count, &$count_item_holding_area $item['image_width'] = (int)$image_size[0]; $item['image_height'] = (int)$image_size[1]; } + $item['raw_text'] = $node['style']['label']; $item['text'] = io_safe_output($node['style']['label']); $item['shape'] = $node['style']['shape']; switch ($node['type']) { @@ -548,7 +549,7 @@ function networkmap_links_to_js_links($relations, $nodes_graph) { $item['arrow_end'] = 'module'; $item['status_end'] = modules_get_agentmodule_status((int)$id_target_module, false, false, null); $item['id_module_end'] = (int)$id_target_module; - $text_end = io_safe_output(modules_get_agentmodule_name((int)$id_target_module)); + $text_end = modules_get_agentmodule_name((int)$id_target_module); if (preg_match ("/(.+)_ifOperStatus$/" , (string)$text_end, $matches)) { if ($matches[1]) { $item['text_end'] = $matches[1]; @@ -559,7 +560,7 @@ function networkmap_links_to_js_links($relations, $nodes_graph) { $item['arrow_start'] = 'module'; $item['status_start'] = modules_get_agentmodule_status((int)$id_source_module, false, false, null); $item['id_module_start'] = (int)$id_source_module; - $text_start = io_safe_output(modules_get_agentmodule_name((int)$id_source_module)); + $text_start = modules_get_agentmodule_name((int)$id_source_module); if (preg_match ("/(.+)_ifOperStatus$/" , (string)$text_start, $matches)) { if ($matches[1]) { $item['text_start'] = $matches[1]; @@ -874,7 +875,6 @@ function networkmap_loadfile($id = 0, $file = '', modules_get_agentmodule_agent($ids[$node_id]['id_module']); $text = modules_get_agentmodule_name($data['id_module']); - $text = io_safe_output($text); $text = ui_print_truncate_text($text, 'agent_medium', false, true, false, '...', false); @@ -885,7 +885,6 @@ function networkmap_loadfile($id = 0, $file = '', $data['id_agent'] = $ids[$node_id]['id_agent']; $text = agents_get_alias($ids[$node_id]['id_agent']); - $text = io_safe_output($text); $text = ui_print_truncate_text($text, 'agent_medium', false, true, false, '...', false); @@ -975,7 +974,7 @@ function duplicate_networkmap($id) { $values = db_get_row('tmap', 'id', $id); unset($values['id']); $free_name = false; - $values['name'] = io_safe_input(__('Copy of ') . io_safe_output($values['name'])); + $values['name'] = io_safe_input(__('Copy of ')) . $values['name']; $count = 1; while (!$free_name) { $exist = db_get_row_filter('tmap', array('name' => $values['name'])); diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 2efc81739a..26ea84367a 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -785,8 +785,8 @@ function reporting_SLA($report, $content, $type = 'dinamic', } $data = array(); - $data['agent'] = modules_get_agentmodule_agent_alias($sla['id_agent_module']); - $data['module'] = modules_get_agentmodule_name($sla['id_agent_module']); + $data['agent'] = io_safe_output(modules_get_agentmodule_agent_alias($sla['id_agent_module'])); + $data['module'] = io_safe_output(modules_get_agentmodule_name($sla['id_agent_module'])); $data['max'] = $sla['sla_max']; $data['min'] = $sla['sla_min']; $data['sla_limit'] = $sla['sla_limit']; @@ -895,8 +895,8 @@ function reporting_SLA($report, $content, $type = 'dinamic', // Slice graphs calculation if ($show_graphs) { $dataslice = array(); - $dataslice['agent'] = modules_get_agentmodule_agent_alias ($sla['id_agent_module']); - $dataslice['module'] = modules_get_agentmodule_name ($sla['id_agent_module']); + $dataslice['agent'] = io_safe_output(modules_get_agentmodule_agent_alias ($sla['id_agent_module'])); + $dataslice['module'] = io_safe_output(modules_get_agentmodule_name ($sla['id_agent_module'])); $dataslice['sla_value'] = $data['sla_value']; $dataslice['order'] = $data['sla_value']; @@ -1304,7 +1304,9 @@ function reporting_event_top_n($report, $content, $type = 'dinamic', $config['font_size'], true, $ttl, - $config['homeurl']); + $config['homeurl'], + 'white', + 'black'); } $return['resume'] = null; @@ -3976,7 +3978,7 @@ function reporting_value($report, $content, $type,$pdf) { $value .= ''. date("Y-m-d H:i:s", ($i-$content["lapse"]+1)).' to '.date("Y-m-d H:i:s",$i).''; if($i>$time_begin['utimestamp']){ - $value .= format_for_graph(reporting_get_agentmodule_data_min( + $value .= format_for_graph(reporting_get_agentmodule_data_max( $content['id_agent_module'], $content["lapse"], $i), $config['graph_precision']) . ' ' . $unit.''; } else{ diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index de10fcaf91..e76ba9399f 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -94,22 +94,27 @@ function ui_print_truncate_text($text, $numChars = GENERIC_SIZE_TEXT, $showTextI } } - $text = io_safe_output($text); - if (mb_strlen($text, "UTF-8") > ($numChars)) { + $text_html_decoded = io_safe_output($text); + $text_has_entities = $text != $text_html_decoded; + + if (mb_strlen($text_html_decoded, "UTF-8") > ($numChars)) { // '/2' because [...] is in the middle of the word. $half_length = intval(($numChars - 3) / 2); // Depending on the strange behavior of mb_strimwidth() itself, // the 3rd parameter is not to be $numChars but the length of // original text (just means 'large enough'). - $truncateText2 = mb_strimwidth($text, - (mb_strlen($text, "UTF-8") - $half_length), - mb_strlen($text, "UTF-8"), "", "UTF-8" ); + $truncateText2 = mb_strimwidth($text_html_decoded, + (mb_strlen($text_html_decoded, "UTF-8") - $half_length), + mb_strlen($text_html_decoded, "UTF-8"), "", "UTF-8" ); - $truncateText = mb_strimwidth($text, 0, - ($numChars - $half_length), "", "UTF-8") . $suffix; + $truncateText = mb_strimwidth($text_html_decoded, 0, + ($numChars - $half_length), "", "UTF-8"); - $truncateText = $truncateText . $truncateText2; + // Recover the html entities to avoid XSS attacks + $truncateText = ($text_has_entities) + ? io_safe_input($truncateText) . $suffix . io_safe_input($truncateText2) + : $truncateText . $suffix . $truncateText2; if ($showTextInTitle) { if ($style === null) { @@ -2968,6 +2973,11 @@ function ui_print_agent_autocomplete_input($parameters) { else $metaconsole_enabled = false; } + + $get_only_string_modules = false; + if (isset($parameters['get_only_string_modules'])) { + $get_only_string_modules = true; + } $spinner_image = html_print_image('images/spinner.gif', true, false, true); if (isset($parameters['spinner_image'])) { @@ -3029,7 +3039,10 @@ function ui_print_agent_autocomplete_input($parameters) { $javascript = $parameters['javascript']; } - + $get_order_json = false; + if (isset($parameters['get_order_json'])) { + $get_order_json = true; + } $javascript_is_function_select = false; //Default value if (isset($parameters['javascript_is_function_select'])) { @@ -3116,6 +3129,14 @@ function ui_print_agent_autocomplete_input($parameters) { if (' . ((int) !$metaconsole_enabled) . ') { inputs.push ("force_local_modules=1"); } + + if (' . ((int) $get_order_json) . ') { + inputs.push ("get_order_json=1"); + } + + if (' . ((int) $get_only_string_modules) . ') { + inputs.push ("get_only_string_modules=1"); + } if (' . ((int)$metaconsole_enabled) . ') { if ((' . ((int)$use_input_server) . ') diff --git a/pandora_console/include/functions_users.php b/pandora_console/include/functions_users.php index 8e3eac823b..957c8c569e 100755 --- a/pandora_console/include/functions_users.php +++ b/pandora_console/include/functions_users.php @@ -152,6 +152,8 @@ function users_get_groups_for_select($id_user, $privilege = "AR", $returnAllGro * @return array A list of the groups the user has certain privileges. */ function users_get_groups ($id_user = false, $privilege = "AR", $returnAllGroup = true, $returnAllColumns = false, $id_groups = null, $keys_field = 'id_grupo') { + static $group_cache = array(); + if (empty ($id_user)) { global $config; diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 7cdb64041e..4fc59cd684 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1140,224 +1140,180 @@ function visual_map_print_item($mode = "read", $layoutData, if ( (get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap') ) { if($width == 0){ - if (($is_string == 17) || ($is_string == 23) || ($is_string == 3) || - ($is_string == 10) || ($is_string == 33)) { - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; - } - else{ - $img = ''; - } + if ($layoutData['id_metaconsole'] != 0) { + $img = ''; } - else { - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; - } - else{ - $img = ''; - } + else{ + $img = ''; } } else{ - if (($is_string == 17) || ($is_string == 23) || ($is_string == 3) || - ($is_string == 10) || ($is_string == 33)) { - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; - } - else{ - $img = ''; - } + if ($layoutData['id_metaconsole'] != 0) { + $img = ''; } - else { - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; - } - else{ - $img = ''; - } + else{ + $img = ''; } } } else { - if (($is_string == 17) || ($is_string == 23) || ($is_string == 3) || - ($is_string == 10) || ($is_string == 33)) { + $color = array(); - $color = array(); - - $color[0] = array('border' => '#000000', - 'color' => $config['graph_color1'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[1] = array('border' => '#000000', - 'color' => $config['graph_color2'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[2] = array('border' => '#000000', - 'color' => $config['graph_color3'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[3] = array('border' => '#000000', - 'color' => $config['graph_color4'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[4] = array('border' => '#000000', - 'color' => $config['graph_color5'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[5] = array('border' => '#000000', - 'color' => $config['graph_color6'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[6] = array('border' => '#000000', - 'color' => $config['graph_color7'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[7] = array('border' => '#000000', - 'color' => $config['graph_color8'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[8] = array('border' => '#000000', - 'color' => $config['graph_color9'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[9] = array('border' => '#000000', - 'color' => $config['graph_color10'], - 'alpha' => CHART_DEFAULT_ALPHA); - $color[11] = array('border' => '#000000', - 'color' => COL_GRAPH9, - 'alpha' => CHART_DEFAULT_ALPHA); - $color[12] = array('border' => '#000000', - 'color' => COL_GRAPH10, - 'alpha' => CHART_DEFAULT_ALPHA); - $color[13] = array('border' => '#000000', - 'color' => COL_GRAPH11, - 'alpha' => CHART_DEFAULT_ALPHA); - $color[14] = array('border' => '#000000', - 'color' => COL_GRAPH12, - 'alpha' => CHART_DEFAULT_ALPHA); - $color[15] = array('border' => '#000000', - 'color' => COL_GRAPH13, - 'alpha' => CHART_DEFAULT_ALPHA); + $color[0] = array('border' => '#000000', + 'color' => $config['graph_color1'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[1] = array('border' => '#000000', + 'color' => $config['graph_color2'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[2] = array('border' => '#000000', + 'color' => $config['graph_color3'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[3] = array('border' => '#000000', + 'color' => $config['graph_color4'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[4] = array('border' => '#000000', + 'color' => $config['graph_color5'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[5] = array('border' => '#000000', + 'color' => $config['graph_color6'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[6] = array('border' => '#000000', + 'color' => $config['graph_color7'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[7] = array('border' => '#000000', + 'color' => $config['graph_color8'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[8] = array('border' => '#000000', + 'color' => $config['graph_color9'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[9] = array('border' => '#000000', + 'color' => $config['graph_color10'], + 'alpha' => CHART_DEFAULT_ALPHA); + $color[11] = array('border' => '#000000', + 'color' => COL_GRAPH9, + 'alpha' => CHART_DEFAULT_ALPHA); + $color[12] = array('border' => '#000000', + 'color' => COL_GRAPH10, + 'alpha' => CHART_DEFAULT_ALPHA); + $color[13] = array('border' => '#000000', + 'color' => COL_GRAPH11, + 'alpha' => CHART_DEFAULT_ALPHA); + $color[14] = array('border' => '#000000', + 'color' => COL_GRAPH12, + 'alpha' => CHART_DEFAULT_ALPHA); + $color[15] = array('border' => '#000000', + 'color' => COL_GRAPH13, + 'alpha' => CHART_DEFAULT_ALPHA); - $module_data = get_bars_module_data($id_module); - $water_mark = array('file' => '/var/www/html/pandora_console/images/logo_vertical_water.png', - 'url' => 'http://localhost/pandora_console/images/logo_vertical_water.png'); - - if ($width == 0) { - if ($layoutData['label_position']=='left') { - if ($layoutData['type_graph'] == 'horizontal') { - $img = '
'. - hbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']) . '
'; - } - else { - $img = '
'. - vbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true) . '
'; - } - } - elseif($layoutData['label_position']=='right') { - if ($layoutData['type_graph'] == 'horizontal') { - $img = '
'. - hbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']) . '
'; - } - else { - $img = '
'. - vbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true) . '
'; - } + $module_data = get_bars_module_data($id_module); + $water_mark = array('file' => '/var/www/html/pandora_console/images/logo_vertical_water.png', + 'url' => 'http://localhost/pandora_console/images/logo_vertical_water.png'); + + if ($width == 0 && $height == 0) { + if ($layoutData['label_position']=='left') { + if ($layoutData['type_graph'] == 'horizontal') { + $img = '
'. + hbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']) . '
'; } else { - if ($layoutData['type_graph'] == 'horizontal') { - $img = hbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']); - } - else { - $img = vbar_graph(true, $module_data, - 400, 400, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true); - } + $img = '
'. + vbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']) . '
'; } } - else{ - if ($layoutData['label_position']=='left') { - if ($layoutData['type_graph'] == 'horizontal') { - $img = '
'. - hbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']) . '
'; - } - else { - $img = '
'. - vbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true) . '
'; - } - } - elseif($layoutData['label_position']=='right') { - if ($layoutData['type_graph'] == 'horizontal') { - $img = '
'. - hbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']) . '
'; - } - else { - $img = '
'. - vbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true) . '
'; - } + elseif($layoutData['label_position']=='right') { + if ($layoutData['type_graph'] == 'horizontal') { + $img = '
'. + hbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']) . '
'; } else { - if ($layoutData['type_graph'] == 'horizontal') { - $img = hbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image']); - } - else { - $img = vbar_graph(true, $module_data, - $width, $width, $color, array(), array(), - ui_get_full_url("images/image_problem.opaque.png", false, false, false), - "", "", $water_mark, $config['fontpath'], 6, - "", 0, $config['homeurl'], $layoutData['image'], true); - } + $img = '
'. + vbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']) . '
'; + } + } + else { + if ($layoutData['type_graph'] == 'horizontal') { + $img = hbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']); + } + else { + $img = vbar_graph(true, $module_data, + 400, 400, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']); } } } - else { - if($width == 0){ - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; + else{ + if ($layoutData['label_position']=='left') { + if ($layoutData['type_graph'] == 'horizontal') { + $img = '
'. + hbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']) . '
'; } - else{ - $img = ''; + else { + $img = '
'. + vbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']) . '
'; } } - else{ - if ($layoutData['id_metaconsole'] != 0) { - $img = ''; + elseif($layoutData['label_position']=='right') { + if ($layoutData['type_graph'] == 'horizontal') { + $img = '
'. + hbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']) . '
'; } - else{ - $img = ''; + else { + $img = '
'. + vbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']) . '
'; + } + } + else { + if ($layoutData['type_graph'] == 'horizontal') { + $img = hbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], $layoutData['border_color']); + } + else { + $img = vbar_graph(true, $module_data, + $width, $height, $color, array(), array(), + ui_get_full_url("images/image_problem.opaque.png", false, false, false), + "", "", $water_mark, $config['fontpath'], 6, + "", 0, $config['homeurl'], $layoutData['image'], true, false, $layoutData['border_color']); } } } @@ -1436,10 +1392,10 @@ function visual_map_print_item($mode = "read", $layoutData, } else { if ($width == 0) { - $img = d3_donut_graph ($layoutData['id'], 400, 400, $donut_data); + $img = d3_donut_graph ($layoutData['id'], 300, 300, $donut_data, $layoutData['border_color']); } else{ - $img = d3_donut_graph ($layoutData['id'], $width, $width, $donut_data); + $img = d3_donut_graph ($layoutData['id'], $width, $width, $donut_data, $layoutData['border_color']); } } } @@ -1607,7 +1563,8 @@ function visual_map_print_item($mode = "read", $layoutData, break; case STATIC_GRAPH: case GROUP_ITEM: - if ($layoutData['image'] != null || $layoutData['show_statistics'] == 1) { + + if (($layoutData['image'] != null && $layoutData['image'] != 'none') || $layoutData['show_statistics'] == 1) { $img_style_title = strip_tags($label); @@ -1833,7 +1790,7 @@ function visual_map_print_item($mode = "read", $layoutData, } } else{ - $img = d3_progress_bar($id, $percentile, $width, 50, $border_color, $unit_text, $label, $fill_color); + $img = d3_progress_bar($id, $percentile, $width, 50, $border_color, $unit_text, io_safe_output($label), $fill_color); } echo $img; @@ -1872,10 +1829,10 @@ function visual_map_print_item($mode = "read", $layoutData, } else{ if($width == 0){ - $img = d3_progress_bubble($id, $percentile, 200,200, $border_color, $unit_text, $label, $fill_color); + $img = d3_progress_bubble($id, $percentile, 200,200, $border_color, $unit_text, io_safe_output($label), $fill_color); } else{ - $img = d3_progress_bubble($id, $percentile, $width, $width, $border_color, $unit_text, $label, $fill_color); + $img = d3_progress_bubble($id, $percentile, $width, $width, $border_color, $unit_text, io_safe_output($label), $fill_color); } } @@ -1915,10 +1872,10 @@ function visual_map_print_item($mode = "read", $layoutData, } if($width == 0){ - $img = progress_circular_bar($id, $percentile, 200,200, $border_color, $unit_text, $label, $fill_color); + $img = progress_circular_bar($id, $percentile, 200,200, $border_color, $unit_text, io_safe_output($label), $fill_color); } else{ - $img = progress_circular_bar($id, $percentile, $width, $width, $border_color, $unit_text, $label, $fill_color); + $img = progress_circular_bar($id, $percentile, $width, $width, $border_color, $unit_text, io_safe_output($label), $fill_color); } } @@ -1958,11 +1915,11 @@ function visual_map_print_item($mode = "read", $layoutData, } if($width == 0){ - $img = progress_circular_bar_interior($id, $percentile, 200,200, $border_color, $unit_text, $label, $fill_color); + $img = progress_circular_bar_interior($id, $percentile, 200,200, $border_color, $unit_text, io_safe_output($label), $fill_color); } else{ - $img = progress_circular_bar_interior($id, $percentile, $width, $width, $border_color, $unit_text, $label, $fill_color); + $img = progress_circular_bar_interior($id, $percentile, $width, $width, $border_color, $unit_text, io_safe_output($label), $fill_color); } } @@ -2044,39 +2001,25 @@ function visual_map_print_item($mode = "read", $layoutData, global $config; - if ($type == SIMPLE_VALUE) { - //~ $returnValue_value = explode(' ', $value); - - //~ if ($returnValue_value[1] != "") { - //~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])) . " " . $returnValue_value[1]; - //~ } - //~ else { - //~ $value = remove_right_zeros(number_format($returnValue_value[0], $config['graph_precision'])); - //~ } - - } - else { - // If the value is a string, dont format it - if (!is_string($value)) { - //~ $value = remove_right_zeros(format_for_graph($value, $config['graph_precision'])); - } - } - - if(get_parameter('action') == 'edit'){ - if( (strip_tags($io_safe_output_text) != '_VALUE_') || (strip_tags($io_safe_output_text) != '(_VALUE_)') ) { + $is_image = get_if_module_is_image($layoutData['id_agente_modulo']); + if(get_parameter('action') == 'edit') { + if(!$is_image) { echo $io_safe_output_text; } else { echo ""; } - } else { - if(strrpos(strip_tags($io_safe_output_text),'(_VALUE_)') !== false || (strip_tags($io_safe_output_text) == '(_VALUE_)')) { - echo str_replace(array("(_VALUE_)","(_value_)"), $value, $io_safe_output_text); + } + else { + if(!$is_image) { + $new_text = str_replace(array("(_VALUE_)","(_value_)"), $value, $io_safe_output_text); + $new_text = str_replace(array('_VALUE_','_value_'), $value, $new_text); + + echo $new_text; } - elseif(strrpos(strip_tags($io_safe_output_text),'_VALUE_') !== false || (strip_tags($io_safe_output_text) == '_VALUE_')) { - echo str_replace(array('_VALUE_','_value_'), $value, $io_safe_output_text); - } else { - echo str_replace('>', ' style="width:'.$layoutData['width'].'px">',$value); + else { + $simple_value_img = str_replace('>', ' style="width:'.$layoutData['width'].'px">', $value); + echo $simple_value_img; } } @@ -2166,6 +2109,20 @@ function visual_map_print_item($mode = "read", $layoutData, } } +function get_if_module_is_image ($id_module) { + $sql = 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $id_module; + + $result = db_get_sql($sql); + $image = strpos($result, 'data:image'); + + if($image === false){ + return false; + } + else{ + return true; + } +} + function get_bars_module_data ($id_module) { $mod_values = db_get_value_filter('datos', 'tagente_estado', array('id_agente_modulo' => $id_module)); @@ -2181,7 +2138,7 @@ function get_bars_module_data ($id_module) { $color_index = 0; $total = 0; foreach ($values as $val) { - $data = explode(":", $val); + $data = explode(",", $val); $values_to_return[$data[0]] = array('g' =>$data[1]); } @@ -2582,16 +2539,22 @@ function get_donut_module_data ($id_module) { $total = 0; foreach ($values as $val) { if ($index < $max_elements) { - $data = explode(":", $val); - $values_to_return[$index]['tag_name'] = $data[0] . ", " . $data[1]; + $data = explode(",", $val); + if ($data[1] == 0) { + $data[1] = __('No data'); + } + $values_to_return[$index]['tag_name'] = $data[0] . ": " . $data[1]; $values_to_return[$index]['color'] = $colors[$index]; $values_to_return[$index]['value'] = (int)$data[1]; $total += (int)$data[1]; $index++; } else { - $data = explode(":", $val); - $values_to_return[$index]['tag_name'] = __('Others') . ", " . $data[1]; + if ($data[1] == 0) { + $data[1] = __('No data'); + } + $data = explode(",", $val); + $values_to_return[$index]['tag_name'] = __('Others') . ": " . $data[1]; $values_to_return[$index]['color'] = $colors[$index]; $values_to_return[$index]['value'] += (int)$data[1]; $total += (int)$data[1]; @@ -2602,6 +2565,33 @@ function get_donut_module_data ($id_module) { $values_to_return[$ind]['percent'] = ($donut_data['value'] * 100) / $total; } + $new_values_to_return = array(); + while (!empty($values_to_return)) { + $first = true; + $max_elem = 0; + $max_elem_array = array(); + $index_to_del = 0; + foreach ($values_to_return as $i => $val) { + if ($first) { + $max_elem = $val['value']; + $max_elem_array = $val; + $index_to_del = $i; + $first = false; + } + else { + if ($val['value'] > $max_elem) { + $max_elem = $val['value']; + $max_elem_array = $val; + $index_to_del = $i; + } + } + } + + $new_values_to_return[] = $max_elem_array; + unset($values_to_return[$index_to_del]); + } + $values_to_return = $new_values_to_return; + return $values_to_return; } diff --git a/pandora_console/include/functions_visual_map_editor.php b/pandora_console/include/functions_visual_map_editor.php index 1333f5e73a..dfa4037f01 100755 --- a/pandora_console/include/functions_visual_map_editor.php +++ b/pandora_console/include/functions_visual_map_editor.php @@ -201,7 +201,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['image_row']['html'] = '' . __('Image') . ' ' . - html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', '', true) . + html_print_select ($images_list, 'image', '', 'showPreview(this.value);', 'None', 'none', true) . ''; @@ -246,6 +246,18 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { 'black' => __('Black'), 'transparent' => __('Transparent')), 'background_color', '', '', 0, 'white', true, false, false) . ''; + + $form_items['grid_color_row'] = array(); + $form_items['grid_color_row']['items'] = array('bars_graph'); + $form_items['grid_color_row']['html'] = + '' . + __('Grid color') . + '' . + '' . + html_print_input_text_extended ('grid_color', + '#000000', 'text-grid_color', '', 7, 7, false, + '', 'class="grid_color"', true) . + ''; $form_items['radio_choice_graph'] = array(); $form_items['radio_choice_graph']['items'] = array( @@ -278,7 +290,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['agent_row'] = array(); $form_items['agent_row']['items'] = array('static_graph', 'percentile_bar', 'percentile_item', 'module_graph', - 'simple_value', 'datos', 'auto_sla_graph', 'bars_graph', 'donut_graph'); + 'simple_value', 'datos', 'auto_sla_graph'); $form_items['agent_row']['html'] = '' . __('Agent') . ''; $params = array(); @@ -291,6 +303,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $params['use_hidden_input_idagent'] = true; $params['print_hidden_input_idagent'] = true; $params['hidden_input_idagent_name'] = 'id_agent'; + $params['get_order_json'] = true; if (defined('METACONSOLE')) { $params['javascript_ajax_page'] = '../../ajax.php'; $params['disabled_javascript_on_blur_function'] = true; @@ -307,6 +320,39 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['agent_row']['html'] .= '' . ui_print_agent_autocomplete_input($params) . ''; + + $form_items['agent_row_string'] = array(); + $form_items['agent_row_string']['items'] = array('donut_graph', 'bars_graph'); + $form_items['agent_row_string']['html'] = '' . + __('Agent') . ''; + $params = array(); + $params['return'] = true; + $params['show_helptip'] = true; + $params['input_name'] = 'agent_string'; + $params['size'] = 30; + $params['selectbox_id'] = 'module'; + $params['javascript_is_function_select'] = true; + $params['use_hidden_input_idagent'] = true; + $params['print_hidden_input_idagent'] = true; + $params['hidden_input_idagent_name'] = 'id_agent_string'; + $params['get_order_json'] = true; + $params['get_only_string_modules'] = true; + if (defined('METACONSOLE')) { + $params['javascript_ajax_page'] = '../../ajax.php'; + $params['disabled_javascript_on_blur_function'] = true; + + $params['print_input_server'] = true; + $params['print_input_id_server'] = true; + $params['input_server_id'] = 'id_server_name'; + $params['input_id_server_name'] = 'id_server_metaconsole'; + $params['input_server_value'] = ''; + $params['use_input_id_server'] = true; + $params['metaconsole_enabled'] = true; + $params['print_hidden_input_idagent'] = true; + } + $form_items['agent_row_string']['html'] .= '' . + ui_print_agent_autocomplete_input($params) . + ''; $form_items['module_row'] = array(); $form_items['module_row']['items'] = array('static_graph', @@ -318,6 +364,18 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { html_print_select(array(), 'module', '', '', __('Any'), 0, true) . ' '; + $form_items['resume_color_row'] = array(); + $form_items['resume_color_row']['items'] = array('donut_graph'); + $form_items['resume_color_row']['html'] = + '' . + __('Resume data color') . + '' . + '' . + html_print_input_text_extended ('resume_color', + '#000000', 'text-resume_color', '', 7, 7, false, + '', 'class="resume_color"', true) . + ''; + $event_times = array(86400 => __('24h'), 28800 => __('8h'), 7200 => __('2h'), @@ -401,7 +459,12 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $form_items['percentile_bar_row_1']['html'] = '' . __('Width') . ' ' . html_print_input_text('width_percentile', 0, '', 3, 5, true) . ''; - + + $form_items['height_bars_graph_row'] = array(); + $form_items['height_bars_graph_row']['items'] = array('bars_graph'); + $form_items['height_bars_graph_row']['html'] = '' . + __('Height') . ' + ' . html_print_input_text('bars_graph_height', 0, '', 3, 5, true) . ''; $form_items['percentile_bar_row_2'] = array(); $form_items['percentile_bar_row_2']['items'] = array('percentile_bar', 'percentile_item', 'datos'); @@ -644,6 +707,8 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) { $(".line_color").attachColorPicker(); $(".percentile_color").attachColorPicker(); $(".percentile_label_color").attachColorPicker(); + $(".resume_color").attachColorPicker(); + $(".grid_color").attachColorPicker(); $("input[name=radio_choice]").change(function(){ $('#count_items').html(1); @@ -704,7 +769,7 @@ function visual_map_editor_print_toolbox() { visual_map_print_button_editor('static_graph', __('Static Graph'), 'left', false, 'camera_min', true); visual_map_print_button_editor('percentile_item', __('Percentile Item'), 'left', false, 'percentile_item_min', true); visual_map_print_button_editor('module_graph', __('Module Graph'), 'left', false, 'graph_min', true); - visual_map_print_button_editor('donut_graph', __('Donut Graph'), 'left', false, 'donut_graph_min', true); + visual_map_print_button_editor('donut_graph', __('Serialized pie graph'), 'left', false, 'donut_graph_min', true); visual_map_print_button_editor('bars_graph', __('Bars Graph'), 'left', false, 'bars_graph_min', true); visual_map_print_button_editor('auto_sla_graph', __('Auto SLA Graph'), 'left', false, 'auto_sla_graph_min', true); visual_map_print_button_editor('simple_value', __('Simple Value'), 'left', false, 'binary_min', true); @@ -767,6 +832,8 @@ function visual_map_editor_print_hack_translate_strings() { __('No Max value defined.') .''; echo ''; + echo ''; echo ''; echo '