summaryrefslogtreecommitdiff
path: root/app.php
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-06-22 23:06:12 +0200
committerRaindropsSys <contact@minteck.org>2023-06-22 23:06:12 +0200
commit23563c7188e089929b60f9e10721c6fc43a220ff (patch)
treeedfe2b009c82900d4ac27db02222d2f68dcad846 /app.php
parent7a7a49332df7c852abbaa33c7e8e87f93d064d61 (diff)
downloadpluralconnect-23563c7188e089929b60f9e10721c6fc43a220ff.tar.gz
pluralconnect-23563c7188e089929b60f9e10721c6fc43a220ff.tar.bz2
pluralconnect-23563c7188e089929b60f9e10721c6fc43a220ff.zip
Updated 15 files, added includes/maintenance/deleteUnusedAssets.php and deleted 4944 files (automated)
Diffstat (limited to 'app.php')
-rw-r--r--app.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/app.php b/app.php
index 2f589d4..2568d06 100644
--- a/app.php
+++ b/app.php
@@ -2,7 +2,7 @@
ob_start();
-//if (true) {
+//if (false) {
if (!str_starts_with($_SERVER['REQUEST_URI'], "/api")) {
require_once $_SERVER['DOCUMENT_ROOT'] . "/error.php";
set_error_handler("ch_error");
@@ -88,16 +88,22 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) {
} else {
$namesCloudburst = [...array_map(function ($i) {
return $i['name'];
- }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)), "unknown-cb"];
+ }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true), function ($i) {
+ return file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $i["id"] . ".json");
+ })), "unknown-cb"];
$namesRaindrops = [...array_map(function ($i) {
return $i['name'];
- }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true)), "unknown-rd"];
+ }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), function ($i) {
+ return file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $i["id"] . ".json");
+ })), "unknown-rd"];
$namesOther = [];
if ($isLoggedIn || $isLowerLoggedIn) {
$namesOther = [...array_map(function ($i) {
return $i['name'];
- }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true)), $app["other"]["unknown"]];
+ }, array_filter(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/members.json"), true), function ($i) {
+ return file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $i["id"] . ".json");
+ })), $app["other"]["unknown"]];
}
if ((in_array($toplevel, $namesCloudburst) || in_array($toplevel, $namesRaindrops) || in_array($toplevel, $namesOther)) && $toplevel !== "unknown") {