2012-02-27 Miguel de Dios <miguel.dedios@artica.es>

* 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.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5660 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-02-28 11:48:45 +00:00
parent 692e49c57b
commit 435503360f
11 changed files with 64 additions and 36 deletions

View File

@ -1,3 +1,15 @@
2012-02-27 Miguel de Dios <miguel.dedios@artica.es>
* 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 <juanmanuel.ramon@artica.es> 2012-02-28 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* operation/agentes/estado_ultimopaquete.php: Fixed bug in this view * operation/agentes/estado_ultimopaquete.php: Fixed bug in this view

View File

@ -16,7 +16,8 @@
if (isset($_SERVER['REQUEST_TIME'])) { if (isset($_SERVER['REQUEST_TIME'])) {
$time = $_SERVER['REQUEST_TIME']; $time = $_SERVER['REQUEST_TIME'];
} else { }
else {
$time = get_system_time (); $time = get_system_time ();
} }

View File

@ -51,7 +51,8 @@ if ($news !== false) {
echo '<table cellpadding="4" cellspacing="4" class="databox">'; echo '<table cellpadding="4" cellspacing="4" class="databox">';
if ($config["prominent_time"] == "timestamp") { if ($config["prominent_time"] == "timestamp") {
$comparation_suffix = ""; $comparation_suffix = "";
} else { }
else {
$comparation_suffix = __('ago'); $comparation_suffix = __('ago');
} }
foreach ($news as $article) { foreach ($news as $article) {
@ -62,7 +63,8 @@ if ($news !== false) {
echo '</td></tr>'; echo '</td></tr>';
} }
echo '</table>'; echo '</table>';
} else { }
else {
echo '<div>'.__('No news articles at this moment').'</div>'; echo '<div>'.__('No news articles at this moment').'</div>';
} }
echo '</div>'; echo '</div>';

View File

@ -14,21 +14,21 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // 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); ui_print_page_header (__('You don\'t have access to this page'), "", false, "", true);
} else { }
else {
echo "<br><br><center><h3>".__('You don\'t have access to this page')."</h3></center>"; echo "<br><br><center><h3>".__('You don\'t have access to this page')."</h3></center>";
} }
?> ?>
<div id="noaccess"> <div id="noaccess">
<div align='center'> <div align='center'>
<?php
<?php if (file_exists("images/noaccess.png")) {
if (file_exists("images/noaccess.png")){
echo html_print_image('images/noaccess.png', true, array("alt" => __('No access'))); echo html_print_image('images/noaccess.png', true, array("alt" => __('No access')));
} }
?> ?>
<div>&nbsp;</div> <div>&nbsp;</div>
<div class="msg" style='width: 400px'><?php echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');?></div> <div class="msg" style='width: 400px'><?php echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');?></div>
</div> </div>

View File

@ -92,14 +92,16 @@
if ($shortcut_state == 2){ if ($shortcut_state == 2){
echo "<div id='shortcut_button' style='position: fixed; overflow: hidden; bottom: 0px; left: 0px; width: 185px; height: 40px; background-color: #FFFFFF; border: 1px solid #808080; border-top-left-radius: 10px; border-top-right-radius: 10px;'>"; echo "<div id='shortcut_button' style='position: fixed; overflow: hidden; bottom: 0px; left: 0px; width: 185px; height: 40px; background-color: #FFFFFF; border: 1px solid #808080; border-top-left-radius: 10px; border-top-right-radius: 10px;'>";
}else{ }
else{
echo "<div id='shortcut_button' style='position: fixed; overflow: hidden; bottom: 0px; left: 0px; width: 185px; height: 0px; background-color: #FFFFFF; border: 1px solid #808080; border-top-left-radius: 10px; border-top-right-radius: 10px;'>"; echo "<div id='shortcut_button' style='position: fixed; overflow: hidden; bottom: 0px; left: 0px; width: 185px; height: 0px; background-color: #FFFFFF; border: 1px solid #808080; border-top-left-radius: 10px; border-top-right-radius: 10px;'>";
} }
html_print_image("images/pandora_textlogo.png", false, array("title" => __("Press here to activate shortcut bar"))); html_print_image("images/pandora_textlogo.png", false, array("title" => __("Press here to activate shortcut bar")));
echo "</div>"; echo "</div>";
if ($shortcut_state == 2){ if ($shortcut_state == 2){
echo "<div id='shotcut_bar' style='position: fixed; overflow:hidden; bottom: 0px; left: 0px; width:100%; height: 20px; background-color:#DCDCDC; border: 1px solid #808080;'>"; echo "<div id='shotcut_bar' style='position: fixed; overflow:hidden; bottom: 0px; left: 0px; width:100%; height: 20px; background-color:#DCDCDC; border: 1px solid #808080;'>";
} else { }
else {
echo "<div id='shotcut_bar' style='position: fixed; overflow:hidden; bottom: 0px; left: 0px; width:100%; height: 0px; background-color:#DCDCDC; border: 1px solid #808080;'>"; echo "<div id='shotcut_bar' style='position: fixed; overflow:hidden; bottom: 0px; left: 0px; width:100%; height: 0px; background-color:#DCDCDC; border: 1px solid #808080;'>";
} }
@ -214,7 +216,8 @@
// This will show and hide the shortcut value in Javascript code // This will show and hide the shortcut value in Javascript code
if (isset($_POST['nick']) and $shortcut_state != 2){ if (isset($_POST['nick']) and $shortcut_state != 2){
html_print_input_hidden("login_console", 1); html_print_input_hidden("login_console", 1);
} else { }
else {
html_print_input_hidden("login_console", 0); html_print_input_hidden("login_console", 0);
} }
@ -230,11 +233,13 @@
$('#shortcut_button').css({height: 22}).animate({ height: '40' }, 900); $('#shortcut_button').css({height: 22}).animate({ height: '40' }, 900);
$('#shotcut_bar').css({height: 20}).animate({ height: '0' }, 900); $('#shotcut_bar').css({height: 20}).animate({ height: '0' }, 900);
$('#shortcut_button').css({height:40}).animate({ height: '22' }, 900); $('#shortcut_button').css({height:40}).animate({ height: '22' }, 900);
} else { }
else {
if ($('#shotcut_bar').css('height') == '0px'){ if ($('#shotcut_bar').css('height') == '0px'){
$('#shotcut_bar').css('height', '0px'); $('#shotcut_bar').css('height', '0px');
$('#shortcut_button').css('height', '22px'); $('#shortcut_button').css('height', '22px');
}else{ }
else{
$('#shotcut_bar').css('height', '20px'); $('#shotcut_bar').css('height', '20px');
$('#shortcut_button').css('height', '40px'); $('#shortcut_button').css('height', '40px');
} }
@ -252,7 +257,8 @@
function (data) { function (data) {
} }
); );
} else { }
else {
$('#shotcut_bar').css({height: 20}).animate({ height: '0' }, 900); $('#shotcut_bar').css({height: 20}).animate({ height: '0' }, 900);
$('#shortcut_button').css({height: 40}).animate({ height: '22' }, 900); $('#shortcut_button').css({height: 40}).animate({ height: '22' }, 900);
jQuery.post ("ajax.php", jQuery.post ("ajax.php",

View File

@ -140,7 +140,8 @@ if ($agents !== false) {
foreach ($table_renders as $name => $values) { foreach ($table_renders as $name => $values) {
if (! is_numeric ($name)) { if (! is_numeric ($name)) {
array_push ($data, renders_agent_field ($agent, $name, $values, true)); array_push ($data, renders_agent_field ($agent, $name, $values, true));
} else { }
else {
array_push ($data, renders_agent_field ($agent, $values, false, true)); array_push ($data, renders_agent_field ($agent, $values, false, true));
} }
} }

View File

@ -64,11 +64,13 @@ if ($copy_action) {
"Trying to access Alert Management"); "Trying to access Alert Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
}else }
else {
// Header // Header
ui_print_page_header (__('Alerts').' &raquo; '.__('Alert actions'), "images/god2.png", false, "", true); ui_print_page_header (__('Alerts').' &raquo; '.__('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']); $own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
$own_groups = array_keys(users_get_groups($config['id_user'], "LM")); $own_groups = array_keys(users_get_groups($config['id_user'], "LM"));
@ -79,7 +81,7 @@ if ($copy_action) {
if ($is_in_group) if ($is_in_group)
// Header // Header
ui_print_page_header (__('Alerts').' &raquo; '.__('Alert actions'), "images/god2.png", false, "", true); ui_print_page_header (__('Alerts').' &raquo; '.__('Alert actions'), "images/god2.png", false, "", true);
else{ else {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Alert Management"); "Trying to access Alert Management");
require ("general/noaccess.php"); require ("general/noaccess.php");

View File

@ -146,11 +146,13 @@ if ($delete_template) {
"Trying to access Alert Management"); "Trying to access Alert Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
}else }
else
// Header // Header
ui_print_page_header (__('Alerts')." &raquo; ". __('Alert templates'), "images/god2.png", false, "", true); ui_print_page_header (__('Alerts')." &raquo; ". __('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']); $own_info = get_user_info ($config['id_user']);
if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
$own_groups = array_keys(users_get_groups($config['id_user'], "LM")); $own_groups = array_keys(users_get_groups($config['id_user'], "LM"));
@ -161,14 +163,14 @@ if ($delete_template) {
if ($is_in_group) if ($is_in_group)
// Header // Header
ui_print_page_header (__('Alerts')." &raquo; ". __('Alert templates'), "images/god2.png", false, "", true); ui_print_page_header (__('Alerts')." &raquo; ". __('Alert templates'), "images/god2.png", false, "", true);
else{ else {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Alert Management"); "Trying to access Alert Management");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
} }
} }
}else } else
// Header // Header
ui_print_page_header (__('Alerts')." &raquo; ". __('Alert templates'), "images/god2.png", false, "", true); ui_print_page_header (__('Alerts')." &raquo; ". __('Alert templates'), "images/god2.png", false, "", true);

View File

@ -29,7 +29,8 @@ if ($delete_layout) {
if ($result) { if ($result) {
echo '<h3 class="suc">'.__('Successfully deleted').'</h3>'; echo '<h3 class="suc">'.__('Successfully deleted').'</h3>';
db_clean_cache(); db_clean_cache();
} else { }
else {
echo '<h3 class="error">'.__('Not deleted. Error deleting data').'</h3>'; echo '<h3 class="error">'.__('Not deleted. Error deleting data').'</h3>';
} }
$id_layout = 0; $id_layout = 0;
@ -149,7 +150,8 @@ else
if (!$maps) { if (!$maps) {
echo '<div class="nf">'.('No maps defined').'</div>'; echo '<div class="nf">'.('No maps defined').'</div>';
} else { }
else {
foreach ($maps as $map) { foreach ($maps as $map) {
if (check_acl ($config['id_user'], $map['id_group'], "IW")) { if (check_acl ($config['id_user'], $map['id_group'], "IW")) {
$data = array (); $data = array ();

View File

@ -106,9 +106,8 @@ if ($action == "update" && $id_tag != 0){
$name_tag = $result_tag["name"]; $name_tag = $result_tag["name"];
$description_tag = $result_tag["description"]; $description_tag = $result_tag["description"];
$url_tag = $result_tag["url"]; $url_tag = $result_tag["url"];
} // If current action is create (new) or somethig goes wrong fields are filled with void value
// If current action is create (new) or somethig goes wrong fields are filled with void value else {
}else{
$name_tag = ""; $name_tag = "";
$description_tag = ""; $description_tag = "";
$url_tag = ""; $url_tag = "";

View File

@ -259,7 +259,6 @@ if(xml_parse(xml_parser_create(), $xml)) {
$result_sources = incidents_xml_to_array(incidents_call_api($url_sources)); $result_sources = incidents_xml_to_array(incidents_call_api($url_sources));
$result_groups = incidents_xml_to_array(incidents_call_api($url_groups)); $result_groups = incidents_xml_to_array(incidents_call_api($url_groups));
$result_users = incidents_xml_to_array(incidents_call_api($url_users)); $result_users = incidents_xml_to_array(incidents_call_api($url_users));
require_once('incident.incident.php'); require_once('incident.incident.php');
break; break;
case 'workunits': case 'workunits':
@ -273,7 +272,9 @@ if(xml_parse(xml_parser_create(), $xml)) {
break; break;
} }
} }
else {
ui_print_error_message(__("There is a error in the message from your Integria or there is not connection."));
}
echo '<div style="clear:both">&nbsp;</div>'; echo '<div style="clear:both">&nbsp;</div>';
?> ?>