diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-01 09:22:39 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-01 09:22:39 +0100 |
commit | 1652541150f4e8d4c8bb147c81238780cf888e45 (patch) | |
tree | d785ef573af12e9b0dd222e98c87eeda98abd50d /apps/files_sharing | |
parent | 25a4571dcd54b9db082ca9b2aa70924b4dc6f18d (diff) | |
parent | 0dd0adf69f4f507551389b147985f92c9d922d43 (diff) | |
download | nextcloud-server-1652541150f4e8d4c8bb147c81238780cf888e45.tar.gz nextcloud-server-1652541150f4e8d4c8bb147c81238780cf888e45.zip |
Merge pull request #22700 from owncloud/only_1_linkshare
For now only allow 1 link share per file/folder
Diffstat (limited to 'apps/files_sharing')
-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 |