~launchpad-pqm/mailman/2.1

« back to all changes in this revision

Viewing changes to Mailman/Cgi/options.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2009-10-21 01:06:17 UTC
  • mfrom: (975.1.1 mailman.2112)
  • Revision ID: launchpad@pqm.canonical.com-20091021010617-prbs2ay6nhxx515v
[rs=flacoste] Upgrade Mailman to upstream 2.1.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 1998-2006 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
99
99
        user = cgidata.getvalue('email')
100
100
        if not user:
101
101
            # If we're coming from the listinfo page and we left the email
102
 
            # address field blank, it's not an error.  listinfo.html names the
103
 
            # button UserOptions; we can use that as the descriminator.
104
 
            if not cgidata.getvalue('UserOptions'):
 
102
            # address field blank, it's not an error.  Likewise if we're
 
103
            # coming from anywhere else. Only issue the error if we came
 
104
            # via one of our buttons.
 
105
            if (cgidata.getvalue('login') or cgidata.getvalue('login-unsub')
 
106
                    or cgidata.getvalue('login-remind')):
105
107
                doc.addError(_('No address given'))
106
108
            loginpage(mlist, doc, None, language)
107
109
            print doc.Format()
419
421
        return
420
422
 
421
423
    if cgidata.has_key('changepw'):
 
424
        # Is this list admin and is list admin allowed to change passwords.
 
425
        if not (is_user_or_siteadmin
 
426
                or mm_cfg.OWNERS_CAN_CHANGE_MEMBER_PASSWORDS):
 
427
            doc.addError(_("""The list administrator may not change the
 
428
                    password for a user."""))
 
429
            options_page(mlist, doc, user, cpuser, userlang)
 
430
            print doc.Format()
 
431
            return
422
432
        newpw = cgidata.getvalue('newpw')
423
433
        confirmpw = cgidata.getvalue('confpw')
424
434
        if not newpw or not confirmpw:
797
807
    if mlist.topics:
798
808
        table = Table(border="0")
799
809
        for name, pattern, description, emptyflag in mlist.topics:
 
810
            if emptyflag:
 
811
                continue
800
812
            quotedname = urllib.quote_plus(name)
801
813
            details = Link(mlist.GetScriptURL('options') +
802
814
                           '/%s/?VARHELP=%s' % (user, quotedname),
859
871
    # Preamble
860
872
    # Set up the login page
861
873
    form = Form(actionurl)
 
874
    form.AddItem(Hidden('language', lang))
862
875
    table = Table(width='100%', border=0, cellspacing=4, cellpadding=5)
863
876
    table.AddRow([_("""In order to change your membership option, you must
864
877
    first log in by giving your %(extra)smembership password in the section