Skip to content

Commit

Permalink
[~] ModellingAppZoneHandler: added some logging CactuseSecurity#2597
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidProgramming committed Nov 13, 2024
1 parent 2507454 commit 1ffc9fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions roles/lib/files/FWO.Services/ModellingAppZoneHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ private async Task DeleteExistingAppZones(int ownerId)
try
{
await apiConnection.SendQueryAsync<ReturnId>(ModellingQueries.deleteNwGroup, new { id = existingAppZone.Id });

await LogChange(ModellingTypes.ChangeType.Delete, ModellingTypes.ModObjectType.AppZone, existingAppZone.Id, $"Delete App Zone: {existingAppZone.Display()}", ownerId);
}
catch (Exception ex)
{
Expand All @@ -85,7 +87,7 @@ private async Task DeleteExistingAppZones(int ownerId)
DisplayMessageInUi(ex, userConfig.GetText("app_zone_creation"), userConfig.GetText("E9203"), true);
}

return (false, []);
return (false, default);
}

private void ApplyNamingConvention(string extAppId, ModellingAppZone appZone)
Expand All @@ -110,6 +112,8 @@ private async Task<int> AddAppZoneToDb(ModellingAppZone appZone)

ReturnId[]? returnIds = ( await apiConnection.SendQueryAsync<NewReturning>(ModellingQueries.newAppZone, azVars) ).ReturnIds;

await LogChange(ModellingTypes.ChangeType.Insert, ModellingTypes.ModObjectType.AppZone, appZone.Id, $"New App Zone: {appZone.Display()}", null);

if (returnIds != null && returnIds.Length > 0)
return returnIds[0].NewId;
}
Expand All @@ -132,8 +136,6 @@ private async Task AddAppServerToAppZone(ModellingAppZone appZone)
};

await apiConnection.SendQueryAsync<ReturnId>(ModellingQueries.addNwObjectToNwGroup, nwobject_nwgroupVars);

await LogChange(ModellingTypes.ChangeType.Insert, ModellingTypes.ModObjectType.AppZone, appZone.Id, $"New App Zone: {appZone.Display()}", appZone.AppId);
}
}
}
Expand Down

0 comments on commit 1ffc9fa

Please sign in to comment.