mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Refactor nav pages, add page to see users of the server
This commit is contained in:
34
BTCPayServer/Controllers/ServerController.cs
Normal file
34
BTCPayServer/Controllers/ServerController.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using BTCPayServer.Models;
|
||||
using BTCPayServer.Models.ServerViewModels;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BTCPayServer.Controllers
|
||||
{
|
||||
public class ServerController : Controller
|
||||
{
|
||||
private UserManager<ApplicationUser> _UserManager;
|
||||
|
||||
public ServerController(UserManager<ApplicationUser> userManager)
|
||||
{
|
||||
_UserManager = userManager;
|
||||
}
|
||||
|
||||
[Route("server/users")]
|
||||
public IActionResult ListUsers()
|
||||
{
|
||||
var users = new UsersViewModel();
|
||||
users.Users
|
||||
= _UserManager.Users.Select(u => new UsersViewModel.UserViewModel()
|
||||
{
|
||||
Name = u.UserName,
|
||||
Email = u.Email
|
||||
}).ToList();
|
||||
return View(users);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user