diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 68841fd03c..a18f08eada 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2012-02-27 Miguel de Dios + + * operation/integria_incidents/incident.php: added error message when + Pandora have a bad conf for the Integria API. And cleaned source code style. + + * general/footer.php, general/logon_ok.php, general/noaccess.php, + general/shortcut_bar.php, general/ui/agents_list.php, + godmode/alerts/alert_templates.php, + godmode/alerts/configure_alert_action.php, + godmode/reporting/map_builder.php, godmode/tag/edit_tag.php: cleaned source + code style. + 2012-02-28 Juan Manuel Ramon * operation/agentes/estado_ultimopaquete.php: Fixed bug in this view diff --git a/pandora_console/general/footer.php b/pandora_console/general/footer.php index 499571eb9c..8cc269e1ba 100644 --- a/pandora_console/general/footer.php +++ b/pandora_console/general/footer.php @@ -16,7 +16,8 @@ if (isset($_SERVER['REQUEST_TIME'])) { $time = $_SERVER['REQUEST_TIME']; -} else { +} +else { $time = get_system_time (); } diff --git a/pandora_console/general/logon_ok.php b/pandora_console/general/logon_ok.php index 025d9ffbea..3bd82d0401 100644 --- a/pandora_console/general/logon_ok.php +++ b/pandora_console/general/logon_ok.php @@ -51,7 +51,8 @@ if ($news !== false) { echo ''; if ($config["prominent_time"] == "timestamp") { $comparation_suffix = ""; - } else { + } + else { $comparation_suffix = __('ago'); } foreach ($news as $article) { @@ -62,7 +63,8 @@ if ($news !== false) { echo ''; } echo '
'; -} else { +} +else { echo '
'.__('No news articles at this moment').'
'; } echo ''; diff --git a/pandora_console/general/noaccess.php b/pandora_console/general/noaccess.php index 98a6012e29..67a2e769e2 100644 --- a/pandora_console/general/noaccess.php +++ b/pandora_console/general/noaccess.php @@ -14,21 +14,21 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -if (file_exists("images/noaccess.png")){ +if (file_exists("images/noaccess.png")) { ui_print_page_header (__('You don\'t have access to this page'), "", false, "", true); -} else { +} +else { echo "

".__('You don\'t have access to this page')."

"; } ?>
- - __('No access'))); - } -?> + __('No access'))); + } + ?>
 

