diff MoinMoin/PageEditor.py @ 6066:68092d872ecc

add page name to abuse log
author 'Karl O. Pinc' <kop@meme.com>
date Thu, 04 Sep 2014 14:09:28 -0500
parents 17ccba0ae187
children 751214fa01d7
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Thu Sep 04 13:16:01 2014 -0500
+++ b/MoinMoin/PageEditor.py	Thu Sep 04 14:09:28 2014 -0500
@@ -169,10 +169,10 @@
 
         # check edit permissions
         if not request.user.may.write(self.page_name):
-            log_attempt('edit: edit', False, request)
+            log_attempt('edit: edit', False, request, name=self.page_name)
             msg = _('You are not allowed to edit this page.')
         elif not self.isWritable():
-            log_attempt('edit: immutable', False, request)
+            log_attempt('edit: immutable', False, request, name=self.page_name)
             msg = _('Page is immutable!')
         elif self.rev:
             # Trying to edit an old version, this is not possible via
@@ -554,7 +554,7 @@
             return False, _("You can't copy to an empty pagename.")
 
         if not self.request.user.may.write(newpagename):
-            log_attempt('edit: copy', False, request)
+            log_attempt('edit: copy', False, request, name=self.page_name)
             return False, _('You are not allowed to copy this page!')
 
         newpage = PageEditor(request, newpagename)
@@ -607,7 +607,7 @@
 
         if not (request.user.may.delete(self.page_name)
                 and request.user.may.write(newpagename)):
-            log_attempt('edit: rename', False, request)
+            log_attempt('edit: rename', False, request, name=self.page_name)
             msg = _('You are not allowed to rename this page!')
             raise self.AccessDenied(msg)
 
@@ -715,7 +715,7 @@
         success = True
         if not (request.user.may.write(self.page_name)
                 and request.user.may.delete(self.page_name)):
-            log_attempt('edit: delete', False, request)
+            log_attempt('edit: delete', False, request, name=self.page_name)
             msg = _('You are not allowed to delete this page!')
             raise self.AccessDenied(msg)
 
@@ -1080,11 +1080,11 @@
 
         msg = ""
         if not request.user.may.save(self, newtext, rev, **kw):
-            log_attempt('edit: edit', False, request)
+            log_attempt('edit: edit', False, request, name=self.page_name)
             msg = _('You are not allowed to edit this page!')
             raise self.AccessDenied(msg)
         elif not self.isWritable():
-            log_attempt('edit: immutable', False, request)
+            log_attempt('edit: immutable', False, request, name=self.page_name)
             msg = _('Page is immutable!')
             raise self.Immutable(msg)
         elif not newtext:
@@ -1128,7 +1128,7 @@
             if (not request.user.may.admin(self.page_name) and
                 parseACL(request, newtext).acl != acl.acl and
                 action != "SAVE/REVERT"):
-                log_attempt('edit: acl', False, request)
+                log_attempt('edit: acl', False, request, name=self.page_name)
                 msg = _("You can't change ACLs on this page since you have no admin rights on it!")
                 raise self.NoAdmin(msg)