mirror of
https://github.com/Terranom674/Piwigo_Bratonien_Tools.git
synced 2026-11-05 11:52:17 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e17ab2f7d8 |
No files matched your search
@@ -158,35 +158,9 @@ function bratonien_tools_nc_wizard_save_sources_dispatch()
|
|||||||
$state['technical_source'] = 'WebDAV-Verzeichnisse ausgewählt';
|
$state['technical_source'] = 'WebDAV-Verzeichnisse ausgewählt';
|
||||||
$state['technical_error'] = '';
|
$state['technical_error'] = '';
|
||||||
$state['directory_selection_ready'] = false;
|
$state['directory_selection_ready'] = false;
|
||||||
|
|
||||||
if ((string)($state['editing_mode'] ?? '') === 'migrate')
|
|
||||||
{
|
|
||||||
$editing_id = (int)($state['editing_connection_id'] ?? 0);
|
|
||||||
$connection = $editing_id > 0 ? bratonien_tools_nc_connector_connection($editing_id, true) : null;
|
|
||||||
if (!$connection || (string)$connection['adapter'] !== 'local')
|
|
||||||
{
|
|
||||||
throw new RuntimeException('Die zu migrierende Legacy-Verbindung ist nicht mehr verfügbar.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$migration = bratonien_tools_nc_connector_migration_state($connection);
|
|
||||||
if (empty($migration['ready']))
|
|
||||||
{
|
|
||||||
throw new RuntimeException('Die WebDAV-Migration kann noch nicht abgeschlossen werden. Es fehlen: '.implode(', ', $migration['missing']).'.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$credentials = bratonien_tools_nc_connector_scoped_secret($connection);
|
|
||||||
$state['_api_key_id'] = (string)($credentials['api_key_id'] ?? '');
|
|
||||||
$state['_api_key_secret'] = (string)($credentials['api_key_secret'] ?? '');
|
|
||||||
$state['api_status'] = 'ok';
|
|
||||||
$state['api_error'] = '';
|
|
||||||
$state['step'] = 4;
|
|
||||||
bratonien_tools_nc_wizard_store($state);
|
bratonien_tools_nc_wizard_store($state);
|
||||||
|
|
||||||
return array('message'=>'WebDAV-Quelle wurde übernommen. Mit „Migration starten“ wird jetzt der WebDAV-Nachfolger angelegt; die Legacy-Verbindung bleibt als Fallback erhalten.');
|
return array('message'=>'WebDAV-Verzeichnisse wurden übernommen. Die Verbindung ist für den parallelen Testweg vorbereitet.');
|
||||||
}
|
|
||||||
|
|
||||||
bratonien_tools_nc_wizard_store($state);
|
|
||||||
return array('message'=>'WebDAV-Verzeichnisse wurden übernommen. Die Verbindung ist für den nächsten Einrichtungsschritt vorbereitet.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function bratonien_tools_nc_wizard_finish_dispatch()
|
function bratonien_tools_nc_wizard_finish_dispatch()
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
Plugin Name: Bratonien Tools
|
Plugin Name: Bratonien Tools
|
||||||
Version: 0.9.6.18
|
Version: 0.9.6.17
|
||||||
Description: Erweiterbare Administrationswerkzeuge fuer die Bratonien-Piwigo-Installation.
|
Description: Erweiterbare Administrationswerkzeuge fuer die Bratonien-Piwigo-Installation.
|
||||||
Plugin URI: https://github.com/Terranom674/Piwigo_Bratonien_Tools
|
Plugin URI: https://github.com/Terranom674/Piwigo_Bratonien_Tools
|
||||||
Author: Bratonien
|
Author: Bratonien
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ try
|
|||||||
if (!is_dir($galleryRoot) && !mkdir($galleryRoot, 0755, true)) fail_webdav_reconcile('WebDAV-Galeriebereich konnte nicht angelegt werden.');
|
if (!is_dir($galleryRoot) && !mkdir($galleryRoot, 0755, true)) fail_webdav_reconcile('WebDAV-Galeriebereich konnte nicht angelegt werden.');
|
||||||
@chmod($galleryRoot, 0755);
|
@chmod($galleryRoot, 0755);
|
||||||
|
|
||||||
|
// Alte technische Wrapper unter ./galleries duerfen nicht als Piwigo-Alben auftauchen.
|
||||||
webdav_remove_generated_tree($legacyDefault, $legacyGalleryRoot);
|
webdav_remove_generated_tree($legacyDefault, $legacyGalleryRoot);
|
||||||
|
|
||||||
$sourceDir = $publicSourceRoot.'/connection-'.$id;
|
$sourceDir = $publicSourceRoot.'/connection-'.$id;
|
||||||
@@ -188,9 +189,8 @@ try
|
|||||||
{
|
{
|
||||||
$path = trim((string)($root['webdav_path'] ?? ''), '/');
|
$path = trim((string)($root['webdav_path'] ?? ''), '/');
|
||||||
$display = trim((string)($root['display_name'] ?? ''));
|
$display = trim((string)($root['display_name'] ?? ''));
|
||||||
$runtimePath = $path === '' ? '/' : $path;
|
if ($path === '' || $display === '' || preg_match('/[\t\r\n]/', $path.$display)) fail_webdav_reconcile('Eine gespeicherte WebDAV-Wurzel ist ungueltig.');
|
||||||
if ($display === '' || preg_match('/[\t\r\n]/', $runtimePath.$display)) fail_webdav_reconcile('Eine gespeicherte WebDAV-Wurzel ist ungueltig.');
|
$rootLines[] = $path."\t".$display;
|
||||||
$rootLines[] = $runtimePath."\t".$display;
|
|
||||||
}
|
}
|
||||||
file_put_contents($rootsPath, implode("\n", $rootLines)."\n", LOCK_EX);
|
file_put_contents($rootsPath, implode("\n", $rootLines)."\n", LOCK_EX);
|
||||||
@chmod($rootsPath, 0600);
|
@chmod($rootsPath, 0600);
|
||||||
|
|||||||
Reference in new issue
Block a user