hook_user for cas logout
redndahead - August 11, 2009 - 18:41
| Project: | CAS |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
Description
Is there a reason hook_user isn't used for logging out? Would it interfere with non cas users logging out?

#1
I'd have to think about that.
CAS logout invokes the logout hook to make sure things that need to be done by other modules on logout happen. If we redirect on hook user logout, wouldn't that potentially make modules that have a higher weight not have their hook_user methods fire on logout. This way we know that the logout has completed prior to doing the redirect, yes?
#2
True, the biggest problem I have at the moment is that we can't use the logout link. Where this comes into play are on modules like admin_menu and admin. So my first thought is invoke on logout. But I can see your point. I wonder if aliasing /logout to /caslogout would work.
#3
Actually your problem is a feature for some. I routinely use the drupal logout link to see how my site looks to an anonymous user and then quickly log back in via cas without having to specify my credentials. Nothing to stop the site admin from moving/hiding the logout menu and then using the cas logout menu for all logouts. We might need to write a patch to make sure users who aren't logged in via cas do not get redirected to the CAS server though.
#4
I think we've put this to bed, yes?
#5
Yes I've used theme_link() in my template.php to change the logout link.