[Securable()] // Must be logged in, but no specific securables public ActionResult CompleteProfile(NewProfileModel model) { string userName = CheckPoint.Instance.UserName; CheckPoint.Instance.CreateUserWithDefaultPermissions(userName, model.FirstName, model.LastName, model.Email, model.Phone); Dictionary <string, string> authData = CheckPoint.Instance.GetAuthenticatedData(); // Update the other fields in the user's profile User user = CheckPoint.Instance.GetUser(this.tdb); user.OkayToContact = model.OkayToContact; user.ExternalOrganizationName = model.Organization; user.ExternalOrganizationType = model.OrganizationType; this.tdb.SaveChanges(); API.UserController userController = new API.UserController(this.tdb); if (model.OkayToContact && userController.IsReleaseAnnouncementsSupported()) { userController.SubscribeToReleaseAnnouncements(); } if (!string.IsNullOrEmpty(model.RedirectUrl)) { return(Json(model.RedirectUrl)); } else { return(Json(Url.Action("LoggedInIndex", "Home"))); } }
[Securable()] // Must be logged in, but no specific securables public ActionResult CompleteProfile(NewProfileModel model) { string userName = CheckPoint.Instance.UserName; string organizationName = CheckPoint.Instance.OrganizationName; CheckPoint.Instance.CreateUserWithDefaultPermissions(userName, organizationName, model.FirstName, model.LastName, model.Email, model.Phone); Dictionary <string, string> authData = CheckPoint.Instance.GetAuthenticatedData(); if (organizationName == "HL7" && authData.ContainsKey(CheckPoint.AUTH_DATA_ROLES)) { CheckPoint.Instance.CheckHL7Roles(userName, authData[CheckPoint.AUTH_DATA_ROLES]); } // Update the other fields in the user's profile User user = CheckPoint.Instance.GetUser(this.tdb); user.OkayToContact = model.OkayToContact; user.ExternalOrganizationName = model.Organization; user.ExternalOrganizationType = model.OrganizationType; this.tdb.SaveChanges(); if (!string.IsNullOrEmpty(model.RedirectUrl)) { return(Json(model.RedirectUrl)); } else { return(Json(Url.Action("LoggedInIndex", "Home"))); } }
[Securable()] // Must be logged in, but no specific securables public ActionResult NewProfile(string RedirectUrl) { NewProfileModel model = new NewProfileModel() { RedirectUrl = RedirectUrl }; return(View("NewProfile", model)); }
[Securable()] // Must be logged in, but no specific securables public ActionResult NewProfile(string RedirectUrl, string firstName = null, string lastName = null, string email = null, string phone = null) { NewProfileModel model = new NewProfileModel() { RedirectUrl = RedirectUrl, FirstName = firstName, LastName = lastName, Email = email, Phone = phone }; return(View("NewProfile", model)); }