mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-13 13:22:28 +00:00
Refactor Database into DatabaseContext Moved into separate folder so it actually has a namespace instead sitting in the root
26 lines
No EOL
673 B
C#
26 lines
No EOL
673 B
C#
#nullable enable
|
|
|
|
using LBPUnion.ProjectLighthouse.Database;
|
|
using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
#if !DEBUG
|
|
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
|
#endif
|
|
|
|
namespace LBPUnion.ProjectLighthouse.Servers.Website.Pages.Debug;
|
|
|
|
public class RoomVisualizerPage : BaseLayout
|
|
{
|
|
public RoomVisualizerPage(DatabaseContext database) : base(database)
|
|
{}
|
|
|
|
public IActionResult OnGet()
|
|
{
|
|
#if !DEBUG
|
|
User? user = this.Database.UserFromWebRequest(this.Request);
|
|
if (user == null || !user.IsAdmin) return this.NotFound();
|
|
#endif
|
|
|
|
return this.Page();
|
|
}
|
|
} |