# HG changeset patch # User Alain Mazy # Date 1768242532 -3600 # Node ID ac89820c43b2220b7884f828de40979da5c91c5c # Parent b4bf2767a82920667ba8f410a568367bbe159efb fix audit logs for zip uploads diff -r b4bf2767a829 -r ac89820c43b2 NEWS --- a/NEWS Fri Jan 02 13:00:15 2026 +0100 +++ b/NEWS Mon Jan 12 19:28:52 2026 +0100 @@ -1,3 +1,8 @@ +Pending changes in the mainline +=============================== + +* Now recording audit-logs when uploading a zip. + 2025-11-20 - v 0.10.3 ===================== diff -r b4bf2767a829 -r ac89820c43b2 Plugin/Plugin.cpp --- a/Plugin/Plugin.cpp Fri Jan 02 13:00:15 2026 +0100 +++ b/Plugin/Plugin.cpp Mon Jan 12 19:28:52 2026 +0100 @@ -1225,7 +1225,17 @@ if (GetUserProfileInternal(profile, request) && coreApi.GetAnswerJson(coreResponse)) { - RecordAuditLog(profile.userId, OrthancPluginResourceType_Study, coreResponse["ParentStudy"].asString(), "uploaded-instance", coreResponse["ID"].asString()); + if (coreResponse.isArray()) + { + for (Json::ArrayIndex i = 0; i < coreResponse.size(); ++i) + { + RecordAuditLog(profile.userId, OrthancPluginResourceType_Study, coreResponse[i]["ParentStudy"].asString(), "uploaded-instance", coreResponse[i]["ID"].asString()); + } + } + else if (coreResponse["ID"].isString()) + { + RecordAuditLog(profile.userId, OrthancPluginResourceType_Study, coreResponse["ParentStudy"].asString(), "uploaded-instance", coreResponse["ID"].asString()); + } } else {