From ad162a782b8f5b850fb34736f516b473528af51f Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 25 Mar 2012 15:14:58 -0700 Subject: Backported the password reminder from private archive login feature from the 2.2 branch. --- Mailman/Cgi/private.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'Mailman/Cgi/private.py') diff --git a/Mailman/Cgi/private.py b/Mailman/Cgi/private.py index b0358285..6eb40943 100644 --- a/Mailman/Cgi/private.py +++ b/Mailman/Cgi/private.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2011 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2012 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 @@ -135,6 +135,27 @@ def main(): message = Bold(FontSize('+1', _('Authorization failed.'))).Format() # give an HTTP 401 for authentication failure print 'Status: 401 Unauthorized' + # Are we processing a password reminder from the login screen? + if cgidata.has_key('login-remind'): + if username: + message = Bold(FontSize('+1', _("""If you are a list member, + your password has been emailed to you."""))).Format() + else: + message = Bold(FontSize('+1', + _('Please enter your email address'))).Format() + if mlist.isMember(username): + mlist.MailUserPassword(username) + elif username: + # Not a member + if mlist.private_roster == 0: + # Public rosters + safeuser = Utils.websafe(username) + message = Bold(FontSize('+1', + _('No such member: %(safeuser)s.'))).Format() + else: + syslog('mischief', + 'Reminder attempt of non-member w/ private rosters: %s', + username) # Output the password form charset = Utils.GetCharSet(mlist.preferred_language) print 'Content-type: text/html; charset=' + charset + '\n\n' -- cgit v1.2.3