SA-MP Forums Archive
Help with user password verification - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with user password verification (/showthread.php?tid=609444)



Help with user password verification - Sc0pion - 12.06.2016

Fixed!


Re: Help with user password verification - F1N4L - 12.06.2016

Код:
SELECT * FROM `accounts` WHERE `UserName`='Kusums' AND `Password` = 'asdasd'

//code to get all informations from this column



Re: Help with user password verification - xTURBOx - 12.06.2016

You mean like this?
PHP код:
if(!strcmp(inputtext,password)
{
//if the password matchs
}
else
{
kick(playerid);




Re: Help with user password verification - Sc0pion - 12.06.2016

Fixed!


Re: Help with user password verification - Sjn - 12.06.2016

Quote:
Originally Posted by Sc0pion
Посмотреть сообщение
I have everything set up, I can register a User from server to the database, and load things from database but the problem is that I can't login.
I am wondering how can you load other stuff from the database and not the user's password? Also, it depends on which version of MySQL plugin you are using in order for other people to help you out. Since the functions differs from old and the new one.


Re: Help with user password verification - Sc0pion - 12.06.2016

Fixed!


Re: Help with user password verification - Vince - 12.06.2016

Quote:
Originally Posted by Sc0pion
Посмотреть сообщение
Please do not suggest me to read any threads because they teach me to execute the below given query and to see if row exists, give player access
I'm pretty sure not a single thread will teach you to use unhashed passwords.


Re: Help with user password verification - Sc0pion - 12.06.2016

Fixed!


Re: Help with user password verification - Sjn - 12.06.2016

Quote:
Originally Posted by Sc0pion
Посмотреть сообщение
It doesn't matter if it is hashed or no, I just want to know how to code where it will check input hashed password is equal to retrieved password from MySQL. Anyways when registering, the password is hashed before it gets stored to database, so I have to hash the inputtext to see if retrieved password is equal to inputtext.

Lets just say if MySQL_Password = HashedInputtext, access, else kick?

By the way I use WP_Hash.
This basically does not make sense, mate. You are saying it doesn't matter if the password is hashed or not, it DOES matter in many ways if you actually care about your server. And if you are saying you just want to learn how to code it, start off with the tutorials available. The tutorial has explained how to do what you're looking for very well, with hashed passwords.


Re: Help with user password verification - Sc0pion - 12.06.2016

Fixed!