aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Federation/CloudFederationShare.php
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2018-05-28 17:13:19 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2018-07-02 11:29:28 +0200
commitbbce8c3ea1c73726f233961fe7bdb16b8a08bb67 (patch)
treee3f345e7e2e6f5d21947013331af1f83593fb20a /lib/private/Federation/CloudFederationShare.php
parentdaba042d269bfd701c78e014c0ad7794975d2133 (diff)
downloadnextcloud-server-bbce8c3ea1c73726f233961fe7bdb16b8a08bb67.tar.gz
nextcloud-server-bbce8c3ea1c73726f233961fe7bdb16b8a08bb67.zip
adjust to latest api version
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib/private/Federation/CloudFederationShare.php')
-rw-r--r--lib/private/Federation/CloudFederationShare.php28
1 files changed, 22 insertions, 6 deletions
diff --git a/lib/private/Federation/CloudFederationShare.php b/lib/private/Federation/CloudFederationShare.php
index 5bc172ab6b6..d26073be822 100644
--- a/lib/private/Federation/CloudFederationShare.php
+++ b/lib/private/Federation/CloudFederationShare.php
@@ -50,10 +50,9 @@ class CloudFederationShare implements ICloudFederationShare {
* @param string $ownerDisplayName display name of the user who shared the item
* @param string $sharedBy provider specific UID of the user who shared the resource
* @param string $sharedByDisplayName display name of the user who shared the resource
- * @param array $protocol (e,.g. ['name' => 'webdav', 'options' => ['username' => 'john', 'permissions' => 31]])
* @param string $shareType ('group' or 'user' share)
- * @param $resourceType ('file', 'calendar',...)
- *
+ * @param string $resourceType ('file', 'calendar',...)
+ * @param string $sharedSecret
*/
public function __construct($shareWith = '',
$name = '',
@@ -63,9 +62,9 @@ class CloudFederationShare implements ICloudFederationShare {
$ownerDisplayName = '',
$sharedBy = '',
$sharedByDisplayName = '',
- $protocol = [],
$shareType = '',
- $resourceType = ''
+ $resourceType = '',
+ $sharedSecret = ''
) {
$this->setShareWith($shareWith);
$this->setResourceName($name);
@@ -75,7 +74,13 @@ class CloudFederationShare implements ICloudFederationShare {
$this->setOwnerDisplayName($ownerDisplayName);
$this->setSharedBy($sharedBy);
$this->setSharedByDisplayName($sharedByDisplayName);
- $this->setProtocol($protocol);
+ $this->setProtocol([
+ 'name' => 'webdav',
+ 'options' => [
+ 'sharedSecret' => $sharedSecret,
+ 'permissions' => '{http://open-collaboration-services.org/ns}share-permissions'
+ ]
+ ]);
$this->setShareType($shareType);
$this->setResourceType($resourceType);
@@ -324,6 +329,17 @@ class CloudFederationShare implements ICloudFederationShare {
}
/**
+ * get share Secret
+ *
+ * @return string
+ *
+ * @since 14.0.0
+ */
+ public function getShareSecret() {
+ return $this->share['protocol']['options']['sharedSecret'];
+ }
+
+ /**
* get protocol specification
*
* @return array