mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-02 01:58:40 +00:00
Add proper ban page when logging in (#773)
* Add proper ban page upon logging in * Remove two extra line break tags that don't need to be there * Fix timestamp formatting * Properly display timestamps in correct timezone * Fix formatting issues with ban page * Remove extra parenthesis which would be rendered on-page * Add to redirect middleware to prevent navigating to other pages * Small nitpick, renaming UserBannedPage to BannedUserPage * Resolve nitpicks from reviewers * Remove un-necessary log message in LoginForm * Fix ban reason translatable string argument * Word choice nitpick ("Ban Created" -> "Ban Issued") * Final adjustments and nitpicks, visual and grammatical * Resolve requested changes from reviewers
This commit is contained in:
parent
c8c54d78de
commit
21dbdff20a
11 changed files with 203 additions and 23 deletions
|
@ -13,14 +13,14 @@ namespace LBPUnion.ProjectLighthouse.Servers.Website.Pages;
|
|||
|
||||
public class LandingPage : BaseLayout
|
||||
{
|
||||
public LandingPage(DatabaseContext database) : base(database)
|
||||
{}
|
||||
public List<SlotEntity>? LatestTeamPicks;
|
||||
public List<SlotEntity>? NewestLevels;
|
||||
|
||||
public int PendingAuthAttempts;
|
||||
public List<UserEntity> PlayersOnline = new();
|
||||
|
||||
public List<SlotEntity>? LatestTeamPicks;
|
||||
public List<SlotEntity>? NewestLevels;
|
||||
public LandingPage(DatabaseContext database) : base(database)
|
||||
{ }
|
||||
|
||||
[UsedImplicitly]
|
||||
public async Task<IActionResult> OnGet()
|
||||
|
@ -29,10 +29,12 @@ public class LandingPage : BaseLayout
|
|||
if (user != null && user.PasswordResetRequired) return this.Redirect("~/passwordResetRequired");
|
||||
|
||||
if (user != null)
|
||||
this.PendingAuthAttempts = await this.Database.PlatformLinkAttempts
|
||||
.CountAsync(l => l.UserId == user.UserId);
|
||||
this.PendingAuthAttempts =
|
||||
await this.Database.PlatformLinkAttempts.CountAsync(l => l.UserId == user.UserId);
|
||||
|
||||
List<int> userIds = await this.Database.LastContacts.Where(l => TimeHelper.Timestamp - l.Timestamp < 300).Select(l => l.UserId).ToListAsync();
|
||||
List<int> userIds = await this.Database.LastContacts.Where(l => TimeHelper.Timestamp - l.Timestamp < 300)
|
||||
.Select(l => l.UserId)
|
||||
.ToListAsync();
|
||||
|
||||
this.PlayersOnline = await this.Database.Users.Where(u => userIds.Contains(u.UserId)).ToListAsync();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue