MyBB Community Forums

Full Version: Adding users
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
is there a way of adding users in bulk to the mybb forum system ?

i tried by using .csv file into mysql but they all inputted but no-one could login !!!!!!! Sad

please help !
There currently isn't a mass input tool.

When you imported them using a CSV file, what format were the passwords in?
Thanks for replying!

The passwords were in normal text format, is this the problem?

Are they stored as MD5 ????
There are a number of things that you have to make sure you have in your import

- username
- password (MD5'd)
- email (trust me on this one...you DO NOT want to have a bunch of users with no email-address in the system and then one of them goes to use the Lost Password-function and you end up like me...getting over 13,000 email-failure messages in your inbox)
- groupid
- I am not sure if this is necessary but registration-date (regdate)...you could import it from your source (if you have it) or just give everyone the same


I think that would do it...you can leave the salt empty as it will be created then with their first login... You can always then add other stuff later (allownotices would be the first I would think of)

So if you have the records already in, just make sure that the values in the password-field are MD5'd.

cheers,
Kimmo
ooops...Chris was faster than me.....serves me right for trying to do my paying job at the same time as writing here Smile
but how do i md5 the passwords before importing them?
md5 passwords is done by default this way


$password = 123;
$md5password = md5($password);

in mybb, the passwords are also salted

$salt = generate_salt();
$saltedpw = salt_password($md5password, $salt);

regards
I am not sure if it works (I didn't try it) but you could try to wrap the cleartext password like this:

md5(cleartextpassword)

so if you already wrote the cleartextpasswords in the password field, then something like this should work:

UPDATE mybb_users SET password=md5(password);
DISCLAIMER!!!!
Do not use it until someone can verify what I am saying as this will mess with all the users in the usertable.... I have NOT TRIED this and am not an expert on the matter!

You can also remove your imported records and re-import them but this time in your code you have to use the wrapper md5() mentioned above..

cheers,
Kimmo

UPDATE:
---------
I tried the
UPDATE mybb_users SET password=md5(password);

in a small test-database on MySQL with PHPMyadmin and it worked fine....but use at your own risk....at least have a backup of the table ready (there are only 2 kinds of people in the world, those who have lost data and those who are about to lose data (actually there are only 10 different kinds of people in this world...those who understand binary and those who don't))
Kimmo, that works as long as none of the passwords are already hashed. If you have hashed passwords in there already, use a WHERE clause to limit its effects.