Moodle

Use users lastname in password change confirmation mails

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.3
  • Fix Version/s: 1.9.5
  • Component/s: Authentication, Language
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

Hello

In some countries, for example Germany where I am from, it's necessary to include the users lastname during correspondence - for example mails. The maintainers of the German language pack have included the necessary variables in the mail text ( $string['emailpasswordconfirmation'] = 'Guten Tag $a->firstname $a->lastname ). As this did not solve the problem and still only the first name was included into the mails, I looked up the code that is responsible for sending the mails. There I found the reason and was able to fix it for me.

I'd suggest to include this in the main code of Moodle. The fix would be in the function send_password_change_confirmation_mail() in file /lib/moodlelib.php at line 4469. Here it would be fine to include the line:

$data->lastname = $user->lastname;

At least for me it would be fine to have this in the main-code so I do not have to patch the code after every update .

Andreas

Activity

Hide
Petr Škoda (skodak) added a comment -

fixed in cvs, thanks a lot!

Show
Petr Škoda (skodak) added a comment - fixed in cvs, thanks a lot!
Hide
Tim Hunt added a comment -

Good fix. Thanks Petr and Andreas.

Show
Tim Hunt added a comment - Good fix. Thanks Petr and Andreas.
Hide
Andreas Grupp added a comment -

Hello

After upgrading to Moodle 1.9.4 I've seen that this bug has fixed - thanks a lot.

Unfortunately, while reporting this problem, I did not see that there are other functions involved in reseting a password. In these functions the lastname is also missing. As far as I can see the lastname parameter is also missing in:

  • send_password_change_info()
  • reset_password_and_mail()

A diff between my old and my new moodlelib.php shows the following changes that I've made to fix these two problems:

4406a4407
> $a->lastname = $user->lastname;
4499a4501
> $data->lastname = $user->lastname;

Best regards, Andreas

Show
Andreas Grupp added a comment - Hello After upgrading to Moodle 1.9.4 I've seen that this bug has fixed - thanks a lot. Unfortunately, while reporting this problem, I did not see that there are other functions involved in reseting a password. In these functions the lastname is also missing. As far as I can see the lastname parameter is also missing in:
  • send_password_change_info()
  • reset_password_and_mail()
A diff between my old and my new moodlelib.php shows the following changes that I've made to fix these two problems: 4406a4407 > $a->lastname = $user->lastname; 4499a4501 > $data->lastname = $user->lastname; Best regards, Andreas
Hide
Petr Škoda (skodak) added a comment -

reopening

Show
Petr Škoda (skodak) added a comment - reopening
Hide
Petr Škoda (skodak) added a comment -

should be fixed now, please test and big thanks!

Show
Petr Škoda (skodak) added a comment - should be fixed now, please test and big thanks!
Hide
Tim Hunt added a comment -

Re-closing.

Show
Tim Hunt added a comment - Re-closing.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: