summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/desktop-app.php5
1 files changed, 5 insertions, 0 deletions
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 {