summaryrefslogtreecommitdiff
path: root/app/Model/Notification.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-01 16:38:14 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-11-01 16:38:14 -0400
commitd040a6c5f60749bc03b266f9a343b889faddf1df (patch)
tree5578750c5ddd0b32d560217f86a4302369267850 /app/Model/Notification.php
parentd97e1bd4cfd013b54e72f446a0e5934fff559781 (diff)
Fix issue with notifications and projects that allow everybody
Diffstat (limited to 'app/Model/Notification.php')
-rw-r--r--app/Model/Notification.php11
1 files changed, 11 insertions, 0 deletions
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')