summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/lib/ShareByMailProvider.php
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-03-29 16:50:23 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2017-04-03 10:29:32 +0200
commitb84fd7c3615c9d7b1830b6d51f6ad5b943d06b9f (patch)
tree2db691145f7ca15449a67d0b026a770f277561aa /apps/sharebymail/lib/ShareByMailProvider.php
parent3cc0d15f92175f01744cef0840e32d9b5657db3b (diff)
downloadnextcloud-server-b84fd7c3615c9d7b1830b6d51f6ad5b943d06b9f.tar.gz
nextcloud-server-b84fd7c3615c9d7b1830b6d51f6ad5b943d06b9f.zip
set expire date for all share types
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/sharebymail/lib/ShareByMailProvider.php')
-rw-r--r--apps/sharebymail/lib/ShareByMailProvider.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php
index f49a4d07eb9..415011d2d6d 100644
--- a/apps/sharebymail/lib/ShareByMailProvider.php
+++ b/apps/sharebymail/lib/ShareByMailProvider.php
@@ -24,6 +24,7 @@ namespace OCA\ShareByMail;
use OC\HintException;
use OC\Share20\Exception\InvalidShare;
use OCP\Activity\IManager;
+use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
@@ -440,6 +441,7 @@ class ShareByMailProvider implements IShareProvider {
->set('uid_owner', $qb->createNamedParameter($share->getShareOwner()))
->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy()))
->set('password', $qb->createNamedParameter($share->getPassword()))
+ ->set('expiration', $qb->createNamedParameter($share->getExpirationDate(), IQueryBuilder::PARAM_DATE))
->execute();
return $share;
@@ -699,6 +701,13 @@ class ShareByMailProvider implements IShareProvider {
$share->setShareOwner($owner->getUID());
}
+ if ($data['expiration'] !== null) {
+ $expiration = \DateTime::createFromFormat('Y-m-d H:i:s', $data['expiration']);
+ if ($expiration !== false) {
+ $share->setExpirationDate($expiration);
+ }
+ }
+
$share->setNodeId((int)$data['file_source']);
$share->setNodeType($data['item_type']);