diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index cf09370a4..69086638a 100644 --- a/op/op.AddDocument.php +++ b/op/op.AddDocument.php @@ -50,6 +50,11 @@ if ($folder->getAccessMode($user) < M_READWRITE) { UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied")); } +$remain = checkQuota(); +if ($remain < 0) { + UI::exitError(getMLText("folder_title", array("foldername" => htmlspecialchars($folder->getName()))),getMLText("quota_exceeded", array('bytes'=>SeedDMS_Core_File::format_filesize(abs($remain))))); +} + $comment = $_POST["comment"]; $version_comment = $_POST["version_comment"]; if($version_comment == "" && isset($_POST["use_comment"])) diff --git a/op/op.UpdateDocument.php b/op/op.UpdateDocument.php index 94dfb2ddf..26794ce3c 100644 --- a/op/op.UpdateDocument.php +++ b/op/op.UpdateDocument.php @@ -49,6 +49,11 @@ if ($document->isLocked()) { else $document->setLocked(false); } +$remain = checkQuota(); +if ($remain < 0) { + UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("quota_exceeded", array('bytes'=>SeedDMS_Core_File::format_filesize(abs($remain))))); +} + if(isset($_POST["comment"])) $comment = $_POST["comment"]; else