-
Notifications
You must be signed in to change notification settings - Fork 18
/
admin.php
239 lines (239 loc) · 13.9 KB
/
admin.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<?php
require"config.php";
require"functions.php";
require"floats.php";
$SESSION_LOGOUT = addslashes(strip_tags($_GET['logout']));
if($SESSION_LOGOUT){
session_destroy();
header("Location: admin.php");
}
$SESSION_ADMIN_USER = addslashes(strip_tags($_POST['admuser']));
$SESSION_ADMIN_PASS = md5(addslashes(strip_tags($_POST['admpass'])));
if($SESSION_ADMIN_USER==$ADMIN_USERNAME) {
if($SESSION_ADMIN_PASS==$ADMIN_PASSWORD) {
$_SESSION['SESSION_ADMIN'] = $SESSION_ADMIN_USER;
header("Location: admin.php");
}
}
if($SESSION_ADMIN==$ADMIN_USERNAME) {
$EDIT_MADE = 0;
$POSTED_ADMIN_username = addslashes(strip_tags($_POST['username']));
$POSTED_ADMIN_password = addslashes(strip_tags($_POST['password']));
$POSTED_ADMIN_repeat = addslashes(strip_tags($_POST['repeat']));
$POSTED_ADMIN_faucet_title = addslashes(strip_tags($_POST['faucet_title']));
$POSTED_ADMIN_faucet_url = addslashes(strip_tags($_POST['faucet_url']));
$POSTED_ADMIN_tx_display_limit = addslashes(strip_tags($_POST['tx_display_limit']));
$POSTED_ADMIN_faucet_amount = addslashes(strip_tags($_POST['faucet_amount']));
$POSTED_ADMIN_pay_every = addslashes(strip_tags($_POST['pay_every']));
$POSTED_ADMIN_blockchain_guid = addslashes(strip_tags($_POST['blockchain_guid']));
$POSTED_ADMIN_blockchain_first = addslashes(strip_tags($_POST['blockchain_first']));
$POSTED_ADMIN_blockchain_second = addslashes(strip_tags($_POST['blockchain_second']));
$POSTED_ADMIN_yocaptcha_status = addslashes(strip_tags($_POST['yocaptcha_status']));
$POSTED_ADMIN_yocaptcha_public = addslashes(strip_tags($_POST['yocaptcha_public']));
$POSTED_ADMIN_yocaptcha_private = addslashes(strip_tags($_POST['yocaptcha_private']));
if($POSTED_ADMIN_username) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET username='$POSTED_ADMIN_username' WHERE id='1'");
}
if($POSTED_ADMIN_password) {
if($POSTED_ADMIN_password==$POSTED_ADMIN_repeat){
$EDIT_MADE = 1;
$POSTED_ADMIN_password = md5($POSTED_ADMIN_password);
$sql = mysql_query("UPDATE settings SET password='$POSTED_ADMIN_password' WHERE id='1'");
}
}
if($POSTED_ADMIN_faucet_title) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET faucet_title='$POSTED_ADMIN_faucet_title' WHERE id='1'");
}
if($POSTED_ADMIN_faucet_url) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET faucet_url='$POSTED_ADMIN_faucet_url' WHERE id='1'");
}
if($POSTED_ADMIN_tx_display_limit) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET tx_display_limit='$POSTED_ADMIN_tx_display_limit' WHERE id='1'");
}
if($POSTED_ADMIN_faucet_amount) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET faucet_amount='$POSTED_ADMIN_faucet_amount' WHERE id='1'");
}
if($POSTED_ADMIN_pay_every) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET pay_every='$POSTED_ADMIN_pay_every' WHERE id='1'");
}
if($POSTED_ADMIN_blockchain_guid) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET blockchain_guid='$POSTED_ADMIN_blockchain_guid' WHERE id='1'");
}
if($POSTED_ADMIN_blockchain_first) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET blockchain_first='$POSTED_ADMIN_blockchain_first' WHERE id='1'");
}
if($POSTED_ADMIN_blockchain_second) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET blockchain_second='$POSTED_ADMIN_blockchain_second' WHERE id='1'");
}
if($POSTED_ADMIN_yocaptcha_status) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET yocaptcha_status='$POSTED_ADMIN_yocaptcha_status' WHERE id='1'");
}
if($POSTED_ADMIN_yocaptcha_public) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET yocaptcha_public='$POSTED_ADMIN_yocaptcha_public' WHERE id='1'");
}
if($POSTED_ADMIN_yocaptcha_private) {
$EDIT_MADE = 1;
$sql = mysql_query("UPDATE settings SET yocaptcha_private='$POSTED_ADMIN_yocaptcha_private' WHERE id='1'");
}
if($EDIT_MADE==1) {
header("Location: admin.php");
}
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title><?php echo $WEBSITE_NAME; ?> - Admin</title>
<link rel="stylesheet" type="text/css" href="style/style.css">
</head>
<body style="font-family: verdana; font-size: 12px; padding: 0px; margin-top: 60px; margin-bottom: 20px; margin-left: 0px; margin-right: 0px;">
<?php
if($SESSION_ADMIN!=$ADMIN_USERNAME) {
echo '<center>
<div align="center" style="width: 280px; background: #FFFFFF; border-radius: 16px; -moz-border-radius: 16px; padding: 15px;">
<form action="admin.php" method="POST">
<table style="width: 250px; font-size: 12px;">
<tr>
<td colspan="2" align="left" style="font-size: 14px;"><b>Administrator Login</b></td>
</tr><tr>
<td align="right"><b>Username:</b></td>
<td align="right"><input type="text" name="admuser" placeholder="Username" style="width: 180px;"></td>
</tr><tr>
<td align="right"><b>Password:</b></td>
<td align="right"><input type="password" name="admpass" placeholder="Password" style="width: 180px;"></td>
</tr><tr>
<td colspan="2" align="right"><input type="submit" nmae="submit" value="Login"></td>
</tr>
</table>
</form>
</div>
</center>';
} else {
echo '<center>
<table style="width: 500px;">
<tr>
<td align="center" style="width: 20px;">
</td>
<td align="center" style="width: 600px;">
<div align="center" style="width: 600px; background: #FFFFFF; border-radius: 16px; -moz-border-radius: 16px; padding: 15px;">
<form action="admin.php" method="POST">
<table style="width: 500px;">
<tr>
<td align="left" style="padding: 5px;"><h3>Administration Panel:</h3></td>
</tr><tr>
<td align="center" style="padding: 5px; padding-left: 25px;">
<b>Deposit address: '.$BLOCKCHAIN_FROM.'</b>
</td>
</tr><tr>
<td align="center" style="padding: 5px;">
<table>
<tr>
<td align="left" colspan="2"><b>Bitcoin Faucet Settings:</b></td>
</tr><tr>
<td align="center" colspan="2">(Only modify fields you want to edit)</td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Admin Username:</b></td>
<td align="right" style="width: 320px;"><input type="text" name="username" placeholder="'.$ADMIN_USERNAME.'" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Admin Password:</b></td>
<td align="right" style="width: 320px;"><input type="password" name="password" placeholder="New Password" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Repeat Password:</b></td>
<td align="right" style="width: 320px;"><input type="password" name="repeat" placeholder="Repeat New Password" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Facuet Name:</b></td>
<td align="right" style="width: 320px;"><input type="text" name="faucet_title" placeholder="'.$WEBSITE_NAME.'" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Facuet URL:</b></td>
<td align="right" style="width: 320px;"><input type="text" name="faucet_url" placeholder="'.$WEBSITE_URL.'" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Txid\'s to list:</b></td>
<td align="right" style="width: 320px;"><input type="text" name="tx_display_limit" placeholder="'.$TX_DISPLAY_LIMIT.'" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Pay Per Request:</b></td>
<td align="right" style="width: 320px;"><input type="text" name="faucet_amount" placeholder="'.$FAUCET_AMOUNT.'" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Pay Every:</b></td>
<td align="right" style="width: 320px;">
<select name="pay_every" class="admin-box">';
if($FAUCET_REQUEST_EVERY=="hourly") {
echo '<option value="hourly" selected>Hourly</option>
<option value="daily">Daily</option>
<option value="ampm">AM/PM</option>';
}
if($FAUCET_REQUEST_EVERY=="daily") {
echo '<option value="hourly">Hourly</option>
<option value="daily" selected>Daily</option>
<option value="ampm">AM/PM</option>';
}
if($FAUCET_REQUEST_EVERY=="ampm") {
echo '<option value="hourly">Hourly</option>
<option value="daily">Daily</option>
<option value="ampm" selected>AM/PM</option>';
}
echo '</select>
</td>
</tr><tr>
<td align="left" colspan="2"><b>Blockchain.info Wallet Credentials:</b></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Wallet Identifier:</b></td>
<td align="right" style="width: 320px;"><input type="text" name="blockchain_guid" placeholder="'.$BLOCKCHAIN_GUID.'" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>First Password:</b></td>
<td align="right" style="width: 320px;"><input type="password" name="blockchain_first" placeholder="First Password" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Second Password:</b></td>
<td align="right" style="width: 320px;"><input type="password" name="blockchain_second" placeholder="Second Password" class="admin-box"></td>
</tr><tr>
<td align="left" colspan="2"><b>yoCaptcha Website Keys:</b>(Site Specific)</td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Enable Captchas:</b></td>
<td align="right" style="width: 320px;">
<select name="yocaptcha_status" class="admin-box">';
if($yocaptcha_status=="active") {
echo '<option value="active" selected>Enabled</option>
<option value="inactive">Disabled</option>';
}
if($yocaptcha_status=="inactive") {
echo '<option value="active">Enabled</option>
<option value="inactive" selected>Disabled</option>';
}
echo '</select>
</td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Public Key:</b></td>
<td align="right" style="width: 320px;"><input type="text" name="yocaptcha_public" placeholder="'.$yocaptcha_public.'" class="admin-box"></td>
</tr><tr>
<td align="right" style="width: 150px;"><b>Private Key:</b></td>
<td align="right" style="width: 320px;"><input type="Password" name="yocaptcha_private" placeholder="Private Key" class="admin-box"></td>
</tr><tr>
<td align="right" colspan="2"><input type="submit" name="submit" value="Submit Changes" class="admin-button"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
'.$TXID_DISPLAY_LIST.'
</div>
</td>
<td align="center" style="width: 20px;">
</td>
</tr>
</table>
</center>';
}
?>
</body>
</html>