-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathnew_staff.php
executable file
·320 lines (311 loc) · 11.3 KB
/
new_staff.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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<?php
session_start();
require "global_func.php";
if ($_SESSION['loggedin'] == 0)
{
header("Location: login.php");
exit;
}
$userid = $_SESSION['userid'];
require "header.php";
$h = new headers;
$h->startheaders();
include "mysql.php";
global $c;
$is =
mysql_query(
"SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",
$c) or die(mysql_error());
$ir = mysql_fetch_array($is);
check_level();
$fm = money_formatter($ir['money']);
$cm = money_formatter($ir['crystals'], '');
$lv = date('F j, Y, g:i a', $ir['laston']);
$h->userdata($ir, $lv, $fm, $cm);
$h->menuarea();
if ($ir['user_level'] != 2 && $ir['user_level'] != 3 && $ir['user_level'] != 5)
{
print "You sneak, get out of here!";
$h->endpage();
exit;
}
$posta = mysql_real_escape_string(print_r($_POST, 1), $c);
$geta = mysql_real_escape_string(print_r($_GET, 1), $c);
mysql_query(
"INSERT INTO seclogs VALUES(NULL, $userid, '$posta', '$geta', "
. time() . " )", $c);
// Stuff that all staff can do
$actions = array();
$actions['fedform'] = 'fed_user_form';
$actions['fedsub'] = 'fed_user_submit';
$actions['unfedform'] = 'unfed_user_form';
$actions['unfedsub'] = 'unfed_user_submit';
$actions['atklogs'] = 'view_attack_logs';
$actions['ipform'] = 'ip_search_form';
$actions['ipsub'] = 'ip_search_submit';
$actions['massjailip'] = 'mass_jail';
$actions['itmlogs'] = 'view_itm_logs';
$actions['cashlogs'] = 'view_cash_logs';
// Stuff that a secretary or admin can do
if ($ir['user_level'] == 2 || $ir['user_level'] == 3)
{
$actions['giveitem'] = 'give_item_form';
$actions['giveitemsub'] = 'give_item_submit';
$actions['mailform'] = 'mail_user_form';
$actions['mailsub'] = 'mail_user_submit';
$actions['invbeg'] = 'inv_user_begin';
$actions['invuser'] = 'inv_user_view';
$actions['deleinv'] = 'inv_delete';
$actions['creditform'] = 'credit_user_form';
$actions['creditsub'] = 'credit_user_submit';
$actions['maillogs'] = 'view_mail_logs';
$actions['reportsview'] = 'reports_view';
$actions['repclear'] = 'report_clear';
}
// Stuff that only admins can do
if ($ir['user_level'] == 2)
{
$actions['newuser'] = 'new_user_form';
$actions['newusersub'] = 'new_user_submit';
$actions['newitem'] = 'new_item_form';
$actions['newitemsub'] = 'new_item_submit';
$actions['killitem'] = 'kill_item_form';
$actions['killitemsub'] = 'kill_item_submit';
$actions['edititem'] = 'edit_item_begin';
$actions['edititemform'] = 'edit_item_form';
$actions['edititemsub'] = 'edit_item_sub';
$actions['newshop'] = 'new_shop_form';
$actions['newshopsub'] = 'new_shop_submit';
$actions['newstock'] = 'new_stock_form';
$actions['newstocksub'] = 'new_stock_submit';
$actions['edituser'] = 'edit_user_begin';
$actions['edituserform'] = 'edit_user_form';
$actions['editusersub'] = 'edit_user_sub';
$actions['fedeform'] = 'fed_edit_form';
$actions['fedesub'] = 'fed_edit_submit';
$actions['editnews'] = 'newspaper_form';
$actions['subnews'] = 'newspaper_submit';
$actions['editadnews'] = 'adnewspaper_form';
$actions['subadnews'] = 'adnewspaper_submit';
$actions['donator'] = 'donators_list';
$actions['acceptdp'] = 'accept_dp';
$actions['declinedp'] = 'decline_dp';
$actions['givedpform'] = 'give_dp_form';
$actions['givedpsub'] = 'give_dp_submit';
$actions['stafflist'] = 'staff_list';
$actions['userlevel'] = 'userlevel';
$actions['userlevelform'] = 'userlevelform';
$actions['massmailer'] = 'massmailer';
$actions['record'] = 'admin_user_record';
$actions['change_id'] = 'admin_user_changeid';
}
// Check their action
if (isset($_GET['action']) && isset($actions[$_GET['action']]))
{
define('IN_STAFF', true);
require_once('new_staff_actions.php');
$action_name = $actions[$_GET['action']];
$action_name();
}
else
{
switch ($ir['user_level'])
{
case 2:
admin_index();
break;
case 3:
sec_index();
break;
case 5:
ass_index();
break;
}
}
function admin_index()
{
global $ir, $c, $userid;
print
"Welcome to the breakthenet admin panel, <b>{$ir['username']}!</b><br />";
echo <<<EOF
<table width='90%' border='1' cellspacing='1' cellpadding='2'>
<tr style='background-color: black; color: white;'>
<th>Users</th>
<th>Shops</th>
<th>News</th>
</tr>
<tr>
<td rowspan='3'>
> <a href='new_staff.php?action=newuser'>Create New User</a><br />
> <a href='new_staff.php?action=edituser'>Edit User</a><br />
> <a href='new_staff.php?action=mailform'>Mail Ban User</a><br />
> <a href='new_staff.php?action=fedform'>Jail User</a><br />
> <a href='new_staff.php?action=fedeform'>Edit Fedjail Sentence</a><br />
> <a href='new_staff.php?action=unfedform'>Unjail User</a><br />
> <a href='new_staff.php?action=invbeg'>View User Inventory</a><br />
> <a href='new_staff.php?action=creditform'>Credit User Money/Crystals</a><br />
> <a href='new_staff.php?action=ipform'>Ip Search</a><br />
> <a href='new_staff.php?action=reportsview'>Player Reports</a><br />
</td>
<td>
> <a href='new_staff.php?action=newshop'>Create New Shop</a><br />
> <a href='new_staff.php?action=newstock'>Add Item To Shop</a><br />
</td>
<td rowspan='3'>
EOF;
include 'admin.news';
$versq = mysql_query("SELECT VERSION()");
$mv = mysql_result($versq, 0, 0);
mysql_free_result($versq);
$versionno = intval('11003');
$version = '1.1.0c';
$phpv = phpversion();
$critical_files =
array('installer.php', 'installer_head.php', 'installer_foot.php',
'dbdata.sql');
$have_files = array();
foreach ($critical_files as $test_file)
{
if (file_exists('./' . $test_file))
{
$have_files[] = $test_file;
}
}
$critical_error = '';
if (count($have_files) > 0)
{
$errfiles = implode(', ', $have_files);
$critical_error =
<<<EOF
<br />
<div style="border: 2px solid red; background-color: #FF6666; color: black; width: 75%;">
<h3>WARNING!</h3>
The following system-critical files still exist: {$errfiles}<br />
It is HIGHLY recommended that you delete these files immediately to
avoid your game being hacked.
</div>
EOF;
}
echo <<<EOF
</td>
</tr>
<tr style='background-color: black; color: white; height: 10pt;'>
<th>Misc.</th>
</tr>
<tr>
<td>
> <a href='new_staff.php?action=editnews'>Edit Newspaper</a><br />
> <a href='new_staff.php?action=massmailer'>Mass Mailer</a><br />
</td>
</tr>
<tr style='background-color: black; color: white;'>
<th>Items</th>
<th>Logs</th>
<th>System Info</th>
</tr>
<tr>
<td>
> <a href='new_staff.php?action=newitem'>Create New Item</a><br />
> <a href='new_staff.php?action=giveitem'>Give Item To User</a><br />
> <a href='new_staff.php?action=edititem'>Edit Item</a><br />
> <a href='new_staff.php?action=killitem'>Delete An Item</a><br />
</td>
<td>
> <a href='new_staff.php?action=atklogs'>Attack Logs</a><br />
> <a href='new_staff.php?action=cashlogs'>Cash Xfer Logs</a><br />
> <a href='new_staff.php?action=itmlogs'>Item Xfer Logs</a><br />
> <a href='new_staff.php?action=maillogs'>Mail Logs</a><br />
</td>
<td rowspan='3'>
<table width='75%' cellspacing='1' border='1'>
<tr>
<th>PHP Version:</th>
<td>{$phpv}</td>
</tr>
<tr>
<th>MySQL Version:</th>
<td>{$mv}</td>
</tr>
<tr>
<th>Codes Version:</th>
<td>{$version} (Build: {$versionno})</td>
</tr>
<tr>
<th>Update Status:</th>
<td>
<iframe
src='http://www.mccodes.com/update_check.php?version={$versionno}&type=free'
width='250' height='30'></iframe>
</td>
</tr>
</table>
{$critical_error}
</td>
</tr>
<tr style='background-color: black; color: white;'>
<th>Experimental</th>
<th>Critical Tools</th>
</tr>
<tr>
<td>
> <a href='new_staff.php?action=record'>User Record</a><br />
> <a href='new_staff.php?action=change_id'>Change User's ID</a><br />
</td>
<td>
> <a href='new_staff.php?action=stafflist'>Staff List</a><br />
> <a href='new_staff.php?action=userlevelform'>Adjust User Level</a><br />
> <a href='new_staff.php?action=donator'>Donator Packs</a><br />
> <a href='new_staff.php?action=givedpform'>Give User Donator Pack</a><br />
> <a href='new_staff.php?action=editadnews'>Edit Admin News</a><br />
</td>
</tr>
</table>
EOF;
}
function sec_index()
{
global $ir, $c;
print
"Welcome to the breakthenet secretary panel, {$ir['username']}!<br />
<h3><font color=red>Secretary Warning: Any sec who uses their powers without reason will be fired. No second chances.</font></h3><br />
<b>News from the Admins:</b> <br />";
include "admin.news";
print
"<u>Users</u><br />
[<a href='new_staff.php?action=fedform'>Jail User</a>]<br />
[<a href='new_staff.php?action=unfedform'>Unjail User</a>]<br />
[<a href='new_staff.php?action=mailform'>Mail Ban User</a>]<br />
[<a href='new_staff.php?action=invbeg'>View User Inventory</a>]<br />
[<a href='new_staff.php?action=creditform'>Credit User Money/Crystals</a>]<br />
[<a href='new_staff.php?action=ipform'>Ip Search</a>]<br />
[<a href='new_staff.php?action=reportsview'>Player Reports</a>]<br />
<br />
<u>Items</u><br />
[<a href='new_staff.php?action=giveitem'>Give Item To User</a>]<br />
<br />
<u>Logs</u><br />
[<a href='new_staff.php?action=atklogs'>Attack Logs</a>]<br />
[<a href='new_staff.php?action=cashlogs'>Cash Xfer Logs</a>]<br />
[<a href='new_staff.php?action=itmlogs'>Item Xfer Logs</a>]<br />
[<a href='new_staff.php?action=maillogs'>Mail Logs</a>]";
}
function ass_index()
{
global $ir, $c;
print
"Welcome to the breakthenet assistant panel, {$ir['username']}!<br />
<h3><font color=red>Assistant Warning: Any assistant who uses their powers without reason will be fired. No second chances.</font></h3><br />
<b>News from the Admins:</b> <br />";
include "admin.news";
print
"<u>Users</u><br />
[<a href='new_staff.php?action=fedform'>Jail User</a>]<br />
[<a href='new_staff.php?action=unfedform'>Unjail User</a>]<br />
[<a href='new_staff.php?action=ipform'>Ip Search</a>]<br />
<br />
<u>Logs</u><br />
[<a href='new_staff.php?action=atklogs'>Attack Logs</a>]<br />
[<a href='new_staff.php?action=cashlogs'>Cash Xfer Logs</a>]<br />
[<a href='new_staff.php?action=itmlogs'>Item Xfer Logs</a>]";
}
$h->endpage();