summaryrefslogtreecommitdiff
path: root/includes/functions.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
committerMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
commit2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 (patch)
tree17848d95522dab25d3cdeb9c4a6450e2a234861f /includes/functions.inc
parent108525534c28013cfe1897c30e4565f9893f3766 (diff)
downloadpluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.gz
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.bz2
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.zip
Update
Diffstat (limited to 'includes/functions.inc')
-rw-r--r--includes/functions.inc19
1 files changed, 18 insertions, 1 deletions
diff --git a/includes/functions.inc b/includes/functions.inc
index 386d2b2..c3ec313 100644
--- a/includes/functions.inc
+++ b/includes/functions.inc
@@ -21,6 +21,23 @@ if (!function_exists("getAsset")) {
}
$id = $id1 . $id2;
+
+ if (str_ends_with(getMemberWithoutSystem($memberID)["name"], "-travelling")) {
+ $id1 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/general.json"), true)["uuid"]);
+
+ $members = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($systemID === "gdapd" ? "ynmuc" : "gdapd") . "/members.json"), true);
+ $list = array_map(function ($i) {
+ return $i["name"];
+ }, $members);
+
+ if (in_array(substr(getMemberWithoutSystem($memberID)["name"], 0, -11), $list)) {
+ $id2 = preg_replace("/^([\da-f]{8})-([\da-f]{4})-([\da-f]{4})-([\da-f]{4})-([\da-f]{12})$/", "$1$2$3$4$5", getMemberFromName(substr(getMemberWithoutSystem($memberID)["name"], 0, -11))["uuid"]);
+ } else {
+ return "/error/nomember/?s=$systemID&m=$memberID&t=$type";
+ }
+
+ $id = $id1 . $id2;
+ }
} else {
$id = $id1;
}
@@ -457,7 +474,7 @@ if (!function_exists("getMemberFromName")) {
$list = [...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/members.json"), true), ...json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/members.json"), true)];
foreach ($list as $item) {
- if ($item["name"] === $name) return $item;
+ if ($item["name"] === $name) return getMemberWithoutSystem($item["id"]);
}
}
}