1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

fix issue with duplicate js function names for loader

hide flagged status of users on webfront unless logged in (will still show the level if they report someone because cba to update the view component w/out auth status)
add terminal to the radar maps
This commit is contained in:
RaidMax
2019-07-24 10:36:37 -05:00
parent 21cda0123b
commit ba86810d4f
13 changed files with 126 additions and 24 deletions

View File

@ -7,6 +7,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static SharedLibraryCore.Database.Models.EFClient;
using static SharedLibraryCore.Database.Models.EFPenalty;
namespace WebfrontCore.Controllers
@ -25,11 +26,20 @@ namespace WebfrontCore.Controllers
var activePenalties = (await Manager.GetPenaltyService().GetActivePenaltiesAsync(client.AliasLinkId, client.IPAddress))
.Where(_penalty => _penalty.Type != PenaltyType.Flag);
int displayLevelInt = (int)client.Level;
string displayLevel = client.Level.ToLocalizedLevelName();
if (!Authorized && client.Level.ShouldHideLevel())
{
displayLevelInt = (int)Permission.User;
displayLevel = Permission.User.ToLocalizedLevelName();
}
var clientDto = new PlayerInfo()
{
Name = client.Name,
Level = client.Level.ToLocalizedLevelName(),
LevelInt = (int)client.Level,
Level = displayLevel,
LevelInt = displayLevelInt,
ClientId = client.ClientId,
IPAddress = client.IPAddressString,
NetworkId = client.NetworkId,
@ -129,6 +139,15 @@ namespace WebfrontCore.Controllers
}
var clientsDto = await Manager.GetClientService().FindClientsByIdentifier(clientName);
foreach(var client in clientsDto)
{
if (!Authorized && ((Permission)Enum.Parse(typeof(Permission), client.Level)).ShouldHideLevel())
{
client.LevelInt = (int)Permission.User;
client.Level = Permission.User.ToLocalizedLevelName();
}
}
ViewBag.Title = $"{clientsDto.Count} {Localization["WEBFRONT_CLIENT_SEARCH_MATCHING"]} \"{clientName}\"";
return View("Find/Index", clientsDto);