MyBB Community Forums

Full Version: php121 Instant messenger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to integrate php121 messenger in to my forum. It has an option to use the existing mybb user database. However it uses simple md5 passwords and not the salted type as in mybb.

Please could you give me some pointers on how to use the salted passwords.

Here is an extract from the login module of php121:

Quote:function userLookup($username, $password) {
global $php121db, $password;
global $db_usertable, $dbf_uid, $dbf_uname, $dbf_upassword, $dbf_salt, $dbf_passwordtype, $dbf_uemail;
global $dbf_user_chatting, $dbf_smilies, $dbf_level, $dbf_showrequest;
global $dbf_upassword_len;

$stop = "";
if (mysql_num_rows(mysql_query("SELECT $dbf_uname FROM $db_usertable WHERE $dbf_uname='$username'",$php121db)) == 0) $stop .= _USERNAME_NOT_FOUND . "<br>";
if ($stop == ""){
$row = mysql_fetch_row(mysql_query("SELECT $dbf_upassword from $db_usertable WHERE $dbf_uname='$username'", $php121db));
if ($dbf_passwordtype == "plaintext") {
if ($row[0] != substr(md5($password), 0, $dbf_upassword_len)) $stop .= _INCORRECT_PASSWORD . "<br>";
} else if ($dbf_passwordtype == "md5") {
if ($row[0] != substr($password, 0, $dbf_upassword_len)) $stop .= _INCORRECT_PASSWORD . "<br>";
}
}

return($stop);
}


Any ideas would be welcome.

The website is www.php121.com

Please take a look at this post about how the passwort/salt system is working.
Michael83 Wrote:Please take a look at this post about how the passwort/salt system is working.

Thanks, i have had a look at that thread before and I understand the principal but my php skills are not that good and I failed to get it to work.
Managed to get it to work with a bit of trial and error.
Thanks.
Got a link to your forum? I'd like to see this in action Smile
And can you set the code and what it can do?