diff options
author | Minteck <contact@minteck.org> | 2023-03-03 07:04:02 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-03-03 07:04:02 +0100 |
commit | 29928887e733f3bc2c2baaf06dafd495a006753b (patch) | |
tree | 90f5fa4c5273f201cc2d26086298ad094d9dadda /includes/travelling.inc | |
parent | 3d77712a9ab014635c75a33ea0f491bbda6aead3 (diff) | |
download | pluralconnect-29928887e733f3bc2c2baaf06dafd495a006753b.tar.gz pluralconnect-29928887e733f3bc2c2baaf06dafd495a006753b.tar.bz2 pluralconnect-29928887e733f3bc2c2baaf06dafd495a006753b.zip |
Updated 18 files and added 10 files (automated)
Diffstat (limited to 'includes/travelling.inc')
-rw-r--r-- | includes/travelling.inc | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/includes/travelling.inc b/includes/travelling.inc index 4487956..0d1696a 100644 --- a/includes/travelling.inc +++ b/includes/travelling.inc @@ -39,19 +39,24 @@ foreach ($members as $member) { function withTravelers(array $members, string $system): array { global $travelling; - - return [ - ...array_map(function ($i) use ($system) { - $i['system'] = $system; - return $i; - }, array_filter($members, function ($i) use ($travelling) { - return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria'])); - })), - ...array_filter(array_map(function ($i) use ($system) { - $i['system'] = $system === "gdapd" ? "ynmuc" : "gdapd"; - return $i; - }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true)), function ($i) use ($travelling) { - return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']); - }) + global $app; + + if ($system === $app["other"]["id"]) { + return $members; + } else { + return [ + ...array_map(function ($i) use ($system) { + $i['system'] = $system; + return $i; + }, array_filter($members, function ($i) use ($travelling) { + return !(isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria'])); + })), + ...array_filter(array_map(function ($i) use ($system) { + $i['system'] = $system === "gdapd" ? "ynmuc" : "gdapd"; + return $i; + }, json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($system === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true)), function ($i) use ($travelling) { + return isset($travelling[$i['id']]) && $travelling[$i['id']]['travelling'] && (!isset($travelling[$i['id']]['equestria']) || !$travelling[$i['id']]['equestria']); + }) ]; + } }
\ No newline at end of file |