X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/174a626682442c7b8513117e91ba6b8e956b818d..de068d5b8a1fd46a70f75f4e20e581ee846f866d:/skins/photo_theme/logout.py diff --git a/skins/photo_theme/logout.py b/skins/photo_theme/logout.py new file mode 100755 index 0000000..f3ec6fe --- /dev/null +++ b/skins/photo_theme/logout.py @@ -0,0 +1,17 @@ +## Script (Python) "logout" +##title=Logout handler +##parameters=ajax='' +from Products.CMFCore.utils import getToolByName +from Products.CMFDefault.utils import translate +def _(msg) : return translate(msg, context) +utool = getToolByName(context, 'portal_url') +REQUEST = context.REQUEST +if REQUEST.has_key('portal_skin'): + context.portal_skins.clearSkinCookie() +REQUEST.RESPONSE.expireCookie('__ac', path='/') +session = REQUEST.SESSION +for k in session.keys() : + del session[k] +context.setStatus(True, _('You have been logged out.')) +portal = utool.getPortalObject() +return context.setRedirect(portal, 'object/view') \ No newline at end of file