Fix editing publicly shared documents

(cherry picked from commit c4b794360a571680201f285713a977391848b594)
This commit is contained in:
Andreas Böhler 2017-06-28 19:19:12 +02:00 committed by Andras Timar
parent 29d587293d
commit 909053b299
2 changed files with 3 additions and 3 deletions

View File

@ -66,7 +66,7 @@ var odfViewer = {
var viewer;
if($('#isPublic').val() === '1') {
viewer = OC.generateUrl(
'apps/richdocuments/public?shareToken={shareToken}&fileName={fileName}&requesttoken={requesttoken}',
'apps/richdocuments/public?shareToken={shareToken}&fileName={fileName}&requesttoken={requesttoken}&dir={dir}',
{
shareToken: $('#sharingToken').val(),
fileName: fileName,

View File

@ -142,7 +142,7 @@ class DocumentController extends Controller {
* @return TemplateResponse
* @throws \Exception
*/
public function publicPage($shareToken, $fileName) {
public function publicPage($shareToken, $fileName, $dir) {
try {
$share = $this->shareManager->getShareByToken($shareToken);
// not authenticated ?
@ -156,7 +156,7 @@ class DocumentController extends Controller {
$node = $share->getNode();
if($node instanceof Folder) {
$item = $node->get($fileName);
$item = $node->get($dir.'/'.$fileName);
} else {
$item = $node;
}