check quota

This commit is contained in:
Uwe Steinmann 2014-05-20 06:43:44 +02:00
parent 6e8af30e17
commit 71fb34cbca
2 changed files with 16 additions and 2 deletions

View File

@ -49,6 +49,13 @@ if ($folder->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied"));
}
if($settings->_quota > 0) {
$remain = checkQuota($user);
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"]))

View File

@ -38,13 +38,20 @@ if (!is_object($document)) {
}
if ($document->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
}
if($settings->_quota > 0) {
$remain = checkQuota($user);
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 ($document->isLocked()) {
$lockingUser = $document->getLockingUser();
if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("no_update_cause_locked"));
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("no_update_cause_locked"));
}
else $document->setLocked(false);
}