Please know that all attempts to access this page are recorded in security logs of Pandora System Database');?>
diff --git a/pandora_console/general/shortcut_bar.php b/pandora_console/general/shortcut_bar.php index 4a2bca36d2..5ea39b2c5d 100644 --- a/pandora_console/general/shortcut_bar.php +++ b/pandora_console/general/shortcut_bar.php @@ -92,14 +92,16 @@ if ($shortcut_state == 2){ echo "
"; - }else{ + } + else{ echo "
"; } html_print_image("images/pandora_textlogo.png", false, array("title" => __("Press here to activate shortcut bar"))); echo "
"; if ($shortcut_state == 2){ echo "
"; - } else { + } + else { echo "
"; } @@ -214,7 +216,8 @@ // This will show and hide the shortcut value in Javascript code if (isset($_POST['nick']) and $shortcut_state != 2){ html_print_input_hidden("login_console", 1); - } else { + } + else { html_print_input_hidden("login_console", 0); } @@ -230,11 +233,13 @@ $('#shortcut_button').css({height: 22}).animate({ height: '40' }, 900); $('#shotcut_bar').css({height: 20}).animate({ height: '0' }, 900); $('#shortcut_button').css({height:40}).animate({ height: '22' }, 900); - } else { + } + else { if ($('#shotcut_bar').css('height') == '0px'){ $('#shotcut_bar').css('height', '0px'); $('#shortcut_button').css('height', '22px'); - }else{ + } + else{ $('#shotcut_bar').css('height', '20px'); $('#shortcut_button').css('height', '40px'); } @@ -252,7 +257,8 @@ function (data) { } ); - } else { + } + else { $('#shotcut_bar').css({height: 20}).animate({ height: '0' }, 900); $('#shortcut_button').css({height: 40}).animate({ height: '22' }, 900); jQuery.post ("ajax.php", diff --git a/pandora_console/general/ui/agents_list.php b/pandora_console/general/ui/agents_list.php index f3e6d60c4a..3e51597d88 100644 --- a/pandora_console/general/ui/agents_list.php +++ b/pandora_console/general/ui/agents_list.php @@ -140,7 +140,8 @@ if ($agents !== false) { foreach ($table_renders as $name => $values) { if (! is_numeric ($name)) { array_push ($data, renders_agent_field ($agent, $name, $values, true)); - } else { + } + else { array_push ($data, renders_agent_field ($agent, $values, false, true)); } } diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index 97f9db0776..70540994a1 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -64,11 +64,13 @@ if ($copy_action) { "Trying to access Alert Management"); require ("general/noaccess.php"); exit; - }else + } + else { // Header ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "", true); - // If user tries to copy an action of others groups - }else{ + } + } // If user tries to copy an action of others groups + else { $own_info = get_user_info ($config['id_user']); if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) $own_groups = array_keys(users_get_groups($config['id_user'], "LM")); @@ -79,7 +81,7 @@ if ($copy_action) { if ($is_in_group) // Header ui_print_page_header (__('Alerts').' » '.__('Alert actions'), "images/god2.png", false, "", true); - else{ + else { db_pandora_audit("ACL Violation", "Trying to access Alert Management"); require ("general/noaccess.php"); diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index 1c699432dc..e41b1d1bd5 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -146,11 +146,13 @@ if ($delete_template) { "Trying to access Alert Management"); require ("general/noaccess.php"); exit; - }else + } + else // Header ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "", true); - // If user tries to delete a template of others groups - }else{ + + } // If user tries to delete a template of others groups + else { $own_info = get_user_info ($config['id_user']); if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) $own_groups = array_keys(users_get_groups($config['id_user'], "LM")); @@ -161,14 +163,14 @@ if ($delete_template) { if ($is_in_group) // Header ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "", true); - else{ + else { db_pandora_audit("ACL Violation", "Trying to access Alert Management"); require ("general/noaccess.php"); exit; } } - }else + } else // Header ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "", true); diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 74ab9b63da..8f51f3e02a 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -29,7 +29,8 @@ if ($delete_layout) { if ($result) { echo '

'.__('Successfully deleted').'

'; db_clean_cache(); - } else { + } + else { echo '

'.__('Not deleted. Error deleting data').'

'; } $id_layout = 0; @@ -149,7 +150,8 @@ else if (!$maps) { echo '
'.('No maps defined').'
'; -} else { +} +else { foreach ($maps as $map) { if (check_acl ($config['id_user'], $map['id_group'], "IW")) { $data = array (); diff --git a/pandora_console/godmode/tag/edit_tag.php b/pandora_console/godmode/tag/edit_tag.php index 8d463465e9..db3022cc3a 100644 --- a/pandora_console/godmode/tag/edit_tag.php +++ b/pandora_console/godmode/tag/edit_tag.php @@ -106,9 +106,8 @@ if ($action == "update" && $id_tag != 0){ $name_tag = $result_tag["name"]; $description_tag = $result_tag["description"]; $url_tag = $result_tag["url"]; - -// If current action is create (new) or somethig goes wrong fields are filled with void value -}else{ +} // If current action is create (new) or somethig goes wrong fields are filled with void value +else { $name_tag = ""; $description_tag = ""; $url_tag = ""; diff --git a/pandora_console/operation/integria_incidents/incident.php b/pandora_console/operation/integria_incidents/incident.php index 679db8c52a..03057e1b57 100755 --- a/pandora_console/operation/integria_incidents/incident.php +++ b/pandora_console/operation/integria_incidents/incident.php @@ -153,7 +153,7 @@ $delete_file = get_parameter('delete_file', 0); if($delete_file != 0) { $url = $integria_api."&op=delete_file¶ms=".$delete_file; - + // Call the integria API $result = incidents_call_api($url); } @@ -162,7 +162,7 @@ $delete_incident = get_parameter('delete_incident', 0); if($delete_incident != 0) { $url = $integria_api."&op=delete_incident¶ms=".$delete_incident; - + // Call the integria API $result = incidents_call_api($url); } @@ -259,7 +259,6 @@ if(xml_parse(xml_parser_create(), $xml)) { $result_sources = incidents_xml_to_array(incidents_call_api($url_sources)); $result_groups = incidents_xml_to_array(incidents_call_api($url_groups)); $result_users = incidents_xml_to_array(incidents_call_api($url_users)); - require_once('incident.incident.php'); break; case 'workunits': @@ -273,7 +272,9 @@ if(xml_parse(xml_parser_create(), $xml)) { break; } } - +else { + ui_print_error_message(__("There is a error in the message from your Integria or there is not connection.")); +} echo '
 
'; ?>