mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-30948 do not generate new passwords for suspended accounts because they would not get any emails
This commit is contained in:
parent
ca8fe0b00a
commit
daa8b1ac06
1 changed files with 2 additions and 1 deletions
|
@ -212,8 +212,9 @@ function cron_run() {
|
|||
p.id as prefid
|
||||
FROM {user} u
|
||||
JOIN {user_preferences} p ON u.id=p.userid
|
||||
WHERE p.name='create_password' AND p.value='1' AND u.email !='' ");
|
||||
WHERE p.name='create_password' AND p.value='1' AND u.email !='' AND u.suspended = 0 AND u.auth != 'nologin'");
|
||||
|
||||
// note: we can not send emails to suspended accounts
|
||||
foreach ($newusers as $newuser) {
|
||||
if (setnew_password_and_mail($newuser)) {
|
||||
unset_user_preference('create_password', $newuser);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue