comparison MoinMoin/action/Despam.py @ 448:45924beef130

user.isSuperUser() check, require cfg.superuser being a list or tuple imported from: moin--main--1.5--patch-452
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 18 Feb 2006 15:31:50 +0000
parents 8a750c0d229a
children 17ab8fe4a94b
comparison
equal deleted inserted replaced
447:e0e016a553bd 448:45924beef130
159 def execute(pagename, request): 159 def execute(pagename, request):
160 _ = request.getText 160 _ = request.getText
161 # be extra paranoid in dangerous actions 161 # be extra paranoid in dangerous actions
162 actname = __name__.split('.')[-1] 162 actname = __name__.split('.')[-1]
163 if actname in request.cfg.actions_excluded or \ 163 if actname in request.cfg.actions_excluded or \
164 request.user.name not in request.cfg.superuser: 164 not request.user.isSuperUser():
165 return Page.Page(request, pagename).send_page(request, 165 return Page.Page(request, pagename).send_page(request,
166 msg = _('You are not allowed to use this action.')) 166 msg = _('You are not allowed to use this action.'))
167 167
168 editor = request.form.get('editor', [None])[0] 168 editor = request.form.get('editor', [None])[0]
169 timestamp = time.time() - 24 * 3600 169 timestamp = time.time() - 24 * 3600