From ad90cd678bab026d3cfec4a1ea1852a7bee7ccbe Mon Sep 17 00:00:00 2001 From: Terranom674 Date: Tue, 18 Aug 2026 16:13:05 +0200 Subject: [PATCH] Technische NC-Anlage uebernimmt vorhandene API einmalig --- include/nc_connector_create_api.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/nc_connector_create_api.inc.php b/include/nc_connector_create_api.inc.php index 0b923d4..a76350c 100644 --- a/include/nc_connector_create_api.inc.php +++ b/include/nc_connector_create_api.inc.php @@ -28,6 +28,7 @@ function bratonien_tools_nc_connector_create_local_api_first() throw new RuntimeException('Fallback-Benutzer und Fallback-Passwort muessen entweder beide angegeben oder beide leer gelassen werden.'); } + $wizard_auth_present = array_key_exists('nc_api_validated', $_POST); $validated_pending_api = (string)($_POST['nc_api_validated'] ?? '') === '1'; $api_key_id = trim((string)($_POST['nc_connection_api_key_id'] ?? '')); $api_key_secret = trim((string)($_POST['nc_connection_api_key_secret'] ?? '')); @@ -35,7 +36,7 @@ function bratonien_tools_nc_connector_create_local_api_first() { throw new RuntimeException('API-Schluessel-ID und API-Geheimnis muessen entweder beide vorhanden oder beide leer sein.'); } - if ($validated_pending_api && $api_key_id === '') + if (($validated_pending_api || (!$wizard_auth_present && $fallback_user === '')) && $api_key_id === '') { $legacy_api = bratonien_tools_nc_api_credentials(); $api_key_id = trim((string)($legacy_api['key_id'] ?? ''));