lngstone
  • Posts: 2
  • Joined: 17/12/2008
Hello.

I'm very happy to use YAF (ver. 1.9.3 RC2) on a couple of my websites. It rocks!
Now I have a new community site with YAF and I need to grant access to the forum to all the community members.
I read a lot of threads in this forum that explain how to integrate YAF with an existing authentication of an external website.
I don't need authentication on my site except for the forum, so it would be better to import all the users into the YAF database.

Is there an import routine for YAF so that I can bulk add all the 2500+ members?
If there isn't an import routine, can someone point out some DLL call or a method to write a generic import (i.e. from a text file)?

Thank you in advance.

<--< nik >-->
Sponsor
mddubs
  • Posts: 476
  • Joined: 07/08/2008
If your existing authentication system uses the .NET Membership Framework, then there is no work to be done at all. When a user visits the forum for the first time, YAF becomes aware of that user and he's activated in the forum.

If your existing system doesn't use .NET Membership, you can write custom code to convert it to YAF or convert it to .NET Membership. I'd do the latter.

My systems all use the .NET Membership Framework, so that's all I've got for ya.
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 🙂 )
lngstone
  • Posts: 2
  • Joined: 17/12/2008
Thank you for your reply.

Our existing application doesn't use any authentication system at all.
It's a totally public website, except for the forum, and is actually written in classic ASP.
So it would be more practical for us to import users into YAF DB.
Can I directly populate the yaf_User table?
How can I calculate the ProviderUserKey?
Are there other tables I need to update?
Would it have more sense to call some function yet implemented in the YAF code?

Thank you in advance.

<--< nik >-->

TommyB
  • Posts: 118
  • Joined: 06/07/2005
This yaf version you use uses the .net membership.
There you can easily create new users, delete them... with only a few lines of source code.
Users created there will appear in yaf if they visit / login the first time (this is what mddubs says)

If you are able to get the plain password for all your existing user accounts you should be able to create a script (a temporary asp.net page for example) to import all users. If they are encrypted it is not really possible (ok nothing is impossible but its a _lot_ of work).
Anyway, using only that way you will loose all other information like post count and so on.

To use membership in asp.net simply try to google for terms like "asp.net membership" ;)
Here you will find something like this (code is in visual basic, but i think c# needs only a ; at the end)
Membership.CreateUser("UserName", "P@ssw0rd", "userName@emailAddress")


You can create a text file (or xml, whatever) and write a small aspx page that reads it out and calls the above code for each user entry in this file.

I haven't tried it but it should work. Correct me if I'm wrong. 🙂
- Sry for my english ;)

BattCursor.Net  - Official homepage of that tool for vista laptops!
mddubs
  • Posts: 476
  • Joined: 07/08/2008
Good solution Tommy. That's what I would do if I had a list of users I needed to add to a membership app. That would be a great little winform utility that others might find useful.

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 🙂 )
Users browsing this topic
    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