public IActionResult EditTorch(EditTorchFileModel model) { if (User.Claims.FirstOrDefault(c => c.Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/role").Value == "User") { return(RedirectToAction(nameof(HomeController.Index), "Home")); } ServerFileManager.FileWriter(ConfigTor.TorrcPath, model.Torch); return(View(model)); }
public IActionResult DeleteLog() { if (User.Claims.FirstOrDefault(c => c.Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/role").Value == "User") { return(RedirectToAction(nameof(HomeController.Index), "Home")); } ServerFileManager.FileWriter(GetPathes.Get_LogPath() + @"\Log.txt", ""); return(Content("Ok")); }
public IActionResult Settings(appsettingsModel model) { if (User.Claims.FirstOrDefault(c => c.Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/role").Value == "Admin") { var json = JsonConvert.SerializeObject(model); ServerFileManager.FileWriter(GetPathes.Get_SolutionMainPath() + "/Alduin.Web/appsettings.json", json); ViewData["Result"] = "ok"; return(View(model)); } else { return(RedirectToAction(nameof(HomeController.Index), "Home")); } }