mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-17 07:12:32 +00:00
Add case generator for bans, allow mods to ban
This commit is contained in:
parent
1eede416d4
commit
cdcc03fdc1
8 changed files with 85 additions and 47 deletions
|
@ -24,7 +24,7 @@ public class AdminUserController : ControllerBase
|
|||
public async Task<IActionResult> UnbanUser([FromRoute] int id)
|
||||
{
|
||||
User? user = this.database.UserFromWebRequest(this.Request);
|
||||
if (user == null || !user.IsAdmin) return this.NotFound();
|
||||
if (user == null || !user.IsModerator) return this.NotFound();
|
||||
|
||||
User? targetedUser = await this.database.Users.FirstOrDefaultAsync(u => u.UserId == id);
|
||||
if (targetedUser == null) return this.NotFound();
|
||||
|
@ -42,7 +42,7 @@ public class AdminUserController : ControllerBase
|
|||
[HttpGet("wipePlanets")]
|
||||
public async Task<IActionResult> WipePlanets([FromRoute] int id) {
|
||||
User? user = this.database.UserFromWebRequest(this.Request);
|
||||
if (user == null || !user.IsAdmin) return this.NotFound();
|
||||
if (user == null || !user.IsModerator) return this.NotFound();
|
||||
|
||||
User? targetedUser = await this.database.Users.FirstOrDefaultAsync(u => u.UserId == id);
|
||||
if (targetedUser == null) return this.NotFound();
|
||||
|
@ -118,7 +118,7 @@ public class AdminUserController : ControllerBase
|
|||
}
|
||||
else
|
||||
{
|
||||
return this.Redirect($"/admin/user/{id}/ban");
|
||||
return this.Redirect($"/moderation/user/{id}/ban");
|
||||
}
|
||||
|
||||
return this.Redirect("/admin/users");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue