diff options
author | Minteck <contact@minteck.org> | 2023-02-06 22:53:06 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-06 22:53:06 +0100 |
commit | a0b85ee44c07ac7ffd3f69227069e8835f0f2730 (patch) | |
tree | 4edc61c5a642915b55b8f9a12b4213dd5fca4339 /api | |
parent | abd342282b48d742cca1740f76d220037fd13800 (diff) | |
download | pluralconnect-a0b85ee44c07ac7ffd3f69227069e8835f0f2730.tar.gz pluralconnect-a0b85ee44c07ac7ffd3f69227069e8835f0f2730.tar.bz2 pluralconnect-a0b85ee44c07ac7ffd3f69227069e8835f0f2730.zip |
Updated 9 files and added assets/uploads/pt-pinkiepie.png (automated)
Diffstat (limited to 'api')
-rw-r--r-- | api/computer.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/api/computer.php b/api/computer.php index a4ead80..cd065e7 100644 --- a/api/computer.php +++ b/api/computer.php @@ -9,6 +9,14 @@ $json_object = json_decode($request_raw, true); $host = md5($json_object['host']); switch ($_GET['type']) { + case "heartbeat": + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $_PROFILE['login'] . "-" . $host . ".json")) { + $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $_PROFILE['login'] . "-" . $host . ".json"), true); + $data["date"] = date('c'); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/metadata/" . $_PROFILE['login'] . "-" . $host . ".json", json_encode($data)); + } + break; + case "screenshot": $id = $json_object['id']; $data = base64_decode($json_object['data']); |