summaryrefslogtreecommitdiff
path: root/pages/api/computer.php
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-05-18 18:05:49 +0200
committerRaindropsSys <contact@minteck.org>2023-05-18 18:05:49 +0200
commit5e768d30a0c8ea53423cc4f077c8f37381b8cbb3 (patch)
tree6a880225d277907848e3cbd09b9ab28c6e47dacf /pages/api/computer.php
parent59466d5019d69691fc17c607c456f77859017968 (diff)
downloadpluralconnect-5e768d30a0c8ea53423cc4f077c8f37381b8cbb3.tar.gz
pluralconnect-5e768d30a0c8ea53423cc4f077c8f37381b8cbb3.tar.bz2
pluralconnect-5e768d30a0c8ea53423cc4f077c8f37381b8cbb3.zip
Updated 2 files (automated)
Diffstat (limited to 'pages/api/computer.php')
-rw-r--r--pages/api/computer.php9
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