-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·95 lines (89 loc) · 2.99 KB
/
Copy pathindex.php
File metadata and controls
executable file
·95 lines (89 loc) · 2.99 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
<?php
require("PlayerDB.php");
header('Content-Type:application/json;charset=utf-8');
function get($name)
{
return ! empty($_GET[$name]) ? $_GET[$name] : "";
}
function post($name)
{
return ! empty($_POST[$name]) ? $_POST[$name] : "";
}
function response($status, $message = '', $data = array()) {
if (! is_bool ( $status )) {
return '';
}
$result = array (
'status' => $status,
'message' => $message,
'data' => $data
);
echo json_encode($result,JSON_UNESCAPED_UNICODE);
}
function lib_replace_end_tag($str)
{
if (empty($str)) return false;
$str = htmlspecialchars($str);
$str = str_replace('/', "", $str);
$str = str_replace("\\", "", $str);
$str = str_replace(">", "", $str);
$str = str_replace("<", "", $str);
$str = str_replace("<SCRIPT>", "", $str);
$str = str_replace("</SCRIPT>", "", $str);
$str = str_replace("<script>", "", $str);
$str = str_replace("</script>", "", $str);
$str = str_replace("select","select",$str);
$str = str_replace("join","join",$str);
$str = str_replace("union","union",$str);
$str = str_replace("where","where",$str);
$str = str_replace("insert","insert",$str);
$str = str_replace("delete","delete",$str);
$str = str_replace("update","update",$str);
$str = str_replace("like","like",$str);
$str = str_replace("drop","drop",$str);
$str = str_replace("create","create",$str);
$str = str_replace("modify","modify",$str);
$str = str_replace("rename","rename",$str);
$str = str_replace("alter","alter",$str);
$str = str_replace("cas","cast",$str);
$str = str_replace("&","&",$str);
$str = str_replace(">",">",$str);
$str = str_replace("<","<",$str);
$str = str_replace(" ",chr(32),$str);
$str = str_replace(" ",chr(9),$str);
$str = str_replace(" ",chr(9),$str);
$str = str_replace("&",chr(34),$str);
$str = str_replace("'",chr(39),$str);
$str = str_replace("<br />",chr(13),$str);
$str = str_replace("''","'",$str);
$str = str_replace("css","'",$str);
$str = str_replace("CSS","'",$str);
return $str;
}
$action = get('action');
//var_dump($_POST);
$playerdb = new playerDB();
$result = array();
switch ($action) {
case "verify":
$result = $playerdb->VerifyMail(post("mail"));
break;
case "register":
$result = $playerdb->Register(post("mail"), post("mailcode"), post("password"), post("playername"));
break;
case "login":
$result = $playerdb->Login(post("mail"), post("password"), post("uuid"), post("token"), post("skinenable"));
break;
case "heartbeat":
$result = $playerdb->Heartbeat(post("uuid"), post("session"), post("status"));
break;
// Server API
case "check":
$result = $playerdb->Check(post("playeruuid"));
break;
default:
break;
}
echo json_encode($result, JSON_UNESCAPED_UNICODE);
echo "\n";
?>