YAFLogo

douder1
  • douder1
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
Hello

I have asp.net web site

I want to register new user to yet forum when he register in the web site

I do it like this

YAF.Providers.Membership.YafMembershipProvider test = new YAF.Providers.Membership.YafMembershipProvider();

test.ApplicationName = "YetAnotherForum";

MembershipCreateStatus m;

MembershipUser u=test.CreateUser("Nuser", "d7d7d7", "douder1@gmail.com", "d", "d", true, null, out m);

the problem is that the user dont get all the details that he need to get

like group "registered"

So anybody knows how to do it correctly?

Sponsor
mddubs
  • mddubs
  • 100% (Exalted)
  • YAF Developer
16 years ago
Using a .net membership provider, new users must login and visit the forum before they are completely entered into the system.
UserPostedImage 

www.bunkerhollow.com  | www.careercomputing.com 

When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek 🙂, who stole this off Ederon 🙂 )

douder1
  • douder1
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
R u shore ?

That there no way to register to the forum from my web site

mddubs
  • mddubs
  • 100% (Exalted)
  • YAF Developer
16 years ago
You can sort through the code and make your application add users to YAF each time they register on your site if you want, and before you ask I don't know the specifics on how to do that. I've left the defaults, so when a new user registers on my site, they don't exist in the YAF tables until that user is logged in and visits /forum/default.aspx for the first time.
UserPostedImage 

www.bunkerhollow.com  | www.careercomputing.com 

When I post fp:mddubs in a topic, I'm leaving my footprint there so I can track it once I get into coding/supporting. (Yes I stole this off Mek 🙂, who stole this off Ederon 🙂 )

jshepler
16 years ago

the problem is that the user dont get all the details that he need to get

like group "registered"

douder1 wrote:

CreateUser() just creates the user - it doesn't add the user to any roles. You would need to call Roles.AddUserToRole() to do that manually.

Mddubbs is right though, yaf does all that automatically the first time a user visits the forum - you shouldn't need to do it yourself.

If you must, yaf's DB class has a static method, YAF.Classes.Data.DB.user_aspnet(), that calls the stored procedure, yaf_user_aspnet, that will insert an existing membership user into yaf. At least, I think those are the class/method/sproc names - I don't have access to the code right now and I'm old, my memory isn't as good as it used to be. If got the names wrong, I'm close - you should be able to find them.


not jsheLPer

douder1
  • douder1
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
16 years ago
Thanks very much both of u helped me allot