diff options
Diffstat (limited to 'api/emergency-real.php')
-rw-r--r-- | api/emergency-real.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/api/emergency-real.php b/api/emergency-real.php new file mode 100644 index 0000000..20a918f --- /dev/null +++ b/api/emergency-real.php @@ -0,0 +1,19 @@ +<?php + +require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLoggedIn; +if (!$isLoggedIn) header("Location: /login") and die(); +global $_PROFILE; + +file_get_contents('https://ntfy.sh/' . json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"], false, stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => + "Content-Type: text/plain\r\n" . + "Title: ⚠️🆘 EMERGENCY ⚠️🆘\r\n" . + "Priority: urgent\r\n" . + "Tags: emergency", + 'content' => "This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now!" + ] +])); + +die();
\ No newline at end of file |