summaryrefslogtreecommitdiff
path: root/pages/api/save-private.php
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /pages/api/save-private.php
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'pages/api/save-private.php')
-rw-r--r--pages/api/save-private.php35
1 files changed, 0 insertions, 35 deletions
diff --git a/pages/api/save-private.php b/pages/api/save-private.php
deleted file mode 100644
index 6843e2a..0000000
--- a/pages/api/save-private.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn;
-if (!$isLoggedIn) 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;
-$content = $json_object['content'] ?? null;
-
-if (!isset($system) || trim($system) === "" || strlen($system) !== 5 || !preg_match("/[a-z]/i", $system))
- peh_error("System not found", 404);
-
-if (!isset($member) || trim($member) === "" || strlen($member) !== 5 || !preg_match("/[a-z]/i", $member))
- if ($member !== null && $member !== "null") peh_error("System member not found", 404);
-
-if (!isset($content))
- peh_error("No content", 400);
-
-if ($member !== null && $member !== "null") {
- $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $member . "-private.html";
-} else {
- $file = $_SERVER['DOCUMENT_ROOT'] . "/includes/data/content/" . $system . ".html";
-}
-
-if (trim($content) === "") {
- if (file_exists($file)) {
- unlink($file);
- }
- die();
-}
-
-file_put_contents($file, $content); \ No newline at end of file