Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/activity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-11-14 23:11:55 +0300
committerGitHub <noreply@github.com>2018-11-14 23:11:55 +0300
commitb9ec0f22fd386643a42c7fe388c8774f2878af9b (patch)
tree3bce937cd33f01e73ecd42c7d614968c0e761cce
parent13931fda4ced6f906faf95d118216dafe9f79ec1 (diff)
parentaad465b9988ea43cb1bb6b74a5d66ed00be54b37 (diff)
Merge pull request #313 from nextcloud/backport/311/fix-restricted-user-for-email-command-13v13.0.8RC1
[stable13] Correctly restrict affected users when using command to send emails
-rw-r--r--lib/MailQueueHandler.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/MailQueueHandler.php b/lib/MailQueueHandler.php
index f5290fa0..6c040373 100644
--- a/lib/MailQueueHandler.php
+++ b/lib/MailQueueHandler.php
@@ -231,11 +231,11 @@ class MailQueueHandler {
if ($restrictEmails !== null) {
if ($restrictEmails === UserSettings::EMAIL_SEND_HOURLY) {
- $query->where($query->expr()->lte('amq_timestamp', $query->createFunction($query->getColumnName('amq_latest_send') . ' + ' . 3600)));
+ $query->where($query->expr()->eq('amq_timestamp', $query->createFunction($query->getColumnName('amq_latest_send') . ' - ' . 3600)));
} else if ($restrictEmails === UserSettings::EMAIL_SEND_DAILY) {
- $query->where($query->expr()->eq('amq_timestamp', $query->createFunction($query->getColumnName('amq_latest_send') . ' + ' . 3600 * 24)));
+ $query->where($query->expr()->eq('amq_timestamp', $query->createFunction($query->getColumnName('amq_latest_send') . ' - ' . 3600 * 24)));
} else if ($restrictEmails === UserSettings::EMAIL_SEND_WEEKLY) {
- $query->where($query->expr()->eq('amq_timestamp', $query->createFunction($query->getColumnName('amq_latest_send') . ' + ' . 3600 * 24 * 7)));
+ $query->where($query->expr()->eq('amq_timestamp', $query->createFunction($query->getColumnName('amq_latest_send') . ' - ' . 3600 * 24 * 7)));
} else if ($restrictEmails === UserSettings::EMAIL_SEND_ASAP) {
$query->where($query->expr()->eq('amq_timestamp', 'amq_latest_send'));
}