summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-10-20 11:40:40 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-10-20 11:40:40 +0200
commitd9c26c86a3441900555d4bb7bd9bf6d9e4349740 (patch)
tree33b85d11a0c250627fa0ee6a391494766ddcddcd /apps
parent3157ff441c9bb89ed2c2bb58353a27e07dc6284c (diff)
downloadnextcloud-server-d9c26c86a3441900555d4bb7bd9bf6d9e4349740.tar.gz
nextcloud-server-d9c26c86a3441900555d4bb7bd9bf6d9e4349740.zip
Also expire share type email
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/ExpireSharesJob.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/ExpireSharesJob.php b/apps/files_sharing/lib/ExpireSharesJob.php
index 4ca3b80e343..ac86b53e417 100644
--- a/apps/files_sharing/lib/ExpireSharesJob.php
+++ b/apps/files_sharing/lib/ExpireSharesJob.php
@@ -24,6 +24,7 @@
namespace OCA\Files_Sharing;
+use OCP\Share\IShare;
use OC\BackgroundJob\TimedJob;
/**
@@ -51,7 +52,7 @@ class ExpireSharesJob extends TimedJob {
$now = new \DateTime();
$now = $now->format('Y-m-d H:i:s');
- /*
+ /**
* Expire file link shares only (for now)
*/
$qb = $connection->getQueryBuilder();
@@ -59,7 +60,10 @@ class ExpireSharesJob extends TimedJob {
->from('share')
->where(
$qb->expr()->andX(
- $qb->expr()->eq('share_type', $qb->expr()->literal(\OCP\Share::SHARE_TYPE_LINK)),
+ $qb->expr()->orX(
+ $qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_LINK)),
+ $qb->expr()->eq('share_type', $qb->expr()->literal(IShare::TYPE_EMAIL))
+ ),
$qb->expr()->lte('expiration', $qb->expr()->literal($now)),
$qb->expr()->orX(
$qb->expr()->eq('item_type', $qb->expr()->literal('file')),