summaryrefslogtreecommitdiff
path: root/pages/api/overage.php
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-18 11:34:36 +0100
commit9337aae8b1c87fad34884dacd5cd79d9591c60db (patch)
tree5340f9fa67cd6236e4c879f0057d51d0b1e21361 /pages/api/overage.php
parent953ddd82e48dd206cef5ac94456549aed13b3ad5 (diff)
downloadpluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.gz
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.tar.bz2
pluralconnect-9337aae8b1c87fad34884dacd5cd79d9591c60db.zip
Updated 39 files, added 86 files, deleted 40 files and renamed 2 files (automated)
Diffstat (limited to 'pages/api/overage.php')
-rw-r--r--pages/api/overage.php47
1 files changed, 0 insertions, 47 deletions
diff --git a/pages/api/overage.php b/pages/api/overage.php
deleted file mode 100644
index aef4ac6..0000000
--- a/pages/api/overage.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $_PROFILE;
-require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc";
-if (!$isLoggedIn) header("Location: /-/login") and die();
-
-header("Content-Type: application/json");
-
-$obj = [
- "raindrops" => null,
- "cloudburst" => null
-];
-
-foreach (["raindrops", "cloudburst"] as $userName) {
- $allowNsfw = null;
- $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/" . ($userName === "raindrops" ? "gdapd" : "ynmuc") . "/fronters.json"), true);
-
- if (count($fronters["members"]) > 0) {
- $id = $fronters["members"][0]["id"];
-
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $id . ".json")) {
- $info = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $id . ".json"), true);
-
- if (isset($info["birth"]["age"]) && $info["birth"]["age"] < 15 && $info["birth"]["age"] > 0) {
- $allowNsfw = false;
- } else if (isset($info["birth"]["year"]) && $info["birth"]["year"] > 1900) {
- if (!isset($info["birth"]["date"])) $info["birth"]["date"] = "01-01";
-
- $age = (int)date('Y') - $info["birth"]["year"] + (strtotime(date('Y') . "-" . $info["birth"]["date"]) <= time() ? 0 : -1);
-
- if ($age < 15) {
- $allowNsfw = false;
- } else {
- $allowNsfw = true;
- }
- } else if ((!isset($info["birth"]["age"]) || $info["birth"]["age"] === 0) && (!isset($info["birth"]["year"]) || $info["birth"]["year"] > 1900)) {
- $allowNsfw = false;
- } else {
- $allowNsfw = true;
- }
- }
- }
-
- $obj[$userName] = $allowNsfw;
-}
-
-die(json_encode($obj, JSON_PRETTY_PRINT)); \ No newline at end of file