diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7004cd0765..7d7067a138 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,16 @@ +2012-06-27 Vanessa Gil + + * extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql, + extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql, + extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql, + pandoradb_data.sql, + pandoradb_data.oracle.sql, + pandoradb_data.postgreSQL.sql, + general/header.php, + godmode/setup/setup_visuals.php, + include/functions_config.php: Disable autorefresh by default except + some pages. + 2012-08-27 Sergio Martin * godmode/alerts/alert_commands.php: Fixed a little bugs diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql index d3bae4d348..1c907e5698 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql @@ -221,7 +221,8 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('enable_pass_policy_admin', 0), ('enable_pass_history', 0), ('compare_pass', 3), - ('meta_style', 'meta_pandora'); + ('meta_style', 'meta_pandora'), + ('enable_refr', 0); -- ----------------------------------------------------- -- Table `tpassword_history` diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql index 5419492057..f4c1d312e1 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql @@ -220,6 +220,7 @@ INSERT INTO tconfig (token, value) VALUES ('enable_pass_policy_admin', 0); INSERT INTO tconfig (token, value) VALUES ('enable_pass_history', 0); INSERT INTO tconfig (token, value) VALUES ('compare_pass', 3); INSERT INTO tconfig (token, value) VALUES ('meta_style', 'meta_pandora'); +INSERT INTO tconfig (token, value) VALUES ('enable_refr', 0); -- ----------------------------------------------------- -- Table `tpassword_history` diff --git a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql index 37d33165eb..a71ad9a99c 100644 --- a/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql +++ b/pandora_console/extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql @@ -220,7 +220,8 @@ INSERT INTO "tconfig" ("token", "value") VALUES ('enable_pass_policy_admin', 0), ('enable_pass_history', 0), ('compare_pass', 3), -('meta_style', 'meta_pandora'); +('meta_style', 'meta_pandora'), +('enable_refr', 0); -- ----------------------------------------------------- -- Table `tpassword_history` diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 6dc04ee7c5..a284713136 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -130,11 +130,38 @@ config_check(); false, 'code' => false); - if ($config["refr"]) { - $ignored_params['refr'] = 0; - echo '' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . ' '. __('Autorefresh'); - echo ' ('.date ("i:s", $config["refr"]).')'; - echo ''; + if ($config["refr"]) {//autorefresh interval + $ignored_params['refr'] = 0; + if (($config['enable_refr']) || (($_GET['sec2'] == 'operation/agentes/tactical') || ($_GET['sec2'] == 'operation/agentes/estado_agente') || + ($_GET['sec2'] == 'operation/agentes/group_view') || ($_GET['sec2'] == 'operation/events/events') || + ($_GET['sec2'] == 'enterprise/dashboard/main_dashboard'))) { //enable autorefresh to all pages or default pages + + echo '' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . ' '. __('Autorefresh'); + echo ' ('.date ("i:s", $config["refr"]).')'; + echo ''; + + } + else { + + $ignored_params['refr'] = ''; + echo '' . html_print_image("images/page_refresh.png", true, array("class" => 'bot', "alt" => 'lightning')) . ' '. __('Autorefresh').''; + $values = array ( + '5' => __('5 seconds'), + '10' => __('10 seconds'), + '15' => __('15 seconds'), + '30' => __('30 seconds'), + (string)SECONDS_1MINUTE => __('1 minute'), + (string)SECONDS_2MINUTES => __('2 minutes'), + (string)SECONDS_5MINUTES => __('5 minutes'), + (string)SECONDS_15MINUTES => __('15 minutes'), + (string)SECONDS_30MINUTES => __('30 minutes'), + (string)SECONDS_1HOUR => __('1 hour')); + echo ''; + + } } else { $ignored_params['refr'] = ''; @@ -267,6 +294,7 @@ ui_require_jquery_file('jquery-ui-1.8.17.custom.min'); $("select#ref").change (function () { href = $(a).attr ("href"); $(document).attr ("location", href + this.value); + }); return false; @@ -276,4 +304,4 @@ ui_require_jquery_file('jquery-ui-1.8.17.custom.min'); ?> }); /* ]]> */ - \ No newline at end of file + diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 66805d4604..6694ffd6d4 100644 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -119,30 +119,34 @@ $values[SECONDS_5MINUTES] = human_time_description_raw(SECONDS_5MINUTES); $values[SECONDS_10MINUTES] = human_time_description_raw(SECONDS_10MINUTES); $values[SECONDS_30MINUTES] = human_time_description_raw(SECONDS_30MINUTES); -$table->data[15][0] = __('Global default interval for refresh') . ui_print_help_tip(__('This interval will affect all pages'), true); -$table->data[15][1] = html_print_select ($values, 'refr', $config["refr"], '', 'N/A', 0, true, false, false); +$table->data[15][0] = __('Enable refresh for all pages'); +$table->data[15][1] = __('Yes').' '.html_print_radio_button ('enable_refr', 1, '', $config["enable_refr"], true).'  '; +$table->data[15][1] .= __('No').' '.html_print_radio_button ('enable_refr', 0, '', $config["enable_refr"], true); -$table->data[16][0] = __('Default interval for refresh on Visual Console') . ui_print_help_tip(__('This interval will affect to Visual Console pages'), true); -$table->data[16][1] = html_print_select ($values, 'vc_refr', $config["vc_refr"], '', 'N/A', 0, true, false, false); +$table->data[16][0] = __('Global default interval for refresh') . ui_print_help_tip(__('This interval will affect all pages'), true); +$table->data[16][1] = html_print_select ($values, 'refr', $config["refr"], '', 'N/A', 0, true, false, false); -$table->data[17][0] = __('Agent size text') . ui_print_help_tip(__('When the agent name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true); -$table->data[17][1] = __('Small:') . html_print_input_text ('agent_size_text_small', $config["agent_size_text_small"], '', 3, 3, true); -$table->data[17][1] .= ' ' . __('Normal:') . html_print_input_text ('agent_size_text_medium', $config["agent_size_text_medium"], '', 3, 3, true); +$table->data[17][0] = __('Default interval for refresh on Visual Console') . ui_print_help_tip(__('This interval will affect to Visual Console pages'), true); +$table->data[17][1] = html_print_select ($values, 'vc_refr', $config["vc_refr"], '', 'N/A', 0, true, false, false); -$table->data[18][0] = __('Module size text') . ui_print_help_tip(__('When the module name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true); -$table->data[18][1] = __('Small:') . html_print_input_text ('module_size_text_small', $config["module_size_text_small"], '', 3, 3, true); -$table->data[18][1] .= ' ' . __('Normal:') . html_print_input_text ('module_size_text_medium', $config["module_size_text_medium"], '', 3, 3, true); +$table->data[18][0] = __('Agent size text') . ui_print_help_tip(__('When the agent name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true); +$table->data[18][1] = __('Small:') . html_print_input_text ('agent_size_text_small', $config["agent_size_text_small"], '', 3, 3, true); +$table->data[18][1] .= ' ' . __('Normal:') . html_print_input_text ('agent_size_text_medium', $config["agent_size_text_medium"], '', 3, 3, true); -$table->data[19][0] = __('Description size text') . ui_print_help_tip(__('When the description name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true); -$table->data[19][1] = html_print_input_text ('description_size_text', $config["description_size_text"], '', 3, 3, true); +$table->data[19][0] = __('Module size text') . ui_print_help_tip(__('When the module name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true); +$table->data[19][1] = __('Small:') . html_print_input_text ('module_size_text_small', $config["module_size_text_small"], '', 3, 3, true); +$table->data[19][1] .= ' ' . __('Normal:') . html_print_input_text ('module_size_text_medium', $config["module_size_text_medium"], '', 3, 3, true); -$table->data[20][0] = __('Item title size text') . ui_print_help_tip(__('When the item title name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true); -$table->data[20][1] = html_print_input_text ('item_title_size_text', $config["item_title_size_text"], '', 3, 3, true); +$table->data[20][0] = __('Description size text') . ui_print_help_tip(__('When the description name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true); +$table->data[20][1] = html_print_input_text ('description_size_text', $config["description_size_text"], '', 3, 3, true); + +$table->data[21][0] = __('Item title size text') . ui_print_help_tip(__('When the item title name have a lot of characters, in some places in Pandora Console it is necesary truncate to N characters.'), true); +$table->data[21][1] = html_print_input_text ('item_title_size_text', $config["item_title_size_text"], '', 3, 3, true); -$table->data[21][0] = __('GIS Labels') . ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true); -$table->data[21][1] = __('Yes').' '.html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).'  '; -$table->data[21][1] .= __('No').' '.html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true); +$table->data[22][0] = __('GIS Labels') . ui_print_help_tip(__('This enabling this, you get a label with agent name in GIS maps. If you have lots of agents in the map, will be unreadable. Disabled by default.'), true); +$table->data[22][1] = __('Yes').' '.html_print_radio_button ('gis_label', 1, '', $config["gis_label"], true).'  '; +$table->data[22][1] .= __('No').' '.html_print_radio_button ('gis_label', 0, '', $config["gis_label"], true); $listIcons = gis_get_array_list_icons(); @@ -152,7 +156,7 @@ foreach ($listIcons as $index => $value) $arraySelectIcon[$index] = $index; $path = 'images/gis_map/icons/'; //TODO set better method the path -$table->data[22][0] = __('Default icon in GIS') . ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true); +$table->data[23][0] = __('Default icon in GIS') . ui_print_help_tip(__('Agent icon for GIS Maps. If set to "none", group icon will be used'), true); $gis_default_icon = $config["gis_default_icon"]; @@ -174,7 +178,7 @@ else { $path_warning = $path . $gis_default_icon . ".warning.png"; } -$table->data[22][1] = html_print_select($arraySelectIcon, "gis_default_icon", $gis_default_icon, "changeIcons();", __('None'), '', true) . ' ' . html_print_image($path_ok, true, array("id" => "icon_ok", "style" => "display:".$display_icons.";")) . ' ' . html_print_image($path_bad, true, array("id" => "icon_bad", "style" => "display:".$display_icons.";")) . ' ' . html_print_image($path_warning, true, array("id" => "icon_warning", "style" => "display:".$display_icons.";")); +$table->data[23][1] = html_print_select($arraySelectIcon, "gis_default_icon", $gis_default_icon, "changeIcons();", __('None'), '', true) . ' ' . html_print_image($path_ok, true, array("id" => "icon_ok", "style" => "display:".$display_icons.";")) . ' ' . html_print_image($path_bad, true, array("id" => "icon_bad", "style" => "display:".$display_icons.";")) . ' ' . html_print_image($path_warning, true, array("id" => "icon_warning", "style" => "display:".$display_icons.";")); echo '
'; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 1b0e426728..b80c538387 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -224,6 +224,7 @@ function config_update_config () { config_update_value ('font_size', get_parameter('font_size')); config_update_value ('flash_charts', (bool) get_parameter ('flash_charts')); config_update_value ('custom_logo', (string) get_parameter ('custom_logo')); + config_update_value ('enable_refr', get_parameter('enable_refr')); config_update_value ('refr', get_parameter('refr')); config_update_value ('vc_refr', get_parameter('vc_refr')); config_update_value ('agent_size_text_small', get_parameter('agent_size_text_small')); @@ -675,6 +676,10 @@ function config_process_config () { config_update_value ('dbtype', 'mysql'); } + if (!isset ($config['enable_refr'])) { + config_update_value ('enable_refr', 0); + } + if (!isset ($config['vc_refr'])) { config_update_value ('vc_refr', 60); } diff --git a/pandora_console/pandoradb.data.oracle.sql b/pandora_console/pandoradb.data.oracle.sql index 553c1081a8..0ffc45b246 100644 --- a/pandora_console/pandoradb.data.oracle.sql +++ b/pandora_console/pandoradb.data.oracle.sql @@ -104,6 +104,7 @@ INSERT INTO tconfig (token, value) VALUES ('enable_pass_policy_admin', 0); INSERT INTO tconfig (token, value) VALUES ('enable_pass_history', 0); INSERT INTO tconfig (token, value) VALUES ('compare_pass', 3); INSERT INTO tconfig (token, value) VALUES ('meta_style', 'meta_pandora'); +INSERT INTO tconfig (token, value) VALUES ('enable_refr', 0); COMMIT; END;; diff --git a/pandora_console/pandoradb.data.postgreSQL.sql b/pandora_console/pandoradb.data.postgreSQL.sql index 6fcba428fb..70e4fc4a8b 100644 --- a/pandora_console/pandoradb.data.postgreSQL.sql +++ b/pandora_console/pandoradb.data.postgreSQL.sql @@ -99,7 +99,8 @@ INSERT INTO "tconfig" ("token", "value") VALUES ('enable_pass_policy_admin', 0), ('enable_pass_history', 0), ('compare_pass', 3), -('meta_style', 'meta_pandora'); +('meta_style', 'meta_pandora'), +('enable_refr', '0'); COMMIT WORK; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 7eb3786182..4567769bba 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -98,7 +98,8 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('enable_pass_policy_admin', 0), ('enable_pass_history', 0), ('compare_pass', 3), -('meta_style', 'meta_pandora'); +('meta_style', 'meta_pandora'), +('enable_refr', 0); UNLOCK TABLES;