summaryrefslogtreecommitdiff
path: root/api/fronter.php
diff options
context:
space:
mode:
Diffstat (limited to 'api/fronter.php')
-rw-r--r--api/fronter.php30
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();