Skip to content

Instantly share code, notes, and snippets.

@jairsjunior
Last active May 21, 2020 17:30
Show Gist options
  • Save jairsjunior/d252406942a5b049589f835177c3ae52 to your computer and use it in GitHub Desktop.
Save jairsjunior/d252406942a5b049589f835177c3ae52 to your computer and use it in GitHub Desktop.
Moodle 3.7 send email with password on bulk registration
//file moodleFolder/admin/tool/uploaduser/index.php
//line ~ 843
//Comment the first line of if and add this another 3 lines to when
//bulk create user without password generate pass and send e-mail.
if ($user->password === 'to be generated') {
// set_user_preference('create_password', 1, $user);
setnew_password_and_mail($user);
unset_user_preference('create_password', $user);
set_user_preference('auth_forcepasswordchange', 1, $user);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment