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

add support for plugin generated pages (interactions). add disallow vpn command

This commit is contained in:
RaidMax
2022-10-17 09:17:43 -05:00
parent a71a5d7f3b
commit 450c8a45da
17 changed files with 311 additions and 45 deletions

View File

@ -19,6 +19,7 @@ namespace SharedLibraryCore
{
public class BaseController : Controller
{
protected readonly IInteractionRegistration InteractionRegistration;
protected readonly IAlertManager AlertManager;
/// <summary>
@ -41,6 +42,7 @@ namespace SharedLibraryCore
public BaseController(IManager manager)
{
InteractionRegistration = manager.InteractionRegistration;
AlertManager = manager.AlertManager;
Manager = manager;
Localization = Utilities.CurrentLocalization.LocalizationIndex;
@ -71,9 +73,7 @@ namespace SharedLibraryCore
CurrentAlias = new EFAlias { Name = "Webfront Guest" }
};
}
protected async Task SignInAsync(ClaimsPrincipal claimsPrinciple)
{
await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme, claimsPrinciple,
@ -86,7 +86,7 @@ namespace SharedLibraryCore
});
}
public override void OnActionExecuting(ActionExecutingContext context)
public override async void OnActionExecuting(ActionExecutingContext context)
{
if (!HttpContext.Connection.RemoteIpAddress.GetAddressBytes().SequenceEqual(LocalHost))
{
@ -154,6 +154,7 @@ namespace SharedLibraryCore
&& !communityName.Contains("IW4MAdmin")
&& AppConfig.CommunityInformation.IsEnabled;
ViewBag.Interactions = await InteractionRegistration.GetInteractions("Webfront::Nav");
ViewBag.Authorized = Authorized;
ViewBag.Url = AppConfig.WebfrontUrl;
ViewBag.User = Client;