mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
check quota
This commit is contained in:
parent
6e8af30e17
commit
71fb34cbca
|
@ -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"]))
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user