Mrdiamond123
Member
function LinkToForumAccount($strUsername, $strPassword)
{
$strPassword = sha1(strtolower($strUsername) . $strPassword);
$retQuery = MySQLQuery(vsprintf("SELECT user_id FROM xf_user WHERE username = '%s' AND PASSWORD = '%s'", array(MySQLEscape($strUsername), MySQLEscape($strPassword))));
$strSteamID = UserProfile()->SteamID();
if(mysql_num_rows($retQuery) == 1)
{
$arrData = mysql_fetch_array($retQuery);
$iID = $arrData['user_id'];
MySQLQuery(vsprintf("UPDATE panelz_players SET forumid = '%s' WHERE steamid = '%s'", array($iID, $this->SteamID())));
return true;
}
LinkLog('FORUM_LINK', "Linking SteamID $strSteamID failed with login '" . $strUsername . "' '" . $strPassword . "'.", 'FORUM_LINK_FAIL');
return false;
}
As you see i have to select password from my database, is there a way i can do this?
{
$strPassword = sha1(strtolower($strUsername) . $strPassword);
$retQuery = MySQLQuery(vsprintf("SELECT user_id FROM xf_user WHERE username = '%s' AND PASSWORD = '%s'", array(MySQLEscape($strUsername), MySQLEscape($strPassword))));
$strSteamID = UserProfile()->SteamID();
if(mysql_num_rows($retQuery) == 1)
{
$arrData = mysql_fetch_array($retQuery);
$iID = $arrData['user_id'];
MySQLQuery(vsprintf("UPDATE panelz_players SET forumid = '%s' WHERE steamid = '%s'", array($iID, $this->SteamID())));
return true;
}
LinkLog('FORUM_LINK', "Linking SteamID $strSteamID failed with login '" . $strUsername . "' '" . $strPassword . "'.", 'FORUM_LINK_FAIL');
return false;
}
As you see i have to select password from my database, is there a way i can do this?
Last edited: