mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 17:52:02 -04:00
Also expire share type email
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
e737d67979
commit
cb10700cfb
1 changed files with 6 additions and 2 deletions
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
namespace OCA\Files_Sharing;
|
||||
|
||||
use OCP\Share\IShare;
|
||||
use OC\BackgroundJob\TimedJob;
|
||||
|
||||
/**
|
||||
|
|
@ -50,7 +51,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();
|
||||
|
|
@ -58,7 +59,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')),
|
||||
|
|
|
|||
Loading…
Reference in a new issue