From d040a6c5f60749bc03b266f9a343b889faddf1df Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 1 Nov 2014 16:38:14 -0400 Subject: Fix issue with notifications and projects that allow everybody --- app/Model/Notification.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app') diff --git a/app/Model/Notification.php b/app/Model/Notification.php index 0a80e335..d2fcf525 100644 --- a/app/Model/Notification.php +++ b/app/Model/Notification.php @@ -35,6 +35,17 @@ class Notification extends Base */ public function getUsersWithNotification($project_id, array $exclude_users = array()) { + if ($this->projectPermission->isEverybodyAllowed($project_id)) { + + return $this->db + ->table(User::TABLE) + ->columns(User::TABLE.'.id', User::TABLE.'.username', User::TABLE.'.name', User::TABLE.'.email') + ->eq('notifications_enabled', '1') + ->neq('email', '') + ->notin(User::TABLE.'.id', $exclude_users) + ->findAll(); + } + return $this->db ->table(ProjectPermission::TABLE) ->columns(User::TABLE.'.id', User::TABLE.'.username', User::TABLE.'.name', User::TABLE.'.email') -- cgit v1.2.3