Rename /modPanel to /moderation

This commit is contained in:
jvyden 2022-06-17 19:50:01 -04:00
commit a6f077725a
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
11 changed files with 32 additions and 39 deletions

View file

@ -28,7 +28,7 @@ public class ReportsPage : BaseLayout
{
User? user = this.Database.UserFromWebRequest(this.Request);
if (user == null) return this.Redirect("~/login");
if (!user.IsAdmin) return this.NotFound();
if (!user.IsModerator) return this.NotFound();
if (string.IsNullOrWhiteSpace(name)) name = "";
@ -40,7 +40,7 @@ public class ReportsPage : BaseLayout
this.PageAmount = Math.Max(1, (int)Math.Ceiling((double)this.ReportCount / ServerStatics.PageSize));
if (this.PageNumber < 0 || this.PageNumber >= this.PageAmount)
return this.Redirect($"/modPanel/reports/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}");
return this.Redirect($"/moderation/reports/{Math.Clamp(this.PageNumber, 0, this.PageAmount - 1)}");
this.Reports = await this.Database.Reports.Include(r => r.ReportingPlayer)
.Where(r => r.ReportingPlayer.Username.Contains(this.SearchValue))