-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·68 lines (66 loc) · 1.7 KB
/
index.php
File metadata and controls
executable file
·68 lines (66 loc) · 1.7 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
<?php
/******************************************************************************
* phpGridServer
*
* GNU LESSER GENERAL PUBLIC LICENSE
* Version 2.1, February 1999
*
*/
set_include_path(dirname($_SERVER["SCRIPT_FILENAME"]).PATH_SEPARATOR.get_include_path());
if($_SERVER["REQUEST_METHOD"] == "POST" && isset($_SERVER["CONTENT_TYPE"]))
{
$contentType = explode(";", $_SERVER["CONTENT_TYPE"])[0];
if($contentType == "text/xml" || $contentType == "application/xml")
{
/* xmlrpc */
chdir("xmlrpc");
require_once("xmlrpc/xmlrpc.php");
}
else if($contentType == "application/json-rpc")
{
/* json 2.0 rpc */
chdir("json20rpc");
require_once("json20rpc/json20rpc.php");
}
else if($contentType == "application/json")
{
/* json 1.0 rpc */
chdir("jsonrpc");
require_once("jsonrpc/jsonrpc.php");
}
else if($contentType == "application/llsd+xml" || $contentType == "application/xml+llsd")
{
/* llsd-xml (but OpenSim has some broken places with the wrong 'application/xml+llsd') */
chdir("llsd_rpc");
require_once("llsd_rpc/llsd_xml.php");
}
else if($contentType == "application/llsd+binary")
{
/* llsd-binary */
chdir("llsd_rpc");
require_once("llsd_rpc/llsd_binary.php");
}
else if($contentType == "application/x-www-form-urlencoded")
{
require_once("frontpage.php");
}
else if($contentType == "multipart/form-data")
{
require_once("frontpage.php");
}
else
{
http_response_code("400");
header("Content-Type: text/plain");
echo "Unsupported Content-Type: ".$contentType;
exit;
}
}
else if(file_exists("frontpage.php"))
{
require_once("frontpage.php");
}
else
{
require_once("frontpage.sample.php");
}