changeset 3525:ee0644a26e30

action Attachfile, Despam, backup, thread_monitor: removed duplicated checks done by request.__init__
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 26 Apr 2008 19:42:26 +0200
parents 74f42592c7a0
children 23ccc95cb0f4
files MoinMoin/action/AttachFile.py MoinMoin/action/Despam.py MoinMoin/action/backup.py MoinMoin/action/thread_monitor.py
diffstat 4 files changed, 6 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sat Apr 26 15:43:15 2008 +0200
+++ b/MoinMoin/action/AttachFile.py	Sat Apr 26 19:42:26 2008 +0200
@@ -503,11 +503,6 @@
     """ Main dispatcher for the 'AttachFile' action. """
     _ = request.getText
 
-    if action_name in request.cfg.actions_excluded:
-        msg = _('File attachments are not allowed in this wiki!')
-        error_msg(pagename, request, msg)
-        return
-
     do = request.form.get('do', ['upload_form'])
     handler = globals().get('_do_%s' % do[0])
     if handler:
--- a/MoinMoin/action/Despam.py	Sat Apr 26 15:43:15 2008 +0200
+++ b/MoinMoin/action/Despam.py	Sat Apr 26 19:42:26 2008 +0200
@@ -178,10 +178,8 @@
 
 def execute(pagename, request):
     _ = request.getText
-    # be extra paranoid in dangerous actions
-    actname = __name__.split('.')[-1]
-    if actname in request.cfg.actions_excluded or \
-       not request.user.isSuperUser():
+    # check for superuser
+    if not request.user.isSuperUser():
         request.theme.add_msg(_('You are not allowed to use this action.'), "error")
         return Page.Page(request, pagename).send_page()
 
--- a/MoinMoin/action/backup.py	Sat Apr 26 15:43:15 2008 +0200
+++ b/MoinMoin/action/backup.py	Sat Apr 26 19:42:26 2008 +0200
@@ -123,8 +123,7 @@
     """ Return True if backup is allowed """
     action = __name__.split('.')[-1]
     user = request.user
-    return (action not in request.cfg.actions_excluded and
-            user.valid and user.name in request.cfg.backup_users)
+    return user.valid and user.name in request.cfg.backup_users
 
 def execute(pagename, request):
     _ = request.getText
--- a/MoinMoin/action/thread_monitor.py	Sat Apr 26 15:43:15 2008 +0200
+++ b/MoinMoin/action/thread_monitor.py	Sat Apr 26 19:42:26 2008 +0200
@@ -15,10 +15,8 @@
 
 def execute_fs(pagename, request):
     _ = request.getText
-    # be extra paranoid in dangerous actions
-    actname = __name__.split('.')[-1]
-    if actname in request.cfg.actions_excluded or \
-       not request.user.isSuperUser():
+    # check for superuser
+    if not request.user.isSuperUser():
         request.theme.add_msg(_('You are not allowed to use this action.'), "error")
         return Page.Page(request, pagename).send_page()
 
@@ -42,8 +40,7 @@
     _ = request.getText
     # be extra paranoid in dangerous actions
     actname = __name__.split('.')[-1]
-    if actname in request.cfg.actions_excluded or \
-       not request.user.isSuperUser():
+    if not request.user.isSuperUser():
         request.theme.add_msg(_('You are not allowed to use this action.'), "error")
         return Page.Page(request, pagename).send_page()