diff --git a/DeskHub-Webseite/api/public/v1/plugin_webhook.php b/DeskHub-Webseite/api/public/v1/plugin_webhook.php new file mode 100644 index 00000000..4b7f0326 --- /dev/null +++ b/DeskHub-Webseite/api/public/v1/plugin_webhook.php @@ -0,0 +1,50 @@ +&e= + * Das Plugin muss die Berechtigung "api.public" anfordern und prüft die Echtheit jeder Anfrage selbst (siehe plugin_register_webhook()). + * Hier gibt es nur: Methode POST, höchstens 256 KB, Aufruf des Handlers, Antwort als JSON oder Text. + */ +require_once __DIR__ . '/../../../includes/bootstrap.php'; + +header('Cache-Control: no-store'); +header('X-Content-Type-Options: nosniff'); + +function webhook_fail(int $status, string $message): never +{ + http_response_code($status); + header('Content-Type: application/json; charset=utf-8'); + echo json_encode(['error' => $message], JSON_UNESCAPED_UNICODE); + exit; +} + +if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST') { + header('Allow: POST'); + webhook_fail(405, 'Nur POST.'); +} +$slug = (string) ($_GET['p'] ?? ''); +$endpoint = (string) ($_GET['e'] ?? ''); +$handler = plugin_state()['webhooks'][$slug][$endpoint] ?? null; +if (!is_callable($handler)) webhook_fail(404, 'Unbekannte Adresse.'); + +$body = (string) file_get_contents('php://input', false, null, 0, 262145); +if (strlen($body) > 262144) webhook_fail(413, 'Anfrage zu groß.'); +$headers = []; +foreach ($_SERVER as $k => $v) { + if (str_starts_with($k, 'HTTP_')) $headers[strtolower(str_replace('_', '-', substr($k, 5)))] = (string) $v; +} +if (isset($_SERVER['CONTENT_TYPE'])) $headers['content-type'] = (string) $_SERVER['CONTENT_TYPE']; + +$result = plugin_guard($slug, fn() => $handler(['method' => 'POST', 'headers' => $headers, 'body' => $body, 'query' => $_GET, 'ip' => client_ip()]), null); +if (!is_array($result)) webhook_fail(500, 'Fehler im Plugin.'); + +http_response_code((int) ($result['status'] ?? 200)); +foreach ((array) ($result['headers'] ?? []) as $name => $value) { + if (preg_match('/^[A-Za-z0-9-]+$/', (string) $name) && !preg_match('/[\r\n]/', (string) $value)) header($name . ': ' . $value); +} +if (isset($result['json'])) { + header('Content-Type: application/json; charset=utf-8'); + echo json_encode($result['json'], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); +} else { + echo (string) ($result['body'] ?? ''); +} diff --git a/DeskHub-Webseite/csat.php b/DeskHub-Webseite/csat.php new file mode 100644 index 00000000..8fefe38a --- /dev/null +++ b/DeskHub-Webseite/csat.php @@ -0,0 +1,65 @@ + +
+ +

Link nicht gültig

+

Dieser Bewertungslink ist ungültig oder abgelaufen.

+ +

Vielen Dank!

+

+

Ihre Bewertung für Ticket # ist bei uns angekommen.

+ +

Bereits bewertet

+

Sie haben Ticket # schon bewertet. Vielen Dank!

+ +

Wie zufrieden waren Sie?

+

Ticket # –

+
+
+ +
+ = 1; $i--): ?> + required> + + +
+ +

1 Stern = unzufrieden · 5 Sterne = sehr zufrieden

+ + +
+
+ +
+ diff --git a/DeskHub-Webseite/lang.php b/DeskHub-Webseite/lang.php new file mode 100644 index 00000000..a4d950c3 --- /dev/null +++ b/DeskHub-Webseite/lang.php @@ -0,0 +1,20 @@ + time() + 365 * 86400, + 'path' => '/', + 'secure' => request_is_https(), + 'httponly' => true, + 'samesite' => 'Lax', + ]); +} +header('Cache-Control: no-store'); +redirect(i18n_safe_back((string) ($_GET['back'] ?? '/'))); diff --git a/DeskHub-Webseite/login.php b/DeskHub-Webseite/login.php index 48be92aa..720ac43c 100644 --- a/DeskHub-Webseite/login.php +++ b/DeskHub-Webseite/login.php @@ -5,8 +5,9 @@ if (current_user()) { redirect('/home.php'); } $errors = []; -if ($_SERVER['REQUEST_METHOD'] === 'POST') { - verify_csrf(); +if ($_SERVER['REQUEST_METHOD'] === 'POST' && !csrf_valid()) { + $errors[] = 'Die Anmeldeseite war zu lange geöffnet und die Sitzung ist abgelaufen. Bitte melden Sie sich jetzt noch einmal an.'; +} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { $email = trim($_POST['email'] ?? ''); $pass = $_POST['password'] ?? ''; @@ -62,6 +63,7 @@ $imprintHtml = get_setting('footer_imprint_html', ''); +