YAFLogo

lngstone
  • lngstone
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
15 years ago
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
  • mddubs
  • 100% (Exalted)
  • YAF Developer
15 years ago
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
  • lngstone
  • 51.2% (Neutral)
  • YAF Forumling Topic Starter
15 years ago
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
  • TommyB
  • 100% (Exalted)
  • YAF Commander
15 years ago
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
  • mddubs
  • 100% (Exalted)
  • YAF Developer
15 years ago
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 🙂 )