summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2015-11-06 12:05:19 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2015-11-16 13:32:28 +0100
commit1e9fc332125aa8e730c3cdccd88102cfcd6bce9d (patch)
tree7345388bab10435c94c382ddf172cbe1551d4bf7 /lib/private
parent5e3d29b661e5fb8aa40943a6dec621e3343092f3 (diff)
downloadnextcloud-server-1e9fc332125aa8e730c3cdccd88102cfcd6bce9d.tar.gz
nextcloud-server-1e9fc332125aa8e730c3cdccd88102cfcd6bce9d.zip
[Share2.0] OCS Share API getShare uses new code
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/share20/defaultshareprovider.php9
-rw-r--r--lib/private/share20/ishare.php21
-rw-r--r--lib/private/share20/share.php57
3 files changed, 70 insertions, 17 deletions
diff --git a/lib/private/share20/defaultshareprovider.php b/lib/private/share20/defaultshareprovider.php
index 79bc809b9b2..7f21d3aadf5 100644
--- a/lib/private/share20/defaultshareprovider.php
+++ b/lib/private/share20/defaultshareprovider.php
@@ -235,17 +235,16 @@ class DefaultShareProvider implements IShareProvider {
$share->setId((int)$data['id'])
->setShareType((int)$data['share_type'])
->setPermissions((int)$data['permissions'])
- ->setTarget($data['file_target']);
+ ->setTarget($data['file_target'])
+ ->setShareTime((int)$data['stime'])
+ ->setMailSend((bool)$data['mail_send']);
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
$share->setSharedWith($this->userManager->get($data['share_with']));
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) {
$share->setSharedWith($this->groupManager->get($data['share_with']));
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) {
- /*
- * TODO: Clean this up, this should be set as password not sharedWith
- */
- $share->setSharedWith($data['share_with']);
+ $share->setPassword($data['share_with']);
$share->setToken($data['token']);
} else {
$share->setSharedWith($data['share_with']);
diff --git a/lib/private/share20/ishare.php b/lib/private/share20/ishare.php
index fa7c1ea614c..a80abebd71c 100644
--- a/lib/private/share20/ishare.php
+++ b/lib/private/share20/ishare.php
@@ -134,6 +134,13 @@ interface IShare {
public function setPassword($password);
/**
+ * Is a password set for this share
+ *
+ * @return string
+ */
+ public function getPassword();
+
+ /**
* Get the token
*
* @return string
@@ -153,4 +160,18 @@ interface IShare {
* @return string
*/
public function getTarget();
+
+ /**
+ * Get the timestamp this share was created
+ *
+ * @return int
+ */
+ public function getSharetime();
+
+ /**
+ * Get mailSend
+ *
+ * @return bool
+ */
+ public function getMailSend();
}
diff --git a/lib/private/share20/share.php b/lib/private/share20/share.php
index 989edd3c079..4200816799e 100644
--- a/lib/private/share20/share.php
+++ b/lib/private/share20/share.php
@@ -28,39 +28,32 @@ class Share implements IShare {
/** @var string */
private $id;
-
/** @var Node */
private $path;
-
/** @var int */
private $shareType;
-
/** @var IUser|IGroup|string */
private $sharedWith;
-
/** @var IUser|string */
private $sharedBy;
-
/** @var IUser|string */
private $shareOwner;
-
/** @var int */
private $permissions;
-
/** @var \DateTime */
private $expireDate;
-
/** @var string */
private $password;
-
/** @var string */
private $token;
-
/** @var int */
private $parent;
-
/** @var string */
private $target;
+ /** @var int */
+ private $shareTime;
+ /** @var bool */
+ private $mailSend;
/**
* Set the id of the share
@@ -252,7 +245,7 @@ class Share implements IShare {
*
* @return string
*/
- public function getPassword($password) {
+ public function getPassword() {
return $this->password;
}
@@ -315,4 +308,44 @@ class Share implements IShare {
public function getTarget() {
return $this->target;
}
+
+ /**
+ * Set the time this share was created
+ *
+ * @param int $shareTime
+ * @return Share The modified object
+ */
+ public function setShareTime($shareTime) {
+ $this->shareTime = $shareTime;
+ return $this;
+ }
+
+ /**
+ * Get the timestamp this share was created
+ *
+ * @return int
+ */
+ public function getSharetime() {
+ return $this->shareTime;
+ }
+
+ /**
+ * Set mailSend
+ *
+ * @param bool $mailSend
+ * @return Share The modified object
+ */
+ public function setMailSend($mailSend) {
+ $this->mailSend = $mailSend;
+ return $this;
+ }
+
+ /**
+ * Get mailSend
+ *
+ * @return bool
+ */
+ public function getMailSend() {
+ return $this->mailSend;
+ }
}