forked from Erythrocyte3803/PHP-Yggdrasil-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
31 lines (27 loc) · 846 Bytes
/
index.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
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/inc/include.php');
function do404()
{
global $servername, $impname, $impver, $homepage, $regurl, $skinurl, $publickey;
global $db, $client_ip_int;
// 404 strike
$db->updIp404($client_ip_int);
header('content-type:application/json;charset=utf-8');
echo json_encode(serverinfo::info($servername, $impname, $impver, $homepage, $regurl, $skinurl, $publickey));
}
if ($_SERVER["REQUEST_URI"] != "/index.php") {
$requri = explode("?", $_SERVER["REQUEST_URI"])[0];
if (strpos($requri, "sessionserver/session/minecraft/profile") > -1) {
if ($db->allowIp($client_ip_int)) {
include "inc/sessionserver/session/minecraft/profile/index.php";
}
} else {
if ($db->allowIp($client_ip_int)) {
if (!(include "inc" . $requri . "/index.php")) {
do404();
}
}
}
} else {
do404();
}