2012-07-24 Miguel de Dios <miguel.dedios@artica.es>

* godmode/setup/file_manager.php, godmode/setup/news.php,
	godmode/users/configure_user.php, godmode/users/user_list.php,
	godmode/massive/massive_copy_modules.php,
	godmode/massive/massive_enable_disable_alerts.php,
	godmode/massive/massive_delete_action_alerts.php,
	godmode/massive/massive_delete_alerts.php,
	godmode/modules/manage_network_templates_form.php,
	godmode/modules/manage_nc_groups.php,
	godmode/modules/manage_nc_groups_form.php,
	godmode/modules/manage_network_templates.php,
	godmode/netflow/nf_edit.php, godmode/netflow/nf_edit_form.php,
	godmode/netflow/nf_item_list.php,
	godmode/netflow/nf_report_item.php, godmode/netflow/nf.php,
	operation/incidents/incident.php,
	operation/incidents/incident_detail.php,
	operation/agentes/estado_agente.php, operation/agentes/sla_view.php,
	operation/agentes/tactical.php,
	operation/agentes/estado_generalagente.php,
	operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
	operation/integria_incidents/incident_detail.php,
	operation/gis_maps/index.php, operation/events/events_list.php,
	operation/events/events.php, operation/messages/message_edit.php,
	operation/messages/message_list.php,
	operation/reporting/graph_viewer.php, operation/search_reports.php,
	operation/netflow/nf_view.php: cleaned source code.
	
	* godmode/massive/massive_operations.php,
	godmode/massive/massive_edit_modules.php: fixed the massive edition
	of "any" module in agents.
	
	Fixes: #3543484




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6806 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-07-24 16:38:48 +00:00
parent 16827d10cc
commit b11e18e18d
37 changed files with 483 additions and 408 deletions

View File

@ -1,3 +1,37 @@
2012-07-24 Miguel de Dios <miguel.dedios@artica.es>
* godmode/setup/file_manager.php, godmode/setup/news.php,
godmode/users/configure_user.php, godmode/users/user_list.php,
godmode/massive/massive_copy_modules.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_delete_action_alerts.php,
godmode/massive/massive_delete_alerts.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_nc_groups.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/netflow/nf_edit.php, godmode/netflow/nf_edit_form.php,
godmode/netflow/nf_item_list.php,
godmode/netflow/nf_report_item.php, godmode/netflow/nf.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/agentes/estado_agente.php, operation/agentes/sla_view.php,
operation/agentes/tactical.php,
operation/agentes/estado_generalagente.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
operation/integria_incidents/incident_detail.php,
operation/gis_maps/index.php, operation/events/events_list.php,
operation/events/events.php, operation/messages/message_edit.php,
operation/messages/message_list.php,
operation/reporting/graph_viewer.php, operation/search_reports.php,
operation/netflow/nf_view.php: cleaned source code.
* godmode/massive/massive_operations.php,
godmode/massive/massive_edit_modules.php: fixed the massive edition
of "any" module in agents.
Fixes: #3543484
2012-07-24 Juan Manuel Ramon <juanmanuel.ramon@artica.es> 2012-07-24 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_agents.php * include/functions_agents.php

View File

