~mailman-coders/mailman/2.1

« back to all changes in this revision

Viewing changes to Mailman/Cgi/roster.py

  • Committer: Mark Sapiro
  • Date: 2008-12-07 17:41:12 UTC
  • Revision ID: mark@msapiro.net-20081207174112-5y223fo43mhxt202
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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 1998-2008 by the Free Software Foundation, Inc.
2
2
#
3
3
# This program is free software; you can redistribute it and/or
4
4
# modify it under the terms of the GNU General Public License
72
72
    # that, we check roster-email and roster-pw fields for a valid password.
73
73
    # (also allowed: the list moderator, the list admin, and the site admin).
74
74
    password = cgidata.getvalue('roster-pw', '')
75
 
    list_hidden = mlist.WebAuthenticate((mm_cfg.AuthListModerator,
76
 
                                         mm_cfg.AuthListAdmin,
77
 
                                         mm_cfg.AuthSiteAdmin),
78
 
                                        password)
 
75
    addr = cgidata.getvalue('roster-email', '')
 
76
    list_hidden = (not mlist.WebAuthenticate((mm_cfg.AuthUser,),
 
77
                                             password, addr)
 
78
                   and mlist.WebAuthenticate((mm_cfg.AuthListModerator,
 
79
                                              mm_cfg.AuthListAdmin,
 
80
                                              mm_cfg.AuthSiteAdmin),
 
81
                                             password))
79
82
    if mlist.private_roster == 0:
80
83
        # No privacy
81
84
        ok = 1
82
85
    elif mlist.private_roster == 1:
83
86
        # Members only
84
 
        addr = cgidata.getvalue('roster-email', '')
85
87
        ok = mlist.WebAuthenticate((mm_cfg.AuthUser,
86
88
                                    mm_cfg.AuthListModerator,
87
89
                                    mm_cfg.AuthListAdmin,