Implement language aware tokens for one time login link and cancel link

Created on 25 August 2012, about 12 years ago
Updated 7 April 2023, over 1 year ago

Follow-up from #1305378: Tokens should use $options['langcode'] and not need a language object β†’ .

Both tokens [user:one-time-login-url] and [user:cancel-url] from the user module are not localized. These both urls should be localized in the users prefered language.

πŸ› Bug report
Status

Needs work

Version

7.0 ⚰️

Component
User moduleΒ  β†’

Last updated 3 days ago

Created by

πŸ‡©πŸ‡ͺGermany webflo

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada tangozulu

    Regenerated the patch for Drupal 7.95

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΈπŸ‡°Slovakia poker10

    The patch in #38 is wrong, as it removes code from this issues: #3306390: [D7] Changing email address should invalidate one-time login links β†’ , specifically the $account->mail parameters:

    +function user_pass_reset_url($account, $options = array()) {
       $timestamp = REQUEST_TIME;
    -  return url("user/reset/$account->uid/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login, $account->uid, $account->mail), array('absolute' => TRUE));
    ...
    +  return url("user/reset/$account->uid/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login, $account->uid), $url_options);
    
    +function user_cancel_url($account, $options = array()) {
       $timestamp = REQUEST_TIME;
    -  return url("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login, $account->uid, $account->mail), array('absolute' => TRUE));
    ...
    +  return url("user/$account->uid/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login, $account->uid), $url_options);
    
Production build 0.71.5 2024