Password verifacation issue
#1

Hello. I took the Vortex Roleplay script and tried to make the passwords use the WP_HASH thing so that it stored the password as a has and not its actual characters.

I added it for /changepass, and it worked. So now when you /changepass, and relog you can log in with your changed password. But when I tried adding it to the registration case, it didn't work. The password I sign up with doesn't actually work when I try logging back in.


Here is the code:

Код:
		    case 3894:
		    {
				if(strlen(inputtext) > 128 || strlen(inputtext) < 1)
			    {
	 		   		new buf[129];
					WP_Hash(buf, sizeof(buf), inputtext);
					format(Player[playerid][Password], 255, "%s", buf);
			        new Sum, string[128];
			        Sum = 3-Player[playerid][LoginAttempts];
			        SendClientMessage(playerid, ADMINORANGE, "The password you have entered does not match your account. Please try again or use the forums.");
			        Player[playerid][LoginAttempts]++;
					format(string, sizeof(string), "You have %d remaining login attempts, before you are auto-banned.", Sum);
					SendClientMessage(playerid, WHITE, string);
					ShowPlayerDialog(playerid, 3894, DIALOG_STYLE_PASSWORD, "Authentication", "Welcome to Inner City Roleplay\n\nYou have an account, please enter your password to authenticate.", "Login", "Help");
			    }
			    else
			    {
					if(Player[playerid][Authenticated] == 0)
					{
						OnPlayerLoginAttempt(playerid, inputtext);
					}
					else
					{
					    SendClientMessage(playerid, GREY, "You're already authenticated.");
					}
		        }
            }
Reply
#2

You're missing a line that checks if the password entered = the player's password.

If you compare yours to the original, you should be able to find it.
Reply
#3

You may have been right, but I fixed it anyway. Somehow...


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)