typo--.
[Plinn.git] / skins / photo_theme / logout.py
1 ## Script (Python) "logout"
2 ##title=Logout handler
3 ##parameters=ajax=''
4 from Products.CMFCore.utils import getToolByName
5 from Products.CMFDefault.utils import translate
6 def _(msg) : return translate(msg, context)
7 utool = getToolByName(context, 'portal_url')
8 REQUEST = context.REQUEST
9 if REQUEST.has_key('portal_skin'):
10 context.portal_skins.clearSkinCookie()
11 REQUEST.RESPONSE.expireCookie('__ac', path='/')
12 session = REQUEST.SESSION
13 for k in session.keys() :
14 del session[k]
15 context.setStatus(True, _('You have been logged out.'))
16 portal = utool.getPortalObject()
17 return context.setRedirect(portal, 'object/view')