summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-07-04 09:01:50 +0200
committerRaindropsSys <contact@minteck.org>2023-07-04 09:01:50 +0200
commitf4d52a3f0c35968b2007c808da6fd409d50fe8aa (patch)
tree72901c7cea443f4769f9b01cfda79c5fbf03d493 /pages
parent7ceb1d721e1e084be80d3ce7342bc05e2ebcbd1e (diff)
downloadpluralconnect-f4d52a3f0c35968b2007c808da6fd409d50fe8aa.tar.gz
pluralconnect-f4d52a3f0c35968b2007c808da6fd409d50fe8aa.tar.bz2
pluralconnect-f4d52a3f0c35968b2007c808da6fd409d50fe8aa.zip
Updated 5 files (automated)
Diffstat (limited to 'pages')
-rw-r--r--pages/api/rename.php4
-rw-r--r--pages/api/session.php36
-rw-r--r--pages/sessions.inc6
3 files changed, 26 insertions, 20 deletions
diff --git a/pages/api/rename.php b/pages/api/rename.php
index abec81e..3aab034 100644
--- a/pages/api/rename.php
+++ b/pages/api/rename.php
@@ -15,7 +15,7 @@ $obj = [
];
global $token;
-$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)), true);
+$data = json_decode(pf_utf8_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token))), true);
$data["name"] = $_POST["name"] ?? $_GET["name"] ?? $data["name"];
$obj["pre_name"] = $data["name"];
@@ -33,5 +33,5 @@ if (json_last_error() === JSON_ERROR_NONE) {
$obj["new_name"] = $data["name"];
-file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token), json_encode($data));
+file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token), pf_utf8_encode(json_encode($data)));
die(json_encode($obj)); \ No newline at end of file
diff --git a/pages/api/session.php b/pages/api/session.php
index 53e1845..d410c10 100644
--- a/pages/api/session.php
+++ b/pages/api/session.php
@@ -4,22 +4,26 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn;
header("Content-Type: application/json");
+global $token;
-if (!$isLoggedIn || $isLowerLoggedIn) {
- die(json_encode([
- "name" => null,
- "created" => null,
- "last_seen" => null,
- "seen_at" => null
- ], JSON_PRETTY_PRINT));
-}
+if (isset($_GET["raw"])) {
+ die(json_encode(json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)), true), JSON_PRETTY_PRINT));
+} else {
+ if (!$isLoggedIn || $isLowerLoggedIn) {
+ die(json_encode([
+ "name" => null,
+ "created" => null,
+ "last_seen" => null,
+ "seen_at" => null
+ ], JSON_PRETTY_PRINT));
+ }
-global $token;
-$data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)), true);
+ $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/tokens/" . str_replace("/", "", $token)), true);
-die(json_encode([
- "name" => $data["name"],
- "created" => date('c', $data["created"]),
- "last_seen" => date('c', $data["last"]),
- "seen_at" => array_keys($data["addresses"] ?? [])
-], JSON_PRETTY_PRINT)); \ No newline at end of file
+ die(json_encode([
+ "name" => $data["name"],
+ "created" => date('c', $data["created"]),
+ "last_seen" => date('c', $data["last"]),
+ "seen_at" => array_keys($data["addresses"] ?? [])
+ ], JSON_PRETTY_PRINT));
+} \ No newline at end of file
diff --git a/pages/sessions.inc b/pages/sessions.inc
index a8734ac..e24a78f 100644
--- a/pages/sessions.inc
+++ b/pages/sessions.inc
@@ -1,7 +1,7 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $isLowerLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $_PROFILE;
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc'; global $_PROFILE; global $app;
$verified = [
dns_get_record("zephyrheights.equestria.dev", DNS_A)[0]["ip"],
@@ -9,6 +9,7 @@ $verified = [
dns_get_record("bridlewood.equestria.dev", DNS_A)[0]["ip"],
dns_get_record("cloudsdale.equestria.dev", DNS_A)[0]["ip"],
dns_get_record("manehattan.equestria.dev", DNS_A)[0]["ip"],
+ dns_get_record("everfree.equestria.dev", DNS_A)[0]["ip"],
];
$verifiedNames = [
@@ -16,7 +17,8 @@ $verifiedNames = [
"Raindrops System",
"Equestria.dev bridlewood",
"Cloudburst System",
- "Equestria.dev manehattan"
+ "Equestria.dev manehattan",
+ $app["other"]["name"]
];
?>