public ActionResult GivePower(string id) { var dm = new DataManager(); var user = dm.GetUser(u => u.Id == id); user.Role = 1; dm.ModifyUser(user); return RedirectToAction("ManageUsers"); }
// // GET: /User/ public ActionResult ChangeTheme(string theme) { DataManager dm = new DataManager(); ApplicationUser user = dm.GetUser(u => u.Id == User.Identity.GetUserId()); user.Theme = "~/Content/" + theme + ".min.css"; dm.ModifyUser(user); return RedirectToAction("Index", "Home"); }
private bool ConfirmAccount(string confirmationToken) { var dm = new DataManager(); ApplicationUser user = dm.GetUser(u => u.ConfirmationToken == confirmationToken); if (user != null) { user.IsConfirmed = true; user.Role = 2; dm.ModifyUser(user); return true; } return false; }