Firefox PHP

Bulk import of users

Posted by harryatkins 
Bulk import of users
January 05, 2010 05:15PM
Hi all,

New to Phorum which I am finding very interesting. Really liking the way the mods are submitted and used.

My question is, I already have closed and private members (login required) website with a database of some 500 users that I want to bring into the forum.

Ideally I would like them to use the same username and password, so when the visit the forum they will just need to enter their main website details to gain access. Is there a way of doing this in as much as subscribing all 500 to the forum / authorised group (Iam using Register To Group (version 1.0)) in one go?

Thanks for any help on this one.
Re: Bulk import of users
January 05, 2010 05:28PM
You could import all the data into the users table, but you'd need some conversion software to create the correct input for Phorum.

One important point here is the password of the existing users. Phorum uses md5() to hash the password for secure storage in the database. Are the existing passwords also MD5 hashed? If not, then the conversion would take some additional handling through a module or a dirty trick like reassigning all users a new password (they won't like that of course). Apart from the password, it should not be a very daunting task to do the conversion.

IIRC, the fields that should minimally be filled by the conversion are: username, (md5 hashed) password, email, active (with value = 1 for all active users).


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Bulk import of users
January 05, 2010 06:45PM
Maurice thanks for your reply and can see the issue with the passwords (this database was set up some ten years ago) as I am pretty sure it is not md5(). As you say changing all user passwords will not really be an option at this point (buy will think about the impact, I could bill to users as a security update).
Think importing users from different data formats would be a useful mod in helping people transfer login details from other forums on in my case where they already use a login to get into the website.
Harry
Re: Bulk import of users
January 05, 2010 08:54PM
It's hard when password formats get mixed up. We really want to stick to one method in core (which is at the same time a method that is widely supported: a lot of systems use MD5 for password storage).

You are pretty sure that it is not MD5. Why are you so sure? MD5 has been around quite some time (since the early 1990's IIRC), so it's not a rule that a ten year old website wouldn't be using it. If it's not MD5, any idea what the exact format is then?

I once wrote a conversion for a client who had a website that got quite mad on the password encryption. The old algorithm was the strangest that I ever saw in my life. I managed to write a module for Phorum that would handle the authentication using the old algorithm. After doing a successful login, the module stored the password (available at that time) in MD5 format in the database. This way, I managed to let the users do a gradual conversion, without them noticing.

I could cook up a quick module that would handle this same kind of thing, but this won't work if it isn't dead clear what the current algorithm for password encryption is.

If you are lucky enough to have the passwords in plain text format, then it would be easy too of course. No need to do hard stuff in that case.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Bulk import of users
January 06, 2010 12:45AM
You might want to look at the phorum integration forum. Most likely you will eventually want to go to a single logon (for some reason users seem to like that). It also saves you from having to worry about passwords, running two registration systems etc.

If you use the phorum_api_user_save function you don't use a md5ed password. The attached file would need to be modified to get your user data and then call the save function.



Edited 1 time(s). Last edit at 01/06/2010 01:47AM by DavidVB.
Attachments:
open | download - userinterface.php (4.9 KB)
Re: Bulk import of users
January 06, 2010 04:45PM
Hi Dave

Had not thought about a single login. I will take a look at your attachment.

Maurice do you see this a better alternative to that which we have been discussing?
Re: Bulk import of users
January 06, 2010 08:20PM
That depends on your needs. SIngle sign on means that you have two parallel systems where one system is the master for authentication. If you want to move 100% to Phorum, then I see no use in putting a single sign on on top of the system to use the passwords from the old system.

But like discusses in the PM: you have the current passwords in plain text. That makes conversion the easiest route IMO.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Bulk import of users
January 07, 2010 01:30AM
It does depend on how you have the system configured. Phorum works well as either the master application or the slave application. If you won't have any restricted content (other than the forum), simply moving everything to phorum is the way to go. If you like the way phorum handles logins, notifications, etc., there is a quick authentication program to determine if someone is logged in to the forum software that can be used by your other programs.
Re: Bulk import of users
January 07, 2010 10:18AM
Thanks for the update Dave, I am now going to have a think about the best way for me to go with this one.
Thanks to both you and Maurice for you suggestions and support.
Harry
Sorry, only registered users may post in this forum.

Click here to login