Hi,
I am doing some custom integration of the forum and my customers. I have managed to create a user but it does not seem to autocreate a row in yaf_UserGroup causing logon to fail.
Is there a specific existing method for this or should just insert a row after creating the user?
Here is my code for creating the user:
System.Web.Security.MembershipCreateStatus status;
userInfo = System.Web.Security.Membership.CreateUser(txtLogin.Text, txtPassword.Text, c.YafUserID, txtQ.Text, txtA.Text, true,out status);
if (status == System.Web.Security.MembershipCreateStatus.Success)
{
//userInfo.IsApproved = true;
System.Web.Security.Membership.UpdateUser(userInfo);
var p = Profile.GetProfile(userInfo.UserName);
p.RealName = string.Format("{0} {1}", txtFirstName.Text, txtLastName.Text);
p.Save();
db.ExecuteCommand("Update Contacts set YafUserID={0}, InviteCode=null,InviteSentOn=null Where YafUserID={1}", userInfo.UserName, c.YafUserID);
// insert into yaf_UserGroup
System.Web.Security.FormsAuthentication.SetAuthCookie(userInfo.UserName, true);
Thanks!