diff options
| author | bwarsaw | 2001-05-09 06:33:55 +0000 |
|---|---|---|
| committer | bwarsaw | 2001-05-09 06:33:55 +0000 |
| commit | 6dd7546dd5ae49b87f8b4a85269a604557bf7d25 (patch) | |
| tree | 7f7018b8d1598c63bfb0970e1f958a5779214a2f | |
| parent | e4a3a0e44202e07665c6dc84fcaf16951372095b (diff) | |
| download | mailman-6dd7546dd5ae49b87f8b4a85269a604557bf7d25.tar.gz mailman-6dd7546dd5ae49b87f8b4a85269a604557bf7d25.tar.zst mailman-6dd7546dd5ae49b87f8b4a85269a604557bf7d25.zip | |
Add the -c/--listcreator option which sets the global "list creator's"
password, used to create mailing lists through the web.
| -rwxr-xr-x | bin/mmsitepass | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/bin/mmsitepass b/bin/mmsitepass index 7f88ffa65..c6d1aad71 100755 --- a/bin/mmsitepass +++ b/bin/mmsitepass @@ -1,6 +1,6 @@ #! /usr/bin/env python # -# Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc. +# Copyright (C) 1998,1999,2000,2001 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 @@ -26,6 +26,11 @@ Usage: %(PROGRAM)s [options] [password] Options: + -c/--listcreator + Set the list creator password instead of the site password. The list + creator is authorized to create and remove lists, but does not have + the total power of the site administrator. + -h/--help Print this help message and exit. @@ -54,19 +59,27 @@ def usage(code, msg=''): def main(): try: - opts, args = getopt.getopt(sys.argv[1:], 'h', ['help']) + opts, args = getopt.getopt(sys.argv[1:], 'ch', + ['listcreator', 'help']) except getopt.error, msg: usage(1, msg) + # Defaults + siteadmin = 1 + pwdesc = _('site') + for opt, arg in opts: if opt in ('-h', '--help'): usage(0) + elif opt in ('-c', '--listcreator'): + siteadmin = 0 + pwdesc = _('list creator') if len(args) == 1: pw1 = args[0] else: try: - pw1 = getpass.getpass(_('New Password: ')) + pw1 = getpass.getpass(_('New %(pwdesc)s Password: ')) pw2 = getpass.getpass(_('Again to confirm password: ')) if pw1 <> pw2: print _('Passwords do not match; no changes made.') @@ -76,8 +89,8 @@ def main(): sys.exit(0) # Set the site password by writing it to a local file. Make sure the # permissions don't allow other+read. - Utils.SetSiteAdminPassword(pw1) - if Utils.CheckSiteAdminPassword(pw1): + Utils.set_global_password(pw1, siteadmin) + if Utils.check_global_password(pw1, siteadmin): print _('Password changed.') else: print _('Password change failed.') |
