PDA

View Full Version : Data manager on an external server?


TJFweb
12-16-2008, 04:16 AM
Hi,

I have the following problem:
My student database is stored on SERVER1, while my vBulletin installation is stored on SERVER2.

SERVER1 and SERVER2 are on different servers and have different IP addresses.

Users login to access their student resource centre on SERVER1. I need to add a function to the student resource centre on SERVER1 which will allow each student to create their own vBulletin account on SERVER2. They should literally have 1 button to click to 'Create Account' which will create a vBulletin account with things such as username, email, usergroupid etc determined by their student account details on SERVER1.

Up until now, I've considered doing this by having a PHP script on SERVER1 connect to the MySQL database on SERVER2 to insert rows into the user table of the vBulletin database. After reading countless threads here over the past 6 months, it seems like this is not a good idea (though please try to convince me otherwise).

I am now considering using vBulletin's data manager to create user accounts. However, I have only ever seen examples of the data manager being run from the same server as vBulletin. How would I do it in my case?

Thanks in advance.

Dismounted
12-16-2008, 05:20 AM
Create a script on SERVER2 which adds a user using the data manager (from GET/POST Parameters). On SERVER1, create a script which sends the required data over to SERVER2 (for example, in PHP, you could use cURL).

TJFweb
12-16-2008, 06:00 AM
Hi Dismounted, thanks for your reply.

How would I prevent someone from getting the URL to the data manager script on SERVER2 and then creating user accounts at will?

Dismounted
12-16-2008, 07:33 AM
You can use a secret, which only SERVER1 and SERVER2 know. Then create a hash on SERVER1 using this secret and another factor, maybe the username (i.e. md5($username . $secret)). Send this "key" along with the other info to SERVER2, who can verify this.

TJFweb
12-16-2008, 08:23 AM
Thanks for your help, Dismounted. I'll read up on using the data manager as per your advice.