public ActionResult Settings() { if (User.Identity.IsAuthenticated) { var user = _userRepository.GetById(Convert.ToInt32(User.Identity.Name)); if (user == null) return HttpNotFound(); var model = new UserProfileModel { DisplayName = user.DisplayName, UserId = user.Id, Gravatar = user.Gravatar }; return View(model); } else { return HttpNotFound(); } }
public new ActionResult Profile(int? id) { if (id == null && User.Identity.IsAuthenticated) return RedirectToAction("Profile", new {id = User.Identity.Name}); if (id == null) return HttpNotFound(); var user = _userRepository.GetById(id.Value); if (user == null) return HttpNotFound(); var activities = _activityRepository.GetActivitiesByUser(user); var model = new UserProfileModel { DisplayName = user.DisplayName, UserId = user.Id, Activities = activities.ToArray() }; return View(model); }