Forums / Developer / single sign OUT / Comment68545
David Wirth
Wednesday 08 June 2011 6:36:13 am
I can't say I fully understand your requirements of elegance, but how about coding a custom template operator and drop it in pagelayout to determine if the user should be logged out? Is that what you're trying to stay away from?
What config.php are you talking about? [ezroot]/config.php? I think maybe an extension would be more suitable and more portable for you.
Hope this helps
Hmmm, I guess I was stuck in a mindset of resolving the current user before it even got to templates. Pagelayout doesn't come into play until after the module and view have been processed so, in the case of a user who should be logged out, I would have to logout the user out and then redirect back to the same requested URL so the module and view get processed with the appropriate current user. I suppose that would work, though, albeit with an added bit of server processing time. I was originally hoping I just had not yet stumbled upon something built-in with the login/sso handlers that does what I'm trying to do but I'll go ahead and try the template operator approach. Thanks.
(There's also a potential issue with having to put the template operator in multiple pagelayouts but I just took a look and page_head.tpl seems to be an include common to all of them, so I can just put it there.)