summaryrefslogtreecommitdiff
path: root/includes/agewarning.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-22 10:29:48 +0100
committerMinteck <contact@minteck.org>2023-02-22 10:29:48 +0100
commitbf2558253637537c2d57765e557bdc0e164c58ee (patch)
tree9c50b253090001183ba574cc073d13f74e273758 /includes/agewarning.inc
parent005bbb3c5b211dbb52cf8dcedac505f8a683cf42 (diff)
downloadpluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.tar.gz
pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.tar.bz2
pluralconnect-bf2558253637537c2d57765e557bdc0e164c58ee.zip
Updated 23 files, added assets/uploads/pt-princesscelestia.png and renamed assets/uploads/pt-luna.png (automated)
Diffstat (limited to 'includes/agewarning.inc')
-rw-r--r--includes/agewarning.inc42
1 files changed, 29 insertions, 13 deletions
diff --git a/includes/agewarning.inc b/includes/agewarning.inc
index a7ab501..1f51647 100644
--- a/includes/agewarning.inc
+++ b/includes/agewarning.inc
@@ -3,17 +3,33 @@
function showWarning($name, $id, $system) {
$ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"];
- file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy['topic'], false, stream_context_create([
- 'http' => [
- 'method' => 'POST',
- 'header' =>
- "Content-Type: text/plain\r\n" .
- "Title: ⚠️ $name does not have an age or birth year set\r\n" .
- "Priority: max\r\n" .
- "Tags: switch\r\n" .
- "Actions: view, Edit on Cold Haze, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" .
- "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
- 'content' => "To make sure they still appear on the fronting schedule after March 1st, they need to set an age or birth year now."
- ]
- ]));
+ if (time() > 1677628800) {
+ file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy['topic'], false, stream_context_create([
+ 'http' => [
+ 'method' => 'POST',
+ 'header' =>
+ "Content-Type: text/plain\r\n" .
+ "Title: ⚠️ $name does not have an age or birth year set\r\n" .
+ "Priority: max\r\n" .
+ "Tags: switch\r\n" .
+ "Actions: view, Edit on Cold Haze, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" .
+ "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
+ 'content' => "To make sure they appear on the fronting schedule (and to make sure they can front again), they need to set an age or birth year now."
+ ]
+ ]));
+ } else {
+ file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy['topic'], false, stream_context_create([
+ 'http' => [
+ 'method' => 'POST',
+ 'header' =>
+ "Content-Type: text/plain\r\n" .
+ "Title: ⚠️ $name does not have an age or birth year set\r\n" .
+ "Priority: max\r\n" .
+ "Tags: switch\r\n" .
+ "Actions: view, Edit on Cold Haze, https://ponies.equestria.horse/-/metadata/" . ($system === "gdapd" ? "raindrops" : "cloudburst") . "/" . $id . "/, clear=true\r\n" .
+ "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]),
+ 'content' => "To make sure they still appear on the fronting schedule after March 1st, they need to set an age or birth year now."
+ ]
+ ]));
+ }
} \ No newline at end of file