diff options
author | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2023-02-23 19:34:56 +0100 |
commit | 3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch) | |
tree | 75be5fba4368472fb11c8015aee026b2b9a71888 /api/save.php | |
parent | 8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff) | |
download | pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2 pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip |
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'api/save.php')
-rw-r--r-- | api/save.php | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/api/save.php b/api/save.php deleted file mode 100644 index 864f86e..0000000 --- a/api/save.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; global $app; -if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die(); - -$request_raw = file_get_contents('php://input'); -$json_object = json_decode($request_raw, true); - -$system = $_GET['system'] ?? null; -$member = $_GET['member'] ?? null; -$subsystem = $_GET['subsystem'] ?? null; -$content = $json_object['content'] ?? null; - -if (!isset($system) || trim($system) === "" || strlen($system) !== 5 || !preg_match("/[a-z]/i", $system)) - header("Location: /?error=System 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(); - -if (!isset($subsystem) || trim($subsystem) === "" || !preg_match("/[a-z\d]/i", $subsystem)) - if ($subsystem !== null && $subsystem !== "null") header("Location: /?error=Subsystem not found") and die(); - -if ($isLowerLoggedIn && $system !== $app["other"]["id"]) die(); - -if (!isset($content)) - header("Location: /?error=No content") and die(); - -if ($member !== null && $member !== "null") { - $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member . ".html"; -} else { - if ($subsystem !== null && $subsystem !== "null") { - $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/subsystems/" . $system . "-" . $subsystem . ".html"; - } else { - $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . $system . "/content.html"; - } -} - -if (trim($content) === "") { - if (file_exists($file)) { - unlink($file); - } - die(); -} - -file_put_contents($file, $content);
\ No newline at end of file |