summaryrefslogtreecommitdiff
path: root/api/computer.php
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-06 22:53:06 +0100
committerMinteck <contact@minteck.org>2023-02-06 22:53:06 +0100
commita0b85ee44c07ac7ffd3f69227069e8835f0f2730 (patch)
tree4edc61c5a642915b55b8f9a12b4213dd5fca4339 /api/computer.php
parentabd342282b48d742cca1740f76d220037fd13800 (diff)
downloadpluralconnect-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/computer.php')
-rw-r--r--api/computer.php8
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']);