prevent privileged client from being flagged when reported
fix issue with enum parsing on finding client
This commit is contained in:
parent
aa9dd7ac6d
commit
2d9b6b8394
@ -334,7 +334,7 @@ namespace IW4MAdmin
|
|||||||
int reportNum = await Manager.GetClientService().GetClientReportCount(E.Target.ClientId);
|
int reportNum = await Manager.GetClientService().GetClientReportCount(E.Target.ClientId);
|
||||||
bool isAutoFlagged = await Manager.GetClientService().IsAutoFlagged(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));
|
E.Target.Flag(Utilities.CurrentLocalization.LocalizationIndex["SERVER_AUTO_FLAG_REPORT"].FormatExt(reportNum), Utilities.IW4MAdminClient(E.Owner));
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ namespace WebfrontCore.Controllers
|
|||||||
|
|
||||||
foreach(var client in clientsDto)
|
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.LevelInt = (int)Permission.User;
|
||||||
client.Level = Permission.User.ToLocalizedLevelName();
|
client.Level = Permission.User.ToLocalizedLevelName();
|
||||||
|
Loading…
Reference in New Issue
Block a user