summaryrefslogtreecommitdiff
path: root/app/Model/Notification.php
diff options
context:
space:
mode:
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')