Skip to content

Commit

Permalink
Add user confirmation check in reengagement_get_startusers function sql
Browse files Browse the repository at this point in the history
  • Loading branch information
rajandangi committed Jun 17, 2024
1 parent d358026 commit 4924d5f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ function reengagement_get_startusers($reengagement) {
FROM {user} u
JOIN ($esql) je ON je.id = u.id
WHERE u.deleted = 0
AND u.confirmed = 1
AND u.id NOT IN ($alreadycompletionsql)
AND u.id NOT IN ($alreadyripsql)";

Expand All @@ -776,12 +777,6 @@ function reengagement_get_startusers($reengagement) {
$cm = $modinfo->get_cm($reengagement->cmid);
$ainfomod = new \core_availability\info_module($cm);
$information = '';
if (empty($startcandidate->confirmed)) {
// Exclude unconfirmed users. Typically this shouldn't happen, but if an unconfirmed user
// has been enrolled to a course we shouldn't e-mail them about activities they can't access yet.
unset($startusers[$startcandidate->id]);
continue;
}
// Exclude users who can't see this activity.
if (!$ainfomod->is_available($information, false, $startcandidate->id, $modinfo)) {
unset($startusers[$startcandidate->id]);
Expand Down

0 comments on commit 4924d5f

Please sign in to comment.