• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 SOLUTION: vb5 => IPB => Xenforo User Password Import!

#1
Xenforo cant be used to import vb5 directly, so the only solution is to import thru Invision Power Board. Problem: the Passwords from VB5 will be lost and every user has to get a new one.

I hacked xenforo a lil bit and came to a solution to upgrade xenforos auth system to accept VB5 passwords.

You need to do 3 steps:

1st. Import the old passwords from IPS table "conv_password" into the table xf_user_authenticates data BLOB
I created a small script for that.

$db1 = 'IPB SQL HOST';
$dbu = 'IPB SQL User'';
$db = 'IPB SQL DB';

$link = mysql_connect($db1, $dbu, 'IPB SQL PASS');
if (!$link) {
die('Not connected : ' . mysql_error());
}

mysql_select_db($db, $link);


$db2 = 'XEN SQL HOST';
$dbu2 = 'XEN SQL USER';
$db2 = 'XEN SQL DB';

$link2 = mysql_connect($db2, $dbu2, 'XEN SQL PASS');
if (!$link) {
die('Not connected : ' . mysql_error());
}

mysql_select_db($db2, $link2);
$x = 0;

$start = 0;
if($_GET['start']) $start = $_GET['start'];
$qry = 'SELECT * FROM members LIMIT '.$start.',500';
echo $qry;
$res = mysql_query($qry,$link);
while($data = mysql_fetch_assoc($res))
{
$da = array();
if(strpos($data['misc'],'blowfish') !== false)
{
$da['type'] = $data['misc'];
$da['hash'] = $data['conv_password'];
$qry2 = 'UPDATE xf_user_authenticate SET scheme_class="XenForo_Authentication_vBulletin5", data="'.mysql_escape_string(serialize($da)).'" WHERE user_id = '.$data['member_id'];
mysql_query($qry2,$link2);

} elseif($data['misc'] == 'legacy')
{
$da['type'] = $data['misc'];
$token = explode( ' ', $data['conv_password'] );
$da['hash'] = $token[0];
$da['salt'] = $token[1];
$qry2 = 'UPDATE xf_user_authenticate SET scheme_class="XenForo_Authentication_vBulletin5", data="'.mysql_escape_string(serialize($da)).'" WHERE user_id = '.$data['member_id'];
mysql_query($qry2,$link2);
}
}
echo "nxt";
echo '<meta http-equiv="refresh" content="2; url=importPWs.php?start='.($start+500).'">';
after this you just need to upload two small files to implement "XenForo_Authentication_vBulletin5" in the folder: "/library/xenforo/authentication":

File1: vBulletin5.php - attached

File 2: PassHash.php (Open Source File) - attached

et voila: VB5 Login implemented
 

Attachments