5

I am completely exhausted trying to find out a solution for this simple problem.

I am intending to put a "Forgot Password" in my Drupal site and wants a confirmation when the form emails the password to the user.

For instance, I go to this link http://www.some.com/user/password for the "Forgot Password" link.

when I enter the username or password, it just doesn't show anything and just redirects to the homepage. I intend to change that and want to show the confirmation that an email has been successfully sent.

Any idea how I can do this?

What I tried

I tried creating a page--user--password.tpl.php but it doesn't allow me to make any changes. I am not sure where the values are coming in the form.

  • 5
    Have you installed some module the override login functionality? The default behavior is set a notification message, "'Further instructions have been sent to your e-mail address." and redirect to /user. – Shawn Conn Apr 8 '15 at 22:27
  • Thanks Shawn. I installed Login Toboggan. Do you it's happening due to that module? – user219492 Apr 9 '15 at 18:25
  • Perhaps, I know there's a couple of redirection options for 403's & on login. It's worth disabling and trying password reset to test if that's the issue. Something must be controlling the redirect path. – Shawn Conn Apr 9 '15 at 22:39
1

By default, drupal_set_message() is set and displayed on form submission when a new password is emailed. It's possible LoginToboggan is interfering with this but I haven't encountered that in my use of it.

Alternatively, if you cannot resolve the issue, you can use hook_form_alter() to create your own submission handler on the password reset form, and use drupal_set_message() to re-show the message (or any custom message you provide) on the form.

function MYMODULE_password_reset_form_alter(&$form, &$form_state, $form_id) {
  $form['#submit'][] = 'my_custom_handler';
}

function my_custom_handler($form, &$form_state) {
  drupal_set_message('An email has been sent with instructions to reset your password.');

}
0

There's definetly a module or something acting with the login behavior.

On a brand new Drupal 7 install, if you use the reset link on /user/passsword, it redirects to /user and show the following system message : Further instructions have been sent to your e-mail address.

You'll need to desactivate modules which could interfere and check for other things like Rules or whatever.

  • 1
    Welcome to drupal.SE! Sorry to say, but your 'answer' appears to be rather a 'comment' than an actual 'answer' since it provides little to no information that qould be useful to answer the question. Please try to provide some more actual information about possible solutions – be it module names, code snippets, links or the like. Thank you! – tillinberlin Apr 23 '15 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.