Back to index

plone3  3.1.7
redirectToReferrer.py
Go to the documentation of this file.
00001 ## Script (Python) "redirectToReferrer"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=message
00008 ##title=Redirect to Referrer with message
00009 ##
00010 
00011 request=context.REQUEST
00012 referer=request.get('HTTP_REFERER', '')
00013 query_pos=referer.find('?')
00014 if query_pos != -1:
00015     target_url=referer[:referer.find('?')]
00016 else:
00017     target_url=referer
00018 return request.RESPONSE.redirect(target_url)