Back to index

plone3  3.1.7
prefs_error_log_update.py
Go to the documentation of this file.
00001 ## Script (Python) "prefs_error_log_update"
00002 ## Giorgio, Lorty - Plone Castle Sprint
00003 
00004 from Products.CMFPlone import PloneMessageFactory as _
00005 
00006 request=context.REQUEST
00007 membership_tool=context.portal_membership
00008 member=membership_tool.getAuthenticatedMember()
00009 
00010 if hasattr(request, 'form.button.showall'):
00011     member.setProperties(error_log_update=0.0)
00012     context.plone_utils.addPortalMessage(_(u'Showing all entries'))
00013     return request.RESPONSE.redirect(context.absolute_url() +'/prefs_error_log_form')
00014 elif hasattr(request, 'form.button.clear'):
00015     member.setProperties(error_log_update=DateTime().timeTime())
00016     context.plone_utils.addPortalMessage(_(u'Entries cleared'))
00017     return request.RESPONSE.redirect(context.absolute_url() +'/prefs_error_log_form')
00018 else:
00019     return request.RESPONSE.redirect(context.absolute_url() +'/prefs_error_log_form')