[Zope-CMF] change skin based on use property
Chris Withers
chrisw@nipltd.com
Mon, 30 Sep 2002 19:47:43 +0100
Paul Winkler wrote:
>
> See the thread "Forcing skin by role" from Aug. 22nd.
...read that.
Damn. This really does both suck and blow :-(
What sucks is that there's no way to hook traversal after authentication.
What blows is that I have to call this nasty little thing from main_template:
member = context.portal_membership.getAuthenticatedMember()
should_be = member.their_skin
if context.REQUEST.get('portal_skin')!=should_be:
REQUEST=context.REQUEST
member.setProperties({'portal_skin':should_be})
context.portal_skins.updateSkinCookie()
REQUEST.RESPONSE.redirect(REQUEST.URL+'?'+REQUEST.QUERY_STRING)
What can be done to make this better?
cheers,
Chris