I'd like to say goodbye to my visitors after having logged out.
Is there a way to change the behaviour of the logout process ?
They usually get the front page again, and that's exactly what I do not want.

Comments

Christefano-oldaccount’s picture

Disable the default "logout" link in Admin --> Menus and then manually create a link somewhere on your site that uses a "destination" URL variable so it resembles:

    http://drupal.org/logout&destination=node/120253

This link will log you out of drupal.org and redirect you back to this page. On your site, replace "drupal.org" with your domain and change the "node/120253" part to the path of your goodbye page.

vizechef’s picture

Thank you for helping me.
This works fine as a link, i.e. in a separate block.
Do you know a way to combine this with the "standard" log out link ?
I mean, when I change the menue item to "logout&destination=...", I get %xx for some characters ("&" and "=").
I would prefer this solution, if it would be possible.

Christefano-oldaccount’s picture

I haven't tried combining this with the default "logout" link. I don't think it's worth trying, which is why I recommended disabling the default logout link and creating a new one somewhere else.

equinox’s picture

Good Hint. This worked perfectly for me to resolve my "You are not authorized to view this page" errors after logout. First I created a webpage and called the URL -> logged_out. Then, in my case I made this change within logintoboggan.module around line 511, and used this code:

function theme_lt_loggedinblock(){
  global $user;
  return $user->name .' | ' . l(t('log out'), 'http://ecliptic.com/aic/logout&destination=logged_out');
}

Using a path in this function doesn't seem to work, somewhere it gets garbled, but using the full URL with the destination parm works like a charm. Using a path would make this code transportable. I tried t() url() and other functions with no luck. Anyone have a fix?

equinox

suit4’s picture

correctly written, it should be something like:

print l('Log out', 'logout', array('class' => 'logout-link'), 'destination=_your_destination_here_', NULL, TRUE);

This creates a link with an absolute url to the specified destination.
--------------------------------------
http://www.human-aspects.de

abramo’s picture

.

many thanks indeed, works 100% !!

.

margaridacarvalho’s picture

Is there anyway to apply the same principle to a block in drupal 6?

I'm trying but the only result i'm getting is the regular logout, it can seem to redirect to internal or external url inserted in 'destination=_your_destination_here_'.