Improved audit logging on object creation
authorVictor Kirhenshtein <victor@netxms.org>
Sun, 26 Nov 2017 19:55:48 +0000 (21:55 +0200)
committerVictor Kirhenshtein <victor@netxms.org>
Sun, 26 Nov 2017 19:55:48 +0000 (21:55 +0200)
ChangeLog
src/server/core/session.cpp

index 3c772a3..a1936e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,7 @@
 - Fixed file download cancelation
 - HTTPS support in SMSEagle driver
 - New network map element - text box
+- Improved audit logging on object creation
 - Fixed issues: 
        NX-662 (New network map element - text box)
        NX-703 (Export/Import actions)
index 5350dde..53ad41e 100644 (file)
@@ -5106,7 +5106,10 @@ void ClientSession::createObject(NXCPMessage *request)
                                                   // If creation was successful do binding and set comments if needed
                                                   if (object != NULL)
                                                   {
-                                                          WriteAuditLog(AUDIT_OBJECTS, TRUE, m_dwUserId, m_workstation, m_id, object->getId(), _T("Object %s created"), object->getName());
+                        json_t *objData = object->toJson();
+                        WriteAuditLogWithJsonValues(AUDIT_OBJECTS, true, m_dwUserId, m_workstation, m_id, object->getId(), NULL, objData, 
+                           _T("Object %s created (class %s)"), object->getName(), object->getObjectClassName());
+                        json_decref(objData);
                                                           if ((parent != NULL) &&          // parent can be NULL for nodes
                                                               (objectClass != OBJECT_INTERFACE)) // interface already linked by Node::createNewInterface
                                                           {