Esempio n. 1
0
 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));
 }
Esempio n. 2
0
 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"));
 }
Esempio n. 3
0
 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"));
     }
 }