summaryrefslogtreecommitdiff
path: root/pages/api
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-04-20 16:20:07 +0200
committerRaindropsSys <contact@minteck.org>2023-04-20 16:20:07 +0200
commitb4bcb0912c5fe1c7f00c7ac76e5b67620781d3cc (patch)
tree027238ccdf43719ae4bbb65eedeaf9823fff6471 /pages/api
parentb484fc41a94e18f679f2494d598ac3d0ae72e3f8 (diff)
downloadpluralconnect-b4bcb0912c5fe1c7f00c7ac76e5b67620781d3cc.tar.gz
pluralconnect-b4bcb0912c5fe1c7f00c7ac76e5b67620781d3cc.tar.bz2
pluralconnect-b4bcb0912c5fe1c7f00c7ac76e5b67620781d3cc.zip
Updated 12 files and added 3 files (automated)
Diffstat (limited to 'pages/api')
-rw-r--r--pages/api/computername.php10
-rw-r--r--pages/api/docs.php1
2 files changed, 11 insertions, 0 deletions
diff --git a/pages/api/computername.php b/pages/api/computername.php
new file mode 100644
index 0000000..1a719b0
--- /dev/null
+++ b/pages/api/computername.php
@@ -0,0 +1,10 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE;
+if (!$isLoggedIn) header("Location: /-/login") and die();
+
+$names = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/names.json"), true);
+$names[$_GET["id"]] = $_GET["name"];
+file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/computers/names.json", json_encode($names));
+
+die(); \ No newline at end of file
diff --git a/pages/api/docs.php b/pages/api/docs.php
index 3d11831..a60a6e6 100644
--- a/pages/api/docs.php
+++ b/pages/api/docs.php
@@ -22,6 +22,7 @@ if (isset($select)) {
if ($json_object["content"]) $data["contents"] = $json_object["content"];
if ($json_object["name"]) $data["name"] = $json_object["name"];
+if ($json_object["explicit"]) $data["nsfw"] = $json_object["explicit"];
if ($json_object["category"]) $data["category"] = trim($json_object["category"]) !== "" && trim($json_object["category"]) !== "Unsorted" && trim($json_object["category"]) !== "unsorted" && trim($json_object["category"]) !== "/no" && trim($json_object["category"]) !== "Unsort" && trim($json_object["category"]) !== "unsort" ? $json_object["category"] : null;
$data["last"]["date"] = time();