cleanup modal: list stale files to remove; storage restructure: documents/ → {objet}/

This commit is contained in:
Pontoporeia
2026-05-19 23:58:51 +02:00
parent c6199525f9
commit defc919cd0
19 changed files with 292 additions and 22 deletions
+8 -2
View File
@@ -2335,9 +2335,15 @@ class Database
// Clean up thesis files from disk
$files = $this->getThesisFiles($thesisId);
$storageRoot = defined('STORAGE_ROOT') ? STORAGE_ROOT : '/var/www/xamxam/storage';
foreach ($files as $file) {
if (!empty($file['file_path']) && file_exists($file['file_path'])) {
@unlink($file['file_path']);
$fp = $file['file_path'] ?? '';
if ($fp === '' || str_starts_with($fp, 'http://') || str_starts_with($fp, 'https://') || str_starts_with($fp, 'peertube_ids:')) {
continue;
}
$abs = $storageRoot . '/' . $fp;
if (file_exists($abs)) {
@unlink($abs);
}
}