Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-76609

Change password link in new login notification

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 4.0.5
    • Libraries
    • None
    • MOODLE_400_STABLE

      Change password link is not replaced correctly in language string newloginnotificationbodyfull in case, when forgottenpasswordurl is set in site.

      Proposed fix for this:

      diff --git a/lib/classes/task/send_login_notifications.php b/lib/classes/task/send_login_notifications.php
      index e32cf28d06a..d6c2c765a49 100644
      --- a/lib/classes/task/send_login_notifications.php
      +++ b/lib/classes/task/send_login_notifications.php
      @@ -61,7 +61,11 @@ class send_login_notifications extends adhoc_task {
               $userauth = get_auth_plugin($USER->auth);
               if ($userauth->can_change_password()) {
                   if ($changepwurl = $userauth->change_password_url()) {
      -                $changepasswordlink = $changepwurl;
      +                if ($changepwurl instanceof \moodle_url) {
      +                    $changepasswordlink = $changepwurl->out(false);
      +                } else {
      +                    $changepasswordlink = (string)$changepwurl;
      +                }
                   } else {
                       $changepasswordlink = (new \moodle_url('/login/change_password.php'))->out(false);
                   }

       

            Unassigned Unassigned
            arnivoit Arnis Voitkans
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.