summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-10-17 10:50:58 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-11-01 02:18:55 +0100
commit5e90711600ad74088c4a903fdd47cd80d8df69e8 (patch)
tree928b988782dc0bd30cc7c2600e8367f26cb5cf5b /apps/files_sharing
parentf377a61f90065439e2f176669079c00d522adf12 (diff)
downloadnextcloud-server-5e90711600ad74088c4a903fdd47cd80d8df69e8.tar.gz
nextcloud-server-5e90711600ad74088c4a903fdd47cd80d8df69e8.zip
allow to update lables for public link shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 9fb78533a43..61fad5d2b14 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -745,6 +745,7 @@ class ShareAPIController extends OCSController {
* @param string $publicUpload
* @param string $expireDate
* @param string $note
+ * @param string $label
* @param string $hideDownload
* @return DataResponse
* @throws LockedException
@@ -761,6 +762,7 @@ class ShareAPIController extends OCSController {
string $publicUpload = null,
string $expireDate = null,
string $note = null,
+ string $label = null,
string $hideDownload = null
): DataResponse {
try {
@@ -775,7 +777,15 @@ class ShareAPIController extends OCSController {
throw new OCSNotFoundException($this->l->t('Wrong share ID, share doesn\'t exist'));
}
- if ($permissions === null && $password === null && $sendPasswordByTalk === null && $publicUpload === null && $expireDate === null && $note === null && $hideDownload === null) {
+ if ($permissions === null &&
+ $password === null &&
+ $sendPasswordByTalk === null &&
+ $publicUpload === null &&
+ $expireDate === null &&
+ $note === null &&
+ $label === null &&
+ $hideDownload === null
+ ) {
throw new OCSBadRequestException($this->l->t('Wrong or no update parameter given'));
}
@@ -859,6 +869,10 @@ class ShareAPIController extends OCSController {
$share->setPassword($password);
}
+ if ($label !== null) {
+ $share->setLabel($label);
+ }
+
} else {
if ($permissions !== null) {
$permissions = (int)$permissions;