Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.8
-
Fix Version/s: None
-
Component/s: Authentication
-
Labels:None
-
Affected Branches:MOODLE_18_STABLE
Description
I posted this in the authentication forum but didn't get an answer http://moodle.org/mod/forum/discuss.php?d=69353#p311274 . I think its a bug, so submitting here for confirmation.
My custom auth plugin has fields in it for a custom url to direct people to if they'd forgotten their password, and some help text to display at the same time. Up until recently, If the user called login/forgot_password.php they were redirected appropriately.
I think with the quickforms upgrade in 1.8 this might have been lost. It no longer appears to check my auth plug-in to see if there's anything different it should do, so instead my users get a "you can't change your password" email message.
I think, looking back in my cvs history, the relevant code might be something like this, it goes in the display section...
if (!empty($userauth->config->changepasswordhelp)) {
$strextmessage = $userauth->config->changepasswordhelp .'<br /><br />';
}
// if url defined then add that to the message (with a standard message)
if (method_exists($userauth, 'change_password_url') and $userauth->change_password_url($user)) {
$strextmessage .= '<br /><br /><a href="' . $userauth->change_password_url($user) . '">' . $userauth->change_password_url($user) . '</a>';
}
print_header($strforgotten, $strforgotten,
"<a href=\"{$CFG->wwwroot}/login/index.php\">{$strlogin}</a>->{$strforgotten}", 'id_email');
print_box($strextmessage, 'generalbox boxwidthnormal boxaligncenter');
print_footer();
To get this in the current form will need a bit of jigging about though, which I why I'm not offering a complete patch! Am I mad? Is there a different way I should be doing this redirect now?
Jenny
Forgot password and change password are different in that the first works for not-logged-in user, the other for logged-in users. External url for changing of password works as expected.
The problem is that we can not select the correct login before knowing the username or email if not logged in. Also we should not reveal the existence of user with given username or password.
Maybe we could add some hook into forgot password page and allow plugins to add custom instructions.
Workaround is to supply custom instructions into the right login pane.