Jump to content
MakeWebGames

Change password


iseeyou94056

Recommended Posts

Re: Change password

Here

Open preferences.php

Find:

function pass_change()
{
global $ir,$c,$userid,$h;
print "<h3>Password Change</h3><form action='preferences.php?action=passchange2' method='post'>Current Password: <input type='password' name='oldpw' />

New Password: <input type='password' name='newpw' />

Confirm: <input type='password' name='newpw2' />

<input type='submit' value='Change PW' /></form>";
}
function do_pass_change()
{
global $ir,$c,$userid,$h;
if($_POST['oldpw'] != $ir['userpass'])
{
print "The current password you entered was wrong.

[url='preferences.php?action=passchange']> Back[/url]";
}
else if($_POST['newpw'] !== $_POST['newpw2'])
{
print "The new passwords you entered did not match!

[url='preferences.php?action=passchange']> Back[/url]";
}
else
{
mysql_query("UPDATE users SET userpass='{$_POST['newpw']}' WHERE userid=$userid",$c);
print "Password changed!";
}
}

 

Replace with:

function pass_change()
{
global $ir,$c,$userid,$h;
print "<h3>Password Change</h3><form action='preferences.php?action=passchange2' method='post'>Current Password: <input type='password' name='oldpw' />

New Password: <input type='password' name='newpw' />

Confirm: <input type='password' name='newpw2' />

<input type='submit' value='Change PW' /></form>";
}
function do_pass_change()
{
global $ir,$c,$userid,$h;
if(md5($_POST['oldpw']) != $ir['userpass'])
{
print "The current password you entered was wrong.

[url='preferences.php?action=passchange']> Back[/url]";
}
else if($_POST['newpw'] !== $_POST['newpw2'])
{
print "The new passwords you entered did not match!

[url='preferences.php?action=passchange']> Back[/url]";
}
else
{
mysql_query("UPDATE users SET userpass=md5('{$_POST['newpw']}') WHERE userid=$userid",$c);
print "Password changed!";
}
}

 

Try that it should work ... :)

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

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

Guest
Reply to this topic...

×   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...