21.10.2016, 00:26
There must be an error in either your new implementation of Wirlpool without SHA256 or a problem in your saving/loading script. Can you update the topic with all code related to the above mentioned? Also, I am assuming that you are leaving out big chunks of code between logical blocks (if password from the database is equal to the hashed input of the login dialog, etc..). If not, you have to do exactly that: evaluate whether the hashed input of the login dialog exactly matches the hashed password from the database (use strcmp for a string comparison; it returns a non-zero value [1 or -1] when string1 has non-matching characters with string2: https://sampwiki.blast.hk/wiki/Strcmp)
PHP код:
Dialog:Login(playerid, response, listitem, inputtext[]) {
if(response) {
if(isnull(inputtext)) {
// ...
}
new hashedinput[129];
WP_Hash(hashedinput, sizeof(hashedinput), inputtext);
if(!strcmp(hashedinput, password_from_db)) {
// Hashed input matches hashed password from the database
}
else {
// else ...
}
}
return 1;
}