summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mailman/Cgi/listinfo.py14
-rw-r--r--Mailman/Cgi/options.py6
-rw-r--r--Mailman/Cgi/roster.py16
-rw-r--r--Mailman/Cgi/subscribe.py14
4 files changed, 27 insertions, 23 deletions
diff --git a/Mailman/Cgi/listinfo.py b/Mailman/Cgi/listinfo.py
index d9e4d2660..5244d75c7 100644
--- a/Mailman/Cgi/listinfo.py
+++ b/Mailman/Cgi/listinfo.py
@@ -1,17 +1,17 @@
-# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2003 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
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""Produce listinfo page, primary web entry-point to mailing lists.
@@ -54,7 +54,9 @@ def main():
# See if the user want to see this page in other language
cgidata = cgi.FieldStorage()
- language = cgidata.getvalue('language', mlist.preferred_language)
+ language = cgidata.getvalue('language')
+ if not Utils.IsLanguage(language):
+ language = mlist.preferred_language
i18n.set_language(language)
list_listinfo(mlist, language)
@@ -192,7 +194,7 @@ def list_listinfo(mlist, lang):
else:
displang = mlist.FormatButton('displang-button',
text = _("View this page in"))
- replacements['<mm-displang-box>'] = displang
+ replacements['<mm-displang-box>'] = displang
replacements['<mm-lang-form-start>'] = mlist.FormatFormStart('listinfo')
replacements['<mm-fullname-box>'] = mlist.FormatBox('fullname', size=30)
diff --git a/Mailman/Cgi/options.py b/Mailman/Cgi/options.py
index 33717c86c..2f9e9afaa 100644
--- a/Mailman/Cgi/options.py
+++ b/Mailman/Cgi/options.py
@@ -83,7 +83,7 @@ def main():
# preference to view the page in, so we should honor that here. If that's
# not available, use the list's default language.
language = cgidata.getvalue('language')
- if not mm_cfg.LC_DESCRIPTIONS.has_key(language):
+ if not Utils.IsLanguage(language):
language = mlist.preferred_language
i18n.set_language(language)
doc.set_language(language)
@@ -132,7 +132,9 @@ def main():
# And now we know the user making the request, so set things up to for the
# user's stored preferred language, overridden by any form settings for
# their new language preference.
- userlang = cgidata.getvalue('language', mlist.getMemberLanguage(user))
+ userlang = cgidata.getvalue('language')
+ if not Utils.IsLanguage(userlang):
+ userlang = mlist.getMemberLanguage(user)
doc.set_language(userlang)
i18n.set_language(userlang)
diff --git a/Mailman/Cgi/roster.py b/Mailman/Cgi/roster.py
index 71c062400..2dc0c98d3 100644
--- a/Mailman/Cgi/roster.py
+++ b/Mailman/Cgi/roster.py
@@ -1,17 +1,17 @@
-# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2003 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
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""Produce subscriber roster, using listinfo form data, roster.html template.
@@ -21,7 +21,7 @@ Takes listname in PATH_INFO.
# We don't need to lock in this script, because we're never going to change
-# data.
+# data.
import sys
import os
@@ -61,11 +61,9 @@ def main():
cgidata = cgi.FieldStorage()
# messages in form should go in selected language (if any...)
- if cgidata.has_key('language'):
- lang = cgidata['language'].value
- else:
+ lang = cgidata.getvalue('language')
+ if not Utils.IsLanguage(lang):
lang = mlist.preferred_language
-
i18n.set_language(lang)
# Perform authentication for protected rosters. If the roster isn't
diff --git a/Mailman/Cgi/subscribe.py b/Mailman/Cgi/subscribe.py
index c2dfe5cd0..d0a477d7c 100644
--- a/Mailman/Cgi/subscribe.py
+++ b/Mailman/Cgi/subscribe.py
@@ -1,17 +1,17 @@
-# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2003 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
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
"""Process subscription or roster requests from listinfo form."""
@@ -50,7 +50,7 @@ def main():
doc.AddItem(Bold(_('Invalid options to CGI script')))
print doc.Format()
return
-
+
listname = parts[0].lower()
try:
mlist = MailList.MailList(listname, lock=0)
@@ -66,7 +66,9 @@ def main():
# See if the form data has a preferred language set, in which case, use it
# for the results. If not, use the list's preferred language.
cgidata = cgi.FieldStorage()
- language = cgidata.getvalue('language', mlist.preferred_language)
+ language = cgidata.getvalue('language')
+ if not Utils.IsLanguage(language):
+ language = mlist.preferred_language
i18n.set_language(language)
doc.set_language(language)