By margaridacarvalho on
I would like to have a button/menu item/block with link (it doesn't matter) that (when clicked) the user would be redirected to an external URL and at same time it would log out from my site. I don't want this to affect the regular logout link.
How can I achive this?
Thank's in advance.
Comments
Good feature request
+1
You can use the site.com/logout url to log out the current user... but directing them to a specific url would be nice when you "show them the door." So I don't have a solution, but I hope someone does.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
Hi, you need to implement
Hi, you need to implement hook_user in your module, then check for the "logout" operation. In the case of a logout, do a drupal_goto() to an external URL.
Ok, I read your question
Ok, I read your question again. You need to set up a URL with hook_menu. In the function called by the url, put
the following code:
Wow. that's gotta be one of
Wow. that's gotta be one of the most useful snippets / answers to a forum question I've seen.
-Blake
www.BlakeSenftner.com www.3D-Avatar-Store.com
Module Idea!
Just saying this seems like it would be a useful and easy-to-create module. The UI in Drupal would simply be two fields:
• What local url would you like to use for your logout?
• What url would you like to have the logged out user re-directed to?
I have ALMOST enough skill to build this module. If someone comes across this thread in six months and "Logout Destination" does not yet exist, please resurrect it. By then I will be ready to build this module.
A list of some of the Drupal sites I have designed and/or developed can be viewed at motioncity.com
No 'Logout Destination' module
A year has passed, and still no "Logout Destination" module seems to exist.
Anyone care to write one? ;-)
Thank you so much for your
Thank you all so much for your interest.
But I do no master drupal programming. How can I set up a URL with hook_menu? Where should I put that code?