I want to implement a functionality such that: The user registers on site and is sent an email (validation). Then he is taken to a page where hes is able to click on login form.

This was done using drupal's basic functionality. I had to change the message that was coming upon clicking onetime login page.(/user/reset/#hash)

I did it using hook_form_alter.

But it seems, that the text has been changed for the forgot my password link also.

Is there some way? May be I might have to create a separate page for the forgot password?

Thanks in advance

1 Answer 1


Try to do the form_alter, only if url has a #hash

if (preg_match('#^user/reset/(.+)#', $_GET['q'], $matches)) {
  //here for new user
  • didn't work .. I think drupal gives the same URL for the activation link and password reset
    – nitvirus
    Mar 12, 2013 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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