From 78003af142c7c851ee14dbafecaa47954e07a8c2 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 21 Jan 2023 21:59:38 +0100 Subject: Updated api/desktop-app.php (automated) --- api/desktop-app.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api') diff --git a/api/desktop-app.php b/api/desktop-app.php index 20b1da9..2d0f0bf 100644 --- a/api/desktop-app.php +++ b/api/desktop-app.php @@ -34,6 +34,11 @@ if (isset($_GET["config"])) { } if ($proceed) { + if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/app-usage.json")) file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/app-usage.json", "{}"); + $usage = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/app-usage.json"), true); + $usage[$_GET['id']] = date('c'); + file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/app-usage.json", json_encode($usage)); + $data = $keys[$_GET["id"]]["config"] ?? []; } } else { -- cgit