public async Task <IActionResult> Index(RconViewModel viewModel = null) { if (!await CheckRights()) { return(new UnauthorizedResult()); } viewModel.MultiRcon = true; ViewBag.Servers = _serverService.FindAll(); return(View("/Views/Rcon/Index.cshtml", viewModel)); }
public async Task <IActionResult> Index() { var viewModel = new RconViewModel(); var user = await _userservice.getUserFromCp(HttpContext.User); var isModSomeWhere = await _pavlovServerService.IsModSomeWhere(user, _serverSelectedModsService); var servers = await GiveServerWhichTheUserHasRightsTo(); ViewBag.Servers = servers.Where(x => x.ServerServiceState == ServerServiceState.active); ViewBag.commandsAllow = await RightsHandler.GetAllowCommands(viewModel, HttpContext.User, _userservice, isModSomeWhere); return(View(viewModel)); }