bcrypt / php problem
#1

Today I began to build a UCP, consisting of a login and register.
The gamemode currently works with a master account system, allowing the accounts registered to function as a UCP account. Upon a registration in-game, the gamemode uses bcrypt hashing the passwords.

Code:
$options = [ 
    'cost' => 12, 
]; 

$password = password_hash($_POST['password'], PASSWORD_BCRYPT, $options);
My request here is, can somebody help me figuring out, how I input my current settings of accounts into a functioning UCP?

The PHP page will output something similar to the gamemode, but it's not quite the same... Does anybody have a solution?

The bcrypt cost is currently set to 12.

pawn Code:
// on dialog response, register
bcrypt_hash(inputtext, BCRYPT_COST, "OnAccountPasswordHash", "d", playerid);

public OnAccountPasswordChange(playerid) {
    new msg[128];
    new hash[BCRYPT_HASH_LENGTH];
    bcrypt_get_hash(hash);
    mysql_format(sqlHandle, msg, sizeof(msg), "UPDATE `users` SET `password` = '%e' WHERE `id` = '%d'", hash, GetPVarInt(playerid, "AccountID"));
    mysql_function_query(sqlHandle, msg, false, "", "");
    SendClientMessage(playerid, COLOR_LIGHTRED, "* Your password has been changed.");
    format(msg, sizeof(msg), "%s changed %s password.", PlayerInfo[playerid][pName], HisHer(playerid));
    return 1;
}
Reply


Messages In This Thread
bcrypt / php problem - by EmilLykke - 18.12.2019, 20:45
Re: bcrypt / php problem - by Kaliber - 18.12.2019, 22:12
Re: bcrypt / php problem - by EmilLykke - 18.12.2019, 22:59
Re: bcrypt / php problem - by CXdur - 19.12.2019, 00:11
Re: bcrypt / php problem - by Danbo7 - 19.12.2019, 21:31

Forum Jump:


Users browsing this thread: 1 Guest(s)