diff options
Diffstat (limited to 'pages/api')
-rw-r--r-- | pages/api/computer.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pages/api/computer.php b/pages/api/computer.php index f5117f9..7dce4b6 100644 --- a/pages/api/computer.php +++ b/pages/api/computer.php @@ -52,8 +52,15 @@ switch ($_GET['type']) { case "data": if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata")) mkdir($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata"); + if (isset($json_object["_session"])) unset($json_object["_session"]); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $_PROFILE['login'] . "-" . $host . ".json", json_encode($json_object)); break; } -die($_PROFILE['login'] . "-" . $host);
\ No newline at end of file +if (isset($_GET["json"])) { + die(json_encode([ + "id" => $_PROFILE['login'] . "-" . $host + ])); +} else { + die($_PROFILE['login'] . "-" . $host); +}
\ No newline at end of file |