When logging out of the site, the user is not shown the Front page for anonymous users.

Comments

Phillip Mc’s picture

Assigned: Unassigned » Phillip Mc
Status: Active » Closed (fixed)

Try this, which solved a similar issue..i.e. caching issues with Drupal 6.x http://drupal.org/node/241839 open back up the issue if it doesn't work for you.

drbennett’s picture

Status: Closed (fixed) » Active

caching is not enabled on my site.

Authed users are set to redirect to a node(a welcome page). Anonymous users have just some simple code displayed giving login instructions. Once an authed user clicks the logout link they are still being redirected to the welcome page.

Phillip Mc’s picture

Status: Active » Closed (works as designed)

Authed users are set to redirect to a node(a welcome page)

once you redirect away from your front_page to a regular node, the Drupal login will, by default, return to the current page when you login/logout.

In other words the front_page module has no control over what is displayed once you redirect to a regular node...

I assumed you weren't redirecting and were having a cache issue.

you have 2 options:

  1. If you use the front_page settings page textarea for auth users to display the welcome page and the welcome page for anon users, it will work as expected.
  2. not recommended, but, you could override the drupal logout form destination to be front_page. There's a module called login destination you could probably tweak for that purpose.

hope that helps

marking this issue "by design".

drbennett’s picture

Status: Closed (works as designed) » Active

According to the Logout API
http://api.drupal.org/api/function/user_logout/6

Drupal is supposed to return you back to your home page on logoff. I would think that this module would override that since it overrides the initial home page. Can a option be added to the next release to address this? Specifically allow the admin set the module to redirect users on logout to front_page instead of node.

drbennett’s picture

Category: bug » feature
Phillip Mc’s picture

my mistake. you're right. the logout should bring you back to the home page.

what happens when you click on HOME or go to the front page after you log out? in other words, does it display the same authenticated users welcome page?

drbennett’s picture

The authed user page redirect is www.example.com/welcome. The breadcrumbs are also set to redirect to www.example.com/welcome. The breadcrumbs work while logged in. Once the user clicks logout, it processes the logout but then tries to redirect them again to www.example.com/welcome, which then they don't have access to and get a 403 error. I don't see the HOME breadcrumb because it is getting a 403. On this site anonymous users do not have the "access content" permission. All they are supposed to be able to do is view the anonymous front_page and login.

Phillip Mc’s picture

what happens when you go to the front page after you log out? do anon users get pointed back to the www.example.com/welcome page?

drbennett’s picture

no, after logout if I type my URL of either www.example.com or www.example.com/front_page both show the correct anon user page.

Phillip Mc’s picture

Can I suggest a quick test?

In the front_page.module settings page for authenticated users....

  1. .....paste in the following snippet:
    $welcomepagenodeid = 12; // change this to suit
    $welcomenode = node_load($welcomepagenodeid);
    print node_view($welcomenode);
    

    Change the number 12 to be the NODE ID of your welcome page. A simple way of finding that out is to go to your welcome page when logged in as admin and hover your mouse over the EDIT tab. You should see something like this http://www.example.com/node/12/edit. In the example, 12 is the NODE ID.

  2. Select ALLOW EMBEDDED PHP.
  3. Select THEMED, to remove the redirect.
  4. Save the configuration
  5. go to the front page of your site
  6. LOGOUT

note: of course, it's quicker to just put your welcome page node content in the front page settings...but, if there are multiple editors on your site that you allow to edit the front page..it's wiser to use a seperate node for your welcome page and grant them access to edit that instead.

drbennett’s picture

I pasted in and changed the node id and the other instructions to no avail. Still the same 403 error.
Any other ideas?

<?php
$welcomepagenodeid = 1383; // change this to suit
$welcomenode = node_load($welcomepagenodeid);
print node_view($welcomenode);
?>
Phillip Mc’s picture

quick question: when you logout when you're on the front page (I.e. the welcome page) what do you see?

if you don't see the front page for anon users....I'm afraid I don't have any other ideas other than trying out the cache exclude module....

drbennett’s picture

Category: feature » bug

Ok, I finally figured out what was causing it. It is the breadcrumb override. When it is turned on(redirecting to the welcome page) the logout does not work properly. When I turn it off everything works beautifully. When I looked at the front_page.module code it looks like it is being cause from line 297.

  //this checks to see if you are overriding HOME links on the site
  if (variable_get('front_page_breadcrumb', 0)) {
    // This checks to see if the referer is an internal HOME link or not.
    $newhome =  variable_get('front_page_breadcrumb_redirect', 'node');
    $ref = $_SERVER['HTTP_REFERER'];
    global $user, $base_url;
    $parsed_url=parse_url($base_url);
    $domain = $parsed_url['host'];
    if (stristr($ref, $domain)) {
      drupal_goto($path = $newhome, $query = null, $fragment = null);
    }
  }
Phillip Mc’s picture

Status: Active » Closed (works as designed)

am i correct in thinking that your home breadcrumb was redirecting to the 'welcome page' for authenticated users?

Phillip Mc’s picture

Category: bug » support
drbennett’s picture

Yes, that is correct

Phillip Mc’s picture

Status: Closed (works as designed) » Closed (fixed)