private void HandleAccountEmailValidation(HttpContext context, TBAccount account, TBEmailValidation emailValidation) { if (account.Emails.CollectionContent.Find(candidate => candidate.EmailAddress.ToLower() == emailValidation.Email.ToLower()) == null) { TBEmail email = TBEmail.CreateDefault(); email.EmailAddress = emailValidation.Email; email.ValidatedAt = DateTime.Now; account.Emails.CollectionContent.Add(email); account.StoreAccountToRoot(); // TODO: Move Emailroot storage to account root syncs string emailRootID = TBREmailRoot.GetIDFromEmailAddress(email.EmailAddress); TBREmailRoot emailRoot = TBREmailRoot.RetrieveFromDefaultLocation(emailRootID); if (emailRoot == null) { emailRoot = TBREmailRoot.CreateDefault(); emailRoot.ID = emailRootID; emailRoot.UpdateRelativeLocationFromID(); } emailRoot.Account = account; StorageSupport.StoreInformation(emailRoot); string accountID = account.ID; UpdateAccountRootToReferences.Execute(new UpdateAccountRootToReferencesParameters { AccountID = accountID }); UpdateAccountContainerFromAccountRoot.Execute(new UpdateAccountContainerFromAccountRootParameters { AccountID = accountID }); } context.Response.Redirect("/auth/account/website/oip-account/oip-layout-account-welcome.phtml", true); }
public static void SetAllInvitedViewerMembersAsFullCollaborators() { var accountIDs = TBRAccountRoot.GetAllAccountIDs(); foreach (var acctID in accountIDs) { TBRAccountRoot accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(acctID); TBAccount account = accountRoot.Account; foreach (var grpRole in account.GroupRoleCollection.CollectionContent) { if (TBCollaboratorRole.IsRoleStatusValidMember(grpRole.RoleStatus) == false) { grpRole.RoleStatus = TBCollaboratorRole.RoleStatusMemberValue; } if (grpRole.GroupRole == TBCollaboratorRole.ViewerRoleValue) { grpRole.GroupRole = TBCollaboratorRole.CollaboratorRoleValue; } } account.StoreAccountToRoot(); } }