MyBB Community Forums

Full Version: Add users in "batch mode"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,

I wanted to know if it is possible to add users to the forum in batch.

Thing is I have around 60 people I want to get into my forum, but I don't want to do this by hand.

Can't I just create a .csv file for example with the username, email adress and password and generate according user accounts?

Thanks for your help.
miro
You could probably create a big SQL query and run that, but it'd need a lot of code for 60 users to fill all the fields in the table. It is probably possible though... hardest thing would be settings the password encryption with the hash but I could tell you how to set all their passwords to 'test', then they can login and change it...

It'd be easier to just get them to register themselves though.

Edit: Try this... maybe in a test environment first...

INSERT INTO mybb_users (uid,username,password,salt,loginkey,email,postnum,avatar,avatardimensions,avatartype,usergroup,additionalgroups,displaygroup,usertitle,regdate,lastactive,lastvisit,lastpost,website,icq,aim,yahoo,msn,birthday,birthdayprivacy,signature,allownotices,hideemail,subscriptionmethod,invisible,receivepms,pmnotice,pmnotify,remember,threadmode,showsigs,showavatars,showquickreply,showredirect,ppp,tpp,daysprune,dateformat,timeformat,timezone,dst,dstcorrection,buddylist,ignorelist,style,away,awaydate,returndate,awayreason,pmfolders,notepad,referrer,reputation,regip,lastip,longregip,longlastip,language,timeonline,showcodebuttons,totalpms,unreadpms,warningpoints,moderateposts,moderationtime,suspendposting,suspensiontime,coppauser,classicpostbit,loginattempts,failedlogin) VALUES ('2','Test','098f6bcd4621d373cade4e832627b4f6','','KPVsshKOmBRJhZkdjLRp93S5vRFeEIsEK9qgpFqeQVJ5SGPAKs','[email protected]','0','','','','2','','0','','1229004939','1229004939','1229004939','0','','0','','','','','all','','1','0','0','0','1','1','0','1','linear','1','1','1','1','0','0','0','','','','0','0','','','0','0','0','0','','','','0','0','','','0','0','','0','1','0','0','0','0','0','0','0','0','0','1','0');

Change the entry of the UID for each (the first entry in the brackets in the code, '2'), making sure there are no duplicates, and change the username of each (the second entry in the brackets in the code, 'Test'), making sure there are no duplicates. Also make sure your table prefix is correct. Leave everything else as it is. This one line (it is just one line in SQL terms) will create a user with username 'Test', UID of 2, and a password of 'test' (which is encrypted so you can't see it here).
Thanks. Will play a bit with that code snippet and post my results!
In theory that should work, but make sure you only change those 2 things, UID and username.

Something that might cause problems is the loginkey entry... maybe leave that blank actually.

Oh, and when you tell the users to change their password, they'll need to change their email address too.
I wouldn't suggest including the uid, I would miss it out altogether and let MyBB take care of assigning these. If a duplicate was found then SQL will through an error - so it's best to just not do it...
Hmm, yeah you're probably right there... well, make sure you do a few of these in a test forum first. What I posted was basically the sort of thing that would be needed, but will need tweaking.
Why should they change thier email as well?

The forum will be just about our things from uni. Exchanging scripts and so on. Nothing seriuous.
Well because they won't get emails about anything if the address is [email protected] and may cause errors if you edit them in the ACP. They'll need a valid address.
Yeah but I know the peoples eMail adresses. These are guys from my study course. So that's not the problem.
The database will still need to know them. Chances are eventually an email or two will need to be sent to them via the forum.
Pages: 1 2