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