Revision: 8150
          http://svn.sourceforge.net/mailman/?rev=8150&view=rev
Author:   msapiro
Date:     2007-02-06 16:31:24 -0800 (Tue, 06 Feb 2007)

Log Message:
-----------
- 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.

Modified Paths:
--------------
    branches/Release_2_1-maint/mailman/Mailman/Commands/cmd_who.py
    branches/Release_2_1-maint/mailman/NEWS

Modified: branches/Release_2_1-maint/mailman/Mailman/Commands/cmd_who.py
===================================================================
--- branches/Release_2_1-maint/mailman/Mailman/Commands/cmd_who.py      
2007-02-03 11:04:58 UTC (rev 8149)
+++ branches/Release_2_1-maint/mailman/Mailman/Commands/cmd_who.py      
2007-02-07 00:31:24 UTC (rev 8150)
@@ -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,11 +12,9 @@
 #
 # 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.
 
-# Remove this when base minimal compatibility is Python 2.2
-from __future__ import nested_scopes
-
 from email.Utils import parseaddr
 
 from Mailman import mm_cfg
@@ -28,17 +26,21 @@
 
 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 @@
     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 @@
              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 @@
         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 @@
     # 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:

Modified: branches/Release_2_1-maint/mailman/NEWS
===================================================================
--- branches/Release_2_1-maint/mailman/NEWS     2007-02-03 11:04:58 UTC (rev 
8149)
+++ branches/Release_2_1-maint/mailman/NEWS     2007-02-07 00:31:24 UTC (rev 
8150)
@@ -10,6 +10,10 @@
 
     - 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


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to