diff --git a/SharedLibraryCore/BaseController.cs b/SharedLibraryCore/BaseController.cs index 63e3a316d..d03dfac77 100644 --- a/SharedLibraryCore/BaseController.cs +++ b/SharedLibraryCore/BaseController.cs @@ -134,6 +134,7 @@ namespace SharedLibraryCore ViewBag.Localization = Utilities.CurrentLocalization.LocalizationIndex; ViewBag.CustomBranding = Manager.GetApplicationSettings().Configuration().WebfrontCustomBranding ?? "IW4MAdmin"; ViewBag.EnableColorCodes = Manager.GetApplicationSettings().Configuration().EnableColorCodes; + ViewBag.EnablePrivilegedUserPrivacy = Manager.GetApplicationSettings().Configuration().EnablePrivilegedUserPrivacy; base.OnActionExecuting(context); } diff --git a/SharedLibraryCore/Configuration/ApplicationConfiguration.cs b/SharedLibraryCore/Configuration/ApplicationConfiguration.cs index 35290ad84..f74ee0e6e 100644 --- a/SharedLibraryCore/Configuration/ApplicationConfiguration.cs +++ b/SharedLibraryCore/Configuration/ApplicationConfiguration.cs @@ -135,6 +135,8 @@ namespace SharedLibraryCore.Configuration [LocalizedDisplayName("WEBFRONT_CONFIGURATION_PRESET_BAN_REASONS")] public Dictionary PresetPenaltyReasons { get; set; } = new Dictionary {{"afk", "Away from keyboard"}, {"ci", "Connection interrupted. Reconnect"}}; + [LocalizedDisplayName(("WEBFRONT_CONFIGURATION_ENABLE_PRIVILEGED_USER_PRIVACY"))] + public bool EnablePrivilegedUserPrivacy { get; set; } [UIHint("ServerConfiguration")] public ServerConfiguration[] Servers { get; set; } diff --git a/WebfrontCore/Views/Client/Find/Index.cshtml b/WebfrontCore/Views/Client/Find/Index.cshtml index 81d951620..edcf8e1d6 100644 --- a/WebfrontCore/Views/Client/Find/Index.cshtml +++ b/WebfrontCore/Views/Client/Find/Index.cshtml @@ -20,7 +20,14 @@ -
@client.Level
+ @if (!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy) + { +
@loc["GLOBAL_PERMISSION_USER"]
+ } + else + { +
@client.Level
+ }
@client.LastConnectionText
} @@ -41,7 +48,14 @@ -
@client.Level
+ @if (!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy) + { +
@loc["GLOBAL_PERMISSION_USER"]
+ } + else + { +
@client.Level
+ }
@client.LastConnectionText
} diff --git a/WebfrontCore/Views/Client/Profile/Index.cshtml b/WebfrontCore/Views/Client/Profile/Index.cshtml index 36fdaa264..8d967d067 100644 --- a/WebfrontCore/Views/Client/Profile/Index.cshtml +++ b/WebfrontCore/Views/Client/Profile/Index.cshtml @@ -16,7 +16,7 @@
-
+
@if (string.IsNullOrEmpty(gravatarUrl)) { @shortCode @@ -74,9 +74,19 @@ } else { -
- @Model.Level -
+ if (!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy) + { +
+ @ViewBag.Localization["GLOBAL_PERMISSION_USER"] +
+ } + + else + { +
+ @Model.Level +
+ } }
@if (ViewBag.Authorized) @@ -142,11 +152,14 @@
-
-
- @await Component.InvokeAsync("ProfileMetaList", new { clientId = Model.ClientId, count = 30, offset = 0, startAt = DateTime.UtcNow, metaType = Model.MetaFilterType }) +@if ((!ViewBag.Authorized && !ViewBag.EnablePrivilegedUserPrivacy) || ViewBag.Authorized) +{ +
+
+ @await Component.InvokeAsync("ProfileMetaList", new {clientId = Model.ClientId, count = 30, offset = 0, startAt = DateTime.UtcNow, metaType = Model.MetaFilterType}) +
-
+}
diff --git a/WebfrontCore/Views/Penalty/_Penalty.cshtml b/WebfrontCore/Views/Penalty/_Penalty.cshtml index 689b7fd25..fa9d0e5de 100644 --- a/WebfrontCore/Views/Penalty/_Penalty.cshtml +++ b/WebfrontCore/Views/Penalty/_Penalty.cshtml @@ -31,7 +31,12 @@ @loc["WEBFRONT_PENALTY_TEMPLATE_ADMIN"] - @Html.ActionLink(SharedLibraryCore.Utilities.StripColors(Model.PunisherName), "ProfileAsync", "Client", new { id = Model.PunisherId }, new { @class = "level-color-" + (int)Model.PunisherLevel }) + @Html.ActionLink(SharedLibraryCore.Utilities.StripColors(Model.PunisherName), "ProfileAsync", + "Client", + new { id = Model.PunisherId }, + new { @class = !ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy + ? "level-color-0" + : "level-color-" + (int)Model.PunisherLevel }) @@ -64,7 +69,12 @@ - @Html.ActionLink(SharedLibraryCore.Utilities.StripColors(Model.PunisherName), "ProfileAsync", "Client", new { id = Model.PunisherId }, new { @class = "level-color-" + (int)Model.PunisherLevel }) + @Html.ActionLink(SharedLibraryCore.Utilities.StripColors(Model.PunisherName), "ProfileAsync", + "Client", + new { id = Model.PunisherId }, + new { @class = !ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy + ? "level-color-0" + : "level-color-" + (int)Model.PunisherLevel }) @{ diff --git a/WebfrontCore/Views/Shared/_Layout.cshtml b/WebfrontCore/Views/Shared/_Layout.cshtml index abf01e8ff..d584e0a2e 100644 --- a/WebfrontCore/Views/Shared/_Layout.cshtml +++ b/WebfrontCore/Views/Shared/_Layout.cshtml @@ -35,7 +35,14 @@