From 993d81c2ce98a6579b3110a6013c00090dfddaea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sieb=C3=B6rger?= Date: Mon, 29 Jan 2018 14:58:42 +0200 Subject: Allow the list subscription form to be protected from spam bots using reCAPTCHA. --- Mailman/Cgi/listinfo.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Mailman/Cgi/listinfo.py') diff --git a/Mailman/Cgi/listinfo.py b/Mailman/Cgi/listinfo.py index b8704486..91f5b6bb 100644 --- a/Mailman/Cgi/listinfo.py +++ b/Mailman/Cgi/listinfo.py @@ -243,6 +243,16 @@ def list_listinfo(mlist, lang): replacements[''] = displang replacements[''] = mlist.FormatFormStart('listinfo') replacements[''] = mlist.FormatBox('fullname', size=30) + # If reCAPTCHA is enabled, display its user interface + if mm_cfg.RECAPTCHA_SITE_KEY: + replacements[''] = ( + """  + +
+ """ + % mm_cfg.RECAPTCHA_SITE_KEY) + else: + replacements[''] = '' # Do the expansion. doc.AddItem(mlist.ParseTags('listinfo.html', replacements, lang)) -- cgit v1.2.3