From 2e2fab7fc385af5dc92fdaa33dbb1b208c18d786 Mon Sep 17 00:00:00 2001 From: Pingu Date: Fri, 17 Jul 2026 20:04:52 +0000 Subject: [PATCH] =?UTF-8?q?heler/docuseal-to-nextcloud=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- heler/docuseal-to-nextcloud | 127 ++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 heler/docuseal-to-nextcloud diff --git a/heler/docuseal-to-nextcloud b/heler/docuseal-to-nextcloud new file mode 100644 index 0000000..b36d772 --- /dev/null +++ b/heler/docuseal-to-nextcloud @@ -0,0 +1,127 @@ += 200 && $http_code < 300) { + echo "Erfolg!"; + logDebug("DATEI ERFOLGREICH IN NEXTCLOUD ERSTELLT: $filename"); + + $submission_id = $data['data']['id'] ?? null; + if ($submission_id) { + $ch_del = curl_init("URL EINFÜGEN" . $submission_id); + curl_setopt($ch_del, CURLOPT_CUSTOMREQUEST, "DELETE"); + curl_setopt($ch_del, CURLOPT_HTTPHEADER, [ + "X-Auth-Token: " . $api_key, + "Content-Type: application/json" + ]); + curl_setopt($ch_del, CURLOPT_RETURNTRANSFER, true); + $del_result = curl_exec($ch_del); + $del_status = curl_getinfo($ch_del, CURLINFO_HTTP_CODE); + curl_close($ch_del); + + logDebug("DocuSeal Löschauftrag ID $submission_id gesendet. Status: $del_status. Antwort: $del_result"); + } + } else { + http_response_code(500); + logDebug("UPLOAD FEHLGESCHLAGEN. HTTP-Code: " . $http_code . " Antwort: " . $result); + } + } else { + logDebug("FEHLER: PDF konnte nicht per cURL heruntergeladen werden. Status: " . $down_status); + } + } +} else { + logDebug("Event $event wird ignoriert."); +} +?> \ No newline at end of file