From a0b85ee44c07ac7ffd3f69227069e8835f0f2730 Mon Sep 17 00:00:00 2001 From: Minteck Date: Mon, 6 Feb 2023 22:53:06 +0100 Subject: Updated 9 files and added assets/uploads/pt-pinkiepie.png (automated) --- api/computer.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'api') 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']); -- cgit