MyBB Community Forums

Full Version: Reset password before convert - impossible
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I've just converted one phpbb 3.0 board to MyBB and discover small bug.
If user uses reset password option after conversion, he can't login.

It's because reset password change data, but don't clear merge fields in users table: passwordconvert, passwordconverttype and passwordconvertsalt.

This can work only if user first login successfully (= convert password) and then use reset option.


I wrote small plugin to fix it, there is hook and function:


$plugins->add_hook("member_resetpassword_reset", "passwordresetfix_action");


function passwordresetfix_action() {
global $db, $mybb, $user;
    
    $sql_array = array(
        'passwordconvert' => '',
        'passwordconverttype' => '',
        'passwordconvertsalt' => ''
    );
    
    $db->update_query("users", $sql_array, "uid='". (int) $user['uid'] . "'");
}
There is a sticky about this: http://community.mybb.com/thread-169207.html Wink