diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-17 10:05:09 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-08-17 20:45:29 +0200 |
commit | af074eb2b7c0e69fc918a4f3c8abe47b4ea698dd (patch) | |
tree | fc088df1701a5d17b18f3f33435bd7e6bdf15e1a /apps/files_sharing/lib | |
parent | 22e23f304570e3eef1e56f73b7c15ba29025bcdd (diff) | |
download | nextcloud-server-af074eb2b7c0e69fc918a4f3c8abe47b4ea698dd.tar.gz nextcloud-server-af074eb2b7c0e69fc918a4f3c8abe47b4ea698dd.zip |
Move updateShare and getShares over to use proper parameters
* Update tests
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/API/Share20OCS.php | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/apps/files_sharing/lib/API/Share20OCS.php b/apps/files_sharing/lib/API/Share20OCS.php index b8b259ee430..3e91da37a7d 100644 --- a/apps/files_sharing/lib/API/Share20OCS.php +++ b/apps/files_sharing/lib/API/Share20OCS.php @@ -473,6 +473,11 @@ class Share20OCS extends OCSController { * * @NoAdminRequired * + * @param string $shared_with_me + * @param string $reshares + * @param string $subfiles + * @param string $path + * * - Get shares by the current user * - Get shares by the current user and reshares (?reshares=true) * - Get shares with the current user (?shared_with_me=true) @@ -482,11 +487,12 @@ class Share20OCS extends OCSController { * @return DataResponse * @throws OCSNotFoundException */ - public function getShares() { - $sharedWithMe = $this->request->getParam('shared_with_me', null); - $reshares = $this->request->getParam('reshares', null); - $subfiles = $this->request->getParam('subfiles'); - $path = $this->request->getParam('path', null); + public function getShares( + $shared_with_me = 'false', + $reshares = 'false', + $subfiles = 'false', + $path = null + ) { if ($path !== null) { $userFolder = $this->rootFolder->getUserFolder($this->currentUser->getUID()); @@ -500,7 +506,7 @@ class Share20OCS extends OCSController { } } - if ($sharedWithMe === 'true') { + if ($shared_with_me === 'true') { $result = $this->getSharedWithMe($path); return $result; } @@ -543,12 +549,22 @@ class Share20OCS extends OCSController { * @NoAdminRequired * * @param int $id + * @param int $permissions + * @param string $password + * @param string $publicUpload + * @param string $expireDate * @return DataResponse * @throws OCSNotFoundException * @throws OCSBadRequestException * @throws OCSForbiddenException */ - public function updateShare($id) { + public function updateShare( + $id, + $permissions = null, + $password = null, + $publicUpload = null, + $expireDate = null + ) { try { $share = $this->getShareById($id); } catch (ShareNotFound $e) { @@ -561,11 +577,6 @@ class Share20OCS extends OCSController { throw new OCSNotFoundException($this->l->t('Wrong share ID, share doesn\'t exist')); } - $permissions = $this->request->getParam('permissions', null); - $password = $this->request->getParam('password', null); - $publicUpload = $this->request->getParam('publicUpload', null); - $expireDate = $this->request->getParam('expireDate', null); - /* * expirationdate, password and publicUpload only make sense for link shares */ |