From 7b2ee8df8da44d65d34c740681dafb4fd3ecad7d Mon Sep 17 00:00:00 2001 From: RaidMax Date: Fri, 30 Aug 2019 13:31:23 -0500 Subject: [PATCH] prevent privileged client from being flagged when reported fix issue with enum parsing on finding client --- Application/IW4MServer.cs | 2 +- WebfrontCore/Controllers/ClientController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/IW4MServer.cs b/Application/IW4MServer.cs index ffe65b9a..325d6f07 100644 --- a/Application/IW4MServer.cs +++ b/Application/IW4MServer.cs @@ -334,7 +334,7 @@ namespace IW4MAdmin int reportNum = await Manager.GetClientService().GetClientReportCount(E.Target.ClientId); bool isAutoFlagged = await Manager.GetClientService().IsAutoFlagged(E.Target.ClientId); - if (reportNum >= REPORT_FLAG_COUNT && !isAutoFlagged) + if (!E.Target.IsPrivileged() && reportNum >= REPORT_FLAG_COUNT && !isAutoFlagged) { E.Target.Flag(Utilities.CurrentLocalization.LocalizationIndex["SERVER_AUTO_FLAG_REPORT"].FormatExt(reportNum), Utilities.IW4MAdminClient(E.Owner)); } diff --git a/WebfrontCore/Controllers/ClientController.cs b/WebfrontCore/Controllers/ClientController.cs index 90eac9e8..6bfdff90 100644 --- a/WebfrontCore/Controllers/ClientController.cs +++ b/WebfrontCore/Controllers/ClientController.cs @@ -142,7 +142,7 @@ namespace WebfrontCore.Controllers foreach(var client in clientsDto) { - if (!Authorized && ((Permission)Enum.Parse(typeof(Permission), client.Level)).ShouldHideLevel()) + if (!Authorized && ((Permission)client.LevelInt).ShouldHideLevel()) { client.LevelInt = (int)Permission.User; client.Level = Permission.User.ToLocalizedLevelName();