diff options
author | Minteck <contact@minteck.org> | 2022-08-26 22:29:23 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-08-26 22:29:23 +0200 |
commit | 09bd0164ebc020a54b944b7326dcba496fb5d82c (patch) | |
tree | 0c5e765e627ecc94e534ccb6e2bc83917d58dc4c /api/emergency-real.php | |
parent | a2df9a69dcc14cb70118cda2ded499055e7ee358 (diff) | |
download | pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.tar.gz pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.tar.bz2 pluralconnect-09bd0164ebc020a54b944b7326dcba496fb5d82c.zip |
idk when was the last commit so I'm making a new one - Violet Dawn
Diffstat (limited to 'api/emergency-real.php')
-rw-r--r-- | api/emergency-real.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/api/emergency-real.php b/api/emergency-real.php index 20a918f..6a569e8 100644 --- a/api/emergency-real.php +++ b/api/emergency-real.php @@ -4,14 +4,17 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; global $isLogg 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([ +$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: ⚠️🆘 EMERGENCY ⚠️🆘\r\n" . "Priority: urgent\r\n" . - "Tags: emergency", + "Tags: emergency\r\n" . + "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), 'content' => "This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now!" ] ])); |