mirror of
https://github.com/Terranom674/Piwigo_Bratonien_Tools.git
synced 2026-09-19 14:04:34 +00:00
0.9.6.19 allow migration with connection-scoped fallback
This commit is contained in:
@@ -13,12 +13,22 @@ function bratonien_tools_nc_connector_migration_state(array $connection)
|
|||||||
if (trim((string)($config['nextcloud_url'] ?? '')) === '') $missing[] = 'Nextcloud-Adresse';
|
if (trim((string)($config['nextcloud_url'] ?? '')) === '') $missing[] = 'Nextcloud-Adresse';
|
||||||
if (trim((string)($credentials['nextcloud_user'] ?? '')) === '') $missing[] = 'Nextcloud-Benutzer';
|
if (trim((string)($credentials['nextcloud_user'] ?? '')) === '') $missing[] = 'Nextcloud-Benutzer';
|
||||||
if ((string)($credentials['nextcloud_password'] ?? '') === '') $missing[] = 'Nextcloud-Passwort';
|
if ((string)($credentials['nextcloud_password'] ?? '') === '') $missing[] = 'Nextcloud-Passwort';
|
||||||
if (trim((string)($credentials['api_key_id'] ?? '')) === '') $missing[] = 'Piwigo-API-Schluessel-ID';
|
|
||||||
if (trim((string)($credentials['api_key_secret'] ?? '')) === '') $missing[] = 'Piwigo-API-Geheimnis';
|
$api_id = trim((string)($credentials['api_key_id'] ?? ''));
|
||||||
|
$api_secret = trim((string)($credentials['api_key_secret'] ?? ''));
|
||||||
|
$fallback_user = trim((string)($credentials['piwigo_user'] ?? ''));
|
||||||
|
$fallback_password = (string)($credentials['piwigo_password'] ?? '');
|
||||||
|
$api_complete = $api_id !== '' && $api_secret !== '';
|
||||||
|
$fallback_complete = $fallback_user !== '' && $fallback_password !== '';
|
||||||
|
|
||||||
|
if (($api_id === '') !== ($api_secret === '')) $missing[] = 'vollstaendiger Piwigo-API-Zugang';
|
||||||
|
if (!$api_complete && !$fallback_complete) $missing[] = 'Piwigo-API oder Benutzer/Passwort-Fallback';
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'ready'=>!$missing,
|
'ready'=>!$missing,
|
||||||
'missing'=>$missing,
|
'missing'=>$missing,
|
||||||
|
'api_available'=>$api_complete,
|
||||||
|
'fallback_available'=>$fallback_complete,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user