Do not send notifications to disabled users

This commit is contained in:
Frederic Guillot
2016-05-24 22:14:29 -04:00
parent 8ba05940e9
commit 47ec4d89bc
3 changed files with 28 additions and 12 deletions

View File

@@ -162,8 +162,9 @@ class UserNotification extends Base
->table(ProjectUserRole::TABLE)
->columns(User::TABLE.'.id', User::TABLE.'.username', User::TABLE.'.name', User::TABLE.'.email', User::TABLE.'.language', User::TABLE.'.notifications_filter')
->join(User::TABLE, 'id', 'user_id')
->eq('project_id', $project_id)
->eq('notifications_enabled', '1')
->eq(ProjectUserRole::TABLE.'.project_id', $project_id)
->eq(User::TABLE.'.notifications_enabled', '1')
->eq(User::TABLE.'.is_active', 1)
->neq(User::TABLE.'.id', $exclude_user_id)
->findAll();
}
@@ -178,6 +179,7 @@ class UserNotification extends Base
->eq(ProjectGroupRole::TABLE.'.project_id', $project_id)
->eq(User::TABLE.'.notifications_enabled', '1')
->neq(User::TABLE.'.id', $exclude_user_id)
->eq(User::TABLE.'.is_active', 1)
->findAll();
}
@@ -195,6 +197,7 @@ class UserNotification extends Base
->columns(User::TABLE.'.id', User::TABLE.'.username', User::TABLE.'.name', User::TABLE.'.email', User::TABLE.'.language', User::TABLE.'.notifications_filter')
->eq('notifications_enabled', '1')
->neq(User::TABLE.'.id', $exclude_user_id)
->eq(User::TABLE.'.is_active', 1)
->findAll();
}
}