Problem/Motivation
When visiting a page that requires authentication, Drupal's default behavior is to display an "Access denied / You are not authorized to access this page." The Site Configuration page allows you to specify a redirect upon visiting a 403 or 404 page. The Redirect 403 to User Login provided additional configuration options.
Proposed resolution
Add the functionality of the Redirect 403 to User Login to Drupal core.
Remaining tasks
This issue needs a usability review, as tagged.
If approved, create core code for review.
User interface changes
Under Drupal 7 core only exposes a 403 redirect path field.
Enabling the module exposes the following options:
- "Display access denied message on login page" boolean
- "User login 'access denied' message" text input
- "Redirect authenticated users to" text input
- "User login 'access denied' message type select option
- "Path to user login form" text input
- "HTTP redirect code" select option
- "Skip redirect for matching pages" text input for specifying exclusion paths
API changes
?
Data model changes
?
Original report by Bevan
I think this module would make an excellent addition to Drupal core. Has this been turned into a Drupal core patch already?
Comments
Comment #1
deekayen CreditAttribution: deekayen commentedNot that I'm aware of
Comment #2
Bevan CreditAttribution: Bevan commentedThe Redirect 403 to User Login module is a very useful feature that is desirable for most Drupal websites. It would be great to get this feature in Drupal core.
Comment #3
Bevan CreditAttribution: Bevan commentedComment #4
mcaden CreditAttribution: mcaden commentedI was quite disappointed to find that module doesn't work...
then...
I found that I can solve the issue by adding:
to the top of page.tpl.php in my template and it does the same thing.
(code source: http://drupalbin.com/508 - refactored to my style)
Comment #5
Bevan CreditAttribution: Bevan commentedThe module does work when configured right. This is unrelated. Please post it in the forums instead. Thanks! :)
Comment #6
Bojhan CreditAttribution: Bojhan commentedOk, lets do this.
Comment #7
sun.core CreditAttribution: sun.core commentedComment #8
RobLoachRelated: #77514: Better 404 and 403 handling
Comment #9
heyehren CreditAttribution: heyehren commentedThe easiest way to redirect to the login/ register page is by defining the path to a custom page in the Drupal settings.
Go to Configuration --> Site information and scroll down to the bottom :)
Comment #11
Screenack CreditAttribution: Screenack as a volunteer and at Duke University commentedUpdated the ticket using the issue template. Provide more specifics as it relates to Drupal 7 module.
Comment #12
Screenack CreditAttribution: Screenack as a volunteer and at Duke University commentedComment #13
dawehnerWhat happens if you set
/user/login
, and one gets an access denied for the registered user?Comment #15
dpiComment #16
dqdAdditionally to the Closed (duplicate) status I would like to point to the option in core to use 403 redirect settings in
admin/config/system/site-information
to redirect to the user/login path for any who humbles over this issue here.The only drawback covered here #2916746: Redirect subrequest via Basic site settings do not incoorporate correct theme rendering, suggestions and overrides for target path. : ...It sadly makes the login page unstylable from top (like commonly used by many themes), since the redirect does not add the common login-form class to the HTML body tag.
Comment #17
apaderno