Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: hiprakhar on February 06, 2011, 01:56:12 PM

Title: How to import users in smf using usernames and passwords
Post by: hiprakhar on February 06, 2011, 01:56:12 PM
Hello,

I run a college website, which administers a close group of students. I have plaintext usernames and passwords of people. I would like to now import all the users in smf forums, so that we can expand the group functionality.

Please tell how to do so. I tried studying myself, the import process. For this I tried creating testusers with same usernames and passwords. I figured out that despite same plaintext password, the password generated in smf in the smf_members table is different. Also the 4 digit password salt is different. Please tell me how to import the users in smf.
Title: Re: How to import users in smf using usernames and passwords
Post by: hiprakhar on February 07, 2011, 10:22:30 AM
Hi,

Someone plz give me some enlightenment on this.. :)
Title: Re: How to import users in smf using usernames and passwords
Post by: vbgamer45 on February 07, 2011, 10:25:33 AM
Add the entries to the smf_members table

Use the username in the real_name and member_name column

For the password column convert the password to this format in php to import it sha1(strtolower($username) . $password);
Title: Re: How to import users in smf using usernames and passwords
Post by: Arantor on February 07, 2011, 11:10:10 AM
You can actually use plaintext passwords which then get re-encrypted when a user signs in.
Title: Re: How to import users in smf using usernames and passwords
Post by: hiprakhar on February 07, 2011, 12:15:31 PM
Thanks a lot friends! Please also tell what to put in the password_salt field
Title: Re: How to import users in smf using usernames and passwords
Post by: hiprakhar on February 07, 2011, 12:20:30 PM
No need for password salt! Its getting auto-generated everytime I log in!
That sha1(strtolower($username) . $password) as password works like a charm.


Thanks!!

Title: Re: How to import users in smf using usernames and passwords
Post by: vbgamer45 on February 07, 2011, 01:04:07 PM
Glad you got it working!
Title: Re: How to import users in smf using usernames and passwords
Post by: hiprakhar on February 07, 2011, 01:11:03 PM
@vbgamer45

With friends like you, world will become a better place!!

Cheers :)