The password tab url not correct when using password reset.

this is the link that it goes to after receiving the email and logging in

/user/10403/edit/password?pass-reset-token=eugHkoQX5t4SvHY5kBvyM-SLv5d8vuBWP-54Qa44uSs

but is should be this

/user/10403/password?pass-reset-token=eugHkoQX5t4SvHY5kBvyM-SLv5d8vuBWP-54Qa44uSs

/edit is incorrect

how can i get this to go to the correct URL?

Comments

chaloum’s picture

I'd most probably change line 80 in the password_policy_tab.module from

$path .= '/password';

to

$path=str_replace("/edit","/password",$path);

erikwebb’s picture

Title: password tab url not correct when using password reset » Password tab URL not correct when using password reset
Status: Active » Needs review
StatusFileSize
new714 bytes

Give this a try.

mccraic’s picture

Component: Password tab » Code

Hello,

I replaced $path .= '/password'; with $path = str_replace("edit", "password", $path); and found a related issue which I needed to change as well to get the password reset to work properly. In password_policy_password_tab.pages.inc I needed to follow this https://drupal.org/node/1596960#comment-6691492 in order to remove the current password validation. Both of these changes are necessary in order to redirect the one time login to the correct page and remove current password validation for a forgotten password.

Thanks for the help,

Patrick

erikwebb’s picture

@mccraic - I believe we have a cleaner solution to your problem. Could you try this one?

https://drupal.org/node/1596960#comment-6831368

erikwebb’s picture

Combining the separate suggestions together. Can I get a test on this patch?

juanramonperez’s picture

#5 works for me, I only changed the line

$path = str_replace('edit', 'password', $path); 

Instead of

$path .= preg_replace('/\/edit$/', '/\/password/', $path);
erikwebb’s picture

@juanramonperez - I was hoping to avoid issues if there is an "edit" string somewhere else in the URL. Did the patch as is resolve the problem for you?

juanramonperez’s picture

@erikwebb the patch in #5 didn't work for me, there are some problem with the redirect path

erikwebb’s picture

erikwebb’s picture

Version: 7.x-1.2 » 7.x-1.3
erikwebb’s picture

Project: Password Policy » Password tab
Version: 7.x-1.3 » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)
erikwebb’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new2.37 KB
erikwebb’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pedrosp’s picture

The last dev version (#13 patch already there) did'nt work for me.

But after struggling a little bit, I found a solution with a new module that improve the password landing reset page http://drupal.org/project/prlp .
I think both maintainers should evaluate joining forces.

erikwebb’s picture

@pedrosp - What's the specific problems that you're still having?

pedrosp’s picture

@erikwebb the reset password request link didn't redirect to the password tab.
Maybe some order module or rule is having something to do with that, however as I pointed in #15, I can move on.

Maybe this is related also my other issue http://drupal.org/node/1843350 (impossible to update use email , ask for password)

pvasener’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new518 bytes

I still have a issue using the link in the Reset link in the e-mail, I am led to:

http://www.xxx.xxx/user/13/edituser/13/password?pass-reset-token=39nALa7...

instead of

http://www.xxx.xxx/user/13/password?pass-reset-token=39nALa7zkwKiUCj6DFq...

This small patch fixed that.

Status: Needs review » Needs work

The last submitted patch, password_tab-1802978.patch, failed testing.

khaldoon_masud’s picture

this patch has a small error:

$path .= preg_replace('/\/edit$/', '/\/password/', $path);

should be

$path = preg_replace('/\/edit$/', '/\/password/', $path);

khaldoon_masud’s picture

Status: Needs work » Needs review

#18: password_tab-1802978.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, password_tab-1802978.patch, failed testing.

techgirlgeek’s picture

Issue summary: View changes
StatusFileSize
new580 bytes

Here's a patch that incorporates the fix in #20 [#7911179].

When performing the replacement on the $path variable, it should be set to replace, not append, to the current path.

tanc’s picture

Status: Needs work » Reviewed & tested by the community

Patch in #23 works for me. The url is just a straight replacement and should not be appended.

erikwebb’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

OlyN’s picture

Status: Closed (fixed) » Active
StatusFileSize
new1.96 KB

The solution previously applied to this issue is incompatible with i18n and language-prefixed paths, or any other modules that alter the relevant paths. I've created a patch which resolves this by invoking hook_url_inbound_alter() instead of hook_exit().

OlyN’s picture

Status: Active » Needs review
adevms’s picture

I had the problem of not redirecting to the correct url which then let's me enter my password after the one time login. After applying the patch in #27 everything is working as it should be.