## Script (Python) "logout"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
from Products.CMFCore.utils import getToolByName
skintool = getToolByName (context, 'portal_skins')

req = container.REQUEST
resp = req ['RESPONSE']

user = req.get ('AUTHENTICATED_USER', None)

do_logout = False
if user:
	if hasattr (user, 'isAmysqlUserObject'):
		if user.isAmysqlUserObject:
			do_logout = True

if do_logout: user.logout_user (req, resp, None)

pskin = skintool.getSkinByName ('plone_login')
return pskin.logout ()
