diff options
Diffstat (limited to 'request/save/index.php')
-rwxr-xr-x[-rw-r--r--] | request/save/index.php | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/request/save/index.php b/request/save/index.php index 427f4df..e69de29 100644..100755 --- a/request/save/index.php +++ b/request/save/index.php @@ -1,49 +0,0 @@ -<?php - -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.php"; -require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; - -global $_PROFILE; global $_USER; - -$id = $_POST['id'] ?? null; -$type = $_POST['type'] ?? null; -$description = $_POST['description'] ?? null; - -if ($_PROFILE["blocked"] >= 2) die(); - -if (isset($_PROFILE["requests"]["r:" . $id]) || !isset($description)) { - header("Location: /request/?type=$type&id=$id"); - die(); -} - -$rid = uuid(); -file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/requests/" . $rid . ".json", pf_utf8_encode(json_encode([ - "type" => $type, - "author" => $_USER, - "id" => $id, - "contents" => null, - "summary" => $description, - "date" => date('c') -]))); - -$config = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/email.json"), true); - -file_get_contents('https://notifications.equestria.dev/delta', false, stream_context_create([ - 'http' => [ - 'method' => 'POST', - 'header' => - "Content-Type: text/plain\r\n" . - "Title: " . formatPonypush("New change request published") . "\r\n" . - "Priority: default\r\n" . - "Tags: requests\r\n" . - "Actions: view, Open change requests, https://delta.equestria.dev/admin/requests/, clear=true\r\n" . - "Authorization: Basic " . base64_encode($config["ntfyuser"] . ":" . $config["ntfypass"]), - 'content' => formatPonypush($_PROFILE['first_name'] . " " . $_PROFILE["last_name"] . " published a request to " . json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/lang/en.json"), true)["request"]["types"][$type] . (isset($_POST["summary"]) && trim($_POST["summary"]) !== "" ? ": " . $_POST["summary"] : "")) - ] -])); - -$_PROFILE["requests"]["r:" . $id] = $rid; -saveProfile(); - -header("Location: /request/?type=$type&id=$id"); -die();
\ No newline at end of file |