public ActionResult Edit(string id, ConfigUser model)
 {
     id = Server.UrlDecode(id);
     var user = userReader.GetUser(id);
     ValidateAccess(user);
     userReader.UpdateUser(model);
     return RedirectToAction("Index");
 }
Exemple #2
0
 public void UpdateUser(ConfigUser model)
 {
     var user = GetUser(model.NameId);
     user.FirstName = model.FirstName;
     user.LastName = model.LastName;
     if (!user.NameId.ToLower().Equals(ConfigReaderFactory.CurrentUser.NameId.ToLower()))
         user.AdministratorType = model.AdministratorType;
     if(user.AccessToken.IsNullOrWhiteSpace())
         user.SetAccessToken(UniqueIdGenerator.CreateNewId(20).Encrypt(KeySalt));
     cacheManagement.NotifyUserChange(model.NameId.ToLower());
     Repository.SaveChanges();
 }
 public ActionResult Create(ConfigUser model)
 {
     userReader.CreateUser(model);
     return RedirectToAction("Index");
 }
 public ActionResult Delete(string id, ConfigUser model)
 {
     id = Server.UrlDecode(id);
     var user = userReader.GetUser(id);
     ValidateAccess(user);
     userReader.DeleteUser(user);
     ViewBag.UserId = id;
     return RedirectToAction("Index");
 }