I'm transferring users from my old database to a vBulletin database.
I want a script to do this as it'll take forever otherwise.
I have all the user's passwords stored just like md5(password)
But of course, this doesn't work with vBulletin due to salts etc.
So my code is this:
<?Php
mydatabase_connect();
$select=mysql_query("SELECT * from `users`");
while($user=mysql_fetch_array($select)) {
forum_connect();
$check=mysql_query("SELECT * from `user` where `username` = '{$user[username]}'");
if(mysql_num_rows($check)>="1") {
echo "fail";
}else{
$insert=mysql_query("INSERT into `user` SET `username` = '{$user[username]}', `password` = '{$user[password]}', `email` = '{$user[email]}'");
if($insert) {
echo 'success';
}else{
echo 'fail';
}
}
mydatabase_connect();
}
?>
How would I change it to work with vBulletin - so I can set a vBulletin user.password
field and vBulletin user.salt
correctly. Baring in mind that my $user[password] or users
.password
is stored as an md5 hash of their real, text password.
Thanks!