-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathadmin_reset_password.php
134 lines (60 loc) · 1.69 KB
/
admin_reset_password.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
/**
* Admin Password Reset Tool
*
* For Zenbership
* http://www.zenbership.com/
*
* More inforamtion:
* http://documentation.zenbership.com/FAQ/How-do-I-reset-an-administrative-password%253F
*/
// -----------------------------------------------------------------------------------------------
//
// UPDATE THE FOLLOWING VARIABLES
//
// What is your IP?
// You can find your IP at:
// http://www.whatismyip.com/
$ip = 'xxx.xxx.xxx.xxx';
// What is the employee's username you are resetting the password for?
$username = 'admin';
// What would you like the new password to be?
$newPassword = '';
// -----------------------------------------------------------------------------------------------
if ($_SERVER['REMOTE_ADDR'] == $ip) {
require "sd-system/config.php";
if ($_GET['reset'] == '1' && ! empty($username) && ! empty($password)) {
$admin_pass_salt = $db->generate_salt();
$admin_pass_encoded = $db->encode_password($_GET['password'], $admin_pass_salt);
$in = $db->update("
UPDATE
ppSD_staff
SET
salt='$admin_pass_salt',
password='$admin_pass_encoded'
WHERE
username='" . $username . "'
LIMIT 1
");
echo "<h1>DONE</h1>";
echo "<p>Assuming that username \"$username\" exists, his/her password has been updated.</p>";
echo "<p style=\"color:red;\">DELETE THIS FILE FROM YOUR SERVER IMMEDIATELY!</p>";
exit;
} else {
echo "Failed: IP matched but you did not provide the correct parameters.";
exit;
}
/*
$get = $db->get_array("
SELECT *
FROM ppSD_staff
");
echo "<PRE>";
print_r($get);
echo "</PRE>";
exit;
*/
} else {
echo "Failed: IP did not match.";
exit;
}