Skip to content

Commit

Permalink
Merge remote-tracking branch 'skodak/w03_MDL-31092_m23_emailpass'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Jan 16, 2012
2 parents e52c36d + 5e1e0d7 commit 7255250
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/moodlelib.php
Expand Up @@ -5238,6 +5238,11 @@ function generate_email_supportuser() {
function setnew_password_and_mail($user) {
global $CFG, $DB;

// we try to send the mail in language the user understands,
// unfortunately the filter_string() does not support alternative langs yet
// so multilang will not work properly for site->fullname
$lang = empty($user->lang) ? $CFG->lang : $user->lang;

$site = get_site();

$supportuser = generate_email_supportuser();
Expand All @@ -5254,9 +5259,9 @@ function setnew_password_and_mail($user) {
$a->link = $CFG->wwwroot .'/login/';
$a->signoff = generate_email_signoff();

$message = get_string('newusernewpasswordtext', '', $a);
$message = (string)new lang_string('newusernewpasswordtext', '', $a, $lang);

$subject = format_string($site->fullname) .': '. get_string('newusernewpasswordsubj');
$subject = format_string($site->fullname) .': '. (string)new lang_string('newusernewpasswordsubj', '', $a, $lang);

//directly email rather than using the messaging system to ensure its not routed to a popup or jabber
return email_to_user($user, $supportuser, $subject, $message);
Expand Down

0 comments on commit 7255250

Please sign in to comment.