summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorklm1998-03-30 04:56:20 +0000
committerklm1998-03-30 04:56:20 +0000
commite69a9f61fb1c64caadb7c27979c2cfd74bdec750 (patch)
treee55e4a9d600af505c0e3094c436d31ca997a22e1
parent35e89a4cebd8865e63c47ca41d89bf530b1b12f2 (diff)
downloadmailman-e69a9f61fb1c64caadb7c27979c2cfd74bdec750.tar.gz
mailman-e69a9f61fb1c64caadb7c27979c2cfd74bdec750.tar.zst
mailman-e69a9f61fb1c64caadb7c27979c2cfd74bdec750.zip
Check user against .members *and* .digest_members!
Using StampedLogger (to logs/error) for stderr, for debugging. Changed error notices to have a header "Error" and a body describing the problem. Added a (modest) module doc string, wrapped some long lines, etc.
-rwxr-xr-xcgi/handle_opts32
1 files changed, 22 insertions, 10 deletions
diff --git a/cgi/handle_opts b/cgi/handle_opts
index a29cb2463..f262c1949 100755
--- a/cgi/handle_opts
+++ b/cgi/handle_opts
@@ -1,10 +1,18 @@
#!/usr/local/bin/python
-import sys, os, cgi, string
-sys.stderr = sys.stdout
+"""Process input to user options form."""
+
+import sys
sys.path.append('/home/mailman/mailman/modules')
+import os, cgi, string
import mm_utils, maillist, mm_err, mm_cfg, htmlformat
+try:
+ sys.stderr = mm_utils.StampedLogger("error", label = 'handle_opts',
+ manual_reprime=1)
+except IOError:
+ pass # Oh well - SOL on redirect, errors show thru.
+
doc = htmlformat.Document()
@@ -12,7 +20,8 @@ path = os.environ['PATH_INFO']
list_info = mm_utils.GetPathPieces(path)
if len(list_info) < 2:
- doc.AddItem(htmlformat.Header(2, "Invalid options to CGI script."))
+ doc.AddItem(htmlformat.Header(2, "Error"))
+ doc.AddItem(htmlformat.Bold("Invalid options to CGI script."))
print doc.Format()
sys.exit(0)
@@ -20,19 +29,22 @@ list_name = string.lower(list_info[0])
user = list_info[1]
if len(list_info) < 2:
- doc.AddItem(htmlformat.Header(2, "Invalid options to CGI script."))
+ doc.AddItem(htmlformat.Header(2, "Error"))
+ doc.AddItem(htmlformat.Bold("Invalid options to CGI script."))
print doc.Format()
sys.exit(0)
try:
list = maillist.MailList(list_name)
except:
- doc.AddItem(htmlformat.Header(2, "%s: No such list." % list_name))
+ doc.AddItem(htmlformat.Header(2, "Error"))
+ doc.AddItem(htmlformat.Bold("%s: No such list." % list_name))
print doc.Format()
sys.exit(0)
if not list._ready:
- doc.AddItem(htmlformat.Header(2, "%s: No such list." % list_name))
+ doc.AddItem(htmlformat.Header(2, "Error"))
+ doc.AddItem(htmlformat.Bold("%s: No such list." % list_name))
print doc.Format()
sys.exit(0)
@@ -48,14 +60,12 @@ def PrintResults(results):
list.Unlock()
sys.exit(0)
-
form = cgi.FieldStorage()
error = 0
operation = ""
-
-if string.lower(user) not in list.members:
+if string.lower(user) not in list.members + list.digest_members:
PrintResults("%s not a member!<p>" % user)
if form.has_key("unsub"):
@@ -116,7 +126,9 @@ exactly what you did to get this error.<p>''' % (mm_cfg.MAILMAN_OWNER, mm_cfg.MA
PrintResults("Your password has been changed.")
else:
- PrintResults("You must supply your old password, and your new password twice.")
+ PrintResults("You must supply your old password,"
+ " and your new password twice.")
+
else:
# If keys don't exist, set them to whatever they were. (essentially a noop)
if form.has_key("digest"):