-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathjson_grid_info.php
More file actions
34 lines (29 loc) · 807 Bytes
/
json_grid_info.php
File metadata and controls
34 lines (29 loc) · 807 Bytes
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
<?php
/******************************************************************************
* phpGridServer
*
* GNU LESSER GENERAL PUBLIC LICENSE
* Version 2.1, February 1999
*
*/
set_include_path(dirname($_SERVER["SCRIPT_FILENAME"]).PATH_SEPARATOR.get_include_path());
require_once("lib/services.php");
$serverParams = getService("ServerParam");
$params = $serverParams->getGridInfoParams();
header("Content-Type: application/json-rpc");
echo "{";
echo "\"platform\":\"OpenSim\"";
$have_loginuri = False;
foreach($params as $name => $value)
{
if($name == "login")
{
$have_loginuri = True;
}
echo ",\"$name\":\"".addcslashes($value, "\\\n\r\\\"\\\'")."\"";
}
if(!$have_loginuri)
{
echo ",\"login\":\"".addcslashes("http://${_SERVER['SERVER_NAME']}:${_SERVER['SERVER_PORT']}/")."\"";
}
echo "}";