Skip to content

Commit

Permalink
For now only allow 1 link share per file/folder
Browse files Browse the repository at this point in the history
Fixes #22692
This is a temp fix util we get #22327

We just block it in the OCS Share API since we have 1 endpoint now
anyway.
  • Loading branch information
rullzer authored and DeepDiver1975 committed Mar 1, 2016
1 parent f9ba4f9 commit ffce4fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/files_sharing/api/share20ocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,15 @@ public function createShare() {
return new \OC_OCS_Result(null, 404, 'public link sharing is disabled by the administrator');
}

/*
* For now we only allow 1 link share.
* Return the existing link share if this is a duplicate
*/
$existingShares = $this->shareManager->getSharesBy($this->currentUser->getUID(), \OCP\Share::SHARE_TYPE_LINK, $path, false, 1, 0);
if (!empty($existingShares)) {
return new \OC_OCS_Result($this->formatShare($existingShares[0]));
}

$publicUpload = $this->request->getParam('publicUpload', null);
if ($publicUpload === 'true') {
// Check if public upload is allowed
Expand Down

0 comments on commit ffce4fc

Please sign in to comment.