diff options
Diffstat (limited to 'apps/files_trashbin/lib/Trashbin.php')
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index e79fa2c9def..667066c2fca 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -467,9 +468,9 @@ class Trashbin implements IEventListener { Server::get(LoggerInterface::class)->error('trash bin database inconsistent! ($user: ' . $user . ' $filename: ' . $filename . ', $timestamp: ' . $timestamp . ')', ['app' => 'files_trashbin']); } else { // if location no longer exists, restore file in the root directory - if ($location !== '/' && - (!$view->is_dir('files/' . $location) || - !$view->isCreatable('files/' . $location)) + if ($location !== '/' + && (!$view->is_dir('files/' . $location) + || !$view->isCreatable('files/' . $location)) ) { $location = ''; } @@ -880,7 +881,13 @@ class Trashbin implements IEventListener { foreach ($files as $file) { if ($availableSpace < 0 && $expiration->isExpired($file['mtime'], true)) { $tmp = self::delete($file['name'], $user, $file['mtime']); - Server::get(LoggerInterface::class)->info('remove "' . $file['name'] . '" (' . $tmp . 'B) to meet the limit of trash bin size (50% of available quota)', ['app' => 'files_trashbin']); + Server::get(LoggerInterface::class)->info( + 'remove "' . $file['name'] . '" (' . $tmp . 'B) to meet the limit of trash bin size (50% of available quota) for user "{user}"', + [ + 'app' => 'files_trashbin', + 'user' => $user, + ] + ); $availableSpace += $tmp; $size += $tmp; } else { @@ -911,16 +918,20 @@ class Trashbin implements IEventListener { $size += self::delete($filename, $user, $timestamp); $count++; } catch (NotPermittedException $e) { - Server::get(LoggerInterface::class)->warning('Removing "' . $filename . '" from trashbin failed.', + Server::get(LoggerInterface::class)->warning('Removing "' . $filename . '" from trashbin failed for user "{user}"', [ 'exception' => $e, 'app' => 'files_trashbin', + 'user' => $user, ] ); } Server::get(LoggerInterface::class)->info( - 'Remove "' . $filename . '" from trashbin because it exceeds max retention obligation term.', - ['app' => 'files_trashbin'] + 'Remove "' . $filename . '" from trashbin for user "{user}" because it exceeds max retention obligation term.', + [ + 'app' => 'files_trashbin', + 'user' => $user, + ], ); } else { break; |