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.
http://forum.yetanotherf...-can-not-see-forums.aspx Would this solution posted by MSUArrowCS work?
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).
Edited by user
2008-11-20T21:10:50Z
|
Reason: Not specified