aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Mailman/Commands/cmd_who.py55
-rw-r--r--NEWS4
2 files changed, 41 insertions, 18 deletions
diff --git a/Mailman/Commands/cmd_who.py b/Mailman/Commands/cmd_who.py
index e36ca3b6..8470ef9d 100644
--- a/Mailman/Commands/cmd_who.py
+++ b/Mailman/Commands/cmd_who.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2002-2007 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,10 +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.
-
-# Remove this when base minimal compatibility is Python 2.2
-from __future__ import nested_scopes
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
from email.Utils import parseaddr
@@ -28,17 +26,21 @@ def _(s): return s
PUBLICHELP = _("""
who
- See everyone who is on this mailing list.
+ See the non-hidden members of this mailing list.
+ who password
+ See everyone who is on this mailing list. The password is the
+ list's admin or moderator password.
""")
MEMBERSONLYHELP = _("""
who password [address=<address>]
- See everyone who is on this mailing list. The roster is limited to
- list members only, and you must supply your membership password to
- retrieve it. If you're posting from an address other than your
- membership address, specify your membership address with
+ See the non-hidden members of this mailing list. The roster is
+ limited to list members only, and you must supply your membership
+ password to retrieve it. If you're posting from an address other
+ than your membership address, specify your membership address with
`address=<address>' (no brackets around the email address, and no
- quotes!)
+ quotes!). If you provide the list's admin or moderator password,
+ hidden members will be included.
""")
ADMINONLYHELP = _("""
@@ -71,13 +73,23 @@ def process(res, args):
mlist = res.mlist
address = None
password = None
- ok = 0
+ ok = False
+ full = False
if mlist.private_roster == 0:
# Public rosters
if args:
- usage(res)
- return STOP
- ok = 1
+ if len(args) == 1:
+ if mlist.Authenticate((mm_cfg.AuthListModerator,
+ mm_cfg.AuthListAdmin),
+ args[0]):
+ full = True
+ else:
+ usage(res)
+ return STOP
+ else:
+ usage(res)
+ return STOP
+ ok = True
elif mlist.private_roster == 1:
# List members only
if len(args) == 1:
@@ -95,7 +107,13 @@ def process(res, args):
mm_cfg.AuthListAdmin),
password, address):
# Then
- ok = 1
+ ok = True
+ if mlist.Authenticate(
+ (mm_cfg.AuthListModerator,
+ mm_cfg.AuthListAdmin),
+ password):
+ # Then
+ ok = full = True
else:
# Admin only
if len(args) <> 1:
@@ -104,7 +122,7 @@ def process(res, args):
if mlist.Authenticate((mm_cfg.AuthListModerator,
mm_cfg.AuthListAdmin),
args[0]):
- ok = 1
+ ok = full = True
if not ok:
res.results.append(
_('You are not allowed to retrieve the list membership.'))
@@ -118,7 +136,8 @@ def process(res, args):
# Convenience function
def addmembers(members):
for member in members:
- if mlist.getMemberOption(member, mm_cfg.ConcealSubscription):
+ if not full and mlist.getMemberOption(member,
+ mm_cfg.ConcealSubscription):
continue
realname = mlist.getMemberName(member)
if realname:
diff --git a/NEWS b/NEWS
index 5d11cba3..4b695d69 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,10 @@ Here is a history of user visible changes to Mailman.
- Fixed admin.py so null VARHELP category is handled (1573393).
+ - Changed cmd_who.py to list all members if authorization is with the
+ list's admin or moderator password and to accept the password if the
+ roster is public.
+
2.1.9 (12-Sep-2006)
Security