diff options
| author | klm | 1998-12-17 01:29:31 +0000 |
|---|---|---|
| committer | klm | 1998-12-17 01:29:31 +0000 |
| commit | e7575ce3c09f2b169debab93594144503da94134 (patch) | |
| tree | ea31bc97e3db2d5edf77c5d05920fa9c73da6f0d /Mailman | |
| parent | 1e27f92f6b5b331d39b71d0849c60ace9c330f14 (diff) | |
| download | mailman-e7575ce3c09f2b169debab93594144503da94134.tar.gz mailman-e7575ce3c09f2b169debab93594144503da94134.tar.zst mailman-e7575ce3c09f2b169debab93594144503da94134.zip | |
We needed *something* by which people can determine the lists they
subscribe to. I'm adding a button on the user options page that they
can click, as long as they provide their password, to get to a page of
links to the options pages for all their subscriptions on the current
system. It's not very pretty (options.py and handle_options.py are
even more packed with miscellaneous stuff, and the page they go to is
extremely unrefined), but i think it's not bad for an hour hack, and
is needed.
(The password protection is necessary since the user options page is
visible to anyone, and not having a password would give away the list
of private subscriptions.)
Diffstat (limited to 'Mailman')
| -rw-r--r-- | Mailman/Cgi/handle_opts.py | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/Mailman/Cgi/handle_opts.py b/Mailman/Cgi/handle_opts.py index 6156038d5..226b66611 100644 --- a/Mailman/Cgi/handle_opts.py +++ b/Mailman/Cgi/handle_opts.py @@ -121,14 +121,50 @@ def main(): # mm_cfg.MAILMAN_OWNER)) PrintResults("You have been unsubscribed.<p>") + + elif form.has_key("emailpw"): try: list.MailUserPassword(user) PrintResults("A reminder of your password " "has been emailed to you.<p>") except Errors.MMBadUserError: - PrintResults("Your password entry has not been found. The list " - "manager is being notified.<p>") + PrintResults("Your password entry has not been found. The" + " list administrator is being notified.<p>") + + + elif form.has_key("othersubs"): + if not form.has_key('othersubspw'): + PrintResults("You must specify your password.") + else: + try: + list.ConfirmUserPassword(user, form['othersubspw'].value) + except Errors.MMListNotReady: + PrintResults("The list is currently not functional.") + except Errors.MMNotAMemberError: + PrintResults("You seem to no longer be a list member.") + except Errors.MMBadPasswordError: + PrintResults("Incorrect password.") + except: + PrintResults('''An unknown error occured. <p> +Please send mail to <a href=%s>%s</a> explaining +exactly what happened to provoke this error.<p>''' + % (mm_cfg.MAILMAN_OWNER, mm_cfg.MAILMAN_OWNER)) + + doc.AddItem(htmlformat.Header(2, + "List Subscriptions for %s on %s" + % (user, list.host_name))) + def optionslinks(l, user=user): + if l.IsMember(user): + link = htmlformat.Link(l.GetAbsoluteOptionsURL(user), + l.real_name) + return link + all_links = filter(None, Utils.map_maillists(optionslinks)) + items = htmlformat.UnorderedList() + for i in all_links: + items.AddItem(i) + doc.AddItem(items) + print doc.Format(bgcolor="#ffffff") elif form.has_key("changepw"): if (form.has_key('opw') @@ -140,7 +176,7 @@ def main(): form['newpw'].value, form['confpw'].value) except Errors.MMListNotReady: - PrintResults("The list is currently not funcitonal.") + PrintResults("The list is currently not functional.") except Errors.MMNotAMemberError: PrintResults("You seem to no longer be a list member.") except Errors.MMBadPasswordError: @@ -155,7 +191,7 @@ exactly what happened to provoke this error.<p>''' PrintResults("Your password has been changed.") else: - PrintResults("You must supply your old password," + PrintResults("You must specify your old password," " and your new password twice.") else: |
