comparison MoinMoin/action/newpage.py @ 6064:b40799be6932

log page creation access denied with abuse logger
author 'Karl O. Pinc' <kop@meme.com>
date Thu, 04 Sep 2014 11:47:12 -0500
parents e78462e0c7f1
children 68092d872ecc
comparison
equal deleted inserted replaced
6063:c2e4df0f760f 6064:b40799be6932
10 @license: GNU GPL, see COPYING for details. 10 @license: GNU GPL, see COPYING for details.
11 """ 11 """
12 12
13 import time 13 import time
14 from MoinMoin.Page import Page 14 from MoinMoin.Page import Page
15 from MoinMoin.util.abuse import log_attempt
15 16
16 class NewPage: 17 class NewPage:
17 """ Open editor for a new page, using template """ 18 """ Open editor for a new page, using template """
18 19
19 def __init__(self, request, referrer): 20 def __init__(self, request, referrer):
63 """ 64 """
64 _ = self.request.getText 65 _ = self.request.getText
65 page = Page(self.request, self.pagename) 66 page = Page(self.request, self.pagename)
66 if not (page.isWritable() and self.request.user.may.read(self.pagename)): 67 if not (page.isWritable() and self.request.user.may.read(self.pagename)):
67 # Same error as the edit page for localization reasons 68 # Same error as the edit page for localization reasons
69 log_attempt('newpage', False, self.request)
68 return _('You are not allowed to edit this page.') 70 return _('You are not allowed to edit this page.')
69 return '' 71 return ''
70 72
71 def render(self): 73 def render(self):
72 """ Redirect to the new page, using edit action and template """ 74 """ Redirect to the new page, using edit action and template """