Skip to content

Commit

Permalink
Fixed #200 - editing from group folder with shared link
Browse files Browse the repository at this point in the history
  • Loading branch information
LinneyS committed Jul 16, 2018
1 parent 974e0ad commit 54508fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion controller/callbackcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,9 @@ public function track($doc, $users, $key, $status, $url) {
$ownerId = $hashData->ownerId;

\OC_Util::tearDownFS();
\OC_Util::setupFS($ownerId);
if (!empty($ownerId)) {
\OC_Util::setupFS($ownerId);
}
}

$token = isset($hashData->token) ? $hashData->token : NULL;
Expand Down
8 changes: 7 additions & 1 deletion controller/editorcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,13 @@ public function config($fileId, $token = NULL) {
$editable = $file->isUpdateable()
&& (empty($token) || ($this->getShare($token)[0]->getPermissions() & Constants::PERMISSION_UPDATE) === Constants::PERMISSION_UPDATE);
if ($editable && $canEdit) {
$hashCallback = $this->crypt->GetHash(["fileId" => $fileId, "ownerId" => $file->getOwner()->getUID(), "token" => $token, "action" => "track"]);
$ownerId = NULL;
$owner = $file->getOwner();
if (!empty($owner)) {
$ownerId = $owner->getUID();
}

$hashCallback = $this->crypt->GetHash(["fileId" => $fileId, "ownerId" => $ownerId, "token" => $token, "action" => "track"]);
$callback = $this->urlGenerator->linkToRouteAbsolute($this->appName . ".callback.track", ["doc" => $hashCallback]);

if (!empty($this->config->GetStorageUrl())) {
Expand Down

0 comments on commit 54508fd

Please sign in to comment.