Move servers to LBPU.PL.Servers

This commit is contained in:
jvyden 2022-05-14 23:37:55 -04:00
parent 545b5a0709
commit b2ec7eae57
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
116 changed files with 173 additions and 162 deletions
ProjectLighthouse.Website/Pages/Admin

View file

@ -1,28 +0,0 @@
#nullable enable
using LBPUnion.ProjectLighthouse.Types;
using LBPUnion.ProjectLighthouse.Website.Pages.Layouts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace LBPUnion.ProjectLighthouse.Website.Pages.Admin;
public class AdminPanelUsersPage : BaseLayout
{
public int UserCount;
public List<User> Users = new();
public AdminPanelUsersPage(Database database) : base(database)
{}
public async Task<IActionResult> OnGet()
{
User? user = this.Database.UserFromWebRequest(this.Request);
if (user == null) return this.Redirect("~/login");
if (!user.IsAdmin) return this.NotFound();
this.Users = await this.Database.Users.OrderByDescending(u => u.UserId).ToListAsync();
this.UserCount = this.Users.Count;
return this.Page();
}
}