aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman
diff options
context:
space:
mode:
authormsapiro <>2007-02-07 00:31:24 +0000
committermsapiro <>2007-02-07 00:31:24 +0000
commit73b3efd456131f2606aff9363dbb97c22ad854df (patch)
treeffb1e62df4e4dbe4f9444df315d70e90f7d70044 /Mailman
parenteee82d55eee059a5b0f0ae47817f3351a5d114e1 (diff)
downloadmailman2-73b3efd456131f2606aff9363dbb97c22ad854df.tar.gz
mailman2-73b3efd456131f2606aff9363dbb97c22ad854df.tar.xz
mailman2-73b3efd456131f2606aff9363dbb97c22ad854df.zip
- Changed cmd_who.py to show hidden members when authorization is by list admin or moderator password.
- Changed cmd_who.py public roster syntax to accept optional list admin or moderator password.
Diffstat (limited to 'Mailman')
-rw-r--r--Mailman/Commands/cmd_who.py55
1 files changed, 37 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: