diff options
author | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
commit | 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch) | |
tree | 75be5fba4368472fb11c8015aee026b2b9a71888 /api/raindrops-data.php | |
parent | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff) | |
download | pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2 pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip |
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'api/raindrops-data.php')
-rw-r--r-- | api/raindrops-data.php | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/api/raindrops-data.php b/api/raindrops-data.php deleted file mode 100644 index 492f561..0000000 --- a/api/raindrops-data.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc"; -if (!$isLoggedIn) header("Location: /-/login") and die(); - -$data = []; -$data["members"] = []; - -foreach (array_filter(scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/data"), function ($i) { return !str_starts_with($i, "."); }) as $file) { - if (str_starts_with($file, "gdapd-") && !(str_ends_with($file, "/members.json") || str_ends_with($file, "/fronters.json") || str_ends_with($file, "/general.json") || str_ends_with($file, "/switches.json"))) { - $name = substr(explode(".", $file)[0], 6); - $parts = explode("-", $name); - - if (explode(".", $file)[1] === "json") { - if (strlen($parts[0]) === 5) { - if (!isset($data["members"][$parts[0]])) $data["members"][$parts[0]] = [ - "metadata" => null, - "content" => null - ]; - if ($parts[1] === "metadata") { - $data["members"][$parts[0]][$parts[1]] = parseMetadata(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true)); - } else { - $data["members"][$parts[0]][$parts[1]] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true); - } - } else { - $data[$name] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file), true); - } - } else { - if (strlen($parts[0]) === 5) { - if (!isset($data["members"][$parts[0]])) $data["members"][$parts[0]] = [ - "metadata" => null, - "content" => null - ]; - $data["members"][$parts[0]][$parts[1]] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file); - } else { - $data[$name] = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $file); - } - } - } -} - -header("Content-Type: application/json"); -die(json_encode($data, JSON_PRETTY_PRINT));
\ No newline at end of file |