Unverified Commit 2b50dc3f authored by Côme Chilliet's avatar 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
...@@ -61,7 +61,7 @@ class logging ...@@ -61,7 +61,7 @@ class logging
/* Create data object */ /* Create data object */
$entry = [ $entry = [
'timestamp' => time(), 'timestamp' => microtime(TRUE),
'action' => $action, 'action' => $action,
'objecttype' => $objecttype, 'objecttype' => $objecttype,
'object' => $object, 'object' => $object,
...@@ -144,7 +144,7 @@ class logging ...@@ -144,7 +144,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