Skip to content

Commit

Permalink
Enhance quota exceeded logging for admins
Browse files Browse the repository at this point in the history
* Adds owner of target folder (i.e. when shared)
* Clarifies user quota (vs disk space) issue

Addresses backend portion of #37519

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
  • Loading branch information
joshtrichards authored Apr 5, 2023
1 parent 636c241 commit 984bcf8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/dav/lib/Connector/Sabre/QuotaPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,13 @@ public function checkQuota($path, $length = null) {
// use target file name for free space check in case of shared files
$path = rtrim($parentPath, '/') . '/' . $info['name'];
}
$targetOwner = $this->view->getOwner($path);
$freeSpace = $this->getFreeSpace($path);
if ($freeSpace >= 0 && $length > $freeSpace) {
if (isset($chunkHandler)) {
$chunkHandler->cleanup();
}
throw new InsufficientStorage("Insufficient space in $path, $length required, $freeSpace available");
throw new InsufficientStorage("Quota exceeded in $path (owner: $targetOwner), $length required, $freeSpace available");
}
}
return true;
Expand Down

0 comments on commit 984bcf8

Please sign in to comment.