-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathadmin.php
More file actions
executable file
·591 lines (522 loc) · 17.1 KB
/
admin.php
File metadata and controls
executable file
·591 lines (522 loc) · 17.1 KB
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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
<?php
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2 of the License, or (at your
// option) any later version.
//
// File: admin.php
include ("config/config.php");
$template_object->enable_gzip = 0;
get_post_ifset("game_name, command, cmd, menu, admin_password, md5admin_password, ip");
if (!isset($game_name) || $game_name == '')
{
$title = "Administration";
}
else
{
$title = "Administration: " . $game_name;
}
if($playerinfo['template'] == '' or !isset($playerinfo['template'])){
$templatename = $default_template;
}else{
$templatename = $playerinfo['template'];
}
include ("header.php");
if ((!isset($menu)) || ($menu == ''))
{
$menu = '';
}
if ((!isset($admin_password)) || ($admin_password == ''))
{
$admin_password = '';
}
if (isset($md5admin_password) && md5($adminpass) == $md5admin_password) //md5 sent from log.php
{
$admin_password = $adminpass;
}
function CHECKED($yesno)
{
return(($yesno == "Y") ? "CHECKED" : "");
}
function YESNO($onoff)
{
return(($onoff == "ON") ? "Y" : "N");
}
?>
<style type="text/css">
#dhtmltooltip{
position: absolute;
width: 150px;
border: 2px solid black;
padding: 2px;
background-color: lightyellow;
visibility: hidden;
z-index: 2000;
/*Remove below line to remove shadow. Below line should always appear last within this CSS*/
filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135);
}
.tooltiptitle{COLOR: #FFFFFF; TEXT-DECORATION: none; CURSOR: Default; font-family: arial; font-weight: bold; font-size: 8pt}
.tooltipcontent{COLOR: #000000; TEXT-DECORATION: none; CURSOR: Default; font-family: arial; font-size: 8pt}
</style>
<div id="dhtmltooltip"></div>
<script type="text/javascript">
/***********************************************
* Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
var offsetxpoint=30 //Customize x offset of tooltip
var offsetypoint=0 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function ddrivetip(thetitle, thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
topColor = "#7D92A9"
subColor = "#A5B4C4"
ContentInfo = '<table border="0" width="150" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" bgcolor="#000000">'+
'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
'<tr><td width="100%" bgcolor='+topColor+'>'+
'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
'<tr><td width="100%" align="center">'+
'<font class="tooltiptitle">'+thetitle+'</font>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'<tr><td width="100%" bgcolor='+subColor+'>'+
'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+
'<tr><td width="100%">'+
'<font class="tooltipcontent">'+thetext+'</font>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>'+
'</td></tr>'+
'</table>';
tipobj.innerHTML=ContentInfo
enabletip=true
return false
}
}
function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"
//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}
function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}
document.onmousemove=positiontip
//-->
</script>
<style type="text/css">
<!--
td { font-size: 10px; color: #e0e0e0; font-family: verdana; }
TEXTAREA { font-size: 10px; font-family: verdana; }
INPUT { font-size: 10px; font-family: verdana; }
SELECT { font-size: 10px; font-family: verdana; }
-->
</style>
<style type="text/css">
/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */
.suckertreemenu ul{
margin: 0;
padding: 0;
list-style-type: none;
z-index: 100;
}
/*Top level list items*/
.suckertreemenu ul li{
position: relative;
display: inline;
float: left;
background-color: #4455aa; /*overall menu background color*/
z-index: 100;
}
/*Top level menu link items style*/
.suckertreemenu ul li a{
display: block;
width: auto; /*Width of top level menu link items*/
padding: 3px 15px 3px 10px;
border: 1px solid #dddddd;
border-left-width: 1;
text-decoration: none;
color: white;
font-weight: bold;
font-family: Verdana, Arial, sans-serif;
font-size: 12px;
}
/*1st sub level menu*/
.suckertreemenu ul li ul{
left: 0;
position: absolute;
top: 1em; /* no need to change, as true value set by script */
display: block;
visibility: hidden;
}
/*Sub level menu list items (undo style from Top level List Items)*/
.suckertreemenu ul li ul li{
display: list-item;
float: none;
}
/*All subsequent sub menu levels offset after 1st level sub menu */
.suckertreemenu ul li ul li ul{
left: auto; /* no need to change, as true value set by script */
top: 0;
}
/* Sub level menu links style */
.suckertreemenu ul li ul li a{
display: block;
width: 160px; /*width of sub menu levels*/
color: white;
text-decoration: none;
padding: 3px 15px 3px 10px;
border: 1px solid #dddddd;
}
.suckertreemenu ul li a:hover{
background-color: #000000;
color: white;
}
/*Background image for top level menu list links */
.suckertreemenu .mainfoldericon{
background: #4455aa url(images/arrow_down.gif) no-repeat center right;
}
/*Background image for subsequent level menu list links */
.suckertreemenu .subfoldericon{
background: #4455aa url(images/arrow_right.gif) no-repeat center right;
}
/* Holly Hack for IE \*/
* html .suckertreemenu ul li { float: left; height: 1%; }
* html .suckertreemenu ul li a { height: 1%; width: 1px;}
* html .suckertreemenu ul li ul li { float: left;}
/* End */
</style>
<script type="text/javascript">
//SuckerTree Horizontal Menu (Sept 14th, 06)
//By Dynamic Drive: http://www.dynamicdrive.com/style/
var menuid="treemenu"
function buildsubmenus_horizontal()
{
var ultags=document.getElementById(menuid).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++)
{
if (ultags[t].parentNode.parentNode.id==menuid)
{ //if this is a first level submenu
ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
}
else
{ //else if this is a sub level menu (ul)
ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
}
ultags[t].parentNode.onmouseover=function()
{
this.getElementsByTagName("ul")[0].style.visibility="visible"
}
ultags[t].parentNode.onmouseout=function()
{
this.getElementsByTagName("ul")[0].style.visibility="hidden"
}
}
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus_horizontal, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus_horizontal)
</script>
<table id="Table_01" width="772" border="0" cellpadding="0" cellspacing="0" align="center">
<?
if ($admin_password == '')
{
?>
<tr>
<td>
<img src="images/admin/admin_01.gif" width="772" height="30" alt=""></td>
</tr>
<tr>
<td background="images/admin/admin_02.gif">
<div align="center">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="650" height="300" id="3D Solar System" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="images/aat-title.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="images/aat-title.swf" quality="high" bgcolor="#000000" width="650" height="300" name="3D Solar System" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></div></td>
</tr>
<tr>
<td>
<img src="images/admin/admin_03.gif" width="772" height="40" alt=""></td>
</tr>
<?
}
else
{
?>
<tr>
<td>
<img src="images/admin/admin_01a.gif" width="772" height="30" alt=""></td>
</tr>
<?
}
?>
</table>
<table width="772" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="images/admin/admin_04.gif"><table cellspacing ="0" cellpadding ="0" border ="1" width ="667" align="center" bgcolor="#000000">
<tr align="center">
<td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="3" align="center">
<tr>
<td>
<div align="center"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="3" color="#66FFCC"><?php echo ucwords(str_replace("_", " ", $menu)); ?></font></b></div>
</td>
</tr>
<?php
$login_ip = getenv("REMOTE_ADDR");
if ($admin_password != $adminpass || $admin_password == md5($adminpass))
{
adminlog("LOG0_RAW","Admin Login attempt from $login_ip");
echo "<tr><td><div align=center><form action=\"admin.php\" method=\"post\">";
?>
Select Game to Administer: <select name="game_number">
<?php
$filelist = get_dirlist($gameroot."config/");
$newcommands = 0;
for ($c=0; $c<count($filelist); $c++) {
if(strstr($filelist[$c], "config_local")){
$gamenumber = str_replace("config_local", "", str_replace(".php", "", $filelist[$c]));
$fs = fopen($gameroot."config/".$filelist[$c], "r");
$items = fgets($fs);
$items = fgets($fs);
$gamename = AAT_substr(trim($items), 3);
fclose($fs);
?>
<option value="<?=$gamenumber;?>" <?php
?>>Admin: <?=$gamename;?></option>
<?php
}
}?>
</select><br><br>
<?php
echo "Password: <input type=password name=admin_password size=20 maxlength=20> ";
echo "<input type=submit value=Submit><input type=reset value=Reset>";
echo "</form></div></td></tr>";
}
else
{
$count = 0;
$filelist = get_dirlist($gameroot."admin");
for ($c=0; $c<count($filelist); $c++) {
$filenameroot = str_replace(".inc", "", $filelist[$c]);
if(strstr($filelist[$c], ".inc")){
$fs = fopen($gameroot."admin/".$filelist[$c], "r");
$items = fgets($fs);
$items = fgets($fs);
$helpinfo = fgets($fs);
$name = AAT_substr(trim($items), 3);
$helpinfo = AAT_substr($helpinfo, 3);
$menuselections = explode(":", $name);
fclose($fs);
$fileroot[$count] = $filenameroot;
$menuselection[$count] = $menuselections[0];
$description[$count] = trim($menuselections[1]);
$help[$count] = addslashes(trim($helpinfo));
$count++;
}
}
array_multisort($description, SORT_ASC, SORT_STRING, $menuselection, $fileroot, $help);
?>
<tr><td width="100%">
<table align="center"><tr><td align="center">
<img src="images/spacer.gif" height="1" width="530"><br>
<div class="suckertreemenu">
<ul id="treemenu">
<li><a href="#">View</a>
<ul>
<?
for($i = 0; $i < $count; $i++)
{
if($menuselection[$i] == 1)
{
echo "<li><a href=\"admin.php?menu=$fileroot[$i]&game_number=$game_number&admin_password=$admin_password\" onMouseover=\"ddrivetip('$description[$i]', '$help[$i]');\" onMouseout=\"hideddrivetip()\">$description[$i]</a></li>";
}
}
?>
</ul>
</li>
<li><a href="#">Edit</a>
<ul>
<?
for($i = 0; $i < $count; $i++)
{
if($menuselection[$i] == 2)
{
echo "<li><a href=\"admin.php?menu=$fileroot[$i]&game_number=$game_number&admin_password=$admin_password\" onMouseover=\"ddrivetip('$description[$i]', '$help[$i]');\" onMouseout=\"hideddrivetip()\">$description[$i]</a></li>";
}
}
?>
</ul>
</li>
<li><a href="">Update</a>
<ul>
<?
for($i = 0; $i < $count; $i++)
{
if($menuselection[$i] == 8)
{
echo "<li><a href=\"admin.php?menu=$fileroot[$i]&game_number=$game_number&admin_password=$admin_password\" onMouseover=\"ddrivetip('$description[$i]', '$help[$i]');\" onMouseout=\"hideddrivetip()\">$description[$i]</a></li>";
}
}
?>
</ul>
</li>
<li><a href="#">Message</a>
<ul>
<?
for($i = 0; $i < $count; $i++)
{
if($menuselection[$i] == 3)
{
echo "<li><a href=\"admin.php?menu=$fileroot[$i]&game_number=$game_number&admin_password=$admin_password\" onMouseover=\"ddrivetip('$description[$i]', '$help[$i]');\" onMouseout=\"hideddrivetip()\">$description[$i]</a></li>";
}
}
?>
</ul>
</li>
<li><a href="#">Scheduler</a>
<ul>
<?
for($i = 0; $i < $count; $i++)
{
if($menuselection[$i] == 4)
{
echo "<li><a href=\"admin.php?menu=$fileroot[$i]&game_number=$game_number&admin_password=$admin_password\" onMouseover=\"ddrivetip('$description[$i]', '$help[$i]');\" onMouseout=\"hideddrivetip()\">$description[$i]</a></li>";
}
}
?>
</ul>
</li>
<li><a href="#">Backup</a>
<ul>
<?
for($i = 0; $i < $count; $i++)
{
if($menuselection[$i] == 5)
{
echo "<li><a href=\"admin.php?menu=$fileroot[$i]&game_number=$game_number&admin_password=$admin_password\" onMouseover=\"ddrivetip('$description[$i]', '$help[$i]');\" onMouseout=\"hideddrivetip()\">$description[$i]</a></li>";
}
}
?>
</ul>
</li>
<li><a href="#">Restore</a>
<ul>
<?
for($i = 0; $i < $count; $i++)
{
if($menuselection[$i] == 6)
{
echo "<li><a href=\"admin.php?menu=$fileroot[$i]&game_number=$game_number&admin_password=$admin_password\" onMouseover=\"ddrivetip('$description[$i]', '$help[$i]');\" onMouseout=\"hideddrivetip()\">$description[$i]</a></li>";
}
}
?>
</ul>
</li>
<li><a href="">Reset</a>
<ul>
<?
for($i = 0; $i < $count; $i++)
{
if($menuselection[$i] == 7)
{
echo "<li><a href=\"admin.php?menu=$fileroot[$i]&game_number=$game_number&admin_password=$admin_password\" onMouseover=\"ddrivetip('$description[$i]', '$help[$i]');\" onMouseout=\"hideddrivetip()\">$description[$i]</a></li>";
}
}
?>
</ul>
</li>
</ul>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<div align="center">
<?php
require ("backends/cpuloadclass/class_CPULoad.php");
$cpuload = new CPULoad();
$cpuload->get_load();
$cpuload->print_load();
echo "The average CPU load is: ".$cpuload->load["cpu"]."%<br>\n";
?>
</div>
</td>
</tr>
<?
if (empty($menu))
{
adminlog("LOG0_RAW","Admin Login successful from $login_ip");
echo "<tr><td><div align=center>Welcome to the Alien Assault Traders Administration Module<BR><BR>\n";
echo "</div></td></tr>";
}
else
{
include ("admin/". $menu . ".inc");
}
}
echo "<tr><td colspan=\"9\"><div align=center>" . $l_global_mlogin . "</div></td></tr>";
?>
</table>
</td>
</tr></table></td>
</tr>
</table>
<table width="772" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="images/admin/admin_05.gif" width="772" height="31" alt=""></td>
</tr>
</table>
<?php
include ("footer.php");
?>