diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-10-16 10:31:38 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-11-01 02:15:07 +0100 |
commit | f377a61f90065439e2f176669079c00d522adf12 (patch) | |
tree | 25ea0a4c30facec9c660d1a044be175505906c01 /apps | |
parent | d0411b2369e285b8c82e49294244032ca9624075 (diff) | |
download | nextcloud-server-f377a61f90065439e2f176669079c00d522adf12.tar.gz nextcloud-server-f377a61f90065439e2f176669079c00d522adf12.zip |
allow to add labels to shares
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 5137b102b5a..9fb78533a43 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -160,6 +160,7 @@ class ShareAPIController extends OCSController { 'token' => null, 'uid_file_owner' => $share->getShareOwner(), 'note' => $share->getNote(), + 'label' => $share->getLabel(), 'displayname_file_owner' => $shareOwner !== null ? $shareOwner->getDisplayName() : $share->getShareOwner(), ]; @@ -354,15 +355,17 @@ class ShareAPIController extends OCSController { * @param string $shareWith * @param string $publicUpload * @param string $password - * @param bool $sendPasswordByTalk + * @param string $sendPasswordByTalk * @param string $expireDate + * @param string $label * * @return DataResponse - * @throws OCSNotFoundException - * @throws OCSForbiddenException + * @throws NotFoundException * @throws OCSBadRequestException * @throws OCSException - * + * @throws OCSForbiddenException + * @throws OCSNotFoundException + * @throws \OCP\Files\InvalidPathException * @suppress PhanUndeclaredClassMethod */ public function createShare( @@ -373,7 +376,8 @@ class ShareAPIController extends OCSController { string $publicUpload = 'false', string $password = '', string $sendPasswordByTalk = null, - string $expireDate = '' + string $expireDate = '', + string $label = '' ): DataResponse { $share = $this->shareManager->newShare(); @@ -473,6 +477,10 @@ class ShareAPIController extends OCSController { $share->setPassword($password); } + if (!empty($label)) { + $share->setLabel($label); + } + //Expire date if ($expireDate !== '') { try { |