diff options
| author | viega | 1998-06-14 01:00:28 +0000 |
|---|---|---|
| committer | viega | 1998-06-14 01:00:28 +0000 |
| commit | 73e488770ae493feeaf08ac9d21bd14eccdb2da2 (patch) | |
| tree | 950823c4949a13fcf3b3dcb82df1310bbe6be6ba /cgi/options | |
| parent | 8dfd4643c7d8216cfbf6e180ed7b868715b9e775 (diff) | |
| download | mailman-73e488770ae493feeaf08ac9d21bd14eccdb2da2.tar.gz mailman-73e488770ae493feeaf08ac9d21bd14eccdb2da2.tar.zst mailman-73e488770ae493feeaf08ac9d21bd14eccdb2da2.zip | |
Replaced with Mailman.runcgi-wrapped code that runs Mailman.Cgi.<script>
Diffstat (limited to 'cgi/options')
| -rwxr-xr-x | cgi/options | 120 |
1 files changed, 5 insertions, 115 deletions
diff --git a/cgi/options b/cgi/options index 2dcf3d666..60cabfd9d 100755 --- a/cgi/options +++ b/cgi/options @@ -16,120 +16,10 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -"""Produce user options form, from list options.html template. +import paths -Takes listname/userid in PATH_INFO, expecting an `obscured' userid. Depending -on the mm_utils.{O,Uno}bscureEmail utilities tolerance, will work fine with an -unobscured ids as well. +def options(): + import Mailman.Cgi.options -""" - -# We don't need to lock in this script, because we're never going to change -# data. - -import sys -import os, string -import paths # path hacking -import mm_utils, maillist, htmlformat, mm_cfg - -try: - sys.stderr = mm_utils.StampedLogger("error", label = 'options', - manual_reprime=1, nofail=0) -except IOError: - pass # Oh well - SOL on redirect, errors show thru. - -doc = htmlformat.HeadlessDocument() - -try: - path = os.environ['PATH_INFO'] -except KeyError: - path = "" -list_info = mm_utils.GetPathPieces(path) - -if len(list_info) < 2: - doc.AddItem(htmlformat.Header(2, "Error")) - doc.AddItem(htmlformat.Bold("Invalid options to CGI script.")) - print doc.Format() - sys.exit(0) - -list_name = string.lower(list_info[0]) -user = mm_utils.UnobscureEmail(list_info[1]) - -try: - list = maillist.MailList(list_name) -except: - 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, "Error")) - doc.AddItem(htmlformat.Bold("%s: No such list." % list_name )) - print doc.Format() - list.Unlock() - sys.exit(0) - -if string.lower(user) not in list.members + list.digest_members: - doc.AddItem(htmlformat.Header(2, "Error")) - doc.AddItem(htmlformat.Bold("%s: No such member %s." - % (list_name, `user`))) - doc.AddItem(list.GetMailmanFooter()) - print doc.Format() - list.Unlock() - sys.exit(0) - -# Re-obscure the user's address for the page banner if obscure_addresses set. -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( - mm_cfg.Digests, 1, user) -replacements['<mm-undigest-radio-button>'] = list.FormatOptionButton( - mm_cfg.Digests, 0, user) -replacements['<mm-plain-digests-button>'] = list.FormatOptionButton( - mm_cfg.DisableMime, 1, user) -replacements['<mm-mime-digests-button>'] = list.FormatOptionButton( - mm_cfg.DisableMime, 0, user) -replacements['<mm-delivery-enable-button>'] = list.FormatOptionButton( - mm_cfg.DisableDelivery, 0, user) -replacements['<mm-delivery-disable-button>'] = list.FormatOptionButton( - mm_cfg.DisableDelivery, 1, user) -replacements['<mm-disabled-notice>'] = list.FormatDisabledNotice(user) -replacements['<mm-dont-ack-posts-button>'] = list.FormatOptionButton( - mm_cfg.AcknowlegePosts, 0, user) -replacements['<mm-ack-posts-button>'] = list.FormatOptionButton( - mm_cfg.AcknowlegePosts, 1, user) -replacements['<mm-receive-own-mail-button>'] = list.FormatOptionButton( - mm_cfg.DontReceiveOwnPosts, 0, user) -replacements['<mm-dont-receive-own-mail-button>'] = list.FormatOptionButton( - mm_cfg.DontReceiveOwnPosts, 1, user) -replacements['<mm-public-subscription-button>'] = list.FormatOptionButton( - mm_cfg.ConcealSubscription, 0, user) -replacements['<mm-hide-subscription-button>'] = list.FormatOptionButton( - mm_cfg.ConcealSubscription, 1, user) - -replacements['<mm-digest-submit>'] = list.FormatButton('setdigest', - 'Submit My Changes') -replacements['<mm-unsubscribe-button>'] = list.FormatButton('unsub', 'Unsubscribe') -replacements['<mm-digest-pw-box>'] = list.FormatSecureBox('digpw') -replacements['<mm-unsub-pw-box>'] = list.FormatSecureBox('upw') -replacements['<mm-old-pw-box>'] = list.FormatSecureBox('opw') -replacements['<mm-new-pass-box>'] = list.FormatSecureBox('newpw') -replacements['<mm-confirm-pass-box>'] = list.FormatSecureBox('confpw') -replacements['<mm-change-pass-button>'] = list.FormatButton('changepw', - "Change My Password") -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 To Me') - - -doc.AddItem(list.ParseTags('options.html', replacements)) -print doc.Format() - -list.Unlock()
\ No newline at end of file +from Mailman.runcgi import * +wrap_func(options) |
