Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
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?
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.
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.
Comments
Comment #1
metzlerd commentedI'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?
Comment #2
redndahead commentedTrue, 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.
Comment #3
metzlerd commentedActually 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.
Comment #4
metzlerd commentedI think we've put this to bed, yes?
Comment #5
redndahead commentedYes I've used theme_link() in my template.php to change the logout link.