Unverified Commit 7922bdb3 authored by Côme Chilliet's avatar Côme Chilliet Committed by Côme Chilliet
Browse files

:ambulance: fix(logging) Store microseconds in audit datetime

This avoids having too many audit events on the same timestamp.

issue #5995
Showing with 2 additions and 2 deletions
+2 -2
...@@ -60,7 +60,7 @@ class logging { ...@@ -60,7 +60,7 @@ class logging {
/* Create data object */ /* Create data object */
$entry = array( $entry = array(
'timestamp' => time(), 'timestamp' => microtime(TRUE),
'action' => $action, 'action' => $action,
'objecttype' => $objecttype, 'objecttype' => $objecttype,
'object' => $object, 'object' => $object,
...@@ -143,7 +143,7 @@ class logging { ...@@ -143,7 +143,7 @@ class logging {
} }
$tabObject = objects::create('auditEvent'); $tabObject = objects::create('auditEvent');
$baseObject = $tabObject->getBaseObject(); $baseObject = $tabObject->getBaseObject();
$baseObject->fdAuditDateTime = new DateTime('@'.$entry['timestamp']); $baseObject->fdAuditDateTime = DateTime::createFromFormat('U.u', number_format($entry['timestamp'], 6, '.', ''));
$baseObject->fdAuditAction = $entry['action']; $baseObject->fdAuditAction = $entry['action'];
$baseObject->fdAuditAuthorDN = $entry['user']; $baseObject->fdAuditAuthorDN = $entry['user'];
$baseObject->fdAuditObjectType = $entry['objecttype']; $baseObject->fdAuditObjectType = $entry['objecttype'];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment