Reputation: 3099
I'm working on a drupal site. Instead of showing a page with something regarding "permission not found" it just results in a redirect loop.
"Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects."
- chrome error
Can someone point me in the right direction? Thanks.
EDIT: This happens when the user is logged in already and goes to a page that they do not have access to.
The problem is happening in the function login_register in user.module, where it breaks is the calls to drupal_get_form('user_login') and drupal_get_form('user_register'). In user_login the line that causes the redirect is: if ($user->uid) { drupal_goto(''); } In user_register, it's: if (!$admin && $user->uid) { drupal_goto('user/'. $user->uid); } When I comment those drupal_goto lines out, the page shows correctly.
It however shows the log in screen which I don't want. I want to be able to say "if the user is logged in but does not have permission to view this page, then show a message, otherwise if the user is not logged in, then show the login form"
Upvotes: 3
Views: 7060
Reputation: 1410
Looks like the access to the 403 page is denied. That will send you to the 403 page every time you try to visit the 403 page, ending in an infinite loop.
Upvotes: 1
Reputation: 13994
You need to make sure that the "permission not found" is viewable by all (i.e. also viewers that are not logged in and have no roles/rights/permissions whatsoever).
That is, probably the "permission not found" page can currently not be viewed without having certain permissions. Thus, the user is not allowed to view the "permission not found" page and gets redirected to the "permission not found" page, which again redirects to the "permission not found" page etc etc.
Upvotes: 1
Reputation: 9974
I would trace HTTP headers to check the contents of the requests. Zend debugger could help also.
Upvotes: 1
Reputation: 13321
Check to see what your 403 error page is set to here: admin/settings/error-reporting . If it's empty and nothing looks out of the norm.
Switch your theme to Garland to rule out the problem being in your theme.
If those don't expose the cause of the problem, then start to isolate the problem by disabling modules. The purpose of this is to isolate which module is causing the problem.
1) Make a backup of your database so you can easily get back to where you started,
2) Go to town disabling modules 1 by one. Start with custom modules and modules you've installed most recently, and then on to modules that may deal with access. After that, just guess.
If you find a module causing the problem, then check to see if there's an update for it, or look in the project issue queue to see if it's a reported problem. Otherwise, report it.
Good luck.
Upvotes: 1