-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchangepass.php
28 lines (24 loc) · 1.08 KB
/
changepass.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?
require_once("header.php");
if($passchanged) {
TheEnd("Password changed!");
} else if ($do_changepass) {
if (($new_password) && ($new_password == $new_password_verify)) {
$users[password] = md5($new_password);
$users[passchanged] = 1;
db_safe_query("UPDATE $playerdb SET password='$users[password]' WHERE num=$users[num];");
db_safe_query("UPDATE ".$prefix."_users SET user_password='$users[password]' WHERE user_id=$users[num];");
saveUserData($users, "passchanged", true);
if(isset($cookie['auth']))
makeAuthCode($users[num], $users[password], 0, SERVER, true, $users[rsalt]);
else if(isset($_GET['auth']))
makeAuthCode($users[num], $users[password], 0, SERVER, false, $users[rsalt]);
else
$printmessage = "You aren't logged in!<br>\n";
header(str_replace('&', '&', "Location: ".$config[sitedir].$config[main]."?changepass&passchanged=true$authstr"));
}
else $printmessage = "Error! Passwords do not match!<br>\n";
}
template_display('changepass.html');
TheEnd("");
?>