aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/HTMLFormatter.py
diff options
context:
space:
mode:
authorYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-08-28 00:30:29 +0900
committerYasuhito FUTATSUKI at POEM <futatuki@poem.co.jp>2016-08-28 00:30:29 +0900
commit0aaf0a65b317cf64ff47595b4c57c3fa4a97dc7f (patch)
treee47de4b9704acf1d696eb863f3bcfff7e73a1737 /Mailman/HTMLFormatter.py
parenta302a27393d816018943cd58e933e17da9398fe7 (diff)
parentd85ac809ee9d20c0b944082863da9410f7d3e252 (diff)
downloadmailman2-0aaf0a65b317cf64ff47595b4c57c3fa4a97dc7f.tar.gz
mailman2-0aaf0a65b317cf64ff47595b4c57c3fa4a97dc7f.tar.xz
mailman2-0aaf0a65b317cf64ff47595b4c57c3fa4a97dc7f.zip
Merge lp:mailman/2.1 up to 1671 (2.1.23)
Diffstat (limited to '')
-rw-r--r--Mailman/HTMLFormatter.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Mailman/HTMLFormatter.py b/Mailman/HTMLFormatter.py
index 901e7e58..5fcce75b 100644
--- a/Mailman/HTMLFormatter.py
+++ b/Mailman/HTMLFormatter.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2015 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2016 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
@@ -28,6 +28,8 @@ from Mailman.htmlformat import *
from Mailman.i18n import _
+from Mailman.CSRFcheck import csrf_token
+
EMPTYSTRING = ''
BR = '<br>'
@@ -317,12 +319,17 @@ class HTMLFormatter:
container.AddItem("</center>")
return container
- def FormatFormStart(self, name, extra=''):
+ def FormatFormStart(self, name, extra='',
+ mlist=None, contexts=None, user=None):
base_url = self.GetScriptURL(name)
if extra:
full_url = "%s/%s" % (base_url, extra)
else:
full_url = base_url
+ if mlist:
+ return ("""<form method="POST" action="%s">
+<input type="hidden" name="csrf_token" value="%s">"""
+ % (full_url, csrf_token(mlist, contexts, user)))
return ('<FORM Method=POST ACTION="%s">' % full_url)
def FormatArchiveAnchor(self):