diff MoinMoin/action/edit.py @ 1561:d12202b5791c

check if multiple submit buttons are pressed at once (ported from 1.5)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 18 Sep 2006 19:55:05 +0200
parents bd5b43d70399
children 8bfaae6fa0a5
line wrap: on
line diff
--- a/MoinMoin/action/edit.py	Mon Sep 18 19:28:59 2006 +0200
+++ b/MoinMoin/action/edit.py	Mon Sep 18 19:55:05 2006 +0200
@@ -15,6 +15,12 @@
     """ edit a page """
     _ = request.getText
 
+    if request.form.has_key('button_preview') and request.form.has_key('button_spellcheck'):
+        # multiple buttons pressed at once? must be some spammer/bot
+        request.makeForbidden403()
+        request.log("LOL, some spammer pressed multiple buttons at once ...")
+        return
+
     if not request.user.may.write(pagename):
         Page(request, pagename).send_page(request,
             msg=_('You are not allowed to edit this page.'))