Skip to content

Commit

Permalink
Revert "Add user confirmation check in reengagement_get_startusers fu…
Browse files Browse the repository at this point in the history
…nction sql"

This reverts commit 4924d5f.
  • Loading branch information
rajandangi committed Jun 17, 2024
1 parent 4924d5f commit 66fbd07
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,6 @@ 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 @@ -777,6 +776,12 @@ 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 66fbd07

Please sign in to comment.