Permalink
Browse files

MDL-30948 do not generate new passwords for suspended accounts becaus…

…e they would not get any emails
  • Loading branch information...
1 parent 7d1906c commit a36531da4f19053687dfa2b068a4eb53642a8523 @skodak skodak committed with stronk7 Jan 3, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/cronlib.php
View
@@ -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);

0 comments on commit a36531d

Please sign in to comment.