@ -243,7 +243,8 @@ $(document).ready (function () {
function (data, status) { function (data, status) {
if (data.length == 0) { if (data.length == 0) {
no_modules = true; no_modules = true;
} else { }
else {
jQuery.each (data, function (i, val) { jQuery.each (data, function (i, val) {
option = $("<option></option>") option = $("<option></option>")
.attr ("value", val["id_agente_modulo"]) .attr ("value", val["id_agente_modulo"])

View File

@ -65,10 +65,11 @@ if ($delete) {
$alerts_agent_modules = array_merge($alerts_agent_modules, alerts_get_alerts_agent_module ($agent_alert['id_agent_module'], true, false, 'id')); $alerts_agent_modules = array_merge($alerts_agent_modules, alerts_get_alerts_agent_module ($agent_alert['id_agent_module'], true, false, 'id'));
} }
} }
if (empty($alerts_agent_modules)) { if (empty($alerts_agent_modules)) {
ui_print_result_message (false, '', __('Could not be deleted').". ".__('No alerts selected')); ui_print_result_message (false, '', __('Could not be deleted').". ".__('No alerts selected'));
} else { }
else {
$results = true; $results = true;
$agent_module_actions = array(); $agent_module_actions = array();
@ -137,7 +138,8 @@ $table->data[1][1] = html_print_select (array(),'id_agents[]', 0, false, '', '',
if (empty($id_agents)) { if (empty($id_agents)) {
$alert_templates = ''; $alert_templates = '';
} else { }
else {
$alert_templates = agents_get_alerts_simple ($id_agents); $alert_templates = agents_get_alerts_simple ($id_agents);
} }
$table->data[2][0] = __('Alert templates'); $table->data[2][0] = __('Alert templates');

View File

@ -192,7 +192,8 @@ $(document).ready (function () {
if (this.value != 0) { if (this.value != 0) {
$("#id_agents").enable (); $("#id_agents").enable ();
$("#id_group").enable ().change (); $("#id_group").enable ().change ();
} else { }
else {
$("#id_group, #id_agents").disable (); $("#id_group, #id_agents").disable ();
} }
}); });

View File

@ -28,78 +28,6 @@ require_once($config['homedir'] . "/include/functions_agents.php");
require_once($config['homedir'] . "/include/functions_groups.php"); require_once($config['homedir'] . "/include/functions_groups.php");
require_once($config['homedir'] . '/include/functions_users.php'); require_once($config['homedir'] . '/include/functions_users.php');
function process_manage_edit ($module_name, $agents_select = null) {
if (is_int ($module_name) && $module_name <= 0) {
echo '<h3 class="error">'.__('No modules selected').'</h3>';
return false;
}
/* List of fields which can be updated */
$fields = array ('min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', 'min_ff_event', 'module_interval',
'disabled', 'post_process', 'unit', 'snmp_community', 'tcp_send', 'custom_string_1', 'plugin_parameter',
'custom_string_2', 'custom_string_3', 'min', 'max', 'id_module_group', 'plugin_user', 'plugin_pass', 'id_export', 'history_data');
$values = array ();
// Specific snmp reused fields
if(get_parameter ('tcp_send', '') == 3) {
$plugin_user_snmp = get_parameter ('plugin_user_snmp', '');
if($plugin_user_snmp != '') {
$values['plugin_user'] = $plugin_user_snmp;
}
$plugin_pass_snmp = get_parameter ('plugin_pass_snmp', '');
if($plugin_pass_snmp != '') {
$values['plugin_pass'] = $plugin_pass_snmp;
}
}
foreach ($fields as $field) {
$value = get_parameter ($field, '');
if ($value != '') {
$values[$field] = $value;
}
}
if (strlen(get_parameter('history_data')) > 0) {
$values['history_data'] = get_parameter('history_data');
}
// Whether to update module tag info
$update_tags = get_parameter('id_tag', false);
if (array_search(0, $agents_select) !== false) {
$modules = db_get_all_rows_filter ('tagente_modulo',
array ('nombre' => $module_name),
array ('id_agente_modulo'));
}
else {
$modules = db_get_all_rows_filter ('tagente_modulo',
array ('id_agente' => $agents_select,
'nombre' => $module_name),
array ('id_agente_modulo'));
}
db_process_sql_begin ();
if ($modules === false)
return false;
foreach ($modules as $module) {
$result = modules_update_agent_module ($module['id_agente_modulo'], $values, true, $update_tags);
if (is_error($result)) {
db_process_sql_rollback ();
return false;
}
}
db_process_sql_commit ();
return true;
}
$module_type = (int) get_parameter ('module_type'); $module_type = (int) get_parameter ('module_type');
$idGroupMassive = (int) get_parameter('id_group_massive'); $idGroupMassive = (int) get_parameter('id_group_massive');
$idAgentMassive = (int) get_parameter('id_agent_massive'); $idAgentMassive = (int) get_parameter('id_agent_massive');
@ -116,22 +44,22 @@ $update = (bool) get_parameter_post ('update');
if ($update) { if ($update) {
$agents_ = ''; $agents_ = '';
if($selection_mode == 'modules') { if ($selection_mode == 'modules') {
$force = get_parameter('force_type', false); $force = get_parameter('force_type', false);
if($agents_select == false) { if ($agents_select == false) {
$agents_select = array(); $agents_select = array();
$agents_ = array(); $agents_ = array();
} }
foreach($agents_select as $agent_name) { foreach ($agents_select as $agent_name) {
$agents_[] = agents_get_agent_id($agent_name); $agents_[] = agents_get_agent_id($agent_name);
} }
$modules_ = $module_name; $modules_ = $module_name;
} }
else if($selection_mode == 'agents') { else if ($selection_mode == 'agents') {
$force = get_parameter('force_group', false); $force = get_parameter('force_group', false);
$agents_ = $agents_id; $agents_ = $agents_id;
$modules_ = $modules_select; $modules_ = $modules_select;
} }
@ -139,13 +67,13 @@ if ($update) {
$success = 0; $success = 0;
$count = 0; $count = 0;
if($agents_ == false) { if ($agents_ == false) {
$agents_ = array(); $agents_ = array();
} }
// If the option to select all of one group or module type is checked // If the option to select all of one group or module type is checked
if($force) { if ($force) {
if($force == 'type') { if ($force == 'type') {
$condition = ''; $condition = '';
if($module_type != 0) if($module_type != 0)
$condition = ' AND t2.id_tipo_modulo = '.$module_type; $condition = ' AND t2.id_tipo_modulo = '.$module_type;
@ -153,24 +81,24 @@ if ($update) {
$agents_ = db_get_all_rows_sql('SELECT DISTINCT(t1.id_agente) $agents_ = db_get_all_rows_sql('SELECT DISTINCT(t1.id_agente)
FROM tagente t1, tagente_modulo t2 FROM tagente t1, tagente_modulo t2
WHERE t1.id_agente = t2.id_agente'); WHERE t1.id_agente = t2.id_agente');
foreach($agents_ as $id_agent) { foreach ($agents_ as $id_agent) {
$module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent, 'id_tipo_modulo' => $module_type),'nombre'); $module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent, 'id_tipo_modulo' => $module_type),'nombre');
if($module_name == false) { if ($module_name == false) {
$module_name = array(); $module_name = array();
} }
foreach($module_name as $mod_name) { foreach ($module_name as $mod_name) {
$result = process_manage_edit ($mod_name['nombre'], $id_agent['id_agente']); $result = process_manage_edit ($mod_name['nombre'], $id_agent['id_agente']);
$count ++; $count ++;
$success += (int)$result; $success += (int)$result;
} }
} }
} }
else if($force == 'group') { else if ($force == 'group') {
$agents_ = array_keys (agents_get_group_agents ($group_select, false, "none")); $agents_ = array_keys (agents_get_group_agents ($group_select, false, "none"));
foreach($agents_ as $id_agent) { foreach ($agents_ as $id_agent) {
$module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent),'nombre'); $module_name = db_get_all_rows_filter('tagente_modulo', array('id_agente' => $id_agent),'nombre');
if($module_name == false) { if ($module_name == false) {
$module_name = array(); $module_name = array();
} }
foreach($module_name as $mod_name) { foreach($module_name as $mod_name) {
@ -184,13 +112,13 @@ if ($update) {
// We empty the agents array to skip the standard procedure // We empty the agents array to skip the standard procedure
$agents_ = array(); $agents_ = array();
} }
foreach($agents_ as $agent_) { foreach($agents_ as $agent_) {
if($modules_ == false) { if($modules_ == false) {
$modules_ = array(); $modules_ = array();
} }
foreach($modules_ as $module_) { foreach($modules_ as $module_) {
$result = process_manage_edit ($module_, $agents_); $result = process_manage_edit ($module_, $agents_);
$count ++; $count ++;
@ -423,7 +351,7 @@ $table->data['edit8'][3] = html_print_select_from_sql ('SELECT id_tag, name FROM
echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">'; echo '<form method="post" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=edit_modules" id="form_edit">';
html_print_table ($table); html_print_table ($table);
echo '<div class="action-buttons" style="width: '.$table->width.'" onsubmit="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden ('update', 1); html_print_input_hidden ('update', 1);
html_print_submit_button (__('Update'), 'go', false, 'class="sub upd"'); html_print_submit_button (__('Update'), 'go', false, 'class="sub upd"');
echo '</div>'; echo '</div>';
@ -452,10 +380,10 @@ $(document).ready (function () {
$("#module_name").change(module_changed_by_multiple_modules); $("#module_name").change(module_changed_by_multiple_modules);
clean_lists(); clean_lists();
$(".select_modules_row").css('display', '<?php echo $modules_row?>'); $(".select_modules_row").css('display', '<?php echo $modules_row?>');
$(".select_agents_row").css('display', '<?php echo $agents_row?>'); $(".select_agents_row").css('display', '<?php echo $agents_row?>');
// Trigger change to refresh selection when change selection mode // Trigger change to refresh selection when change selection mode
$("#agents_selection_mode").change (function() { $("#agents_selection_mode").change (function() {
$("#module_name").trigger('change'); $("#module_name").trigger('change');
@ -486,7 +414,7 @@ $(document).ready (function () {
else { else {
filter = "id_tipo_modulo="+this.value; filter = "id_tipo_modulo="+this.value;
} }
$("#module_loading").show (); $("#module_loading").show ();
$("tr#delete_table-edit1, tr#delete_table-edit2").hide (); $("tr#delete_table-edit1, tr#delete_table-edit2").hide ();
$("#module_name").attr ("disabled", "disabled") $("#module_name").attr ("disabled", "disabled")
@ -529,7 +457,7 @@ $(document).ready (function () {
} }
$('input[type=checkbox]').change ( $('input[type=checkbox]').change (
function () { function () {
if(this.id == "checkbox-force_type"){ if(this.id == "checkbox-force_type"){
if(this.checked) { if(this.checked) {
$(".select_modules_row_2").css('display', 'none'); $(".select_modules_row_2").css('display', 'none');
@ -571,7 +499,7 @@ $(document).ready (function () {
$("#form_edit input[name=selection_mode]").change (function () { $("#form_edit input[name=selection_mode]").change (function () {
selector = this.value; selector = this.value;
clean_lists(); clean_lists();
if(selector == 'agents') { if(selector == 'agents') {
$(".select_modules_row").css('display', 'none'); $(".select_modules_row").css('display', 'none');
$(".select_agents_row").css('display', ''); $(".select_agents_row").css('display', '');
@ -593,7 +521,7 @@ $(document).ready (function () {
$("#groups_select").change ( $("#groups_select").change (
function () { function () {
if (this.value < 0) { if (this.value < 0) {
clean_lists(); clean_lists();
$(".select_agents_row_2").css('display', 'none'); $(".select_agents_row_2").css('display', 'none');
@ -616,7 +544,7 @@ $(document).ready (function () {
}, },
function (data, status) { function (data, status) {
$("#id_agents").html(''); $("#id_agents").html('');
jQuery.each (data, function (id, value) { jQuery.each (data, function (id, value) {
option = $("<option></option>").attr ("value", value["id_agente"]).html (value["nombre"]); option = $("<option></option>").attr ("value", value["id_agente"]).html (value["nombre"]);
$("#id_agents").append (option); $("#id_agents").append (option);
@ -629,3 +557,84 @@ $(document).ready (function () {
}); });
/* ]]> */ /* ]]> */
</script> </script>
<?php
function process_manage_edit ($module_name, $agents_select = null) {
if (is_int ($module_name) && $module_name < 0) {
echo '<h3 class="error">'.__('No modules selected').'</h3>';
return false;
}
/* List of fields which can be updated */
$fields = array ('min_warning', 'max_warning', 'str_warning', 'min_critical', 'max_critical', 'str_critical', 'min_ff_event', 'module_interval',
'disabled', 'post_process', 'unit', 'snmp_community', 'tcp_send', 'custom_string_1', 'plugin_parameter',
'custom_string_2', 'custom_string_3', 'min', 'max', 'id_module_group', 'plugin_user', 'plugin_pass', 'id_export', 'history_data');
$values = array ();
// Specific snmp reused fields
if(get_parameter ('tcp_send', '') == 3) {
$plugin_user_snmp = get_parameter ('plugin_user_snmp', '');
if($plugin_user_snmp != '') {
$values['plugin_user'] = $plugin_user_snmp;
}
$plugin_pass_snmp = get_parameter ('plugin_pass_snmp', '');
if($plugin_pass_snmp != '') {
$values['plugin_pass'] = $plugin_pass_snmp;
}
}
foreach ($fields as $field) {
$value = get_parameter ($field, '');
if ($value != '') {
$values[$field] = $value;
}
}
if (strlen(get_parameter('history_data')) > 0) {
$values['history_data'] = get_parameter('history_data');
}
// Whether to update module tag info
$update_tags = get_parameter('id_tag', false);
if (array_search(0, $agents_select) !== false) {
//Apply at All agents.
$modules = db_get_all_rows_filter ('tagente_modulo',
array ('nombre' => $module_name),
array ('id_agente_modulo'));
}
else {
if ($module_name == 0) {
//Any module
$modules = db_get_all_rows_filter ('tagente_modulo',
array ('id_agente' => $agents_select),
array ('id_agente_modulo'));
}
else {
$modules = db_get_all_rows_filter ('tagente_modulo',
array ('id_agente' => $agents_select,
'nombre' => $module_name),
array ('id_agente_modulo'));
}
}
db_process_sql_begin ();
if ($modules === false)
return false;
foreach ($modules as $module) {
$result = modules_update_agent_module ($module['id_agente_modulo'], $values, true, $update_tags);
if (is_error($result)) {
db_process_sql_rollback ();
return false;
}
}
db_process_sql_commit ();
return true;
}
?>

View File

@ -43,15 +43,16 @@ if (is_ajax ()) {
$alert_templates = agents_get_alerts_simple ($id_agents); $alert_templates = agents_get_alerts_simple ($id_agents);
echo json_encode (index_array ($alert_templates, 'id_alert_template', 'template_name')); echo json_encode (index_array ($alert_templates, 'id_alert_template', 'template_name'));
return; return;
} else { }
else {
$id_alert_templates = (array) get_parameter ('id_alert_templates'); $id_alert_templates = (array) get_parameter ('id_alert_templates');
$disabled = (int) get_parameter ('disabled'); $disabled = (int) get_parameter ('disabled');
$agents_alerts = alerts_get_agents_with_alert_template ($id_alert_templates, false, $agents_alerts = alerts_get_agents_with_alert_template ($id_alert_templates, false,
array('order' => 'tagente.nombre, talert_template_modules.disabled', 'talert_template_modules.disabled' => $disabled), array('order' => 'tagente.nombre, talert_template_modules.disabled', 'talert_template_modules.disabled' => $disabled),
array ('LEFT(CONCAT(LEFT(tagente.nombre,40), " - ", tagente_modulo.nombre), 85) as agent_agentmodule_name', array ('LEFT(CONCAT(LEFT(tagente.nombre,40), " - ", tagente_modulo.nombre), 85) as agent_agentmodule_name',
'talert_template_modules.id as template_module_id'), $id_agents); 'talert_template_modules.id as template_module_id'), $id_agents);
echo json_encode (index_array ($agents_alerts, 'template_module_id', 'agent_agentmodule_name')); echo json_encode (index_array ($agents_alerts, 'template_module_id', 'agent_agentmodule_name'));
return; return;
} }

View File

@ -39,7 +39,8 @@ $options_alerts = array('add_alerts' => __('Massive alerts addition'), 'delete_a
$options_agents = array('edit_agents' => __('Massive agents edition'), 'delete_agents' => __('Massive agents deletion')); $options_agents = array('edit_agents' => __('Massive agents edition'), 'delete_agents' => __('Massive agents deletion'));
if (check_acl ($config['id_user'], 0, "PM")) { if (check_acl ($config['id_user'], 0, "PM")) {
$options_users = array('add_profiles' => __('Massive profiles addition'), 'delete_profiles' => __('Massive profiles deletion')); $options_users = array('add_profiles' => __('Massive profiles addition'),
'delete_profiles' => __('Massive profiles deletion'));
} }
else { else {
$options_users = array(); $options_users = array();
@ -151,43 +152,38 @@ $submit_add = get_parameter('crtbutton');
echo '<div id="loading" display="none">'; echo '<div id="loading" display="none">';
echo html_print_image("images/wait.gif", true, array("border" => '0')) . '<br />'; echo html_print_image("images/wait.gif", true, array("border" => '0')) . '<br />';
echo '<strong>'.__('Please wait').'...</strong>'; echo '<strong>' . __('Please wait...') . '</strong>';
echo '</div>'; echo '</div>';
?> ?>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
$(document).ready (function () {
$('#manage_config_form').submit( function() {
$(document).ready (function () { confirm_status = confirm(" <?php echo __('Are you sure?'); ?> ");
$('#manage_config_form').submit( function() { if (confirm_status)
confirm = confirm(" <?php echo __('Are you sure?'); ?> "); $("#loading").css("display", "");
if (confirm) else
$("#loading").css("display", ""); return false;
else });
return false;
$('#form_edit').submit( function() {
confirm_status = confirm(" <?php echo __('Are you sure?'); ?> ");
if (confirm_status)
$("#loading").css("display", "");
else
return false;
});
$('[id^=form]').submit( function() {
confirm_status = confirm(" <?php echo __('Are you sure?'); ?> ");
if (confirm_status)
$("#loading").css("display", "");
else
return false;
});
$("#loading").css("display", "none");
}); });
$('#form_edit').submit( function() {
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
if (confirm)
$("#loading").css("display", "");
else
return false;
});
$('[id^=form]').submit( function() {
confirm = confirm(" <?php echo __('Are you sure?'); ?> ");
if (confirm)
$("#loading").css("display", "");
else
return false;
});
$("#loading").css("display", "none");
});
</script> </script>
<?php <?php

View File

@ -46,13 +46,15 @@ if ($create) {
ui_print_error_message (__('Could not be created. Blank name')); ui_print_error_message (__('Could not be created. Blank name'));
require_once ('manage_nc_groups_form.php'); require_once ('manage_nc_groups_form.php');
return; return;
} else { }
else {
$result = db_process_sql_insert ('tnetwork_component_group', $result = db_process_sql_insert ('tnetwork_component_group',
array ('name' => $name, array ('name' => $name,
'parent' => $parent)); 'parent' => $parent));
if ($result) { if ($result) {
db_pandora_audit( "Module management", "Create component group #$result"); db_pandora_audit( "Module management", "Create component group #$result");
} else { }
else {
db_pandora_audit( "Module management", "Fail try to create component group"); db_pandora_audit( "Module management", "Fail try to create component group");
} }
ui_print_result_message ($result, ui_print_result_message ($result,
@ -75,7 +77,8 @@ if ($update) {
array ('id_sg' => $id)); array ('id_sg' => $id));
if ($result) { if ($result) {
db_pandora_audit( "Module management", "Update component group #$id"); db_pandora_audit( "Module management", "Update component group #$id");
} else { }
else {
db_pandora_audit( "Module management", "Fail try to update component group #$id"); db_pandora_audit( "Module management", "Fail try to update component group #$id");
} }

View File

@ -33,7 +33,8 @@ if ($id) {
$group = network_components_get_group ($id); $group = network_components_get_group ($id);
$name = $group['name']; $name = $group['name'];
$parent = $group['parent']; $parent = $group['parent'];
} else { }
else {
$name = ''; $name = '';
$parent = ''; $parent = '';
} }
@ -57,10 +58,11 @@ if ($id) {
html_print_input_hidden ('update', 1); html_print_input_hidden ('update', 1);
html_print_input_hidden ('id', $id); html_print_input_hidden ('id', $id);
html_print_submit_button (__('Update'), 'crt', false, 'class="sub upd"'); html_print_submit_button (__('Update'), 'crt', false, 'class="sub upd"');
} else { }
else {
html_print_input_hidden ('create', 1); html_print_input_hidden ('create', 1);
html_print_submit_button (__('Create'), 'crt', false, 'class="sub wand"'); html_print_submit_button (__('Create'), 'crt', false, 'class="sub wand"');
} }
echo '</div>'; echo '</div>';
echo '</form>'; echo '</form>';
?> ?>

View File

@ -141,7 +141,8 @@ if ($export_profile) {
foreach ($components[0] as $row_name => $detail) { foreach ($components[0] as $row_name => $detail) {
if (is_numeric ($row_name)) { if (is_numeric ($row_name)) {
$inv_names[] = $row_name; $inv_names[] = $row_name;
} else { }
else {
$row_names[] = $row_name; $row_names[] = $row_name;
} }
} }

View File

@ -85,10 +85,11 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
if ($result) { if ($result) {
db_pandora_audit("Module management", "Update module template #$id_np"); db_pandora_audit("Module management", "Update module template #$id_np");
} else { }
else {
db_pandora_audit("Module management", "Fail try to update module template #$id_np"); db_pandora_audit("Module management", "Fail try to update module template #$id_np");
} }
ui_print_result_message ($result !== false, ui_print_result_message ($result !== false,
__('Successfully updated network profile'), __('Successfully updated network profile'),
__('Error updating network profile')); __('Error updating network profile'));
@ -100,7 +101,8 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
if ($result) { if ($result) {
db_pandora_audit("Module management", "Create module template #$result"); db_pandora_audit("Module management", "Create module template #$result");
} else { }
else {
db_pandora_audit("Module management", "Fail try to create module template"); db_pandora_audit("Module management", "Fail try to create module template");
} }
@ -109,9 +111,10 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
__('Error adding network profile')); __('Error adding network profile'));
$id_np = (int) $result; //Will return either 0 (in case of error) or an int $id_np = (int) $result; //Will return either 0 (in case of error) or an int
} }
} else { }
else {
ui_print_result_message(false, "", _("Cannot create a template without name")); ui_print_result_message(false, "", _("Cannot create a template without name"));
} }
} }
elseif ($id_np > 0) { elseif ($id_np > 0) {

View File

@ -53,10 +53,11 @@ if ($update) {
if (db_get_value('token', 'tconfig', 'token', 'netflow_path') === false) { if (db_get_value('token', 'tconfig', 'token', 'netflow_path') === false) {
config_create_value('netflow_path', $config['netflow_path']); config_create_value('netflow_path', $config['netflow_path']);
} else { }
else {
db_process_sql_update ('tconfig', db_process_sql_update ('tconfig',
array ('value' => $config['netflow_path']), array ('value' => $config['netflow_path']),
array ('token' => 'netflow_path')); array ('token' => 'netflow_path'));
} }
} }

View File

@ -45,13 +45,14 @@ if ($delete) {
$result2 = db_process_sql_delete ('tnetflow_report_content', $result2 = db_process_sql_delete ('tnetflow_report_content',
array ('id_filter' => $id_filter)); array ('id_filter' => $id_filter));
if ($result !== false) { if ($result !== false) {
$result = true; $result = true;
} else { }
else {
$result = false; $result = false;
} }
ui_print_result_message ($result, ui_print_result_message ($result,
__('Successfully deleted'), __('Successfully deleted'),
__('Not deleted. Error deleting data')); __('Not deleted. Error deleting data'));

View File

@ -66,8 +66,8 @@ if ($id) {
$aggregate = $filter['aggregate']; $aggregate = $filter['aggregate'];
$output = $filter['output']; $output = $filter['output'];
$advanced_filter = $filter['advanced_filter']; $advanced_filter = $filter['advanced_filter'];
}
} else { else {
$name = ''; $name = '';
$assign_group = ''; $assign_group = '';
$ip_dst = ''; $ip_dst = '';

View File

@ -171,17 +171,20 @@ $sql = "SELECT id_rc FROM tnetflow_report_content where `order`= (select max(`or
$item_max = db_get_row_sql($sql); $item_max = db_get_row_sql($sql);
$last_item = $item_max['id_rc']; $last_item = $item_max['id_rc'];
foreach ($reports_item as $item) { foreach ($reports_item as $item) {
$data = array (); $data = array ();
if (($item['id_rc'] == $first_item) && ($item['id_rc'] == $last_item)){ if (($item['id_rc'] == $first_item) && ($item['id_rc'] == $last_item)){
$data[0] = '<span style="display: block; float: left; width: 16px;">&nbsp;</span>'; $data[0] = '<span style="display: block; float: left; width: 16px;">&nbsp;</span>';
} else if (($item['id_rc'] == $first_item) && ($item['id_rc'] != $last_item)){ }
else if (($item['id_rc'] == $first_item) && ($item['id_rc'] != $last_item)){
$data[0] = '<span style="display: block; float: left; width: 16px;">&nbsp;</span>'; $data[0] = '<span style="display: block; float: left; width: 16px;">&nbsp;</span>';
$data[0] .= '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>'; $data[0] .= '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>';
} else if (($item['id_rc'] == $last_item) && ($item['id_rc'] != $first_item)){ }
else if (($item['id_rc'] == $last_item) && ($item['id_rc'] != $first_item)){
$data[0] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>'; $data[0] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>';
} else { }
else {
$data[0] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>'; $data[0] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>';
$data[0] .= '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>'; $data[0] .= '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>';
} }
@ -214,7 +217,7 @@ $last_item = $item_max['id_rc'];
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if(isset($data)) { if (isset($data)) {
echo '<form method="post" action="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$id.'">'; echo '<form method="post" action="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$id.'">';
html_print_input_hidden('multiple_delete', 1); html_print_input_hidden('multiple_delete', 1);
html_print_table ($table); html_print_table ($table);
@ -222,7 +225,8 @@ if(isset($data)) {
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo "</div>"; echo "</div>";
echo "</form>"; echo "</form>";
}else { }
else {
echo "<div class='nf'>".__('There are no defined items')."</div>"; echo "<div class='nf'>".__('There are no defined items')."</div>";
} }

View File

@ -61,7 +61,8 @@ if ($id_rc) {
$max_val = $item['max']; $max_val = $item['max'];
$show_graph = $item['show_graph']; $show_graph = $item['show_graph'];
} else { }
else {
$name_filter = ''; $name_filter = '';
$max_val = ''; $max_val = '';
$show_graph = ''; $show_graph = '';
@ -99,7 +100,8 @@ if ($create){
$order = $result['max_order']; $order = $result['max_order'];
if ($order == '') { if ($order == '') {
$order = 0; $order = 0;
} else { }
else {
$order++; $order++;
} }
@ -113,11 +115,12 @@ if ($create){
$id_rc = db_process_sql_insert('tnetflow_report_content', $values); $id_rc = db_process_sql_insert('tnetflow_report_content', $values);
if ($id_rc === false) { if ($id_rc === false) {
echo '<h3 class="error">'.__ ('Error creating item').'</h3>'; echo '<h3 class="error">'.__ ('Error creating item').'</h3>';
} else { }
else {
echo '<h3 class="suc">'.__ ('Item created successfully').'</h3>'; echo '<h3 class="suc">'.__ ('Item created successfully').'</h3>';
} }
} }
$table->width = '70%'; $table->width = '70%';
$table->border = 0; $table->border = 0;
$table->cellspacing = 3; $table->cellspacing = 3;
@ -168,11 +171,11 @@ if ($id_rc) {
html_print_input_hidden ('update', 1); html_print_input_hidden ('update', 1);
html_print_input_hidden ('id_rc', $id_rc); html_print_input_hidden ('id_rc', $id_rc);
html_print_submit_button (__('Update'), 'crt', false, 'class="sub upd"'); html_print_submit_button (__('Update'), 'crt', false, 'class="sub upd"');
} else { }
else {
html_print_input_hidden ('create', 1); html_print_input_hidden ('create', 1);
html_print_submit_button (__('Create item'), 'crt', false, 'class="sub wand"'); html_print_submit_button (__('Create item'), 'crt', false, 'class="sub wand"');
} }
echo '</div>'; echo '</div>';
echo '</form>'; echo '</form>';
?>
?>

View File

@ -26,10 +26,6 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
require_once ("include/functions_filemanager.php"); require_once ("include/functions_filemanager.php");
//$delete_file = (bool) get_parameter ('delete_file');
//$upload_file = (bool) get_parameter ('upload_file');
//$create_dir = (bool) get_parameter ('create_dir');
// Header // Header
ui_print_page_header (__('File manager'), "", false, "", true); ui_print_page_header (__('File manager'), "", false, "", true);
@ -38,47 +34,8 @@ if (isset($config['filemanager']['message'])) {
$config['filemanager']['message'] = null; $config['filemanager']['message'] = null;
} }
//// Upload file
//if ($upload_file) {
// if (isset ($_FILES['file']) && $_FILES['file']['name'] != "") {
// $filename = $_FILES['file']['name'];
// $filesize = $_FILES['file']['size'];
// $directory = (string) get_parameter ('directory');
//
// // Copy file to directory and change name
// $nombre_archivo = $config['homedir'].'/'.$directory.'/'.$filename;
// if (! @copy ($_FILES['file']['tmp_name'], $nombre_archivo )) {
// echo "<h3 class=error>".__('attach_error')."</h3>";
// } else {
// // Delete temporal file
// unlink ($_FILES['file']['tmp_name']);
// }
//
// }
//}
//if ($delete_file) {
// $filename = (string) get_parameter ('filename');
// echo "<h3>".__('Deleting')." ".$filename."</h3>";
// if (is_dir ($filename)) {
// rmdir ($filename);
// } else {
// unlink ($filename);
// }
//}
$directory = (string) get_parameter ('directory', "/"); $directory = (string) get_parameter ('directory', "/");
//// CREATE DIR
//if ($create_dir) {
// $dirname = (string) get_parameter ('dirname');
// if ($dirname) {
// @mkdir ($directory.'/'.$dirname);
// echo '<h3>'.__('Created directory %s', $dirname).'</h3>';
// }
//}
// A miminal security check to avoid directory traversal // A miminal security check to avoid directory traversal
if (preg_match ("/\.\./", $directory)) if (preg_match ("/\.\./", $directory))
$directory = "images"; $directory = "images";
@ -105,10 +62,7 @@ $available_directories[$directory] = $directory;
$real_directory = realpath ($config['homedir'].'/'.$directory); $real_directory = realpath ($config['homedir'].'/'.$directory);
//filemanager_box_upload_file_explorer($real_directory, $directory); echo '<h4>' . __('Index of %s', $directory) . '</h4>';
echo '<h4>'.__('Index of %s', $directory).'</h4>';
filemanager_file_explorer($real_directory, $directory, 'index.php?sec=gsetup&sec2=godmode/setup/file_manager'); filemanager_file_explorer($real_directory, $directory, 'index.php?sec=gsetup&sec2=godmode/setup/file_manager');
?> ?>

View File

@ -85,18 +85,20 @@ if ((isset ($_GET["form_add"])) || (isset ($_GET["form_edit"]))) {
$text = $result["text"]; $text = $result["text"];
$author = $result["author"]; $author = $result["author"];
$timestamp = $result["timestamp"]; $timestamp = $result["timestamp"];
} else { }
else {
echo "<h3 class='error'>".__('Name error')."</h3>"; echo "<h3 class='error'>".__('Name error')."</h3>";
} }
} else { // form_add }
else { // form_add
$creation_mode = 1; $creation_mode = 1;
$text = ""; $text = "";
$subject = ""; $subject = "";
$author = $config['id_user']; $author = $config['id_user'];
} }
// Create news // Create news
echo '<table class="databox" cellpadding="4" cellspacing="4" width="98%">'; echo '<table class="databox" cellpadding="4" cellspacing="4" width="98%">';
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/news">'; echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/news">';
if ($creation_mode == 1) if ($creation_mode == 1)

View File

@ -71,7 +71,8 @@ ui_print_page_header (__('User detail editor'), "images/god3.png", false, "", tr
if ($config['user_can_update_info']) { if ($config['user_can_update_info']) {
$view_mode = false; $view_mode = false;
} else { }
else {
$view_mode = true; $view_mode = true;
} }
@ -240,7 +241,8 @@ if ($update_user) {
$pass_ok = login_validate_pass($password_new, $id, true); $pass_ok = login_validate_pass($password_new, $id, true);
if ($pass_ok != 1) { if ($pass_ok != 1) {
ui_print_error_message($pass_ok); ui_print_error_message($pass_ok);
} else { }
else {
$res2 = update_user_password ($id, $password_new); $res2 = update_user_password ($id, $password_new);
if ($res2) { if ($res2) {
$res3 = save_pass_history($id, $password_new); $res3 = save_pass_history($id, $password_new);
@ -249,7 +251,8 @@ if ($update_user) {
__('User info successfully updated'), __('User info successfully updated'),
__('Error updating user info (no change?)')); __('Error updating user info (no change?)'));
} }
} else { }
else {
$res2 = update_user_password ($id, $password_new); $res2 = update_user_password ($id, $password_new);
if ($res2) { if ($res2) {
$res3 = save_pass_history($id, $password_new); $res3 = save_pass_history($id, $password_new);

View File

@ -235,7 +235,8 @@ foreach ($info as $user_id => $user_info) {
$data[3] = html_print_image ("images/user_suit.png", true, $data[3] = html_print_image ("images/user_suit.png", true,
array ("alt" => __('Admin'), array ("alt" => __('Admin'),
"title" => __('Administrator'))).'&nbsp;'; "title" => __('Administrator'))).'&nbsp;';
} else { }
else {
$data[3] = html_print_image ("images/user_green.png", true, $data[3] = html_print_image ("images/user_green.png", true,
array ("alt" => __('User'), array ("alt" => __('User'),
"title" => __('Standard User'))).'&nbsp;'; "title" => __('Standard User'))).'&nbsp;';
@ -250,7 +251,8 @@ foreach ($info as $user_id => $user_info) {
$data[3] .= groups_get_name ($row["id_grupo"]); $data[3] .= groups_get_name ($row["id_grupo"]);
$data[3] .= "<br />"; $data[3] .= "<br />";
} }
} else { }
else {
$data[3] .= __('The user doesn\'t have any assigned profile/group'); $data[3] .= __('The user doesn\'t have any assigned profile/group');
} }
$data[3] .= "</span></a>"; $data[3] .= "</span></a>";
@ -266,7 +268,8 @@ foreach ($info as $user_id => $user_info) {
$data[5] .= '<a href="index.php?sec=gusuarios&amp;sec2=godmode/users/configure_user&amp;id='.$user_id.'">'.html_print_image('images/config.png', true, array('title' => __('Edit'))).'</a>'; $data[5] .= '<a href="index.php?sec=gusuarios&amp;sec2=godmode/users/configure_user&amp;id='.$user_id.'">'.html_print_image('images/config.png', true, array('title' => __('Edit'))).'</a>';
if ($config["admin_can_delete_user"] && $user_info['id_user'] != $config['id_user']) { if ($config["admin_can_delete_user"] && $user_info['id_user'] != $config['id_user']) {
$data[5] .= "&nbsp;&nbsp;<a href='index.php?sec=gusuarios&sec2=godmode/users/user_list&user_del=1&delete_user=".$user_info['id_user']."'>".html_print_image('images/cross.png', true, array ('title' => __('Delete'), 'onclick' => "if (! confirm ('" .__('Deleting User'). " ". $user_info['id_user'] . ". " . __('Are you sure?') ."')) return false"))."</a>"; $data[5] .= "&nbsp;&nbsp;<a href='index.php?sec=gusuarios&sec2=godmode/users/user_list&user_del=1&delete_user=".$user_info['id_user']."'>".html_print_image('images/cross.png', true, array ('title' => __('Delete'), 'onclick' => "if (! confirm ('" .__('Deleting User'). " ". $user_info['id_user'] . ". " . __('Are you sure?') ."')) return false"))."</a>";
} else { }
else {
$data[5] .= ''; //Delete button not in this mode $data[5] .= ''; //Delete button not in this mode
} }
array_push ($table->data, $data); array_push ($table->data, $data);

View File

@ -473,20 +473,13 @@ foreach ($agents as $agent) {
$data[2] = ui_print_os_icon ($agent["id_os"], false, true); $data[2] = ui_print_os_icon ($agent["id_os"], false, true);
//The interval we are thinking that it must be the agent interval in this
//cell and it'snt the interval of modules.
// if ($agent_info["interval"] > $agent["intervalo"]) {
// $data[2] = '<span class="green">'.$agent_info["interval"].'</span>';
// } else {
// $data[2] = $agent["intervalo"];
// }
$data[3] = human_time_description_raw($agent["intervalo"]); $data[3] = human_time_description_raw($agent["intervalo"]);
$data[4] = ui_print_group_icon ($agent["id_grupo"], true); $data[4] = ui_print_group_icon ($agent["id_grupo"], true);
$data[5] = '<b>'; $data[5] = '<b>';
$data[5] .= $agent_info["modules"]; $data[5] .= $agent_info["modules"];
if ($agent_info["monitor_alertsfired"] > 0) if ($agent_info["monitor_alertsfired"] > 0)
$data[5] .= ' : <span class="orange">' . $agent_info["monitor_alertsfired"] . '</span>'; $data[5] .= ' : <span class="orange">' . $agent_info["monitor_alertsfired"] . '</span>';
if ($agent_info["monitor_critical"] > 0) if ($agent_info["monitor_critical"] > 0)
@ -541,14 +534,15 @@ if (!empty ($table->data)) {
html_print_table ($table); html_print_table ($table);
ui_pagination ($total_agents, ui_get_url_refresh (array ('group_id' => $group_id, 'search' => $search, 'sort_field' => $sortField, 'sort' => $sort, 'status' => $status))); ui_pagination ($total_agents, ui_get_url_refresh (array ('group_id' => $group_id, 'search' => $search, 'sort_field' => $sortField, 'sort' => $sort, 'status' => $status)));
unset ($table); unset ($table);
} else { }
else {
echo '<div class="nf">'.__('There are no defined agents').'</div>'; echo '<div class="nf">'.__('There are no defined agents').'</div>';
} }
?> ?>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready (function () { $(document).ready (function () {
$("table#table1 tr").hover (function () { $("table#table1 tr").hover (function () {
$(".actions", this).css ("visibility", ""); $(".actions", this).css ("visibility", "");
}, },

View File

@ -180,20 +180,21 @@ echo " / ";
if ($agent["ultimo_contacto_remoto"] == "01-01-1970 00:00:00") { if ($agent["ultimo_contacto_remoto"] == "01-01-1970 00:00:00") {
echo __('Never'); echo __('Never');
} else { }
else {
echo $agent["ultimo_contacto_remoto"]; echo $agent["ultimo_contacto_remoto"];
} }
echo '</td></tr>'; echo '</td></tr>';
// Timezone Offset // Timezone Offset
if ($agent['timezone_offset'] != 0) { if ($agent['timezone_offset'] != 0) {
echo '<tr><td class="datos2"><b>'.__('Timezone Offset'). '</b></td>'; echo '<tr><td class="datos2"><b>' . __('Timezone Offset') . '</b></td>';
echo '<td class="datos2" colspan="2">'.$agent["timezone_offset"].'</td></tr>'; echo '<td class="datos2" colspan="2">' . $agent["timezone_offset"] . '</td></tr>';
} }
// Next contact (agent) // Next contact (agent)
$progress = agents_get_next_contact($id_agente); $progress = agents_get_next_contact($id_agente);
echo '<tr><td class="datos"><b>'.__('Next agent contact').'</b></td>'; echo '<tr><td class="datos"><b>' . __('Next agent contact') . '</b></td>';
echo '<td class="datos f9" colspan="2">' . progress_bar($progress, 200, 20) . '</td></tr>'; echo '<td class="datos f9" colspan="2">' . progress_bar($progress, 200, 20) . '</td></tr>';
// Custom fields // Custom fields

View File

@ -134,9 +134,10 @@ if ($result !== false) {
$data[1] .= "(".$sla_data["sla_min"]." / ".$sla_data["sla_max"]." / ".$sla_data["sla_limit"].")"; $data[1] .= "(".$sla_data["sla_min"]." / ".$sla_data["sla_max"]." / ".$sla_data["sla_limit"].")";
$data[2] = format_numeric (reporting_get_agentmodule_sla ($sla_data["id_agent_module"], $config["sla_period"], 1)).'%'; $data[2] = format_numeric (reporting_get_agentmodule_sla ($sla_data["id_agent_module"], $config["sla_period"], 1)).'%';
$status = modules_get_agentmodule_status ($sla_data["id_agent_module"]); $status = modules_get_agentmodule_status ($sla_data["id_agent_module"]);
if ($status == 1){ if ($status == 1) {
$data[3] = html_print_image ("images/pixel_red.png", true, array ("width" => 40, "height" => 18, "title" => __('Module Down'))); $data[3] = html_print_image ("images/pixel_red.png", true, array ("width" => 40, "height" => 18, "title" => __('Module Down')));
} else { }
else {
$data[3] = html_print_image ("images/pixel_green.png", true, array ("width" => 40, "height" => 18, "title" => __('Module Up'))); $data[3] = html_print_image ("images/pixel_green.png", true, array ("width" => 40, "height" => 18, "title" => __('Module Up')));
} }
array_push ($table->data, $data); array_push ($table->data, $data);
@ -144,4 +145,4 @@ if ($result !== false) {
html_print_table ($table); html_print_table ($table);
unset ($table); unset ($table);
} }
?> ?>

View File

@ -274,34 +274,40 @@ if($is_admin) {
if ($server["status"] == 0){ if ($server["status"] == 0){
$data[2] = ui_print_status_image (STATUS_SERVER_DOWN, '', true); $data[2] = ui_print_status_image (STATUS_SERVER_DOWN, '', true);
} else { }
else {
$data[2] = ui_print_status_image (STATUS_SERVER_OK, '', true); $data[2] = ui_print_status_image (STATUS_SERVER_OK, '', true);
} }
if ($server["type"] != "snmp") { if ($server["type"] != "snmp") {
$data[3] = progress_bar($server["load"], 80, 20); $data[3] = progress_bar($server["load"], 80, 20);
if ($server["type"] != "recon"){ if ($server["type"] != "recon"){
$data[4] = $server["lag_txt"]; $data[4] = $server["lag_txt"];
} else { }
else {
$data[4] = __("N/A"); $data[4] = __("N/A");
} }
} else { }
else {
$data[3] = ""; $data[3] = "";
$data[4] = __("N/A"); $data[4] = __("N/A");
} }
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if (!empty ($table->data)) { if (!empty ($table->data)) {
html_print_table ($table); html_print_table ($table);
} else { }
echo '<div class="nf">'.__('There are no servers configured in the database').'</div>'; else {
echo '<div class="nf">' .
__('There are no servers configured in the database') .
'</div>';
} }
unset ($table); unset ($table);
} }
echo '</div>'; echo '</div>';
?> ?>

View File

@ -445,7 +445,8 @@ $(document).ready( function() {
$option = $('#select_validate').val(); $option = $('#select_validate').val();
if ($option == 2) { if ($option == 2) {
$(".standby_alert_checkbox").css('display', ''); $(".standby_alert_checkbox").css('display', '');
} else { }
else {
$(".standby_alert_checkbox").css('display', 'none'); $(".standby_alert_checkbox").css('display', 'none');
} }
}); });
@ -453,10 +454,10 @@ $(document).ready( function() {
$("#tgl_event_control").click (function () { $("#tgl_event_control").click (function () {
$("#event_control").toggle (); $("#event_control").toggle ();
// Trick to don't collapse filter if autorefresh button has been pushed // Trick to don't collapse filter if autorefresh button has been pushed
if ($("#hidden-toogle_filter").val() == 'true'){ if ($("#hidden-toogle_filter").val() == 'true') {
$("#hidden-toogle_filter").val('false'); $("#hidden-toogle_filter").val('false');
} }
else{ else {
$("#hidden-toogle_filter").val('true'); $("#hidden-toogle_filter").val('true');
} }
return false; return false;
@ -470,12 +471,12 @@ $(document).ready( function() {
var select_validate = $('#select_validate_'+id).val(); // 1 validate, 2 in process, 3 add comment var select_validate = $('#select_validate_'+id).val(); // 1 validate, 2 in process, 3 add comment
var checkbox_standby_alert = $('#checkbox-standby-alert-'+id).attr('checked'); var checkbox_standby_alert = $('#checkbox-standby-alert-'+id).attr('checked');
var similars = $('#group_rep').val(); var similars = $('#group_rep').val();
if(!select_validate) { if (!select_validate) {
select_validate = 1; select_validate = 1;
} }
if(checkbox_standby_alert) { if (checkbox_standby_alert) {
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "operation/events/events", {"page" : "operation/events/events",
"standby_alert" : 1, "standby_alert" : 1,
@ -516,8 +517,8 @@ $(document).ready( function() {
"get_comment" : 1, "get_comment" : 1,
"id" : id "id" : id
}, },
function (data, status) { function (data, status) {
$("#comment_row_"+id).html(data); $("#comment_row_"+id).html(data);
}); });
// Get event comment in header // Get event comment in header
@ -527,8 +528,8 @@ $(document).ready( function() {
"id" : id "id" : id
}, },
function (data, status) { function (data, status) {
$("#comment_header_"+id).html(data); $("#comment_header_"+id).html(data);
}); });
// Change state image // Change state image
$("#validate-"+id).css("display", "none"); $("#validate-"+id).css("display", "none");
@ -538,12 +539,12 @@ $(document).ready( function() {
// Remove row due to new state // Remove row due to new state
if (($("#status").val() == 2) || ($("#status").val() == 0) || ($("#status").val() == 3)){ if (($("#status").val() == 2) || ($("#status").val() == 0) || ($("#status").val() == 3)){
$.each($tr, function(index, value){ $.each($tr, function(index, value){
row = value; row = value;
if ($(row).attr('id') != ''){ if ($(row).attr('id') != ''){
row_id_name = $(row).attr('id').split('-').shift(); row_id_name = $(row).attr('id').split('-').shift();
row_id_number = $(row).attr('id').split('-').pop() - 1; row_id_number = $(row).attr('id').split('-').pop() - 1;
row_id_number_next = parseInt($(row).attr('id').split('-').pop()) + 1; row_id_number_next = parseInt($(row).attr('id').split('-').pop()) + 1;
@ -557,8 +558,8 @@ $(document).ready( function() {
$("#"+selected_row_id).css('display', 'none'); $("#"+selected_row_id).css('display', 'none');
$("#"+next_row_id).css('display', 'none'); $("#"+next_row_id).css('display', 'none');
} }
}); });
} }
} // In process } // In process
else if (select_validate == 2){ else if (select_validate == 2){
@ -572,10 +573,10 @@ $(document).ready( function() {
"get_comment" : 1, "get_comment" : 1,
"id" : id "id" : id
}, },
function (data, status) { function (data, status) {
$("#comment_row_"+id).html(data); $("#comment_row_"+id).html(data);
}); });
// Get event comment in header // Get event comment in header
jQuery.post ("ajax.php", jQuery.post ("ajax.php",
{"page" : "operation/events/events", {"page" : "operation/events/events",
@ -583,16 +584,16 @@ $(document).ready( function() {
"id" : id "id" : id
}, },
function (data, status) { function (data, status) {
$("#comment_header_"+id).html(data); $("#comment_header_"+id).html(data);
}); });
// Remove delete link (if event is not grouped and there is more than one event) // Remove delete link (if event is not grouped and there is more than one event)
if ($("#group_rep").val() == 1){ if ($("#group_rep").val() == 1) {
if (parseInt($("#count_event_group_"+id).text()) <= 1){ if (parseInt($("#count_event_group_"+id).text()) <= 1) {
$("#delete-"+id).replaceWith('<img alt="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" title="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" src="images/cross.disabled.png">'); $("#delete-"+id).replaceWith('<img alt="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" title="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" src="images/cross.disabled.png">');
} }
} }
else{ // Remove delete link (if event is not grouped) else { // Remove delete link (if event is not grouped)
$("#delete-"+id).replaceWith('<img alt="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" title="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" src="images/cross.disabled.png">'); $("#delete-"+id).replaceWith('<img alt="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" title="' + <?php echo "'" . __('Is not allowed delete events in process') . "'"; ?> + '" src="images/cross.disabled.png">');
} }
@ -600,22 +601,22 @@ $(document).ready( function() {
$("#status_img_"+id).attr ("src", "images/hourglass.png"); $("#status_img_"+id).attr ("src", "images/hourglass.png");
$("#status_img_"+id).attr ("title", <?php echo "'" . __('Event in process') . "'"; ?>); $("#status_img_"+id).attr ("title", <?php echo "'" . __('Event in process') . "'"; ?>);
$("#status_img_"+id).attr ("alt", <?php echo "'" . __('Event in process') . "'"; ?>); $("#status_img_"+id).attr ("alt", <?php echo "'" . __('Event in process') . "'"; ?>);
// Remove row due to new state // Remove row due to new state
if (($("#status").val() == 0) || ($("#status").val() == 1)){ if (($("#status").val() == 0) || ($("#status").val() == 1)){
$.each($tr, function(index, value){ $.each($tr, function(index, value){
row = value; row = value;
if ($(row).attr('id') != ''){ if ($(row).attr('id') != ''){
row_id_name = $(row).attr('id').split('-').shift(); row_id_name = $(row).attr('id').split('-').shift();
row_id_number = $(row).attr('id').split('-').pop() - 1; row_id_number = $(row).attr('id').split('-').pop() - 1;
row_id_number_next = parseInt($(row).attr('id').split('-').pop()) + 1; row_id_number_next = parseInt($(row).attr('id').split('-').pop()) + 1;
previous_row_id = $(row).attr('id'); previous_row_id = $(row).attr('id');
current_row_id = row_id_name + "-" + row_id_number; current_row_id = row_id_name + "-" + row_id_number;
selected_row_id = row_id_name + "-" + row_id_number + "-0"; selected_row_id = row_id_name + "-" + row_id_number + "-0";
next_row_id = row_id_name + '-' + row_id_number_next; next_row_id = row_id_name + '-' + row_id_number_next;
$("#"+previous_row_id).css('display', 'none'); $("#"+previous_row_id).css('display', 'none');
$("#"+current_row_id).css('display', 'none'); $("#"+current_row_id).css('display', 'none');
@ -645,11 +646,12 @@ $(document).ready( function() {
}, },
function (data, status) { function (data, status) {
$("#comment_header_"+id).html(data); $("#comment_header_"+id).html(data);
}); });
} }
//location.reload(); //location.reload();
} else { }
else {
$("#result") $("#result")
.showMessage ("<?php echo __('Could not be validated')?>") .showMessage ("<?php echo __('Could not be validated')?>")
.addClass ("error"); .addClass ("error");
@ -689,7 +691,8 @@ $(document).ready( function() {
function toggleDiv (divid){ function toggleDiv (divid){
if (document.getElementById(divid).style.display == 'none'){ if (document.getElementById(divid).style.display == 'none'){
document.getElementById(divid).style.display = 'block'; document.getElementById(divid).style.display = 'block';
} else { }
else {
document.getElementById(divid).style.display = 'none'; document.getElementById(divid).style.display = 'none';
} }
} }
@ -704,11 +707,12 @@ $(document).ready( function() {
$option = $('#select_validate_' + id_event).val(); $option = $('#select_validate_' + id_event).val();
if ($option == 2) { if ($option == 2) {
$("#standby_alert_checkbox_" + id_event).css('display', ''); $("#standby_alert_checkbox_" + id_event).css('display', '');
} else { }
else {
$("#standby_alert_checkbox_" + id_event).css('display', 'none'); $("#standby_alert_checkbox_" + id_event).css('display', 'none');
} }
}); });
if (display != 'none') { if (display != 'none') {
$('.event_form_' + id_event).css('display', 'none'); $('.event_form_' + id_event).css('display', 'none');
// Hide All showed rows // Hide All showed rows

View File

@ -401,15 +401,16 @@ if ($autorefresh_toogle == 'false'){
} }
else{ else{
// Keeps state with pagination // Keeps state with pagination
if ($autorefresh_toogle == 'no'){ if ($autorefresh_toogle == 'no') {
html_print_input_hidden('toogle_filter', 'false'); html_print_input_hidden('toogle_filter', 'false');
} else { }
else {
// If update button has been pushed then don't collapse filter // If update button has been pushed then don't collapse filter
if ($update_pressed == 'false'){ if ($update_pressed == 'false') {
html_print_input_hidden('toogle_filter', 'false'); html_print_input_hidden('toogle_filter', 'false');
} // Else collapse filter } // Else collapse filter
else{ else {
html_print_input_hidden('toogle_filter', 'true'); html_print_input_hidden('toogle_filter', 'true');
} }
} }
@ -629,9 +630,11 @@ foreach ($result as $event) {
if ($group_rep != 0) { if ($group_rep != 0) {
if ($event["max_estado"] == 2) { if ($event["max_estado"] == 2) {
$estado = 2; $estado = 2;
} else if ($event["min_estado"] == 0) { }
else if ($event["min_estado"] == 0) {
$estado = 0; $estado = 0;
} else { }
else {
$estado = 1; $estado = 1;
} }
} }
@ -639,7 +642,7 @@ foreach ($result as $event) {
else { else {
$estado = $event["estado"]; $estado = $event["estado"];
} }
// Colored box // Colored box
switch($estado) { switch($estado) {
case 0: case 0:
$img_st = "images/star.png"; $img_st = "images/star.png";
@ -689,7 +692,7 @@ foreach ($result as $event) {
$img_sev = "images/status_sets/default/severity_critical.png"; $img_sev = "images/status_sets/default/severity_critical.png";
break; break;
} }
if (in_array('evento', $show_fields)) { if (in_array('evento', $show_fields)) {
// Event description // Event description
$data[$i] = '<span title="'.$event["evento"].'" class="f9">'; $data[$i] = '<span title="'.$event["evento"].'" class="f9">';
@ -698,7 +701,7 @@ foreach ($result as $event) {
$data[$i] .= '</a></span>'; $data[$i] .= '</a></span>';
$i++; $i++;
} }
if (in_array('id_agente', $show_fields)) { if (in_array('id_agente', $show_fields)) {
$data[$i] = '<span style="color: #000000">'; $data[$i] = '<span style="color: #000000">';
@ -945,7 +948,8 @@ foreach ($result as $event) {
$string .= '<b>' . __('Agent name') . '</b></td><td align="left">'; $string .= '<b>' . __('Agent name') . '</b></td><td align="left">';
if ($event["id_agente"] != 0) { if ($event["id_agente"] != 0) {
$string .= ui_print_agent_name ($event["id_agente"], true); $string .= ui_print_agent_name ($event["id_agente"], true);
} else { }
else {
$string .= '<i>- ' . __('Empty') . ' -</i>'; $string .= '<i>- ' . __('Empty') . ' -</i>';
} }
$string .= '</td></tr><tr class="'. $odd .'">'; $string .= '</td></tr><tr class="'. $odd .'">';
@ -1013,7 +1017,8 @@ foreach ($result as $event) {
$odd = ($odd == '')? 'rowOdd' : ''; $odd = ($odd == '')? 'rowOdd' : '';
} else { }
else {
$string .= '<i>- ' . __('Empty') . ' -</i>'; $string .= '<i>- ' . __('Empty') . ' -</i>';
$string .= '</a></td></tr><tr class="' . $odd . '">'; $string .= '</a></td></tr><tr class="' . $odd . '">';
$odd = ($odd == '')? 'rowOdd' : ''; $odd = ($odd == '')? 'rowOdd' : '';
@ -1042,7 +1047,8 @@ foreach ($result as $event) {
$string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Comments') . '</td><td id="comment_row_' . $event['id_evento'] . '" align="left">'; $string .= '<tr class="' . $odd . '"><td align="left" valign="top">' . '<b>' . __('Comments') . '</td><td id="comment_row_' . $event['id_evento'] . '" align="left">';
if($event["user_comment"] != '') { if($event["user_comment"] != '') {
$string .= $event["user_comment"]; $string .= $event["user_comment"];
} else { }
else {
$string .= '<i>- ' . __('Empty') . ' -</i>'; $string .= '<i>- ' . __('Empty') . ' -</i>';
} }
$string .= '</td></tr>'; $string .= '</td></tr>';
@ -1073,7 +1079,8 @@ foreach ($result as $event) {
$string .= $event["source"]; $string .= $event["source"];
$string .= '</td></tr><tr>'; $string .= '</td></tr><tr>';
$odd = ($odd == '')? 'rowOdd' : ''; $odd = ($odd == '')? 'rowOdd' : '';
} else { }
else {
$string .= '<i>- ' . __('Empty') . ' -</i>'; $string .= '<i>- ' . __('Empty') . ' -</i>';
$odd = ($odd == '')? 'rowOdd' : ''; $odd = ($odd == '')? 'rowOdd' : '';
} }
@ -1083,7 +1090,8 @@ foreach ($result as $event) {
$string .= $event["id_extra"]; $string .= $event["id_extra"];
$string .= '</td></tr><tr>'; $string .= '</td></tr><tr>';
$odd = ($odd == '')? 'rowOdd' : ''; $odd = ($odd == '')? 'rowOdd' : '';
} else { }
else {
$string .= '<i>- ' . __('Empty') . ' -</i>'; $string .= '<i>- ' . __('Empty') . ' -</i>';
} }
$string .= '</td></tr>'; $string .= '</td></tr>';

View File

@ -43,7 +43,7 @@ if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM"))
$own_groups = array_keys(users_get_groups($config['id_user'], "IR")); $own_groups = array_keys(users_get_groups($config['id_user'], "IR"));
else else
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false)); $own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
if ($maps !== false) { if ($maps !== false) {
foreach ($maps as $map) { foreach ($maps as $map) {
if ($rowPair) if ($rowPair)
@ -72,8 +72,9 @@ if ($maps !== false) {
if (!empty ($table->data)) { if (!empty ($table->data)) {
html_print_table ($table); html_print_table ($table);
} else { }
echo '<div class="nf">'.__('No maps found').'</div>'; else {
echo '<div class="nf">' . __('No maps found') . '</div>';
} }
unset ($table); unset ($table);
?> ?>

View File

@ -263,12 +263,13 @@ echo '</form>';
if ($count < 1) { if ($count < 1) {
echo '<div class="nf">'.__('No incidents match your search filter').'</div><br />'; echo '<div class="nf">'.__('No incidents match your search filter').'</div><br />';
} else { }
else {
// TOTAL incidents // TOTAL incidents
$url = "index.php?sec=workspace&amp;sec2=operation/incidents/incident"; $url = "index.php?sec=workspace&amp;sec2=operation/incidents/incident";
$estado = -1; $estado = -1;
// add form filter values for group, priority, state, and search fields: user and text // add form filter values for group, priority, state, and search fields: user and text
if ($grupo != -1) if ($grupo != -1)
$url .= "&amp;grupo=".$grupo; $url .= "&amp;grupo=".$grupo;
@ -280,7 +281,7 @@ if ($count < 1) {
$url .= "&amp;usuario=".$usuario; $url .= "&amp;usuario=".$usuario;
if ($texto != '') if ($texto != '')
$url .= "&amp;texto=".$texto; $url .= "&amp;texto=".$texto;
// Show pagination // Show pagination
ui_pagination ($count, $url, $offset, 0, false); //($count + $offset) it's real count of incidents because it's use LIMIT $offset in query. ui_pagination ($count, $url, $offset, 0, false); //($count + $offset) it's real count of incidents because it's use LIMIT $offset in query.
echo '<br />'; echo '<br />';
@ -342,7 +343,8 @@ if ($count < 1) {
if (check_acl ($config["id_user"], $row["id_grupo"], "IM") || $config["id_user"] == $row["id_usuario"] || $config["id_user"] == $row["id_creator"]) { if (check_acl ($config["id_user"], $row["id_grupo"], "IM") || $config["id_user"] == $row["id_usuario"] || $config["id_user"] == $row["id_creator"]) {
$data[8] = html_print_checkbox ("id_inc[]", $row["id_incidencia"], false, true); $data[8] = html_print_checkbox ("id_inc[]", $row["id_incidencia"], false, true);
} else { }
else {
$data[8] = ''; $data[8] = '';
} }
@ -356,7 +358,7 @@ if ($count < 1) {
if (check_acl ($config["id_user"], 0, "IW")) { if (check_acl ($config["id_user"], 0, "IW")) {
html_print_submit_button (__('Delete incidents'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button (__('Delete incidents'), 'delete_btn', false, 'class="sub delete"');
} }
if (check_acl ($config["id_user"], 0, "IM")) { if (check_acl ($config["id_user"], 0, "IM")) {
html_print_submit_button (__('Become owner'), 'own_btn', false, 'class="sub upd"'); html_print_submit_button (__('Become owner'), 'own_btn', false, 'class="sub upd"');
} }

View File

@ -237,7 +237,8 @@ echo '<tr><td class="datos"><b>'.__('Incident').'</b></td><td colspan="3" class=
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_input_text ("titulo", $titulo,'', 70); html_print_input_text ("titulo", $titulo,'', 70);
} else { }
else {
html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly"); html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly");
} }
@ -250,14 +251,16 @@ echo '<tr><td class="datos"><b>'.__('Owner').'</b></td><td class="datos">';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135"); html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135");
} else { }
else {
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true); html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true);
} }
echo '</td><td class="datos"><b>'.__('Status').'</b></td><td class="datos">'; echo '</td><td class="datos"><b>'.__('Status').'</b></td><td class="datos">';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135'); html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135');
} else { }
else {
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135', true); html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135', true);
} }
echo '</td></tr>'; echo '</td></tr>';
@ -276,7 +279,8 @@ foreach ($return as $row) {
// Only owner could change source or user with Incident management privileges // Only owner could change source or user with Incident management privileges
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select ($fields, "origen_form", $origen, '', '', '', false, false, false, 'w135'); html_print_select ($fields, "origen_form", $origen, '', '', '', false, false, false, 'w135');
} else { }
else {
html_print_select ($fields, "origen_form", $origen, '', '', '', false, false, false, 'w135', true); html_print_select ($fields, "origen_form", $origen, '', '', '', false, false, false, 'w135', true);
} }
echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">'; echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
@ -284,7 +288,8 @@ echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
// Group combo // Group combo
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135'); html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135');
} else { }
else {
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true); html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true);
} }
@ -300,7 +305,8 @@ else {
echo '</td><td class="datos"><b>'.__('Creator').'</b></td><td class="datos">'; echo '</td><td class="datos"><b>'.__('Creator').'</b></td><td class="datos">';
if (empty ($id_creator)) { if (empty ($id_creator)) {
echo 'SYSTEM'; echo 'SYSTEM';
} else { }
else {
echo $id_creator.' (<i>'.get_user_fullname($id_creator).'</i>)'; echo $id_creator.' (<i>'.get_user_fullname($id_creator).'</i>)';
} }
@ -336,9 +342,11 @@ echo '</td></tr></table><div style="width: 98%; text-align:right;">';
// Only if user is the used who opened incident or (s)he is admin // Only if user is the used who opened incident or (s)he is admin
if (isset ($id_inc) AND ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) { if (isset ($id_inc) AND ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) {
html_print_submit_button (__('Update incident'), "accion", false, 'class="sub upd"'); html_print_submit_button (__('Update incident'), "accion", false, 'class="sub upd"');
} elseif (check_acl ($config["id_user"], $id_grupo, "IW")) { }
elseif (check_acl ($config["id_user"], $id_grupo, "IW")) {
html_print_submit_button (__('Create'), "accion", false, 'class="sub wand"'); html_print_submit_button (__('Create'), "accion", false, 'class="sub wand"');
} else { }
else {
html_print_submit_button (__('Submit'), "accion", true, 'class="sub upd"'); html_print_submit_button (__('Submit'), "accion", true, 'class="sub upd"');
} }
echo "</div></form>"; echo "</div></form>";
@ -350,7 +358,7 @@ if (isset ($id_inc)) {
// ******************************************************************** // ********************************************************************
echo '<div>'; echo '<div>';
echo '<a class="note_control" href="#">'; echo '<a class="note_control" href="#">';
echo html_print_image ('images/add.png', true); echo html_print_image ('images/add.png', true);
echo __('Add note'); echo __('Add note');
@ -361,7 +369,7 @@ if (isset ($id_inc)) {
<tr><td class="datos2"><textarea name="nota" rows="5" cols="70" style="height: 100px;"></textarea></td> <tr><td class="datos2"><textarea name="nota" rows="5" cols="70" style="height: 100px;"></textarea></td>
<td valign="bottom"><input name="addnote" type="submit" class="sub wand" value="'.__('Add').'"></td></tr> <td valign="bottom"><input name="addnote" type="submit" class="sub wand" value="'.__('Add').'"></td></tr>
</table></form></div><div>'; </table></form></div><div>';
$result = incidents_get_notes ($id_inc); $result = incidents_get_notes ($id_inc);
$table->cellpadding = 4; $table->cellpadding = 4;
@ -394,34 +402,34 @@ if (isset ($id_inc)) {
} }
unset ($table); unset ($table);
// ************************************************************ // ************************************************************
// Files attached to this incident // Files attached to this incident
// ************************************************************ // ************************************************************
$result = incidents_get_attach ($id_inc); $result = incidents_get_attach ($id_inc);
$table->cellpadding = 4; $table->cellpadding = 4;
$table->cellspacing = 4; $table->cellspacing = 4;
$table->class = "databox"; $table->class = "databox";
$table->width = '98%'; $table->width = '98%';
$table->head = array (); $table->head = array ();
$table->data = array (); $table->data = array ();
$table->head[0] = __('Filename'); $table->head[0] = __('Filename');
$table->head[1] = __('Description'); $table->head[1] = __('Description');
$table->head[2] = __('Size'); $table->head[2] = __('Size');
$table->head[3] = __('Delete'); $table->head[3] = __('Delete');
$table->align[2] = "center"; $table->align[2] = "center";
$table->align[3] = "center"; $table->align[3] = "center";
foreach ($result as $row) { foreach ($result as $row) {
if (file_exists($config['homedir'] . '/attachment/pand'.$row["id_attachment"].'_'.io_safe_output($row["filename"]). ".zip")) if (file_exists($config['homedir'] . '/attachment/pand'.$row["id_attachment"].'_'.io_safe_output($row["filename"]). ".zip"))
$url = 'attachment/pand'.$row["id_attachment"].'_'.io_safe_output($row["filename"]). ".zip"; $url = 'attachment/pand'.$row["id_attachment"].'_'.io_safe_output($row["filename"]). ".zip";
else else
$url = 'attachment/pand'.$row["id_attachment"].'_'.io_safe_output($row["filename"]); $url = 'attachment/pand'.$row["id_attachment"].'_'.io_safe_output($row["filename"]);
$data[0] = html_print_image("images/disk.png", true, array("border" => '0', "align" => "top")) . $data[0] = html_print_image("images/disk.png", true, array("border" => '0', "align" => "top")) .
'&nbsp;&nbsp;<a target="_new" href="' . $url . '"><b>'.$row["filename"].'</b></a>'; '&nbsp;&nbsp;<a target="_new" href="' . $url . '"><b>'.$row["filename"].'</b></a>';
$data[1] = $row["description"]; $data[1] = $row["description"];
@ -434,7 +442,7 @@ if (isset ($id_inc)) {
} }
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if (!empty ($table->data)) { if (!empty ($table->data)) {
echo "<h4>".__('Attached files')."</h4>"; echo "<h4>".__('Attached files')."</h4>";
echo '<form method="POST" action="index.php?sec=workspace&sec2=operation/incidents/incident_detail&id='.$id_inc.'">'; echo '<form method="POST" action="index.php?sec=workspace&sec2=operation/incidents/incident_detail&id='.$id_inc.'">';
@ -442,22 +450,22 @@ if (isset ($id_inc)) {
echo '</form>'; echo '</form>';
} }
unset ($table); unset ($table);
// ************************************************************ // ************************************************************
// Upload control // Upload control
// ************************************************************ // ************************************************************
// Upload control // Upload control
if ((check_acl($config["id_user"], $id_grupo, "IW")==1)) { if ((check_acl($config["id_user"], $id_grupo, "IW")==1)) {
echo '<div>'; echo '<div>';
echo '<a class="attachment" href="#">'; echo '<a class="attachment" href="#">';
echo html_print_image ('images/add.png', true); echo html_print_image ('images/add.png', true);
echo __('Add attachment'); echo __('Add attachment');
echo '</a>'; echo '</a>';
echo '</div>'; echo '</div>';
echo '<div><form method="post" id="file_control" action="index.php?sec=workspace&sec2=operation/incidents/incident_detail&id='.$id_inc.'&upload_file=1" enctype="multipart/form-data"><h4>'.__('Add attachment').'</h4>'; echo '<div><form method="post" id="file_control" action="index.php?sec=workspace&sec2=operation/incidents/incident_detail&id='.$id_inc.'&upload_file=1" enctype="multipart/form-data"><h4>'.__('Add attachment').'</h4>';
echo '<table cellpadding="4" cellspacing="3" class="databox" width="98%"> echo '<table cellpadding="4" cellspacing="3" class="databox" width="98%">
<tr><td class="datos">'.__('Filename').'</td><td class="datos"><input type="file" name="userfile" value="userfile" class="sub" size="40" /></td></tr> <tr><td class="datos">'.__('Filename').'</td><td class="datos"><input type="file" name="userfile" value="userfile" class="sub" size="40" /></td></tr>
@ -467,9 +475,8 @@ if (isset ($id_inc)) {
} }
} }
?> ?>
<script> <script>
$(document).ready (function () { $(document).ready (function () {
agent_autocomplete('#text-agent', '#hidden-server_name', '#hidden-id_agent'); agent_autocomplete('#text-agent', '#hidden-server_name', '#hidden-id_agent');
}); });
</script> </script>

View File

@ -178,7 +178,8 @@ elseif (isset ($_GET["insert_form"])) {
} }
$prioridad = 0; $prioridad = 0;
$id_grupo = 0; $id_grupo = 0;
} else { }
else {
db_pandora_audit("HACK","Trying to get to incident details in an unusual way"); db_pandora_audit("HACK","Trying to get to incident details in an unusual way");
require ("general/noaccess.php"); require ("general/noaccess.php");
exit; exit;
@ -212,7 +213,8 @@ if (isset ($id_inc)) { //If $id_inc is set (when $_GET["id"] is set, not $_GET["
ui_print_page_header (__('Incident details'). ' #'.$id_inc, "images/book_edit.png", false, "", false, ""); ui_print_page_header (__('Incident details'). ' #'.$id_inc, "images/book_edit.png", false, "", false, "");
echo '<form name="accion_form" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident&action=update">'; echo '<form name="accion_form" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident&action=update">';
echo '<input type="hidden" name="id_inc" value="'.$id_inc.'">'; echo '<input type="hidden" name="id_inc" value="'.$id_inc.'">';
} else { }
else {
ui_print_page_header (__('Create incident'), "images/book_edit.png", false, "", false, ""); ui_print_page_header (__('Create incident'), "images/book_edit.png", false, "", false, "");
echo '<form name="accion_form" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident&action=insert">'; echo '<form name="accion_form" method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident&action=insert">';
} }
@ -222,7 +224,8 @@ echo '<tr><td class="datos"><b>'.__('Incident').'</b></td><td colspan="3" class=
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_input_text ("titulo", $titulo,'', 70); html_print_input_text ("titulo", $titulo,'', 70);
} else { }
else {
html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly"); html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly");
} }
@ -235,7 +238,8 @@ echo '<tr><td class="datos"><b>'.__('Owner').'</b></td><td class="datos">';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135"); html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135");
} else { }
else {
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true); html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true);
} }
echo '</td><td class="datos"><b>'.__('Status').'</b></td><td class="datos">'; echo '</td><td class="datos"><b>'.__('Status').'</b></td><td class="datos">';
@ -271,7 +275,8 @@ echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
// Group combo // Group combo
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135'); html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135');
} else { }
else {
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true); html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true);
} }
@ -279,14 +284,16 @@ echo '</td></tr><tr><td class="datos"><b>'.__('Priority').'</b></td><td class="d
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135'); html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135');
} else { }
else {
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135', true); html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135', true);
} }
echo '</td><td class="datos"><b>'.__('Creator').'</b></td><td class="datos">'; echo '</td><td class="datos"><b>'.__('Creator').'</b></td><td class="datos">';
if (empty ($id_creator)) { if (empty ($id_creator)) {
echo 'SYSTEM'; echo 'SYSTEM';
} else { }
else {
echo $id_creator.' (<i>'.get_user_fullname($id_creator).'</i>)'; echo $id_creator.' (<i>'.get_user_fullname($id_creator).'</i>)';
} }
@ -294,7 +301,8 @@ echo '</td></tr><tr><td class="datos2" colspan="4">';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"'); html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"');
} else { }
else {
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled'); html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled');
} }
@ -303,9 +311,11 @@ echo '</td></tr></table><div style="width: 650px; text-align:right;">';
// Only if user is the used who opened incident or (s)he is admin // Only if user is the used who opened incident or (s)he is admin
if (isset ($id_inc) AND ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) { if (isset ($id_inc) AND ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) {
html_print_submit_button (__('Update incident'), "accion", false, 'class="sub upd"'); html_print_submit_button (__('Update incident'), "accion", false, 'class="sub upd"');
} elseif (check_acl ($config["id_user"], $id_grupo, "IW")) { }
elseif (check_acl ($config["id_user"], $id_grupo, "IW")) {
html_print_submit_button (__('Create'), "accion", false, 'class="sub wand"'); html_print_submit_button (__('Create'), "accion", false, 'class="sub wand"');
} else { }
else {
html_print_submit_button (__('Submit'), "accion", true, 'class="sub upd"'); html_print_submit_button (__('Submit'), "accion", true, 'class="sub upd"');
} }
echo "</div></form>"; echo "</div></form>";
@ -389,12 +399,13 @@ if (isset ($id_inc)) {
$data[2] = format_for_graph ($row["size"])."B"; $data[2] = format_for_graph ($row["size"])."B";
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) { if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
$data[3] = html_print_input_image ("delete_file", "images/cross.png", $row["id_attachment"], 'border:0px;" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;', true); $data[3] = html_print_input_image ("delete_file", "images/cross.png", $row["id_attachment"], 'border:0px;" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;', true);
} else { }
else {
$data[3] = ''; $data[3] = '';
} }
array_push ($table->data, $data); array_push ($table->data, $data);
} }
if (!empty ($table->data)) { if (!empty ($table->data)) {
echo "<h3>".__('Attached files')."</h3>"; echo "<h3>".__('Attached files')."</h3>";
echo '<form method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id='.$id_inc.'">'; echo '<form method="POST" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id='.$id_inc.'">';
@ -402,22 +413,22 @@ if (isset ($id_inc)) {
echo '</form>'; echo '</form>';
} }
unset ($table); unset ($table);
// ************************************************************ // ************************************************************
// Upload control // Upload control
// ************************************************************ // ************************************************************
// Upload control // Upload control
if ((check_acl($config["id_user"], $id_grupo, "IW")==1)) { if ((check_acl($config["id_user"], $id_grupo, "IW")==1)) {
echo '<div>'; echo '<div>';
echo '<a class="attachment" href="#">'; echo '<a class="attachment" href="#">';
echo html_print_image ('images/add.png', true); echo html_print_image ('images/add.png', true);
echo __('Add attachment'); echo __('Add attachment');
echo '</a>'; echo '</a>';
echo '</div>'; echo '</div>';
echo '<div><form method="post" id="file_control" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id='.$id_inc.'&upload_file=1" enctype="multipart/form-data"><h3>'.__('Add attachment').'</h3>'; echo '<div><form method="post" id="file_control" action="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id='.$id_inc.'&upload_file=1" enctype="multipart/form-data"><h3>'.__('Add attachment').'</h3>';
echo '<table cellpadding="4" cellspacing="3" class="databox" width="400"> echo '<table cellpadding="4" cellspacing="3" class="databox" width="400">
<tr><td class="datos">'.__('Filename').'</td><td class="datos"><input type="file" name="userfile" value="userfile" class="sub" size="40" /></td></tr> <tr><td class="datos">'.__('Filename').'</td><td class="datos"><input type="file" name="userfile" value="userfile" class="sub" size="40" /></td></tr>
@ -426,4 +437,4 @@ if (isset ($id_inc)) {
</table></form></div>'; </table></form></div>';
} }
} }
?> ?>

View File

@ -50,7 +50,8 @@ if ($read_message) {
$message_id = (int) get_parameter ("id_message"); $message_id = (int) get_parameter ("id_message");
if ($show_sent) { if ($show_sent) {
$message = messages_get_message_sent ($message_id); $message = messages_get_message_sent ($message_id);
} else { }
else {
$message = messages_get_message ($message_id); $message = messages_get_message ($message_id);
messages_process_read ($message_id); messages_process_read ($message_id);
} }
@ -88,11 +89,12 @@ if ($read_message) {
$table->data[3][0] = __('Message'); $table->data[3][0] = __('Message');
$table->data[3][1] = html_print_textarea ("message", 15, 255, $message["mensaje"], 'readonly', true); $table->data[3][1] = html_print_textarea ("message", 15, 255, $message["mensaje"], 'readonly', true);
//Prevent RE: RE: RE: //Prevent RE: RE: RE:
if (strstr ($message["subject"], "RE:")) { if (strstr ($message["subject"], "RE:")) {
$new_subj = $message["subject"]; $new_subj = $message["subject"];
} else { }
else {
$new_subj = "RE: ".$message["subject"]; $new_subj = "RE: ".$message["subject"];
} }
@ -100,11 +102,11 @@ if ($read_message) {
$new_msg = "\n\n\nOn ".date ($config["date_format"], $message["timestamp"]).' '.$user_name.' '.__('wrote').":\n\n".$message["mensaje"]; $new_msg = "\n\n\nOn ".date ($config["date_format"], $message["timestamp"]).' '.$user_name.' '.__('wrote').":\n\n".$message["mensaje"];
echo '<form method="post" action="index.php?sec=workspace&amp;sec2=operation/messages/message_list&show_sent=1&amp;delete_message=1&amp;id='.$message_id.'">'; echo '<form method="post" action="index.php?sec=workspace&amp;sec2=operation/messages/message_list&show_sent=1&amp;delete_message=1&amp;id='.$message_id.'">';
html_print_table($table); html_print_table($table);
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>"; echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
echo "</div>"; echo "</div>";
echo "</form>"; echo "</form>";
echo '<form method="post" action="index.php?sec=workspace&sec2=operation/messages/message_edit&amp;new_msg=1&amp;reply=1">'; echo '<form method="post" action="index.php?sec=workspace&sec2=operation/messages/message_edit&amp;new_msg=1&amp;reply=1">';
html_print_input_hidden ("dst_user", $message["id_usuario_origen"]); html_print_input_hidden ("dst_user", $message["id_usuario_origen"]);

View File

@ -87,7 +87,8 @@ if ($show_sent) { //sent view
echo '<p>'.__('You have').' <b>'.$num_messages.'</b> '.' '.__('sent message(s)').'.</p>'; echo '<p>'.__('You have').' <b>'.$num_messages.'</b> '.' '.__('sent message(s)').'.</p>';
} }
$messages = messages_get_overview_sent ('', 'DESC'); $messages = messages_get_overview_sent ('', 'DESC');
} else { //messages received }
else { //messages received
$num_messages = messages_get_count ($config["id_user"]); $num_messages = messages_get_count ($config["id_user"]);
if ($num_messages > 0 && !is_ajax()) { if ($num_messages > 0 && !is_ajax()) {
echo '<p>'.__('You have').' <b>'.$num_messages.'</b> '.' '.__('unread message(s)').'.</p>'; echo '<p>'.__('You have').' <b>'.$num_messages.'</b> '.' '.__('unread message(s)').'.</p>';
@ -97,7 +98,8 @@ if ($show_sent) { //sent view
if (empty ($messages)) { if (empty ($messages)) {
echo '<div class="nf">'.__('There are no messages').'</div>'; echo '<div class="nf">'.__('There are no messages').'</div>';
} else { }
else {
$table->width = "98%"; $table->width = "98%";
$table->class = "databox"; $table->class = "databox";
$table->cellpadding = 4; $table->cellpadding = 4;
@ -135,17 +137,20 @@ if (empty ($messages)) {
$data[0] .= '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&read_message=1&amp;show_sent=1&amp;id_message='.$message_id.'">'; $data[0] .= '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&read_message=1&amp;show_sent=1&amp;id_message='.$message_id.'">';
$data[0] .= html_print_image ("images/email_open.png", true, array ("border" => 0, "title" => __('Click to read'))); $data[0] .= html_print_image ("images/email_open.png", true, array ("border" => 0, "title" => __('Click to read')));
$data[0] .= '</a>'; $data[0] .= '</a>';
} else { }
else {
$data[0] .= '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_list&amp;mark_unread=1&amp;id_message='.$message_id.'">'; $data[0] .= '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_list&amp;mark_unread=1&amp;id_message='.$message_id.'">';
$data[0] .= html_print_image ("images/email_open.png", true, array ("border" => 0, "title" => __('Mark as unread'))); $data[0] .= html_print_image ("images/email_open.png", true, array ("border" => 0, "title" => __('Mark as unread')));
$data[0] .= '</a>'; $data[0] .= '</a>';
} }
} else { }
else {
if ($show_sent) { if ($show_sent) {
$data[0] .= '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;show_sent=1&amp;id_message='.$message_id.'">'; $data[0] .= '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;show_sent=1&amp;id_message='.$message_id.'">';
$data[0] .= html_print_image ("images/email.png", true, array ("border" => 0, "title" => __('Message unread - click to read'))); $data[0] .= html_print_image ("images/email.png", true, array ("border" => 0, "title" => __('Message unread - click to read')));
$data[0] .= '</a>'; $data[0] .= '</a>';
} else { }
else {
$data[0] .= '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;id_message='.$message_id.'">'; $data[0] .= '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;id_message='.$message_id.'">';
$data[0] .= html_print_image ("images/email.png", true, array ("border" => 0, "title" => __('Message unread - click to read'))); $data[0] .= html_print_image ("images/email.png", true, array ("border" => 0, "title" => __('Message unread - click to read')));
$data[0] .= '</a>'; $data[0] .= '</a>';
@ -158,7 +163,8 @@ if (empty ($messages)) {
$dest_user = $message["dest"]; $dest_user = $message["dest"];
} }
$data[1] = $dest_user; $data[1] = $dest_user;
} else { }
else {
$orig_user = get_user_fullname ($message["sender"]); $orig_user = get_user_fullname ($message["sender"]);
if (!$orig_user) { if (!$orig_user) {
$orig_user = $message["sender"]; $orig_user = $message["sender"];
@ -168,12 +174,14 @@ if (empty ($messages)) {
if ($show_sent) { if ($show_sent) {
$data[2] = '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&amp;read_message=1&show_sent=1&amp;id_message='.$message_id.'">'; $data[2] = '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&amp;read_message=1&show_sent=1&amp;id_message='.$message_id.'">';
} else { }
else {
$data[2] = '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;id_message='.$message_id.'">'; $data[2] = '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_edit&amp;read_message=1&amp;id_message='.$message_id.'">';
} }
if ($message["subject"] == "") { if ($message["subject"] == "") {
$data[2] .= __('No Subject'); $data[2] .= __('No Subject');
} else { }
else {
$data[2] .= $message["subject"]; $data[2] .= $message["subject"];
} }
$data[2] .= '</a>'; $data[2] .= '</a>';
@ -185,7 +193,8 @@ if (empty ($messages)) {
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' . onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' .
html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'. html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'.
html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true); html_print_checkbox_extended ('delete_multiple[]', $message_id, false, false, '', 'class="check_delete"', true);
} else { }
else {
$data[4] = '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_list&delete_message=1&id='.$message_id.'" $data[4] = '<a href="index.php?sec=workspace&amp;sec2=operation/messages/message_list&delete_message=1&id='.$message_id.'"
onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' . onClick="javascript:if (!confirm(\''.__('Are you sure?').'\')) return false;">' .
html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'. html_print_image ('images/cross.png', true, array("title" => __('Delete'))) . '</a>'.

View File

@ -42,7 +42,7 @@ if ($id) {
$period = get_parameter('period', '86400'); $period = get_parameter('period', '86400');
$update_date = get_parameter('update_date', 0); $update_date = get_parameter('update_date', 0);
if($update_date){ if ($update_date) {
$date = get_parameter_post ('date'); $date = get_parameter_post ('date');
$time = get_parameter_post ('time'); $time = get_parameter_post ('time');
$interval = get_parameter('period','86400'); $interval = get_parameter('period','86400');
@ -72,19 +72,19 @@ echo '<form method="post" action="index.php?sec=netf&sec2=operation/netflow/nf_v
$table->cellpadding = 5; $table->cellpadding = 5;
$table->class = "databox_color"; $table->class = "databox_color";
$table->style[0] = 'vertical-align: top;'; $table->style[0] = 'vertical-align: top;';
$table->data = array (); $table->data = array ();
$table->data[0][0] = '<b>'.__('Date').'</b>'; $table->data[0][0] = '<b>'.__('Date').'</b>';
$table->data[0][1] = html_print_input_text ('date', $date, false, 10, 10, true); $table->data[0][1] = html_print_input_text ('date', $date, false, 10, 10, true);
$table->data[0][1] .= html_print_image ("images/calendar_view_day.png", true, array ("alt" => "calendar", "onclick" => "scwShow(scwID('text-date'),this);")); $table->data[0][1] .= html_print_image ("images/calendar_view_day.png", true, array ("alt" => "calendar", "onclick" => "scwShow(scwID('text-date'),this);"));
$table->data[0][1] .= html_print_input_text ('time', $time, false, 10, 5, true); $table->data[0][1] .= html_print_input_text ('time', $time, false, 10, 5, true);
$table->data[1][0] = '<b>'.__('Interval').'</b>'; $table->data[1][0] = '<b>'.__('Interval').'</b>';
$table->data[1][1] = html_print_select (netflow_get_valid_intervals (), 'period', $period, '', '', 0, true, false, false); $table->data[1][1] = html_print_select (netflow_get_valid_intervals (), 'period', $period, '', '', 0, true, false, false);
html_print_table ($table); html_print_table ($table);
echo '<div class="action-buttons" style="width:60%;">'; echo '<div class="action-buttons" style="width:60%;">';
html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"'); html_print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
html_print_input_hidden ('update_date', 1); html_print_input_hidden ('update_date', 1);
@ -107,7 +107,7 @@ if (empty ($all_rcs)) {
// Process report items // Process report items
for ($x = 0; isset($all_rcs[$x]['id_rc']); $x++) { for ($x = 0; isset($all_rcs[$x]['id_rc']); $x++) {
// Get report item // Get report item
$report_id = $all_rcs[$x]['id_rc']; $report_id = $all_rcs[$x]['id_rc'];
$content_report = db_get_row_sql("SELECT * FROM tnetflow_report_content WHERE id_rc='$report_id'"); $content_report = db_get_row_sql("SELECT * FROM tnetflow_report_content WHERE id_rc='$report_id'");
@ -120,21 +120,18 @@ for ($x = 0; isset($all_rcs[$x]['id_rc']); $x++) {
// Get the command to call nfdump // Get the command to call nfdump
$command = netflow_get_command ($filter); $command = netflow_get_command ($filter);
if ($filter['aggregate'] != 'none') { if ($filter['aggregate'] != 'none') {
echo '<h4>' . $filter['id_name'] . ' (' . __($filter['aggregate']) . '/' . __($filter['output']) . ')</h4>'; echo '<h4>' . $filter['id_name'] . ' (' . __($filter['aggregate']) . '/' . __($filter['output']) . ')</h4>';
} else { }
else {
echo '<h4>' . $filter['id_name'] . ' (' . __($filter['output']) . ')</h4>'; echo '<h4>' . $filter['id_name'] . ' (' . __($filter['output']) . ')</h4>';
} }
// Build a unique id for the cache // Build a unique id for the cache
$unique_id = $report_id . '_' . $content_id . '_' . ($end_date - $start_date); $unique_id = $report_id . '_' . $content_id . '_' . ($end_date - $start_date);
// Draw // Draw
netflow_draw_item ($start_date, $end_date, $type, $filter, $command, $filter, $max_aggregates, $unique_id); netflow_draw_item ($start_date, $end_date, $type, $filter, $command, $filter, $max_aggregates, $unique_id);
} }
?>
?>

View File

@ -102,9 +102,9 @@ if ($view_graph) {
include ("general/noaccess.php"); include ("general/noaccess.php");
exit; exit;
} }
$url = "index.php?sec=reporting&sec2=operation/reporting/graph_viewer&id=$id_graph&view_graph=1"; $url = "index.php?sec=reporting&sec2=operation/reporting/graph_viewer&id=$id_graph&view_graph=1";
if (check_acl ($config['id_user'], 0, "IW")) { if (check_acl ($config['id_user'], 0, "IW")) {
$options['setup'] = "<a href='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id=$id_graph'>" $options['setup'] = "<a href='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id=$id_graph'>"
. html_print_image ("images/setup.png", true, array ("title" => __('Setup'))) . html_print_image ("images/setup.png", true, array ("title" => __('Setup')))
@ -115,15 +115,16 @@ if ($view_graph) {
$options['screen'] = "<a href='$url&pure=1'>" $options['screen'] = "<a href='$url&pure=1'>"
. html_print_image ("images/fullscreen.png", true, array ("title" => __('Full screen mode'))) . html_print_image ("images/fullscreen.png", true, array ("title" => __('Full screen mode')))
. "</a>"; . "</a>";
} else { }
else {
$options['screen'] = "<a href='$url&pure=0'>" $options['screen'] = "<a href='$url&pure=0'>"
. html_print_image ("images/normalscreen.png", true, array ("title" => __('Back to normal mode'))) . html_print_image ("images/normalscreen.png", true, array ("title" => __('Back to normal mode')))
. "</a>"; . "</a>";
} }
// Header // Header
ui_print_page_header (__('Reporting'). " &raquo; ". __('Custom graphs')." - ".$graph['name'], "images/reporting.png", false, "", false, $options); ui_print_page_header (__('Reporting'). " &raquo; ". __('Custom graphs')." - ".$graph['name'], "images/reporting.png", false, "", false, $options);
echo "<table class='databox_frame' cellpadding='0' cellspacing='0' width='98%'>"; echo "<table class='databox_frame' cellpadding='0' cellspacing='0' width='98%'>";
echo "<tr><td>"; echo "<tr><td>";
custom_graphs_print ($id_graph, $height, $width, $period, $stacked, false, $unixdate); custom_graphs_print ($id_graph, $height, $width, $period, $stacked, false, $unixdate);
@ -145,9 +146,9 @@ if ($view_graph) {
echo "<b>".__('Period')."</b>"; echo "<b>".__('Period')."</b>";
echo "</td>"; echo "</td>";
echo "<td class='datos'>"; echo "<td class='datos'>";
echo html_print_extended_select_for_time ('period', $period, '', '', '0', 10, true); echo html_print_extended_select_for_time ('period', $period, '', '', '0', 10, true);
echo "</td>"; echo "</td>";
echo "<td class='datos'>"; echo "<td class='datos'>";
$stackeds = array (); $stackeds = array ();

View File

@ -83,7 +83,8 @@ else {
foreach ($reports as $report) { foreach ($reports as $report) {
if($linkReport) { if($linkReport) {
$reportstring = "<a href='?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&id_report=" . $report['id_report'] . "' title='" . __("Edit") . "'>" . $report['name'] . "</a>"; $reportstring = "<a href='?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&id_report=" . $report['id_report'] . "' title='" . __("Edit") . "'>" . $report['name'] . "</a>";
} else { }
else {
$reportstring = $report['name']; $reportstring = $report['name'];
} }
$data = array( $data = array(
@ -96,9 +97,9 @@ else {
array_push($table->data, $data); array_push($table->data, $data);
} }
echo "<br />";ui_pagination ($totalReports); echo "<br />";ui_pagination ($totalReports);
html_print_table ($table); unset($table); html_print_table ($table); unset($table);
ui_pagination ($totalReports); ui_pagination ($totalReports);
} }
?> ?>

View File

@ -644,7 +644,8 @@ function CheckAll() {
function toggleDiv (divid){ function toggleDiv (divid){
if (document.getElementById(divid).style.display == 'none'){ if (document.getElementById(divid).style.display == 'none'){
document.getElementById(divid).style.display = 'block'; document.getElementById(divid).style.display = 'block';
} else { }
else {
document.getElementById(divid).style.display = 'none'; document.getElementById(divid).style.display = 'none';
} }
} }

View File

@ -49,13 +49,13 @@ if (is_ajax ()){
$shortcut_update = get_parameter("shortcut_update", 0); $shortcut_update = get_parameter("shortcut_update", 0);
// Update of user to show/don't show shortcut bar // Update of user to show/don't show shortcut bar
if ($shortcut_update){ if ($shortcut_update) {
// First we get the actual state // First we get the actual state
$shortcut_value = db_get_value_filter('shortcut', 'tusuario', array('id_user' => $id)); $shortcut_value = db_get_value_filter('shortcut', 'tusuario', array('id_user' => $id));
//Deactivate shorcut var //Deactivate shorcut var
if ($shortcut_value == 1){ if ($shortcut_value == 1) {
db_process_sql_update('tusuario', array('shortcut' => 0), array('id_user' => $id)); db_process_sql_update('tusuario', array('shortcut' => 0), array('id_user' => $id));
} }
// Activate shortcut var // Activate shortcut var
@ -64,7 +64,7 @@ if (is_ajax ()){
} }
} }
return; return;
} }
@ -198,7 +198,8 @@ if ($view_mode === false) {
html_print_input_text_extended ("password_new", "", '', '', '15', '25', $view_mode, '', 'class="input"', false, true); html_print_input_text_extended ("password_new", "", '', '', '15', '25', $view_mode, '', 'class="input"', false, true);
echo '</td></tr><tr><td class="datos">'.__('Password confirmation').'</td><td class="datos">'; echo '</td></tr><tr><td class="datos">'.__('Password confirmation').'</td><td class="datos">';
html_print_input_text_extended ("password_conf", "", '', '', '15', '25', $view_mode, '', 'class="input"', false, true); html_print_input_text_extended ("password_conf", "", '', '', '15', '25', $view_mode, '', 'class="input"', false, true);
} else { }
else {
echo '<i>'.__('You can not change your password from Pandora FMS under the current authentication scheme').'</i>'; echo '<i>'.__('You can not change your password from Pandora FMS under the current authentication scheme').'</i>';
} }
} }
@ -221,7 +222,7 @@ $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"))
$display_all_group = true; $display_all_group = true;
else else
$display_all_group = false; $display_all_group = false;
$usr_groups = (users_get_groups($config['id_user'], 'AR', $display_all_group)); $usr_groups = (users_get_groups($config['id_user'], 'AR', $display_all_group));
$id_usr = $config['id_user']; $id_usr = $config['id_user'];
@ -265,7 +266,8 @@ $dashboards = get_user_dashboards ($config['id_user']);
$dashboards_aux = array(); $dashboards_aux = array();
if ($dashboards === false) { if ($dashboards === false) {
$dashboards = array('None'=>'None'); $dashboards = array('None'=>'None');
} else { }
else {
foreach ($dashboards as $key=>$dashboard) { foreach ($dashboards as $key=>$dashboard) {
$dashboards_aux[$dashboard['name']] = $dashboard['name']; $dashboards_aux[$dashboard['name']] = $dashboard['name'];
} }
@ -276,7 +278,8 @@ $layouts = visual_map_get_user_layouts ($config['id_user'], true);
$layouts_aux = array(); $layouts_aux = array();
if ($layouts === false) { if ($layouts === false) {
$layouts_aux = array('None'=>'None'); $layouts_aux = array('None'=>'None');
} else { }
else {
foreach ($layouts as $layout) { foreach ($layouts as $layout) {
$layouts_aux[$layout] = $layout; $layouts_aux[$layout] = $layout;
} }
@ -290,7 +293,8 @@ echo '</td></tr></table>';
echo '<div style="width:90%; text-align:right;">'; echo '<div style="width:90%; text-align:right;">';
if (!$config["user_can_update_info"]) { if (!$config["user_can_update_info"]) {
echo '<i>'.__('You can not change your user info from Pandora FMS under the current authentication scheme').'</i>'; echo '<i>'.__('You can not change your user info from Pandora FMS under the current authentication scheme').'</i>';
} else { }
else {
html_print_submit_button (__('Update'), 'uptbutton', $view_mode, 'class="sub upd"'); html_print_submit_button (__('Update'), 'uptbutton', $view_mode, 'class="sub upd"');
} }
echo '</div></form>'; echo '</div></form>';
@ -324,7 +328,8 @@ foreach ($result as $profile) {
if (!empty ($table->data)) { if (!empty ($table->data)) {
html_print_table ($table); html_print_table ($table);
} else { }
else {
echo '<div class="nf">'.__('This user doesn\'t have any assigned profile/group').'</div>'; echo '<div class="nf">'.__('This user doesn\'t have any assigned profile/group').'</div>';
} }
?> ?>