Hi!
This is what happens:
1. As a not logged in user I go to http://www.mysite.com/admin
The 403 page is displayed with the admin theme activated and the user login displayed in the left sidebar.
2. I try to log in. Although I am positive the login details are correct, instead of being logged in, I am now sent to the 403 page again but this time at the address http://www.mysite.com/customerror/403?destination=admin
Questions:
1. Why does logging in not work? Seems like a bug to me.
2. Actually I'd prefer it if the 403 page was displayed with the main theme, as is the 404 page. (See also #278575: Admin theme is used on error pages below /admin.)
Comment | File | Size | Author |
---|---|---|---|
#9 | customerror-Making-redirect-from-403-page-work-825860-9-git.patch | 1.79 KB | gisle |
Comments
Comment #1
kodo CreditAttribution: kodo commentedHi, you can try return back this changes http://drupalcode.org/viewvc/drupal/contributions/modules/customerror/cu...
I had the same problem. It helped me.
Comment #2
PWG CreditAttribution: PWG commentedThanks, kodo. I'll try it. Sorry for replying so late.
Comment #3
hermes_costell CreditAttribution: hermes_costell commentedThe solution above doesn't solve the problem as of 11/4/2010.
Correct solution:
On the admin/settings/customerror page anywhere inside the "Description for 403: " block place this code:
menu_set_active_item($_REQUEST['destination']);
And check the "Allow PHP code to be executed for 403" box.
Comment #4
carn1x CreditAttribution: carn1x commentedThis issue is still relevant for the latest 7.x-1.x-dev
EDIT: Actually maybe this is slightly different. I find that the visual behavior indicates that logging in isn't possible, however I am actually successfully logged in. It's not that login doesn't work, but simply that the login form action is set to "/customerror/403?destination=path/that/generated/403".
I've fixed this particular issue on my site by modifying any form action to remove the customerror/403:
So instead of the form posting to "/customerror/403?destination=path/that/generated/403", instead the user is sent to: "/path/that/generated/403"
Comment #5
rconstantine CreditAttribution: rconstantine commentedI ended up changing the following function thus:
Comment #6
free6512 CreditAttribution: free6512 commentedThank you rconstantine, that solved my issue!
Comment #7
rconstantine CreditAttribution: rconstantine commentedIn that case, I'm changing the status.
Comment #8
sunshine32818 CreditAttribution: sunshine32818 commentedThis worked for me, but only if I logged in correctly. After a login failure occurs, a successful login on the second attempt does not redirect the user to the homepage instead it logs me in but shows the Access Denied message still.
Comment #9
gislePlease find attached a patch that fixes this issue. It should be applied to the current head of the 7.x-1.x branch (with SHA-1 starting with 392d341ec...).
When requesting a 403 page, the user is redirerected to the page requested after successfully logging in. This version also works if the the user mistypes username or password before getting it right.
Please review.
Comment #10
mrfelton CreditAttribution: mrfelton commentedPatch in #9 works for me. Thanks.
Comment #11
gislePatch in #9 committed on May 2, 2013 19:13 (commit 9ad93b4 on 7.x-1.x branch).
Comment #13
gisleThis fix needs to be backported to 6.x-1.x-dev branch.
Comment #13.0
gisleAdded xref to #278575: Admin theme is used on error pages below /admin.-
Comment #15
gisleI am not going to work on issues affecting D6.
Comment #16
gisleThe Drupal 6 branch is no longer supported.