Merge branch 'MDL-43451-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2014-01-07 23:32:38 +01:00
commit b3b1b18a4f

View File

@ -223,8 +223,9 @@ function cron_run() {
// Generate new password emails for users - ppl expect these generated asap
if ($DB->count_records('user_preferences', array('name'=>'create_password', 'value'=>'1'))) {
mtrace('Creating passwords for new users...');
$newusers = $DB->get_recordset_sql("SELECT u.id as id, u.email, u.firstname,
u.lastname, u.username, u.lang,
$usernamefields = get_all_user_name_fields(true, 'u');
$newusers = $DB->get_recordset_sql("SELECT u.id as id, u.email,
$usernamefields, u.username, u.lang,
p.id as prefid
FROM {user} u
JOIN {user_preferences} p ON u.id=p.userid