Fixed that exported csv file of audit log contains unnecessary data.
This commit is contained in:
parent
14c5ec6b87
commit
85475bd6cc
|
@ -299,7 +299,7 @@ html_print_table ($table);
|
|||
echo '<div style="width: '.$table->width.'" class="action-buttons">';
|
||||
echo '<a href="' .
|
||||
ui_get_full_url(false, false, false, false) . 'index.php?sec=gextensions&sec2=godmode/audit_log_csv&tipo_log='.$tipo_log.'&user_filter='.$user_filter.'&filter_text='.$filter_text.'&filter_hours_old='.$filter_hours_old.'&filter_ip='.$filter_ip.'"'.
|
||||
'target="_new">' .
|
||||
'>' .
|
||||
html_print_button (__('Export to CSV '), 'export_csv', false, '', 'class=sub upd', true, false). '</a>';
|
||||
echo '</div>';
|
||||
|
||||
|
|
|
@ -2293,6 +2293,11 @@ function print_audit_csv ($data) {
|
|||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
if (!$data) {
|
||||
echo __('No data found to export');
|
||||
return 0;
|
||||
}
|
||||
|
||||
$config['ignore_callback'] = true;
|
||||
while (@ob_end_clean ());
|
||||
|
||||
|
@ -2301,19 +2306,19 @@ function print_audit_csv ($data) {
|
|||
header("Pragma: no-cache");
|
||||
header("Expires: 0");
|
||||
|
||||
if ($data) {
|
||||
echo __('User') . ';' .
|
||||
__('Action') . ';' .
|
||||
__('Date') . ';' .
|
||||
__('Source ID') . ';' .
|
||||
__('Comments') ."\n";
|
||||
foreach ($data as $line) {
|
||||
echo io_safe_output($line['id_usuario']) . ';' . io_safe_output($line['accion']) . ';' . $line['fecha'] . ';' . $line['ip_origen'] . ';'. io_safe_output($line['descripcion']). "\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo __('No data found to export');
|
||||
// BOM
|
||||
print pack('C*',0xEF,0xBB,0xBF);
|
||||
|
||||
echo __('User') . ';' .
|
||||
__('Action') . ';' .
|
||||
__('Date') . ';' .
|
||||
__('Source ID') . ';' .
|
||||
__('Comments') ."\n";
|
||||
foreach ($data as $line) {
|
||||
echo io_safe_output($line['id_usuario']) . ';' . io_safe_output($line['accion']) . ';' . $line['fecha'] . ';' . $line['ip_origen'] . ';'. io_safe_output($line['descripcion']). "\n";
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue