1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-14 13:02:07 +02:00

MDL-30948 do not generate new passwords for suspended accounts because they would not get any emails

This commit is contained in:
Petr Skoda 2012-01-03 16:47:32 +01:00
parent ca8fe0b00a
commit daa8b1ac06

@ -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);