From 8e6c50e10da4686fe25108fb7395a1ec43ec83e1 Mon Sep 17 00:00:00 2001 From: Lucas Bartholemy Date: Thu, 11 Oct 2018 12:02:04 +0200 Subject: [PATCH] Fix #3322: Disabled users still receive emails notifications --- protected/humhub/docs/CHANGELOG.md | 1 + .../modules/notification/components/NotificationManager.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index 5eab4cdfaa..0765c7ffbc 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -6,6 +6,7 @@ HumHub Change Log - Fix: Richtext loses mark state - Fix: New comment scroll behavior not used in edit comment - Chng: Updated `humhub-prosemirror-richtext` to v1.0.12 +- Fix #3322: Disabled users still receive emails notifications 1.3.5 (October 10, 2018) diff --git a/protected/humhub/modules/notification/components/NotificationManager.php b/protected/humhub/modules/notification/components/NotificationManager.php index 15deb32acc..132c7c3d6d 100644 --- a/protected/humhub/modules/notification/components/NotificationManager.php +++ b/protected/humhub/modules/notification/components/NotificationManager.php @@ -64,6 +64,7 @@ class NotificationManager public function sendBulk(BaseNotification $notification, $userQuery) { $processed = []; + /** @var User $user */ foreach ($userQuery->each() as $user) { if ($notification->suppressSendToOriginator && $notification->isOriginator($user)) { @@ -74,6 +75,10 @@ class NotificationManager continue; } + if ($user->status != User::STATUS_ENABLED) { + continue; + } + if ($notification->saveRecord($user)) { foreach ($this->getTargets($user) as $target) { $target->send($notification, $user);