summaryrefslogtreecommitdiff
path: root/Project-Unite/Controllers
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-17 20:01:25 -0400
committerMichael <[email protected]>2017-05-17 20:01:25 -0400
commit40c424f787351b5e2e89aabedb5e67bfeece7008 (patch)
tree69fb4ae140c7f04da6d905acfff82e08ed867b5b /Project-Unite/Controllers
parentc9d5c86c523aa9af8362077b82ede659ec884b22 (diff)
downloadproject-unite-40c424f787351b5e2e89aabedb5e67bfeece7008.tar.gz
project-unite-40c424f787351b5e2e89aabedb5e67bfeece7008.tar.bz2
project-unite-40c424f787351b5e2e89aabedb5e67bfeece7008.zip
even more profile fields
Diffstat (limited to 'Project-Unite/Controllers')
-rw-r--r--Project-Unite/Controllers/ManageController.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/Project-Unite/Controllers/ManageController.cs b/Project-Unite/Controllers/ManageController.cs
index 99f41c9..731c37f 100644
--- a/Project-Unite/Controllers/ManageController.cs
+++ b/Project-Unite/Controllers/ManageController.cs
@@ -141,6 +141,33 @@ namespace Project_Unite.Controllers
return View(usr);
}
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ public ActionResult Index(ApplicationUser model)
+ {
+ if (!ModelState.IsValid)
+ return View(model);
+ var db = new ApplicationDbContext();
+ var usr = db.Users.FirstOrDefault(x => x.UserName == User.Identity.Name);
+ usr.DisplayName = model.DisplayName;
+ usr.FullName = model.FullName;
+ usr.Hobbies = model.Hobbies;
+ usr.Bio = model.Bio;
+ usr.Interests = model.Interests;
+ usr.ShowFollowers = model.ShowFollowers;
+ usr.ShowFollowed = model.ShowFollowed;
+ usr.ShowEmail = model.ShowEmail;
+ usr.ShowPostAndTopicCounts = model.ShowPostAndTopicCounts;
+ usr.ShowJoinDate = model.ShowJoinDate;
+ if (usr.Email != model.Email)
+ usr.EmailConfirmed = false;
+ usr.Email = model.Email;
+ usr.Website = model.Website;
+ usr.YoutubeUrl = model.YoutubeUrl;
+ db.SaveChanges();
+ return View(model);
+ }
+
//
// POST: /Manage/RemoveLogin
[HttpPost]