diff options
| author | Michael <[email protected]> | 2017-05-11 10:14:48 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-05-11 10:14:48 -0400 |
| commit | dbce55459fae3568c3cd69562b5fe37bc7493d1c (patch) | |
| tree | 8afedb1f12cef77acd4bf436d2b6e7f3b01eb96b /Project-Unite/Controllers | |
| parent | 7e0dfbb778197ea4dc8205711ea96d87d24d1c95 (diff) | |
| download | project-unite-dbce55459fae3568c3cd69562b5fe37bc7493d1c.tar.gz project-unite-dbce55459fae3568c3cd69562b5fe37bc7493d1c.tar.bz2 project-unite-dbce55459fae3568c3cd69562b5fe37bc7493d1c.zip | |
Jesus.
*looks at the atmosphere with major thoights of the mess he has created*
Diffstat (limited to 'Project-Unite/Controllers')
| -rw-r--r-- | Project-Unite/Controllers/ModeratorController.cs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Project-Unite/Controllers/ModeratorController.cs b/Project-Unite/Controllers/ModeratorController.cs index 99ef8b7..04e40de 100644 --- a/Project-Unite/Controllers/ModeratorController.cs +++ b/Project-Unite/Controllers/ModeratorController.cs @@ -104,24 +104,18 @@ namespace Project_Unite.Controllers return Redirect(returnUrl); } - [HttpPost] - [ValidateAntiForgeryToken] - public ActionResult ChangeUserName(string id, ApplicationUser model, string returnUrl = "") + public ActionResult ChangeUserName(string id, string newName) { var db = new ApplicationDbContext(); var usr = db.Users.FirstOrDefault(x => x.Id == id); if (usr == null) return new HttpStatusCodeResult(404); - usr.DisplayName = model.DisplayName; + usr.DisplayName = newName; db.SaveChanges(); - if (string.IsNullOrWhiteSpace(returnUrl)) - return RedirectToAction("Users"); - else - return Redirect(returnUrl); - + return new HttpStatusCodeResult(200); } public ActionResult Lock(string id) |
