From a86be44b08fe0935fe77d90948b9baad85af3624 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 12 Nov 2008 23:02:29 -0500 Subject: Apply Heiko Rommel's patch for hashlib deprecation warnings for bug 293178. I've modified the patch to improve some of the stylistic issues. --- Mailman/Cgi/admin.py | 6 +++--- Mailman/Cgi/create.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Mailman/Cgi') diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index a6251058..ba44fc44 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -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._ @@ -1269,7 +1269,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 +1279,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/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 -- cgit v1.2.3 From 2137e2b32bd44f8666369b8469a63d12be59e14d Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 5 Dec 2008 15:23:43 -0800 Subject: Updated some FAQ URLs for wiki.list.org. --- Mailman/Cgi/edithtml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Mailman/Cgi') 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('
') -- cgit v1.2.3 From 2274e704c435716f33ed9dabcb80bef0811ba50c Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 7 Dec 2008 09:41:12 -0800 Subject: Fixed a problem in Decorate which could throw a TypeError on conversion to unicode of a header/footer that was already unicode because of interpolating a unicode value. Made a minor change to the authentication logic for displaying hidden members on the roster. --- Mailman/Cgi/roster.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Mailman/Cgi') 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, -- cgit v1.2.3 From 2154e5dc03be61c10c7fb9157600fc19feffce86 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Fri, 2 Jan 2009 18:40:28 -0800 Subject: Mailman/Utils.py - Fixed a long standing error that stopped relative hrefs from being generated for links on Mailman's web pages. Mailman/Cgi/admindb.py - Changed the admindb interface so that when messages are rejected from the summary page, the reject reason is the rejection message from the Errors.HoldMessage subclass instead of the generic "No reason given". --- Mailman/Cgi/admindb.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'Mailman/Cgi') 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('
') # 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 = '' -- cgit v1.2.3 From 4cfb7130a9b64d951b8e3367c67ca445f3eb296e Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sat, 10 Jan 2009 12:44:55 -0800 Subject: - Fixed the admin Membership List Find member function so the 'letter' links to a chunked result would still be limited to the Find member search. SF patch #1532081. - Changed scripts/driver to return a 405 status for non GET, POST, HEAD methods. SF patch #1578756. --- Mailman/Cgi/admin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Mailman/Cgi') diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index ba44fc44..158a9bbd 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 @@ -940,7 +940,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: -- cgit v1.2.3 From 459c60bd8ad6d798a3c55dd075b5efd05677f4b8 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 11 Jan 2009 08:06:13 -0800 Subject: Updated links to Python documentation. --- Mailman/Cgi/admin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Mailman/Cgi') diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index 158a9bbd..3d790b2e 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -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', -- cgit v1.2.3 From c0da6af58657b1fe5730d3dea0e78bc17dac490a Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Tue, 20 Jan 2009 12:22:08 -0800 Subject: Two of the 'new' class exceptions are raised with an argument. --- Mailman/Cgi/subscribe.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Mailman/Cgi') 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 -- cgit v1.2.3