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

forgottenpasswordurl not used in send_login_notifications.php

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1.4
    • Libraries
    • None
    • MOODLE_401_STABLE

      Hello,

      I'm using CAS authentication and I defined the forgottenpasswordurl in /admin/settings.php?section=manageauths

      When I receive a mail from send_login_notifications.php it's pointing to /user/preferences.php?userid=XX to change password instead of the forgottenpasswordurl i have set.

       

      I think we should use this forgottenpasswordurl when it's defined by coding something like this :

      $changepasswordlink = (new \moodle_url('/user/preferences.php', ['userid' => $USER->id]))->out(false);
      // Find a better final URL for changing password.
      $userauth = get_auth_plugin($USER->auth);
      if ($userauth->can_change_password()) {
        if ($changepwurl = $userauth->change_password_url())
        {
          $changepasswordlink = (string) $changepwurl;             
        }
        else
        {
          $changepasswordlink = (new \moodle_url('/login/change_password.php'))->out(false);             
        }
      }
      else if (!empty($CFG->forgottenpasswordurl) && !empty(clean_param($CFG->forgottenpasswordurl, PARAM_URL)))
      {
        $changepasswordlink = $CFG->forgottenpasswordurl;
      }
      

       

       

            Unassigned Unassigned
            mathieu_d Mathieu Domingo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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