From b2cc2d602396b7456a59a44f415669dd8fca0e05 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Tue, 6 Nov 2018 23:48:28 +0100 Subject: Add "password" parameter to the response data of link shares MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to legacy reasons the password of link shares was returned in the "share_with" and "share_with_displayname" parameters of the response data. Now a proper "password" parameter is returned too; the old "share_with" and "share_with_displayname" parameters are kept, although deprecated, and they will be removed in a future version of Nextcloud. Signed-off-by: Daniel Calviño Sánchez --- apps/files_sharing/lib/Controller/ShareAPIController.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/files_sharing/lib/Controller') diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index f61b9dac58a..e33f93e8ce6 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -208,9 +208,13 @@ class ShareAPIController extends OCSController { $result['share_with_displayname'] = $group !== null ? $group->getDisplayName() : $share->getSharedWith(); } else if ($share->getShareType() === Share::SHARE_TYPE_LINK) { + // "share_with" and "share_with_displayname" for passwords of link + // shares was deprecated in Nextcloud 15, use "password" instead. $result['share_with'] = $share->getPassword(); $result['share_with_displayname'] = $share->getPassword(); + $result['password'] = $share->getPassword(); + $result['send_password_by_talk'] = $share->getSendPasswordByTalk(); $result['token'] = $share->getToken(); -- cgit v1.2.3