Register the change under user's name when saving the document
(cherry picked from commit 0f086cfe87294a62f6ae0501c1b55a5011ed71a3) Signed-off-by: Andras Timar <andras.timar@collabora.com>
This commit is contained in:
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…
x
Reference in New Issue
Block a user