From 3b129502a0932e9c50d5a7a4a013330496d2ef55 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 4 Jun 2014 08:01:35 +0200 Subject: [PATCH] unlock document if updated by admin or owner of document --- op/op.UpdateDocument.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/op/op.UpdateDocument.php b/op/op.UpdateDocument.php index 8a99c03f7..afe511e1f 100644 --- a/op/op.UpdateDocument.php +++ b/op/op.UpdateDocument.php @@ -48,6 +48,14 @@ if($settings->_quota > 0) { } } +if ($document->isLocked()) { + $lockingUser = $document->getLockingUser(); + if (($lockingUser->getID() != $user->getID()) && ($document->getAccessMode($user) != M_ALL)) { + UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("no_update_cause_locked")); + } + else $document->setLocked(false); +} + if(isset($_POST["comment"])) $comment = $_POST["comment"]; else