Custom logout redirects

dugawug - December 24, 2007 - 04:31
Project:Drupal
Version:5.7
Component:user.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'd like to be able to provide the URL end users will reach after logging out instead of my domain being the default and only option www.mysite.com

#1

Onopoc - March 30, 2008 - 22:59

With Drupal 5.7 adapt then use the following link:

http://www.example.com/logout&destination=node/mylogoutpage

This link do a log out then redirect to the page "mylogoutpage".

On your site, replace "www.example.com" with your domain and change the "node/mylogoutpage" with the path of your goodbye page.

If you use menus disable the default "logout" link in Admin --> Menus and then manually create a link somewhere on your site that uses the above link.

Source: http://drupal.org/node/120253

#2

tcconway - April 11, 2008 - 16:05
Version:5.4» 5.7

This feature doesn't accept third party urls. I'd like to do something like:
http://www.example.com/logout?destination=http://www.another-site.com/?v...

Possible? when I try that example on my site, It just goes to http://www.example.com/www.another-site...etc

Any ideas?
Thanks!

#3

sid3000 - April 11, 2008 - 17:52

modify the drupal_goto() function!

#4

tcconway - April 11, 2008 - 18:11

Thanks sid. I'll have a look.

One more question, if you don't mind:
Is there a way to set up a custom logout? Not my altering core, but maybe in template.php or something?

I'd like to do a bit of php code during the logout process. My install ties into a custom login process, and when a user clicks a logout link, I have to do a couple of database calls, update a few session variables in addition to logging out of drupal.

Any way to have a custom function somewhere, where I could do something like this, without altering core?
TIA

#5

sid3000 - April 11, 2008 - 21:51
 
 

Drupal is a registered trademark of Dries Buytaert.