CoreyRi1
  • Posts: 4
  • Joined: 19/11/2008
Here's my problem:

I've integrated membership and role providers from another .net solution (dashcommerce). Integrated successfully...users are added to the yaf_User table whenever they sign in to YAF for the first time however they are not added to the yaf_UserGroup table for some reason...so basically, duplicate user accounts are automatically created, however they have no permissions by default, which means that they can't even view any forums. I can go into the admin panel for the forum and manually register each user under a group, but this obviously needs to be done automatically at some point.

I found this thread discussing the same issue: http://forum.yetanotherf...-can-not-see-forums.aspx 

Would this solution posted by MSUArrowCS work?

Quote:

Hi ..

I experienced this issue on an integration effort. I am pretty sure the root cause has something to do with the Membership provider on the original (non-YAF) site, but I cannot verify that. Regardless, my workaround was to call some YAF registration methods from my original site's registration. I had a CreateUserWizard control and caught the CreateUser event. I did the account setup for my site and then called the following:

Code:

MembershipUser oUser = Membership.GetUser(username);
if (oUser != null && oUser.IsApproved == false)
{
oUser.IsApproved = true;
Membership.UpdateUser(oUser);
}

/* Add the user as a YAF user also ... from YAF's Registration Code */
MembershipUser user = Membership.GetUser(username);

// [YAF] setup inital roles (if any) for this user
RoleMembershipHelper.SetupUserRoles(YafContext.Current.PageBoardID, username);

// create the user in the YAF DB as well as sync roles...
int userID = RoleMembershipHelper.CreateForumUser(user,
YafContext.Current.PageBoardID);


The caveat to this is that since it probably means YAF and your site's membership profile aren't getting along, some of the YAF controls, like registration and changing password, won't affect your 'main' login info ... but in my site, this was not a concern - I want my users using my original controls for login/logout/register, etc.

HTH,
BR



If so, could I use this even though dashcommerce and YAF are in two separate directories? Or is there some easier/alternate solution to this problem?

Thanks!:) Any help with this would be hugely appreciated as finding a solution is somewhat urgent (working with a client).
Sponsor
CoreyRi1
  • Posts: 4
  • Joined: 19/11/2008
Has anyone else run in to this problem? Any solutions? Just want to figure out the best work-around for this issue...
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved