2017-01-11, 02:15 AM
Hi,
I'm helping out with a new installation of MyBB (1.8) for an established community that presently uses Google Groups. Before that, it was a mailman mailing list for maybe 15-20 years or so.
So there are a fair few users and the transition is going to be painful enough for some of them. I'd like to make this as simple as possible by pre-creating accounts for them, and entering them manually isn't an option.
There is a ModX format mod, but it appears to be for an earlier version of MyBB, and I can't find any equivalent on the new MyBB plugins site.
I'm handy enough with SQL and scripting (I prefer Python, but I can write PHP at a push) and quite comfortable with vim and remote shell, so my question is:
Can I get away with writing a script to generate a username and password, insert rows into directly into the users table (and email the user with their pw)? Or do I need to mess with other tables?
I figure that a minimum set of fields would be username, password, salt, email and usergroup (registered users).
Should I use an existing row as a template, or will leaving everything else empty provide sane defaults? Or perhaps I would do better by instantiating whatever is the user class? (A hint of where to find that and what is required to instantiate it would be welcome!)
How is the salt generated? Looks like it's a random 8-character alphanumeric string.
How is the password generated? Is it still:
Is there a smarter way to go about it than hacking code?
If I can make this work acceptably, I'll make the code available. Seeing as it'll most likely be in Python, I'll link it from this thread.
I'm helping out with a new installation of MyBB (1.8) for an established community that presently uses Google Groups. Before that, it was a mailman mailing list for maybe 15-20 years or so.
So there are a fair few users and the transition is going to be painful enough for some of them. I'd like to make this as simple as possible by pre-creating accounts for them, and entering them manually isn't an option.
There is a ModX format mod, but it appears to be for an earlier version of MyBB, and I can't find any equivalent on the new MyBB plugins site.
I'm handy enough with SQL and scripting (I prefer Python, but I can write PHP at a push) and quite comfortable with vim and remote shell, so my question is:
Can I get away with writing a script to generate a username and password, insert rows into directly into the users table (and email the user with their pw)? Or do I need to mess with other tables?
I figure that a minimum set of fields would be username, password, salt, email and usergroup (registered users).
Should I use an existing row as a template, or will leaving everything else empty provide sane defaults? Or perhaps I would do better by instantiating whatever is the user class? (A hint of where to find that and what is required to instantiate it would be welcome!)
How is the salt generated? Looks like it's a random 8-character alphanumeric string.
How is the password generated? Is it still:
$stored_pass = md5(md5($salt).md5($plain_pass));
?Is there a smarter way to go about it than hacking code?
If I can make this work acceptably, I'll make the code available. Seeing as it'll most likely be in Python, I'll link it from this thread.