summaryrefslogtreecommitdiff
path: root/pages/api
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-03-21 16:21:21 +0100
committerRaindropsSys <contact@minteck.org>2023-03-21 16:21:21 +0100
commit475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd (patch)
tree2cff46debf9c1e13892e7babff9deb6874ecb4b2 /pages/api
parent7ccc2de87f9e25c715dc09b9aba4eb5c66f80424 (diff)
downloadpluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.gz
pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.tar.bz2
pluralconnect-475c5731bf3362b6ac8d2dc5d5b43e4b4a6117bd.zip
Updated 26 files and added 1074 files (automated)
Diffstat (limited to 'pages/api')
-rw-r--r--pages/api/chrome.php2
-rw-r--r--pages/api/desktop.php3
-rw-r--r--pages/api/me.php28
-rw-r--r--pages/api/menu.php168
-rw-r--r--pages/api/pleasure-real.php35
-rw-r--r--pages/api/pleasure.php35
6 files changed, 265 insertions, 6 deletions
diff --git a/pages/api/chrome.php b/pages/api/chrome.php
index 3b49ec7..c50599a 100644
--- a/pages/api/chrome.php
+++ b/pages/api/chrome.php
@@ -4,7 +4,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $i
if (isset($_GET["e"])) {
- header("Access-Control-Allow-Origin: chrome-extension://klenhenmabddpffgdaijdkjmfkkafbno");
+ header("Access-Control-Allow-Origin: chrome-extension://foioekefbipjjonpgpbjahmplcealhhg");
} else {
header("Access-Control-Allow-Origin: *");
}
diff --git a/pages/api/desktop.php b/pages/api/desktop.php
new file mode 100644
index 0000000..5d79440
--- /dev/null
+++ b/pages/api/desktop.php
@@ -0,0 +1,3 @@
+<?php
+
+die(); \ No newline at end of file
diff --git a/pages/api/me.php b/pages/api/me.php
index 215e1cf..4f86549 100644
--- a/pages/api/me.php
+++ b/pages/api/me.php
@@ -3,19 +3,37 @@
$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true);
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
-if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die();
-global $_PROFILE;
header("Content-Type: application/json");
+if (!$isLoggedIn && !$isLowerLoggedIn) die('{"valid": false}');
+global $_PROFILE;
+
if ($_PROFILE['login'] === "raindrops") {
- die('{"name": "Raindrops System", "id": "raindrops", "pluralkit": "gdapd"}');
+ die(json_encode([
+ "valid" => true,
+ "name" => "Raindrops System",
+ "id" => "raindrops",
+ "pluralkit" => "gdapd",
+ "avatar" => getAsset("gdapd"),
+ "email" => $_PROFILE["profile"]["email"]["email"]
+ ]));
} else if ($_PROFILE["login"] === "cloudburst") {
- die('{"name": "Cloudburst System", "id": "cloudburst", "pluralkit": "ynmuc"}');
+ die(json_encode([
+ "valid" => true,
+ "name" => "Cloudburst System",
+ "id" => "cloudburst",
+ "pluralkit" => "ynmuc",
+ "avatar" => getAsset("ynmuc"),
+ "email" => $_PROFILE["profile"]["email"]["email"]
+ ]));
} else {
die(json_encode([
+ "valid" => true,
"name" => $app["other"]["name"],
"id" => $app["other"]["slug"],
- "pluralkit" => $app["other"]["id"]
+ "pluralkit" => $app["other"]["id"],
+ "avatar" => getAsset($app["other"]["id"]),
+ "email" => $_PROFILE["profile"]["email"]["email"]
]));
} \ No newline at end of file
diff --git a/pages/api/menu.php b/pages/api/menu.php
new file mode 100644
index 0000000..10214d8
--- /dev/null
+++ b/pages/api/menu.php
@@ -0,0 +1,168 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE; global $isLowerLoggedIn; global $app;
+if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die();
+
+$available = json_decode(base64_decode($_GET["available"]), true);
+$isSexual = true;
+
+die(json_encode([
+ [
+ "title" => "Cold Haze",
+ "items" => [
+ [
+ "title" => "Front planner",
+ "link" => "coldhaze://-/fronting",
+ "show" => $available["coldHaze"],
+ "icon" => "icons://planner"
+ ],
+ [
+ "title" => "Profile scores",
+ "link" => "coldhaze://-/profiles",
+ "show" => $available["coldHaze"],
+ "icon" => "icons://scores"
+ ],
+ [
+ "title" => "Money tracker",
+ "link" => "coldhaze://-/money",
+ "show" => $available["coldHaze"] && $isLoggedIn,
+ "icon" => "icons://money"
+ ],
+ [
+ "title" => "Rules",
+ "link" => "coldhaze://-/rules",
+ "show" => $available["coldHaze"] && $isLoggedIn,
+ "icon" => "icons://rules"
+ ],
+ [
+ "title" => "Toys database",
+ "link" => "coldhaze://-/toys",
+ "show" => $available["coldHaze"] && $isLoggedIn && $isSexual,
+ "icon" => "icons://toys"
+ ],
+ [
+ "title" => "Documents",
+ "link" => "coldhaze://-/docs",
+ "show" => $available["coldHaze"] && $isLoggedIn,
+ "icon" => "icons://documents"
+ ],
+ [
+ "title" => "Devices",
+ "link" => "coldhaze://-/computers",
+ "show" => $available["coldHaze"] && $isLoggedIn,
+ "icon" => "icons://computers"
+ ],
+ [
+ "title" => "System travelling",
+ "link" => "coldhaze://-/travelling",
+ "show" => $available["coldHaze"],
+ "icon" => "icons://travelling"
+ ]
+ ]
+ ],
+ [
+ "title" => "Utilities",
+ "items" => [
+ [
+ "title" => "Backup viewer",
+ "link" => "local://backup",
+ "show" => true,
+ "icon" => "icons://backup"
+ ],
+ [
+ "title" => "SSH client",
+ "link" => "local://ssh",
+ "show" => true,
+ "icon" => "icons://ssh"
+ ]
+ ]
+ ],
+ [
+ "title" => "Booru",
+ "items" => [
+ [
+ "title" => "Home",
+ "link" => "booru://home/",
+ "show" => $available["booru"],
+ "icon" => "icons://home"
+ ],
+ [
+ "title" => "Search",
+ "link" => "booru://search/",
+ "show" => $available["booru"],
+ "icon" => "icons://search"
+ ],
+ [
+ "title" => "Followed tags",
+ "link" => "booru://followed/",
+ "show" => $available["booru"],
+ "icon" => "icons://followed"
+ ],
+ [
+ "title" => "Saved images",
+ "link" => "booru://saved/",
+ "show" => $available["booru"],
+ "icon" => "icons://saved"
+ ],
+ [
+ "title" => "Explicit gallery",
+ "link" => "booru://nsfw/g/",
+ "show" => $available["booru"] && $isSexual,
+ "icon" => "icons://nsfw"
+ ],
+ [
+ "title" => "Genitalia",
+ "link" => "booru://nsfw/sp2/",
+ "show" => $available["booru"] && $isSexual,
+ "icon" => "https://booru.equestria.dev/nsfw/icon/"
+ ]
+ ]
+ ],
+ [
+ "title" => "Other apps",
+ "items" => [
+ [
+ "title" => "Ponycon.info",
+ "link" => "ponycon://",
+ "show" => $available["ponycon"],
+ "icon" => "icons://ponycon"
+ ],
+ [
+ "title" => "Delta",
+ "link" => "delta://",
+ "show" => $available["delta"],
+ "icon" => "icons://delta"
+ ],
+ [
+ "title" => "Gitea",
+ "link" => "gitea://equestria.dev",
+ "show" => $available["gitea"],
+ "icon" => "icons://gitea"
+ ],
+ [
+ "title" => "JetBrains Hub",
+ "link" => "hub://hub/projects",
+ "show" => true,
+ "icon" => "icons://hub"
+ ],
+ [
+ "title" => "YouTrack",
+ "link" => "youtrack://",
+ "show" => $available["youtrack"],
+ "icon" => "icons://youtrack"
+ ],
+ [
+ "title" => "Plex",
+ "link" => "https://plex.equestria.dev",
+ "show" => true,
+ "icon" => "icons://plex"
+ ],
+ [
+ "title" => "Proxmox",
+ "link" => "https://admin.equestria.dev",
+ "show" => true,
+ "icon" => "icons://proxmox"
+ ]
+ ]
+ ]
+])); \ No newline at end of file
diff --git a/pages/api/pleasure-real.php b/pages/api/pleasure-real.php
new file mode 100644
index 0000000..2d631ff
--- /dev/null
+++ b/pages/api/pleasure-real.php
@@ -0,0 +1,35 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die();
+global $_PROFILE;
+
+if ($_PROFILE["login"] === "cloudburst") return;
+
+$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"];
+$frontOther = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/fronters.json"), true)["members"];
+
+if ($_PROFILE["login"] === "raindrops" && isset($frontRaindrops[0])) {
+ $pony = $frontRaindrops[0]["display_name"] ?? $frontRaindrops[0]["name"];
+} else if ($_PROFILE["login"] !== "raindrops" && isset($frontOther[0])) {
+ $pony = $frontOther[0]["display_name"] ?? $frontOther[0]["name"];
+} else {
+ $pony = "somepony";
+}
+
+$ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"];
+
+file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_context_create([
+ 'http' => [
+ 'method' => 'POST',
+ 'header' =>
+ "Content-Type: text/plain\r\n" .
+ "Title: 🏩 $pony wants to play for a bit\r\n" .
+ "Priority: high\r\n" .
+ "Tags: pleasure\r\n" .
+ "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
+ 'content' => "Hey, $pony wants to play and have fun for a bit, get up!"
+ ]
+]));
+
+die(); \ No newline at end of file
diff --git a/pages/api/pleasure.php b/pages/api/pleasure.php
new file mode 100644
index 0000000..b300a70
--- /dev/null
+++ b/pages/api/pleasure.php
@@ -0,0 +1,35 @@
+<?php
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
+if (!$isLoggedIn && !$isLowerLoggedIn) header("Location: /-/login") and die();
+global $_PROFILE;
+
+if ($_PROFILE["login"] === "cloudburst") return;
+
+$frontRaindrops = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true)["members"];
+$frontOther = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/other/fronters.json"), true)["members"];
+
+if ($_PROFILE["login"] === "raindrops" && isset($frontRaindrops[0])) {
+ $pony = $frontRaindrops[0]["display_name"] ?? $frontRaindrops[0]["name"];
+} else if ($_PROFILE["login"] !== "raindrops" && isset($frontOther[0])) {
+ $pony = $frontOther[0]["display_name"] ?? $frontOther[0]["name"];
+} else {
+ $pony = "somepony";
+}
+
+$ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"];
+
+file_get_contents('https://' . $ntfy["server"] . '/pleasure', false, stream_context_create([
+ 'http' => [
+ 'method' => 'POST',
+ 'header' =>
+ "Content-Type: text/plain\r\n" .
+ "Title: [Test] 🏩 $pony wants to play for a bit\r\n" .
+ "Priority: high\r\n" .
+ "Tags: pleasure\r\n" .
+ "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
+ 'content' => "[This is a test] Hey, $pony wants to play and have fun for a bit, get up!"
+ ]
+]));
+
+die(); \ No newline at end of file