diff options
| -rw-r--r-- | bin/withlist | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/withlist b/bin/withlist index 84b2cc775..0cf795c5f 100644 --- a/bin/withlist +++ b/bin/withlist @@ -96,16 +96,16 @@ Running listaddr.requestaddr() ... mylist-request@myhost.com As another example, say you wanted to change the password for a particular -user on a particular list. You could put the following function in a file called `changepw.py': +user on a particular list. You could put the following function in a file +called `changepw.py': -import string +from Mailman.Errors import NotAMember def changepw(mlist, addr, newpasswd): - addr = string.lower(addr) - if mlist.passwords.has_key(addr): - mlist.passwords[string.lower(addr)] = newpasswd + try: + mlist.setMemberPassword(addr, newpasswd) mlist.Save() - else: + except NotAMember: print 'No address matched:', addr and run this from the command line: |
