Back to index

plone3  3.1.7
rejectAnonymous.py
Go to the documentation of this file.
00001 ## Script (Python) "rejectAnonymous"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=
00008 ##title=
00009 ##
00010 
00011 from Products.CMFPlone import PloneMessageFactory as _
00012 
00013 context.plone_log("The rejectAnonymous script is deprecated and will be "
00014                   "removed in Plone 4.0.")
00015 
00016 if context.portal_membership.isAnonymousUser():
00017 
00018     url = '%s/login_form' % context.portal_url()
00019     context.plone_utils.addPortalMessage(_(u'You must sign in first.'))
00020 
00021     RESPONSE=context.REQUEST.RESPONSE
00022     return RESPONSE.redirect(url)
00023 return True