diff options
author | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2018-01-30 13:52:57 +0900 |
---|---|---|
committer | Yasuhito FUTATSUKI at POEM <futatuki@poem.co.jp> | 2018-01-30 13:52:57 +0900 |
commit | c0e8bb68ec685ac9e38e1993b4054d4707486bf9 (patch) | |
tree | 79bc7ae61f91d9ccdf417896085ddb844fcb74e2 /Mailman/Cgi/listinfo.py | |
parent | f74c636bcb6d03b269d65a3b4d6ec3af835dca62 (diff) | |
parent | c88ce52f7177f5cf5d56bf3786c90f5c9e679d04 (diff) | |
download | mailman2-c0e8bb68ec685ac9e38e1993b4054d4707486bf9.tar.gz mailman2-c0e8bb68ec685ac9e38e1993b4054d4707486bf9.tar.xz mailman2-c0e8bb68ec685ac9e38e1993b4054d4707486bf9.zip |
sync with lp:mailman/2.1 Rev 1738
Diffstat (limited to 'Mailman/Cgi/listinfo.py')
-rw-r--r-- | Mailman/Cgi/listinfo.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Mailman/Cgi/listinfo.py b/Mailman/Cgi/listinfo.py index b8704486..bab460b6 100644 --- a/Mailman/Cgi/listinfo.py +++ b/Mailman/Cgi/listinfo.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2017 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2018 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -21,6 +21,7 @@ # No lock needed in this script, because we don't change data. import os +import re import cgi import time @@ -243,6 +244,18 @@ def list_listinfo(mlist, lang): replacements['<mm-displang-box>'] = displang replacements['<mm-lang-form-start>'] = mlist.FormatFormStart('listinfo') replacements['<mm-fullname-box>'] = mlist.FormatBox('fullname', size=30) + # If reCAPTCHA is enabled, display its user interface + if mm_cfg.RECAPTCHA_SITE_KEY: + rlang = re.sub('_', '-', lang) + replacements['<mm-recaptcha-ui>'] = ( + """<tr><td> </td><td> + <script src="https://www.google.com/recaptcha/api.js?hl=%s"> + </script> + <div class="g-recaptcha" data-sitekey="%s"></div> + </td></tr>""" + % (rlang, mm_cfg.RECAPTCHA_SITE_KEY)) + else: + replacements['<mm-recaptcha-ui>'] = '' # Do the expansion. doc.AddItem(mlist.ParseTags('listinfo.html', replacements, lang)) |