diff MoinMoin/action/edit.py @ 2983:7b0aadb97d01

new antispam stuff: textchas (text CAPTCHAs), cleanup AttachFile handler (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Jan 2008 02:49:32 +0100
parents ba14d391c2ba
children a875b3c6dabc
line wrap: on
line diff
--- a/MoinMoin/action/edit.py	Sat Jan 05 23:41:20 2008 +0100
+++ b/MoinMoin/action/edit.py	Sun Jan 06 02:49:32 2008 +0100
@@ -158,6 +158,9 @@
     # Save new text
     else:
         try:
+            from MoinMoin.security.textcha import TextCha
+            if not TextCha(request).check_answer_from_form():
+                raise pg.SaveError(_('TextCha: Wrong answer! Go back and try again...', formatted=False))
             savemsg = pg.saveText(savetext, rev, trivial=trivial, comment=comment)
         except pg.EditConflict, e:
             msg = e.message