diff options
author | Minteck <contact@minteck.org> | 2022-09-22 19:47:05 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-09-22 19:47:05 +0200 |
commit | 2162eaa06f7e4764eb3dcfe130ec2c711d0c62ab (patch) | |
tree | a82223bc980747531c640e9dc2c151d5fe3335a3 /api/fronter.php | |
parent | e95b208af90cc386a7d8d1bcab426727cf4f0121 (diff) | |
download | pluralconnect-2162eaa06f7e4764eb3dcfe130ec2c711d0c62ab.tar.gz pluralconnect-2162eaa06f7e4764eb3dcfe130ec2c711d0c62ab.tar.bz2 pluralconnect-2162eaa06f7e4764eb3dcfe130ec2c711d0c62ab.zip |
Cofronting support and stuff like that
Diffstat (limited to 'api/fronter.php')
-rw-r--r-- | api/fronter.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/api/fronter.php b/api/fronter.php index e74d34a..f962625 100644 --- a/api/fronter.php +++ b/api/fronter.php @@ -31,7 +31,22 @@ switch ($type) { if ($member !== null && $member !== "null") header("Location: /?error=System member not found") and die(); if (!isset($list[$date])) $list[$date] = []; - $list[$date][] = $member; + $list[$date][] = [$member, null]; + break; + + case "cofront": + if (!isset($index) || trim($index) === "" || is_integer($index)) + if ($index !== null && $index !== "null") header("Location: /?error=Invalid index") and die(); + + $day = $list[$date]; + + if (!isset($day[$index])) + if ($index !== null && $index !== "null") header("Location: /?error=Index not found") and die(); + + if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member)) + if ($member !== null && $member !== "null") header("Location: /?error=System member not found") and die(); + + $list[$date][$index][1] = $member; break; case "delete": @@ -48,6 +63,19 @@ switch ($type) { break; + case "codelete": + if (!isset($index) || trim($index) === "" || is_integer($index)) + if ($index !== null && $index !== "null") header("Location: /?error=Invalid index") and die(); + + $day = $list[$date]; + + if (!isset($day[$index])) + if ($index !== null && $index !== "null") header("Location: /?error=Index not found") and die(); + + $list[$date][$index][1] = null; + + break; + case "down": if (!isset($index) || trim($index) === "" || is_integer($index)) if ($index !== null && $index !== "null") header("Location: /?error=Invalid index") and die(); |