diff options
Diffstat (limited to 'pages/api/emergency.php')
-rw-r--r-- | pages/api/emergency.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pages/api/emergency.php b/pages/api/emergency.php index 2f764b1..24c975a 100644 --- a/pages/api/emergency.php +++ b/pages/api/emergency.php @@ -9,18 +9,18 @@ if (!$isLoggedIn && !$isLowerLoggedIn) { global $_PROFILE; -$ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"]; +$ntfy = $GLOBALS["ColdHazeApp"]["ntfy"]; file_get_contents('https://' . $ntfy["server"] . '/' . $ntfy["topic"], false, stream_context_create([ 'http' => [ 'method' => 'POST', 'header' => "Content-Type: text/plain\r\n" . - "Title: [Test] ⚠️🆘 EMERGENCY ⚠️🆘\r\n" . + "Title: " . formatPonypush("[Test] ⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" . "Priority: urgent\r\n" . "Tags: emergency\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => "[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]" + 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]") ] ])); @@ -29,11 +29,11 @@ file_get_contents('https://' . $ntfy["server"] . '/emergency', false, stream_con 'method' => 'POST', 'header' => "Content-Type: text/plain\r\n" . - "Title: [Test] ⚠️🆘 EMERGENCY ⚠️🆘\r\n" . + "Title: " . formatPonypush("[Test] ⚠️🆘 EMERGENCY ⚠️🆘") . "\r\n" . "Priority: urgent\r\n" . "Tags: emergency\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => "[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]" + 'content' => formatPonypush("[This notification is test] This is an emergency, " . $_PROFILE['name'] . " is in need of IMMEDIATE help. Please act now! [This notification is test]") ] ])); |