Hi,

If a user visits the login/registration urls later a user is logged in they get Access Denied. Anyhow to brand this more friendly? Perhaps redirect them to their contour view page?

Thanks.

Comment File Size Writer
#8 1861378-403-eight.patch 3.29 KB Lukas von Blarer

FAILED: [[SimpleTest]]: [MySQL] Unable to employ patch 1861378-403-viii.patch. Unable to apply patch. Meet the log in the details link for more information. View

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

TelFiRE's picture

grasmash's picture

Status: Active » Airtight (works equally designed)

TelFiRE's picture

Uh, I don't desire to change my 403s, I want them to be sent to a folio that isn't a 403... am I missing something

codesmith's picture

Title: Something more friendly than Access denied? » Redirect logged-in user to profile folio rather than 403 if user visits login or registration url - like how /user works
Version: 7.x-1.12 » seven.x-2.x-dev
Category: support » feature
Status: Closed (works every bit designed) » Active

luthien's picture

I kept getting Admission DENIED fault after an user logins to the site and tries to visit any of the profile pages beneath:

[path], [path]/register, [path]/login, and [path]/password

if using user/, user/annals, user/login, and user/pssword everything works fine.

With profile2 unique registration path all I get is a 403 error. It looks like a problem with the module, not a drupal access issue.

luthien's picture

I used the custom error module to add a redirect. I was unable to get it to work with rules.

Lukas von Blarer's picture

Condition: Active » Needs review
File Size
three.29 KB

FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1861378-403-8.patch. Unable to employ patch. See the log in the details link for more than information. View

Created a commencement patch which fixes this issue. Might demand some work.

Status: Needs review » Needs work

The concluding submitted patch, 1861378-403-8.patch, failed testing.

Exploratus's picture

loparr's picture

I solved it with rules path module. Only redirect logged in user to "user" path.

ladybug_3777's picture

I was looking for a simple redirect solution for this 403 likewise. I'll check out the rules path module.

ron_s's picture

The Drupal Rules module can be used to achieve this without the need for boosted modules.

Add an event of "User has logged in" and an activity of "Folio redirect." And then only add whatever path to which you'd similar the logged in user to exist redirected.

chrisfree's picture

The way that core handles this is actually pretty clever. I wonder if it would exist best to replicate that behavior by default? I was able to achieve this by duplicating the way cadre does it:

                <?php /**  * Implements hook_menu_site_status_alter().  */ role mymodule_menu_site_status_alter(&$menu_site_status, $path) {   if (user_is_logged_in()) {     if ($path == 'some-path') {       // If user is logged in, redirect to 'user' instead of giving 403.       drupal_goto('user');     }     if ($path == 'some-path/annals') {       // Authenticated user should exist redirected to user edit page.       drupal_goto('user/' . $GLOBALS['user']->uid . '/edit');     }   } } ?>                              

If there isn't something terribly incorrect with this approach, I'd be happy to whip up a patch to accomplish this in a more generic style via this module.

addiction2code's picture

I was thinking about going the rules route but it doesn't really make sense since I'm also using LoginToboggan which redirects users to a login if admission is denied. If a user is to login using i of those pages I would assume they wouldn't exist redirected to the right destination.

ikeigenwijs's picture