aboutsummaryrefslogtreecommitdiffstats
path: root/bin/reset_pw
diff options
context:
space:
mode:
authorbwarsaw <>2004-12-30 23:41:09 +0000
committerbwarsaw <>2004-12-30 23:41:09 +0000
commite6402e44036af0529a35ff6e81cfc3108c1a96e1 (patch)
tree2c71c44668e13aa8155b7aed8f5b25c16af74616 /bin/reset_pw
parent43ccbb2caa517b891b99f307ab3e5cb66bc94555 (diff)
downloadmailman2-e6402e44036af0529a35ff6e81cfc3108c1a96e1.tar.gz
mailman2-e6402e44036af0529a35ff6e81cfc3108c1a96e1.tar.xz
mailman2-e6402e44036af0529a35ff6e81cfc3108c1a96e1.zip
Renamed reset_pw to reset_pw.py so that the file looks like a Python module.
This goes hand-in-hand with one of two changes to withlist. Now, withlist puts the directory it's found in on the end of sys.path. This way it's much easier to run withlist scripts that live in bin. The other change allows running withlist w/o a list name, but only if -i is given. Makes it easier to debug various non-list related parts of Mailman.
Diffstat (limited to 'bin/reset_pw')
-rw-r--r--bin/reset_pw86
1 files changed, 0 insertions, 86 deletions
diff --git a/bin/reset_pw b/bin/reset_pw
deleted file mode 100644
index d7e5527a..00000000
--- a/bin/reset_pw
+++ /dev/null
@@ -1,86 +0,0 @@
-#! @PYTHON@
-#
-# Copyright (C) 2004 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
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# Inspired by Florian Weimer.
-
-"""Reset the passwords for members of a mailing list.
-
-This script resets all the passwords of a mailing list's members. It can also
-be used to reset the lists of all members of all mailing lists, but it is your
-responsibility to let the users know that their passwords have been changed.
-
-This script is intended to be run as a bin/withlist script, i.e.
-
-% bin/withlist -l -r reset_pw [options]
-
-Options:
- -v / --verbose
- Print what the script is doing.
-"""
-
-import sys
-import getopt
-
-import paths
-from Mailman import Utils
-from Mailman.i18n import _
-
-
-try:
- True, False
-except NameError:
- True = 1
- False = 0
-
-
-
-def usage(code, msg=''):
- if code:
- fd = sys.stderr
- else:
- fd = sys.stdout
- print >> fd, _(__doc__.replace('%', '%%'))
- if msg:
- print >> fd, msg
- sys.exit(code)
-
-
-
-def reset_pw(mlist, *args):
- try:
- opts, args = getopt.getopt(args, 'v', ['verbose'])
- except getopt.error, msg:
- usage(1, msg)
-
- verbose = False
- for opt, args in opts:
- if opt in ('-v', '--verbose'):
- verbose = True
-
- listname = mlist.listname()
- if verbose:
- print _('Changing passwords for list: %(listname)s')
-
- for member in mlist.getMembers():
- randompw = Utils.MakeRandomPassword()
- mlist.setMemberPassword(member, randompw)
-
-
-
-if __name__ == '__main__':
- usage(0)