diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-02-28 21:24:23 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-01 08:25:40 +0100 |
commit | ffce4fc6a9bd4b6f77b5268e7bc139d994efaac6 (patch) | |
tree | a0422017ea92faa3c38059e0b0d4fe1cf054c19f /apps | |
parent | f9ba4f95b00d7b605d19de72f4e124128598b8fa (diff) | |
download | nextcloud-server-ffce4fc6a9bd4b6f77b5268e7bc139d994efaac6.tar.gz nextcloud-server-ffce4fc6a9bd4b6f77b5268e7bc139d994efaac6.zip |
For now only allow 1 link share per file/folder
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.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/api/share20ocs.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/api/share20ocs.php index f5834fb2831..4abd821f2ae 100644 --- a/apps/files_sharing/api/share20ocs.php +++ b/apps/files_sharing/api/share20ocs.php @@ -303,6 +303,15 @@ class Share20OCS { 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 |