~xav0989/ubuntu/vivid/mailman/ubuntu-logo

« back to all changes in this revision

Viewing changes to Mailman/Cgi/admin.py

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2009-03-14 14:18:16 UTC
  • mfrom: (1.1.5 upstream) (2.2.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090314141816-ngrjwz59tihjh4hz
Tags: 1:2.1.12-1
* New upstream release.
  + Minimum Python version is now 2.4.
  + Patches obsoleted (incorporated or not useful anymore):
    00_stolen_from_HEAD,
    11_handle_propfind.patch,
    32_MIME_fixup,
    62_new_list_bad_pending_requests,
    67_update_handle_old_versions,
    68_update_catalan,
    78_DeprecationWarning,
    80_fix_string_search.
    Refresh all others. Many thanks to Mark Sapiro and
    Paul Wise for the help in cleaning this up.
  + Fixes bounce handling NotAMemberError (closes: #517997).
* Various packaging cleanups, upgrade debhelper to level 7.
* Removes embedded copy of pythonlib/email module.
* Checked for policy 3.8.1, remove shipped var/{run,lock}
  dirs, they are already created correctly by the init script.

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-2009 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
24
24
import os
25
25
import re
26
26
import cgi
27
 
import sha
28
27
import urllib
29
28
import signal
30
29
from types import *
31
 
from string import lowercase, digits
32
30
 
33
31
from email.Utils import unquote, parseaddr, formataddr
34
32
 
42
40
from Mailman.htmlformat import *
43
41
from Mailman.Cgi import Auth
44
42
from Mailman.Logging.Syslog import syslog
 
43
from Mailman.Utils import sha_new
45
44
 
46
45
# Set up i18n
47
46
_ = i18n._
853
852
    container.AddItem(header)
854
853
    # Add a "search for member" button
855
854
    table = Table(width='100%')
856
 
    link = Link('http://www.python.org/doc/current/lib/re-syntax.html',
 
855
    link = Link('http://docs.python.org/library/re.html'
 
856
                '#regular-expression-syntax',
857
857
                _('(help)')).Format()
858
858
    table.AddRow([Label(_('Find member %(link)s:')),
859
859
                  TextBox('findmember',
901
901
        qsenviron = os.environ.get('QUERY_STRING')
902
902
        if qsenviron:
903
903
            qs = cgi.parse_qs(qsenviron)
904
 
            bucket = qs.get('letter', 'a')[0].lower()
905
 
            if bucket not in digits + lowercase:
906
 
                bucket = None
 
904
            bucket = qs.get('letter', '0')[0].lower()
 
905
        keys = buckets.keys()
 
906
        keys.sort()
907
907
        if not bucket or not buckets.has_key(bucket):
908
 
            keys = buckets.keys()
909
 
            keys.sort()
910
908
            bucket = keys[0]
911
909
        members = buckets[bucket]
912
910
        action = adminurl + '/members?letter=%s' % bucket
942
940
    # Add the alphabetical links
943
941
    if bucket:
944
942
        cells = []
945
 
        for letter in digits + lowercase:
946
 
            if not buckets.get(letter):
947
 
                continue
948
 
            url = adminurl + '/members?letter=%s' % letter
 
943
        for letter in keys:
 
944
            findfrag = ''
 
945
            if regexp:
 
946
                findfrag = '&findmember=' + urllib.quote(regexp)
 
947
            url = adminurl + '/members?letter=' + letter + findfrag
949
948
            if letter == bucket:
950
949
                show = Bold('[%s]' % letter.upper()).Format()
951
950
            else:
1274
1273
    confirm = cgidata.getvalue('confirmmodpw', '').strip()
1275
1274
    if new or confirm:
1276
1275
        if new == confirm:
1277
 
            mlist.mod_password = sha.new(new).hexdigest()
 
1276
            mlist.mod_password = sha_new(new).hexdigest()
1278
1277
            # No re-authentication necessary because the moderator's
1279
1278
            # password doesn't get you into these pages.
1280
1279
        else:
1284
1283
    confirm = cgidata.getvalue('confirmpw', '').strip()
1285
1284
    if new or confirm:
1286
1285
        if new == confirm:
1287
 
            mlist.password = sha.new(new).hexdigest()
 
1286
            mlist.password = sha_new(new).hexdigest()
1288
1287
            # Set new cookie
1289
1288
            print mlist.MakeCookie(mm_cfg.AuthListAdmin)
1290
1289
        else: