MyBB Community Forums

Full Version: Password encoding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've got a little problem.
I would like to make a user panel on my website, and I would like use Mybb for it, but i've got a problem with the password encoding.

I've tried to use the salt_password function, but the generate password is not the same.

For exemple :
Quote:02337b69b7e9e8a7577f83636c180b59 : passord generate by the function
c3367431d39bd5e82e9cf63ce8a23e5d : Password in the db

And I use this code for generate the password ( before i've made an include of the function_users.php) :
$sql = mysql_query("SELECT password, salt FROM mybb_users WHERE username='$pseudo'") or die (mysql_error());
list($too, $salt)=mysql_fetch_array($sql);
echo $salt.'<br />';
echo"Salt = CbHO12Dt<br />";
$pass = salt_password($password, $salt);
echo $pass.'<br />';

And the entire result is :
Quote:CbHO12Dt
Salt = CbHO12Dt
02337b69b7e9e8a7577f83636c180b59
c3367431d39bd5e82e9cf63ce8a23e5d
You need;
salt_password(md5($password), $salt); // note the additional md5
Thank You Smile