dashboard\primary\error("URL isn't a valid URL"), 'no_local' => dashboard\primary\error("URL can't be a local path! Must be a remote URL accessible by the open internet!"), 'failure' => dashboard\primary\error("Failed to add webhook!"), 'success' => dashboard\primary\success("Successfully added webhook!"), 'empty_webhookname' => dashboard\primary\error("Wehbook name can not be empty!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } if (isset($_POST['deletewebhook'])) { $resp = misc\webhook\deleteSingular($_POST['deletewebhook']); match($resp){ 'failure' => dashboard\primary\error("Failed to delete webhook!"), 'success' => dashboard\primary\success("Successfully deleted webhook!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['delallwebhooks'])){ $resp = misc\webhook\deleteAll(); match($resp){ 'failure' => dashboard\primary\error("Failed to delete all webhooks!"), 'success' => dashboard\primary\success("Successfully deleted all webhooks!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } if (isset($_POST['editwebhook'])) { $webhook = misc\etc\sanitize($_POST['editwebhook']); $query = misc\mysql\query("SELECT * FROM `webhooks` WHERE `webid` = ? AND `app` = ?",[$webhook, $_SESSION['app']]); if ($query->num_rows < 1) { dashboard\primary\error("Webhook not Found!"); echo ""; return; } $row = mysqli_fetch_array($query->result); $baselink = $row["baselink"]; $useragent = $row["useragent"]; echo '
'; } if (isset($_POST['savewebhook'])) { $webhook = misc\etc\sanitize($_POST['webhook']); $baselink = misc\etc\sanitize($_POST['baselink']); $useragent = misc\etc\sanitize($_POST['useragent']); if (!filter_var($baselink, FILTER_VALIDATE_URL)) { dashboard\primary\error("URL isn't a valid URL"); echo ""; return; } if(str_contains($baselink, "localhost") || str_contains($baselink, "127.0.0.1")) { dashboard\primary\error("URL can't be a local path! Must be a remote URL accessible by the open internet"); echo ""; return; } misc\mysql\query("UPDATE `webhooks` SET `baselink` = ?,`useragent` = ? WHERE `webid` = ? AND `app` = ?",[$baselink, $useragent, $webhook, $_SESSION['app']]); dashboard\primary\success("Successfully Updated Settings!"); misc\cache\purge('KeyAuthWebhook:' . $_SESSION['app'] . ':' . $webhook); } if (isset($_POST["selected"]) && isset($_POST["action"])) { $selected = json_decode($_POST["selected"]); if ($_POST["action"] == "delete") { foreach ($selected as $webhook) { $resp = misc\webhook\deleteSingular($webhook); match($resp){ 'failure' => dashboard\primary\error("Failed to delete webhook!"), 'success' => dashboard\primary\success("Successfully deleted webhook!"), default => dashboard\primary\error("Unhandled Error! Contact us if you need help") }; } } else if ($_POST["action"] == "authEnable") { foreach ($selected as $value) { $query = misc\mysql\query("UPDATE `webhooks` SET `authed` = 1 WHERE `app` = ? AND `webid` = ?", [$_SESSION['app'], $value]); if ($query->affected_rows != 0) { misc\cache\purge('KeyAuthFile:' . ($secret ?? $_SESSION['app']) . ':' . $fileid); dashboard\primary\success("Successfully updated webhooks!"); } else { dashboard\primary\error("Failed to update webhooks"); } } } else if ($_POST["action"] == "authDisable") { foreach ($selected as $value) { $query = misc\mysql\query("UPDATE `webhooks` SET `authed` = 0 WHERE `app` = ? AND `webid` = ?", [$_SESSION['app'], $value]); if ($query->affected_rows != 0) { misc\cache\purge('KeyAuthFile:' . ($secret ?? $_SESSION['app']) . ':' . $fileid); dashboard\primary\success("Successfully updated webhooks!"); } else { dashboard\primary\error("Failed to update webhooks"); } } } else { dashboard\primary\error("Invalid action"); } } ?>Send and receive secure requests. Learn More.
| Select | ID | Endpoint | User-Agent | Authenticated | Actions |
|---|---|---|---|---|---|
| ' . ' | '; echo "" . $row["webid"] . " | "; echo "" . $row["baselink"] . " | "; echo "" . $row["useragent"] . " | "; echo "" . (($row["authed"] ? 1 : 0) ? 'True' : 'False') . " | "; echo '
Dropdown actions in RED do not show a confirmation! Dropdown actions in BLUE will show a confirmation!