-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
123 lines (106 loc) · 3.99 KB
/
index.html
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
<!DOCTYPE html>
<html>
<title>W3.CSS Template</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-black.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://ben.mctrees.net/ben.css">
<body>
<!-- Header -->
<header class="w3-container w3-blue w3-padding" id="myHeader">
<div class="w3-center">
<h4>McTrees</h4>
<h1 class="w3-xxxlarge w3-animate-bottom">Remote Minecraft server monitor</h1>
</div>
</header>
<div class="w3-row-padding w3-center w3-margin-top">
<div class="w3-quarter w3-hover-opacity">
<div onclick="window.location.search += '&action=restart';show();" class="w3-card w3-container" style="min-height:460px">
<h3>Restart</h3><br>
<i class="fa fa-repeat w3-margin-bottom w3-text-blue" style="font-size:120px"></i>
</div>
</div>
<div class="w3-quarter w3-hover-opacity">
<div onclick="window.location.search += '&action=stop';show();" class="w3-card w3-container" style="min-height:460px">
<h3>Stop</h3><br>
<i class="fa fa-ban w3-margin-bottom w3-text-blue" style="font-size:120px"></i>
</div>
</div>
<div class="w3-quarter w3-hover-opacity">
<div onclick="window.location.search += '&action=start';show();" class="w3-card w3-container" style="min-height:460px">
<h3>Start</h3><br>
<i class="fa fa-play w3-margin-bottom w3-text-blue" style="font-size:120px"></i>
</div>
</div>
<div class="w3-quarter w3-hover-opacity">
<div onclick="window.location.search += '&action=backup';show();" class="w3-card w3-container" style="min-height:460px">
<h3>Backup</h3><br>
<i class="fa fa-floppy-o w3-margin-bottom w3-text-blue" style="font-size:120px"></i>
</div>
</div>
</div>
<center><p>Status: <?php echo exec("msm IM status"); ?></p></center>
<?php
$auth_string = "your-random-string-here";
if(isset($_GET["action"]))
{
if($_COOKIE["token"] == $auth_string) {
$out = exec("msm IM " . escapeshellarg($_GET["action"]));
header('Location: http://ben.mctrees.net/msmcss.html?o=' . $out);
}
else {
echo "Seems you're not signed in. Please refresh the page and do so.";
}
}
?>
<?php
if (isset($_GET["o"])) {
$out = $_GET["o"];
}
if (isset($out))
echo "<center><p>Command output: " . $out . "</p></center>";
?>
<script language="javascript">
function show() {
var text = document.getElementById("loadCard");
text.style.display = "block";
return "done?";
}
</script>
<div id="loadCard" style="display: none" class=" w3-card w3-white w3-display-middle">
<center>
<h1>Please wait...</h1>
<p>Your request is being processed. Please do not press any buttons.</p>
<div class="ben-loader"></div><br>
</center>
</div>
<div id="ben-overlay">
<div class="w3-white w3-card w3-display-middle">
<h3>You are not signed in. Please sign in to continue.</h3>
<form action="/msmverify.php" method="post">
<center>Password: <input class="w3-input" type="password" name="password"></input><button>Submit</button></center>
<br>
</form>
<div class="<?php if (isset($_GET["e"])) { echo 'w3-container w3-red'; } ?>">
<p><?php if (isset($_GET["e"])) { echo $_GET["e"]; } ?></p>
</div>
</div>
</div>
<!--auth-->
<?php
if(isset($_COOKIE["token"])) {
if($_COOKIE["token"] == $auth_string) {
//The user has successfully logged in
} else {
//it's likely the user is a hacker
echo "<center><h3>Looks like your auth cookie expired, you'll have to clear your cookies and re-enter your password.</h3></center>";
echo "<script>document.getElementById('ben-overlay').style.display = 'block';</script>";
}
} else {
echo "<script>document.getElementById('ben-overlay').style.display = 'block';</script>";
}
?>
</body>
</html>