1

When a user resets his password he/she gets an email with a link which adds a message to the website and a hyperlink which it redirects him to the /user/[uid]/edit?token=... page.

How can i alter this link ?

  • Can you explain a little why you need to do this? This may help get a solution to your root problem. – mpdonadio Mar 4 '13 at 14:43
1

I would prefer mail a new link to user rather than altering the current link.

Use Tokens API to create user wise links.

function MYMODULE_token_info() {
  $info['tokens']['user']['passresetlink'] = array(
    'name' => t('Password Reset link 2'),
    'description' => t("Password Reset link 2"),
  );
  return $info;
}

and

function services_chat_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $replacements = array();
  if ($type == 'user' && !empty($data['user'])) {
    $user = $data['user'];
    foreach ($tokens as $name => $original) {
      switch ($name) {
        case 'passresetlink':
          //$user = user_load($node->uid);
          //$newlink = make your link here.
          $replacements[$original] = $newlink;
        break;
      }
    }
  }

  return $replacements;
}

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.