changeset 6063:c2e4df0f760f

log action detections of access violations with abuse logger
author 'Karl O. Pinc' <kop@meme.com>
date Thu, 04 Sep 2014 10:50:04 -0500
parents 17ccba0ae187
children b40799be6932
files MoinMoin/action/edit.py MoinMoin/action/revert.py
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/edit.py	Thu Sep 04 10:49:26 2014 -0500
+++ b/MoinMoin/action/edit.py	Thu Sep 04 10:50:04 2014 -0500
@@ -11,6 +11,7 @@
 from MoinMoin import wikiutil
 from MoinMoin.Page import Page
 from MoinMoin.web.utils import check_surge_protect
+from MoinMoin.util.abuse import log_attempt
 
 def execute(pagename, request):
     """ edit a page """
@@ -22,6 +23,7 @@
         return
 
     if not request.user.may.write(pagename):
+        log_attempt('edit: edit', False, request)
         page = wikiutil.getLocalizedPage(request, 'PermissionDeniedPage')
         page.body = _('You are not allowed to edit this page.')
         page.page_name = pagename
--- a/MoinMoin/action/revert.py	Thu Sep 04 10:49:26 2014 -0500
+++ b/MoinMoin/action/revert.py	Thu Sep 04 10:50:04 2014 -0500
@@ -12,6 +12,7 @@
 from MoinMoin.Page import Page
 from MoinMoin.PageEditor import PageEditor
 from MoinMoin.action import ActionBase
+from MoinMoin.util.abuse import log_attempt
 
 class revert(ActionBase):
     """ revert page action
@@ -32,6 +33,8 @@
         _ = self._
         may = self.request.user.may
         allowed = may.write(self.pagename) and may.revert(self.pagename)
+        if not allowed:
+            log_attempt('revert', False, self.request)
         return allowed, _('You are not allowed to revert this page!')
 
     def check_condition(self):