mirror of
https://github.com/Terranom674/Piwigo_Bratonien_Tools.git
synced 2026-09-19 18:44:30 +00:00
Technische NC-Anlage uebernimmt vorhandene API einmalig
This commit is contained in:
@@ -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.');
|
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';
|
$validated_pending_api = (string)($_POST['nc_api_validated'] ?? '') === '1';
|
||||||
$api_key_id = trim((string)($_POST['nc_connection_api_key_id'] ?? ''));
|
$api_key_id = trim((string)($_POST['nc_connection_api_key_id'] ?? ''));
|
||||||
$api_key_secret = trim((string)($_POST['nc_connection_api_key_secret'] ?? ''));
|
$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.');
|
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();
|
$legacy_api = bratonien_tools_nc_api_credentials();
|
||||||
$api_key_id = trim((string)($legacy_api['key_id'] ?? ''));
|
$api_key_id = trim((string)($legacy_api['key_id'] ?? ''));
|
||||||
|
|||||||
Reference in New Issue
Block a user