Register the change under user's name when saving the document

(cherry picked from commit 0f086cfe87)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
pull/81/head
Pranav Kant 7 years ago committed by Andras Timar
parent 6b112402f9
commit 0a4c5816ee

@ -177,6 +177,14 @@ class WopiController extends Controller {
// Setup the FS which is needed to emit hooks (versioning).
\OC_Util::tearDownFS();
\OC_Util::setupFS($res['owner']);
// Set the user to register the change under his name
$editor = \OC::$server->getUserManager()->get($res['editor']);
if (is_null($editor)) {
throw new \OC\User\NoUserException("User " . $res['editor'] . "not found.");
}
\OC::$server->getUserSession()->setUser($editor);
$file->putContent($content);
return new JSONResponse();
} catch (\Exception $e) {

Loading…
Cancel
Save