Password Issue Converting from MyBB 1.1.8 to SMF 1.1.1

Started by kevz, January 14, 2007, 04:06:53 PM

Previous topic - Next topic

kevz

I've converted my board from MyBB 1.1.8 to SMF 1.1.1. Everything went fine except for user passwords: They no longer work and I'm not able to login to SMF with doing a password reset. Any ideas? Thanks.

Oldiesmann

Looks like the problem is that SMF didn't pull over the password salt. MyBB uses the same password encryption method as IPB2 (at least MyBB 1.2.2 does - not sure about earlier versions)...

Upload this to your SMF directory (make sure you edit the path to MyBB's config file first) and run it:

<?php
// Pull over the password salt from MyBB...
$mybb_path = '/path/to/myBB/inc/config.php';
$mybb_prefix = "`{$config['database']}`.{$config['table_prefix']}";

// Pull in SSI.php to connect to SMF's database...
include_once('SSI.php');

// Pull the user ID and salt from MyBB
$query = db_query("SELECT uid, salt FROM {$mybb_prefix}users", __FILE__, __LINE__);
while(
$mybb_users = mysql_fetch_assoc($query))
{
   
// Insert the info into SMF's table...
   
$update = db_query("UPDATE {$db_prefix}members SET passwordSalt='$mybb_users[salt]' WHERE ID_MEMBER='$mybb_users[uid]'", __FILE__, __LINE__);
}
?>


That should fix the problem. Just remember to edit the path to MyBB's config.php before running the script or you'll get an error.

Advertisement: