douder1
  • Posts: 4
  • Joined: 22/02/2009
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
  • Posts: 476
  • Joined: 07/08/2008
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
  • Posts: 4
  • Joined: 22/02/2009
R u shore ?
That there no way to register to the forum from my web site
mddubs
  • Posts: 476
  • Joined: 07/08/2008
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
  • Posts: 189
  • Joined: 09/08/2008
douder1 wrote:


the problem is that the user dont get all the details that he need to get
like group "registered"



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
  • Posts: 4
  • Joined: 22/02/2009
Thanks very much both of u helped me allot
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