Mercurial > public > src > moin > 1.9
diff MoinMoin/user.py @ 5917:c99f570e274a
moin account resetpw: make password optional, to be able to set a invalid password
this is needed for resetting a password (or many passwords) so that the user is
not able to login, but just to recover using password recovery.
author | Thomas Waldmann <tw AT waldmann-edv DOT de> |
---|---|
date | Thu, 17 Jan 2013 22:39:00 +0100 |
parents | 19e8a1c50bda |
children | 5126fadbf24f |
line wrap: on
line diff
--- a/MoinMoin/user.py Wed Jan 16 16:16:42 2013 +0100 +++ b/MoinMoin/user.py Thu Jan 17 22:39:00 2013 +0100 @@ -183,7 +183,11 @@ elif uname: u = User(request, None, uname) if u and u.exists(): - u.enc_password = encodePassword(newpass) + if not newpass: + # set a invalid password hash + u.enc_password = '' + else: + u.enc_password = encodePassword(newpass) u.save() if notify and not u.disabled and u.email: mailok, msg = u.mailAccountData()