Jump to content
  • 0
Deku

Force Change Password

Question

Posted (edited)

I would like to ask for an npc that will force the player to change his password as soon as he logs in, that the password change is mandatory

thank you very much ❤️

Edit: I am suspecting a database leak and wanted everyone to change their password in a safe way

Edited by Deku

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
	mes "ID";
	input .@inputId$;
	next;
	mes "Old PW";
	input .@inputPw$;
	next;
	query_sql ("SELECT `account_id` FROM `login` WHERE `userid`='"+.@inputId$+"' AND `user_pass`='"+.@inputPw$+"'", .@sum);
	if(.@sum<=0){
		mes "Incorrect ID or PW";
		close;
	}
	next;
	mes "New PW";
	input .@inputPw$;
	if(.@inputPw$!=""){
		query_sql "UPDATE `login` SET `user_pass` = '"+.@inputPw$+"' WHERE `userid` = '"+.@inputId$+"'";
		mes "Done";
		close;
	}
	mes "Canceled";
	end;

This is simple password change scripts. you can adapt it.

Share this post


Link to post
Share on other sites
  • 0

~

---------------------------------------

*escape_sql(<value>)

Converts the value to a string and escapes special characters so that it is safe to
use in query_sql(). Returns the escaped form of the given value.

Example:
	[email protected]$ = "John's Laptop";
	[email protected]_str$ = escape_sql([email protected]$); // Escaped string: John\'s Laptop

---------------------------------------

 

also it's better to create a script in the website , change the stat of all the accounts to prevent them from login and update the stat once they create a new password.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.