Skip to content

Commit

Permalink
Add user confirmation check in reengagement_get_startusers function s…
Browse files Browse the repository at this point in the history
…ql (#161)

Co-authored-by: Rajan Dangi <[email protected]>
  • Loading branch information
rajandangi and rajandangi authored Jun 17, 2024
1 parent 66fbd07 commit 5280db8
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 5280db8

Please sign in to comment.