Any user, even the administrator gets this user access error when he is already logged in.
This causes confusion for users who are already logged in, instead it should redirect the user to the user page.
Comment | File | Size | Author |
---|---|---|---|
#13 | useraccesserror.1.2.patch | 1.03 KB | ged3000 |
#10 | useraccesserror.1.1.patch | 1.08 KB | ged3000 |
#8 | useraccesserror.patch | 1.07 KB | ged3000 |
#2 | user_register_return_to_userspage_user.module.patch | 1023 bytes | Tobias Maier |
Comments
Comment #1
alexis CreditAttribution: alexis commentedAgree, I have the same problem with 4.6.2.
Comment #2
Tobias Maier CreditAttribution: Tobias Maier commentedhere comes a patch for this
i needed relatively long to find out why this happens.
the behavour was theoretically implemented but hook_menu() denied it...
Comment #3
breyten CreditAttribution: breyten commentedI'd rather opt for Drupal to display a message along the lines of 'You can't register an account because you're already logged in.', instead of an equally confusing redirect. Secondly, I'd like to see consistency: If you're logged in now, and try to request a new password, Drupal will give you a 403 as well.
Comment #4
Sergio Beristain CreditAttribution: Sergio Beristain commentedAnybody else, feeling this way?
You may have a point.
But, if the user is already registered and clicks this link, he can still have the message and the user page below. This way you let him know that he is in a 404 and save him a click of having to go back to the user pages.
Comment #5
Jaza CreditAttribution: Jaza commentedRenaming and moving to 6.x queue. This is still relevant, and I for one think it's a valid issue.
Comment #6
PanchoStill to be fixed.
Comment #7
ged3000 CreditAttribution: ged3000 commentedThis behaviour is still present in Drupal 7.x-dev (2009-Mar-14) - updated status to reflect this.
Comment #8
ged3000 CreditAttribution: ged3000 commentedOK, I've thrown a patch together for 7.x-dev (2009-Mar-14).
Currently, the following happens when user/login, /password, and /register are called:
This patch does the following:
Comment #10
ged3000 CreditAttribution: ged3000 commentedOoo, now why would that happen? I shall go investigate!
As a side, I forgot to call t() for the error message - here is my patch with t() called.
I guess it'll probably fail, if the last one did though, I'll see if I can figure why...
Comment #11
ged3000 CreditAttribution: ged3000 commentedSwitching to code needs review, see if it'll like this patch...
Comment #13
ged3000 CreditAttribution: ged3000 commentedThink I've sorted out the patch not applying issue - I was creating the patch without using CVS (instructions at http://drupal.org/patch/create, Quick start example (diff) - I think it put my system's file path in the .patch file, instead of just the relative path. Is this a separate issue?)
OK, let's try this again!
Comment #14
cburschkaThere are several code-style issues that need to be fixed, notably capitalization of booleans, spacing around operators, inline comments not capitalized and not on a separate line.
For the rest:
Could we please get an optional parameter to suppress the message?
user_is_anonymous() isn't just an access callback; it's a boolean function that could be used by any module to show different content to guests, and these calls shouldn't result in an error message.
Unless this function should not be called by any module other than the menu system, in which case it should be documented as such - for example by telling developers to use !user_is_logged_in() instead.
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedI think this should be implemented by redirecting the user to /user after giving a message of t('Access to the register page is only allowed for anonymous users');. I agree that user_is_anonymous() wrong place to make the modification; it should be done in the user/register callback.
Comment #16
codevelopmentHow about something based on this approach?: http://drupal.org/node/118498#comment-1891590
Comment #17
a.bond CreditAttribution: a.bond commentedIs there any patch or mini-module to correct this in 6.x?
Comment #18
mikeytown2 CreditAttribution: mikeytown2 commentedsubscribing from #600472: Confused users: Already logged in users get 403 on user/login or user/register
Comment #19
mikeytown2 CreditAttribution: mikeytown2 commentedadding my tags
Comment #20
heather CreditAttribution: heather commentedAdding Usability tag
Comment #21
Matt V. CreditAttribution: Matt V. commenteda.bond
To address the issue in Drupal 6, I borrowed some code from what others had posted in a related thread and made a module called Already In.
Comment #22
cburschkaWhat we have in Drupal 7 right now looks a bit broken (not impacting functionality, but not the right way to do it either):
user/register is accessible only when the user is not logged in. admin/people/create is only available for user-admins. user_register_form() is only called when either of these is true, and the (!$admin && $user->uid) expression should therefore never be true. Redundant check is redundant?
Comment #23
brianmercer CreditAttribution: brianmercer commentedsubscribing, thx.
Comment #24
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis is covered by #363580: OpenID login fails when in maintenance mode.
Comment #25
kattekrab CreditAttribution: kattekrab commentedthis is still a problem for core in D6.20 - going to user/login returns access denied.
I've been going round in circles trying to find where to post this issue.
so have posted a new issue
http://drupal.org/node/1112824
Comment #26
Anonymous (not verified) CreditAttribution: Anonymous commentedPlease don't change versions on closed tickets.
Comment #27
agrawal anand CreditAttribution: agrawal anand commented#8: useraccesserror.patch queued for re-testing.
Comment #28
xjmI believe this was closed as a duplicate and #363580: OpenID login fails when in maintenance mode is the issue where it will be resolved. If there is a reason this is not a duplicate, please indicate so here.