diff options
| author | klm | 1998-03-08 17:15:39 +0000 |
|---|---|---|
| committer | klm | 1998-03-08 17:15:39 +0000 |
| commit | cc6a86b59b0546ed3ffe3d65e155981b9a8e5d88 (patch) | |
| tree | 885ae5750c7bb33fe8b6a0453356e6abd2d4b594 | |
| parent | be9208323119b21d3fc03e895da42c8440f1f02f (diff) | |
| download | mailman-cc6a86b59b0546ed3ffe3d65e155981b9a8e5d88.tar.gz mailman-cc6a86b59b0546ed3ffe3d65e155981b9a8e5d88.tar.zst mailman-cc6a86b59b0546ed3ffe3d65e155981b9a8e5d88.zip | |
Respect obscured addresses for user identity, as well as unobscured
ones (as long as mm_utils.UnobscureEmail() works like an identity
function on not-obscured email addrs).
Also, set replacement <mm-presentable-user> to the obscured address if
address obscuring is on. (Used by options.html.)
NOTE that the maillist administrator's address is never obscured.
Maillist administrators will have to either present the maillist-owner
address as their admin addr, or otherwise protect themselves if they
wish.
Remove redirection of stderr to file - the script would fail if the
file already existed and was unwritable. (It may make sense to have
a logging mechanism like LogMsg, but working like a file object, for
this purpose...)
Add a module docstring.
| -rwxr-xr-x | cgi/options | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/cgi/options b/cgi/options index f95c4bb62..e2d157241 100755 --- a/cgi/options +++ b/cgi/options @@ -1,9 +1,15 @@ #!/usr/local/bin/python -# We don't need to lock in this script, because we're never going to change data. + +"""Faculty for editing user options. + +Takes listname/userid in PATH_INFO, expecting an "obscured" userid. But +depending on the tolerance of the mm_utils.{O,Uno}bscureEmail utilities may +work fine with an unobscured ids as well.""" + +# We don't need to lock in this script, because we're never going to change +# data. import sys, os, string -f = open('/tmp/options.errs', 'a+') -sys.stderr = f # sys.stdout sys.path.append('/home/mailman/mailman/modules') import mm_utils, maillist, htmlformat, mm_cfg @@ -18,7 +24,7 @@ if len(list_info) < 2: sys.exit(0) list_name = string.lower(list_info[0]) -user = list_info[1] +user = mm_utils.UnobscureEmail(list_info[1]) try: list = maillist.MailList(list_name) @@ -32,6 +38,10 @@ if not list._ready: print doc.Format() sys.exit(0) +if list.obscure_addresses: + presentable_user = mm_utils.ObscureEmail(user, for_text=1) +else: + presentable_user = user replacements = list.GetStandardReplacements() replacements['<mm-digest-radio-button>'] = list.FormatOptionButton( @@ -69,6 +79,7 @@ replacements['<mm-confirm-pass-box>'] = list.FormatSecureBox('confpw') replacements['<mm-change-pass-button>'] = list.FormatButton('changepw') replacements['<mm-form-start>'] = list.FormatFormStart('handle_opts', user) replacements['<mm-user>'] = user +replacements['<mm-presentable-user>'] = presentable_user replacements['<mm-email-my-pw>'] = list.FormatButton('emailpw', 'Email my password') doc.AddItem(list.ParseTags('options.html', replacements)) |
