diff options
| author | klm | 1998-07-12 03:02:19 +0000 |
|---|---|---|
| committer | klm | 1998-07-12 03:02:19 +0000 |
| commit | 262e7302dc79352e1dc3c2ebfb4fe80803a5b835 (patch) | |
| tree | 3c91f57740bdcbc2e848cdcb1a151dc44eab2cb9 | |
| parent | f5f5650d2ec697ea7da5d11f55728bb53968a18b (diff) | |
| download | mailman-262e7302dc79352e1dc3c2ebfb4fe80803a5b835.tar.gz mailman-262e7302dc79352e1dc3c2ebfb4fe80803a5b835.tar.zst mailman-262e7302dc79352e1dc3c2ebfb4fe80803a5b835.zip | |
Recognize and refuse, in an informative way, subscription requests for
already-subscribed members.
(Wrapped a couple of long lines.)
| -rw-r--r-- | Mailman/Cgi/subscribe.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Mailman/Cgi/subscribe.py b/Mailman/Cgi/subscribe.py index 92a0d2f31..57dfb379a 100644 --- a/Mailman/Cgi/subscribe.py +++ b/Mailman/Cgi/subscribe.py @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -"""Process listinfo form submission, ie subscriptions or roster requests.""" +"""Process subscription or roster requests from listinfo form.""" import sys import os, cgi, string @@ -71,17 +71,20 @@ def main(): if (form.has_key("UserOptions") or (form.has_key("info") and not form.has_key("email"))): + # Go to user options section. + if not form.has_key("info"): doc.AddItem(htmlformat.Header(2, "Error")) - doc.AddItem(htmlformat.Bold("You must supply your email address.")) + doc.AddItem( + htmlformat.Bold("You must supply your email address.")) doc.AddItem(list.GetMailmanFooter()) print doc.Format() list.Unlock() sys.exit(0) addr = form['info'].value member = list.FindUser(addr) - if not list.FindUser(addr): + if not member: doc.AddItem(htmlformat.Header(2, "Error")) doc.AddItem(htmlformat.Bold("%s has no subscribed addr <i>%s</i>." % (list.real_name, addr))) @@ -97,7 +100,8 @@ def main(): email = form["email"].value if not form.has_key("pw") or not form.has_key("pw-conf"): error = 1 - results = results + "You must supply a valid password, and confirm it.<br>" + results = (results + + "You must supply a valid password, and confirm it.<br>") else: pw = form["pw"].value pwc = form["pw-conf"].value @@ -120,6 +124,8 @@ def main(): else: try: + if list.FindUser(email): + raise Errors.MMAlreadyAMember results = results + ("Confirmation from your email address is " "required, to prevent anyone from covertly " "subscribing you. Instructions are being " |
