#12522 enhanced audit log

This commit is contained in:
Daniel Cebrian 2023-12-27 16:05:34 +01:00
parent dd4129a136
commit 05ec992fac
6 changed files with 42 additions and 16 deletions

View File

@ -280,18 +280,17 @@ function dbmgr_extension_main()
if (is_array($result) === false) {
echo '<strong>Output: <strong>'.$result;
db_pandora_audit(
AUDIT_LOG_SYSTEM,
'DB Interface Extension. SQL',
false,
false,
$sql
);
return;
}
db_pandora_audit(
AUDIT_LOG_SYSTEM,
'DB Interface Extension. SQL',
false,
false,
$sql
);
echo "<div class='overflow'>";
$table = new stdClass();
$table->width = '100%';

View File

@ -250,6 +250,12 @@ if ($delete_layout || $copy_layout) {
$result = db_process_sql_insert('tlayout', $values);
$auditMessage = ((bool) $result !== false) ? 'Copy visual console' : 'Fail try to copy visual console';
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('%s %s #%s', $auditMessage, $visualConsoleName, $id_layout)
);
$idNewVisualConsole = $result;
if ($result) {

View File

@ -626,7 +626,7 @@ switch ($action) {
db_pandora_audit(
AUDIT_LOG_REPORT_MANAGEMENT,
sprintf('%s #%s', $auditMessage, $idReport)
sprintf('%s %s #%s', $auditMessage, $report['name'], $idReport)
);
ui_print_result_message(
@ -1461,7 +1461,7 @@ switch ($action) {
$auditMessage = ($resultOperationDB === true) ? 'Update report' : 'Fail try to update report';
db_pandora_audit(
AUDIT_LOG_REPORT_MANAGEMENT,
sprintf('%s #%s', $auditMessage, $idReport)
sprintf('%s %s #%s', $auditMessage, $new_values['name'], $idReport),
);
} else {
$resultOperationDB = false;
@ -1513,7 +1513,7 @@ switch ($action) {
]
);
$auditMessage = ((bool) $idOrResult === true) ? sprintf('Create report #%s', $idOrResult) : 'Fail try to create report';
$auditMessage = ((bool) $idOrResult === true) ? sprintf('Create report %s #%s', $reportName, $idOrResult) : 'Fail try to create report';
db_pandora_audit(
AUDIT_LOG_REPORT_MANAGEMENT,
$auditMessage

View File

@ -300,7 +300,7 @@ switch ($activeTab) {
ui_update_name_fav_element($idVisualConsole, 'Visual_Console', $values['name']);
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('Update visual console #%s', $idVisualConsole)
sprintf('Update visual console %s #%s', io_safe_output($values['name']), $idVisualConsole)
);
$action = 'edit';
$statusProcessInDB = [
@ -320,7 +320,7 @@ switch ($activeTab) {
} else {
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('Fail update visual console #%s', $idVisualConsole)
sprintf('Fail update visual console %s #%s', $values['name'], $idVisualConsole)
);
$statusProcessInDB = [
'flag' => false,
@ -339,7 +339,7 @@ switch ($activeTab) {
if ($idVisualConsole !== false) {
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
sprintf('Create visual console #%s', $idVisualConsole)
sprintf('Create visual console %s #%s', io_safe_output($values['name']), $idVisualConsole)
);
$action = 'edit';
$statusProcessInDB = [
@ -359,7 +359,7 @@ switch ($activeTab) {
} else {
db_pandora_audit(
AUDIT_LOG_VISUAL_CONSOLE_MANAGEMENT,
'Fail try to create visual console'
sprintf('Fail try to create visual console %s #%s', io_safe_output($values['name']), $idVisualConsole)
);
$statusProcessInDB = [
'flag' => false,

View File

@ -564,6 +564,13 @@ class Manager implements PublicLogin
];
}
$auditMessage = ($res === false) ? sprintf('Fail try update dashboard %s #%s', $values['name'], $this->dashboardId) : sprintf('Dashboard update %s #%s', $values['name'], $this->dashboardId);
db_pandora_audit(
AUDIT_LOG_DASHBOARD_MANAGEMENT,
$auditMessage,
false,
);
return $result;
}
@ -744,6 +751,13 @@ class Manager implements PublicLogin
}
}
$auditMessage = ($result === false) ? sprintf('Fail try copy dashboard %s #%s', $values['name'], $this->dashboardId) : sprintf('Copy dashboard %s #%s', $values['name'], $this->dashboardId);
db_pandora_audit(
AUDIT_LOG_DASHBOARD_MANAGEMENT,
$auditMessage,
false,
);
return $result;
}

View File

@ -428,6 +428,13 @@ echo '</div>';
ui_include_time_picker();
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
db_pandora_audit(
AUDIT_LOG_REPORT_MANAGEMENT,
sprintf('Report visualized %s #%s.', $report['name'], $report['id_report']),
false,
false
);
?>
<script language="javascript" type="text/javascript">