check if document may be checked in

This commit is contained in:
Uwe Steinmann 2023-03-13 10:22:30 +01:00
parent 7ae5749bcf
commit 00fe788571

View File

@ -26,6 +26,8 @@ include("../inc/inc.DBInit.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
$accessop = new SeedDMS_AccessOperation($dms, $user, $settings);
/* Check if the form data comes from a trusted request */
if(!checkFormKey('checkindocument')) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_request_token"))),getMLText("invalid_request_token"));
@ -62,6 +64,10 @@ if ($document->isLocked()) {
else $document->setLocked(false);
}
if(!$accessop->mayCheckIn($document)) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
}
if(isset($_POST["comment"]))
$comment = $_POST["comment"];
else