Commit 62842915 authored by Richard Mansfield's avatar Richard Mansfield

Send password in cleartext in Leap2a new account emails

Moving password encryption into create_user() (bug #799594) broke
new account emails for new Leap2a imported users, because Leap2a
users are reloaded from the database before the email is sent.

Change-Id: I9b9e65b0cd92261b1b81179a3828ee644fb82785
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 87e94883
......@@ -351,8 +351,8 @@ function adduser_submit(Pieform $form, $values) {
if (!empty($user->email)) {
try {
email_user($user, $USER, get_string('accountcreated', 'mahara', get_config('sitename')),
get_string('accountcreatedchangepasswordtext', 'mahara', $user->firstname, get_config('sitename'), $user->username, $user->password, get_config('wwwroot'), get_config('sitename')),
get_string('accountcreatedchangepasswordhtml', 'mahara', $user->firstname, get_config('wwwroot'), get_config('sitename'), $user->username, $user->password, get_config('wwwroot'), get_config('wwwroot'), get_config('sitename'))
get_string('accountcreatedchangepasswordtext', 'mahara', $user->firstname, get_config('sitename'), $user->username, $values['password'], get_config('wwwroot'), get_config('sitename')),
get_string('accountcreatedchangepasswordhtml', 'mahara', $user->firstname, get_config('wwwroot'), get_config('sitename'), $user->username, $values['password'], get_config('wwwroot'), get_config('wwwroot'), get_config('sitename'))
);
}
catch (EmailException $e) {
......
......@@ -325,7 +325,9 @@ function import_next_user() {
if (empty($FAILEDUSERS[$username])) {
// Reload the user details, as various fields are changed by the
// importer when importing (e.g. firstname/lastname)
$ADDEDUSERS[] = get_record('usr', 'id', $user->id);
$newuser = get_record('usr', 'id', $user->id);
$newuser->clearpasswd = $user->password;
$ADDEDUSERS[] = $newuser;
}
meta_redirect();
......@@ -349,8 +351,8 @@ function finish_import() {
$noemailusers = array();
try {
email_user($user, null, get_string('accountcreated', 'mahara', get_config('sitename')),
get_string('accountcreatedchangepasswordtext', 'mahara', $user->firstname, get_config('sitename'), $user->username, $user->password, get_config('wwwroot'), get_config('sitename')),
get_string('accountcreatedchangepasswordhtml', 'mahara', $user->firstname, get_config('wwwroot'), get_config('sitename'), $user->username, $user->password, get_config('wwwroot'), get_config('wwwroot'), get_config('sitename'))
get_string('accountcreatedchangepasswordtext', 'mahara', $user->firstname, get_config('sitename'), $user->username, $user->clearpasswd, get_config('wwwroot'), get_config('sitename')),
get_string('accountcreatedchangepasswordhtml', 'mahara', $user->firstname, get_config('wwwroot'), get_config('sitename'), $user->username, $user->clearpasswd, get_config('wwwroot'), get_config('wwwroot'), get_config('sitename'))
);
}
catch (EmailException $e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment