aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Cgi
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/Cgi')
-rw-r--r--Mailman/Cgi/admin.py16
-rw-r--r--Mailman/Cgi/admindb.py17
-rw-r--r--Mailman/Cgi/create.py6
-rw-r--r--Mailman/Cgi/edithtml.py2
-rw-r--r--Mailman/Cgi/roster.py14
-rw-r--r--Mailman/Cgi/subscribe.py9
6 files changed, 35 insertions, 29 deletions
diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py
index a6251058..3d790b2e 100644
--- a/Mailman/Cgi/admin.py
+++ b/Mailman/Cgi/admin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2009 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
@@ -24,7 +24,6 @@ import sys
import os
import re
import cgi
-import sha
import urllib
import signal
from types import *
@@ -41,6 +40,7 @@ from Mailman.UserDesc import UserDesc
from Mailman.htmlformat import *
from Mailman.Cgi import Auth
from Mailman.Logging.Syslog import syslog
+from Mailman.Utils import sha_new
# Set up i18n
_ = i18n._
@@ -852,7 +852,8 @@ def membership_options(mlist, subcat, cgidata, doc, form):
container.AddItem(header)
# Add a "search for member" button
table = Table(width='100%')
- link = Link('http://www.python.org/doc/current/lib/re-syntax.html',
+ link = Link('http://docs.python.org/library/re.html'
+ '#regular-expression-syntax',
_('(help)')).Format()
table.AddRow([Label(_('Find member %(link)s:')),
TextBox('findmember',
@@ -940,7 +941,10 @@ def membership_options(mlist, subcat, cgidata, doc, form):
if bucket:
cells = []
for letter in keys:
- url = adminurl + '/members?letter=%s' % letter
+ findfrag = ''
+ if regexp:
+ findfrag = '&findmember=' + urllib.quote(regexp)
+ url = adminurl + '/members?letter=' + letter + findfrag
if letter == bucket:
show = Bold('[%s]' % letter.upper()).Format()
else:
@@ -1269,7 +1273,7 @@ def change_options(mlist, category, subcat, cgidata, doc):
confirm = cgidata.getvalue('confirmmodpw', '').strip()
if new or confirm:
if new == confirm:
- mlist.mod_password = sha.new(new).hexdigest()
+ mlist.mod_password = sha_new(new).hexdigest()
# No re-authentication necessary because the moderator's
# password doesn't get you into these pages.
else:
@@ -1279,7 +1283,7 @@ def change_options(mlist, category, subcat, cgidata, doc):
confirm = cgidata.getvalue('confirmpw', '').strip()
if new or confirm:
if new == confirm:
- mlist.password = sha.new(new).hexdigest()
+ mlist.password = sha_new(new).hexdigest()
# Set new cookie
print mlist.MakeCookie(mm_cfg.AuthListAdmin)
else:
diff --git a/Mailman/Cgi/admindb.py b/Mailman/Cgi/admindb.py
index 75cc66a0..a20763f1 100644
--- a/Mailman/Cgi/admindb.py
+++ b/Mailman/Cgi/admindb.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2009 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
@@ -554,12 +554,8 @@ def show_detailed_requests(mlist, form):
def show_post_requests(mlist, id, info, total, count, form):
- # For backwards compatibility with pre 2.0beta3
- if len(info) == 5:
- ptime, sender, subject, reason, filename = info
- msgdata = {}
- else:
- ptime, sender, subject, reason, filename, msgdata = info
+ # Mailman.ListAdmin.__handlepost no longer tests for pre 2.0beta3
+ ptime, sender, subject, reason, filename, msgdata = info
form.AddItem('<hr>')
# Header shown on each held posting (including count of total)
msg = _('Posting Held for Approval')
@@ -709,10 +705,12 @@ def process_form(mlist, doc, cgidata):
preserve = actions.get('senderpreserve', 0)
forward = actions.get('senderforward', 0)
forwardaddr = actions.get('senderforwardto', '')
- comment = _('No reason given')
bysender = helds_by_sender(mlist)
for id in bysender.get(sender, []):
try:
+ msgdata = mlist.GetRecord(id)[5]
+ comment = msgdata.get('rejection_notice',
+ _('[No explanation given]'))
mlist.HandleRequest(id, action, comment, preserve,
forward, forwardaddr)
except (KeyError, Errors.LostHeldMessage):
@@ -771,7 +769,8 @@ def process_form(mlist, doc, cgidata):
forwardaddrkey = 'forward-addr-%d' % request_id
bankey = 'ban-%d' % request_id
# Defaults
- comment = _('[No reason given]')
+ msgdata = mlist.GetRecord(request_id)[5]
+ comment = msgdata.get('rejection_notice', _('[No explanation given]'))
preserve = 0
forward = 0
forwardaddr = ''
diff --git a/Mailman/Cgi/create.py b/Mailman/Cgi/create.py
index 55ec2887..7e21b981 100644
--- a/Mailman/Cgi/create.py
+++ b/Mailman/Cgi/create.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2008 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,7 +21,6 @@ import sys
import os
import signal
import cgi
-import sha
from types import ListType
from Mailman import mm_cfg
@@ -31,6 +30,7 @@ from Mailman import Errors
from Mailman import i18n
from Mailman.htmlformat import *
from Mailman.Logging.Syslog import syslog
+from Mailman.Utils import sha_new
# Set up i18n
_ = i18n._
@@ -180,7 +180,7 @@ def process_request(doc, cgidata):
# Install the emergency shutdown signal handler
signal.signal(signal.SIGTERM, sigterm_handler)
- pw = sha.new(password).hexdigest()
+ pw = sha_new(password).hexdigest()
# Guarantee that all newly created files have the proper permission.
# proper group ownership should be assured by the autoconf script
# enforcing that all directories have the group sticky bit set
diff --git a/Mailman/Cgi/edithtml.py b/Mailman/Cgi/edithtml.py
index 3aa8ab4e..0e34a1c7 100644
--- a/Mailman/Cgi/edithtml.py
+++ b/Mailman/Cgi/edithtml.py
@@ -168,7 +168,7 @@ must have shell access to your Mailman server.
""")))
doc.AddItem(_('See '))
doc.AddItem(Link(
-'http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq04.048.htp',
+'http://wiki.list.org/x/jYA9',
_('FAQ 4.48.')))
doc.AddItem(Header(3,_("Page Unchanged.")))
doc.AddItem('<hr>')
diff --git a/Mailman/Cgi/roster.py b/Mailman/Cgi/roster.py
index b53e5912..8d06777d 100644
--- a/Mailman/Cgi/roster.py
+++ b/Mailman/Cgi/roster.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2008 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
@@ -72,16 +72,18 @@ def main():
# that, we check roster-email and roster-pw fields for a valid password.
# (also allowed: the list moderator, the list admin, and the site admin).
password = cgidata.getvalue('roster-pw', '')
- list_hidden = mlist.WebAuthenticate((mm_cfg.AuthListModerator,
- mm_cfg.AuthListAdmin,
- mm_cfg.AuthSiteAdmin),
- password)
+ addr = cgidata.getvalue('roster-email', '')
+ list_hidden = (not mlist.WebAuthenticate((mm_cfg.AuthUser,),
+ password, addr)
+ and mlist.WebAuthenticate((mm_cfg.AuthListModerator,
+ mm_cfg.AuthListAdmin,
+ mm_cfg.AuthSiteAdmin),
+ password))
if mlist.private_roster == 0:
# No privacy
ok = 1
elif mlist.private_roster == 1:
# Members only
- addr = cgidata.getvalue('roster-email', '')
ok = mlist.WebAuthenticate((mm_cfg.AuthUser,
mm_cfg.AuthListModerator,
mm_cfg.AuthListAdmin,
diff --git a/Mailman/Cgi/subscribe.py b/Mailman/Cgi/subscribe.py
index 3661dcde..80019581 100644
--- a/Mailman/Cgi/subscribe.py
+++ b/Mailman/Cgi/subscribe.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2003 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2009 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
@@ -12,7 +12,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
"""Process subscription or roster requests from listinfo form."""
@@ -204,8 +205,8 @@ your subscription.""")
if privacy_results:
results = privacy_results
else:
- # We need to interpolate into x
- x = _(x)
+ # We need to interpolate into x.__str__()
+ x = _(str(x))
results = _("""\
Your subscription request was deferred because %(x)s. Your request has been
forwarded to the list moderator. You will receive email informing you of the