diff options
| author | viega | 1998-06-03 12:53:59 +0000 |
|---|---|---|
| committer | viega | 1998-06-03 12:53:59 +0000 |
| commit | 224da5d716292811316af847876cc5435ebf1ef2 (patch) | |
| tree | fafa5b4100356704869cf792db5e22d51281f01d /cgi | |
| parent | f02a5291795a08219d1bac8a898ac78c687710ea (diff) | |
| download | mailman-224da5d716292811316af847876cc5435ebf1ef2.tar.gz mailman-224da5d716292811316af847876cc5435ebf1ef2.tar.zst mailman-224da5d716292811316af847876cc5435ebf1ef2.zip | |
Updated calls to GetScriptURL to the appropriate new form. One or two
minor changes here and there to support relative paths (changing
absolute paths that didn't use GetScriptURL to begin with).
Diffstat (limited to 'cgi')
| -rwxr-xr-x | cgi/admin | 40 | ||||
| -rwxr-xr-x | cgi/admindb | 6 | ||||
| -rwxr-xr-x | cgi/edithtml | 6 | ||||
| -rwxr-xr-x | cgi/listinfo | 8 |
4 files changed, 29 insertions, 31 deletions
@@ -21,7 +21,7 @@ To run stand-alone for debugging, set env var PATH_INFO to name of list and, optionally, options category.""" -__version__ = "$Revision: 687 $" +__version__ = "$Revision: 690 $" import sys import os, cgi, string, crypt, types, time @@ -91,10 +91,6 @@ def isAuthenticated(list, password=None, SECRET="SECRET"): cookie_key = list_name + "-admin" c[cookie_key] = token c[cookie_key]['expires'] = mm_cfg.ADMIN_COOKIE_LIFE - path = list.GetScriptURL("admin") - path = path[string.find(path, "://") + 3:] - path = path[string.find(path, "/"):] - c[cookie_key]["path"] = path print c # Output the cookie return 1 if os.environ.has_key('HTTP_COOKIE'): @@ -102,9 +98,10 @@ def isAuthenticated(list, password=None, SECRET="SECRET"): if c.has_key(list_name + "-admin"): try: inp = base64.decodestring(c[list_name + "-admin"].value) + check = md5.new(SECRET+list_name+SECRET).digest() except Error: # the decodestring may return incorrect padding? + raise 'Decode failed' return 0 - check = md5.new(SECRET+list_name+SECRET).digest() if inp == check: return 1 else: @@ -125,6 +122,7 @@ def main(): except KeyError: path = "" list_info = mm_utils.GetPathPieces(path) + # How many ../'s we need to get back to http://host/mailman if len(list_info) == 0: FormatAdminOverview() @@ -253,8 +251,8 @@ def FormatAdminOverview(error=None): % ((error and "the right ") or "")) + " General list information can be found at ", - Link(os.path.join(mm_cfg.DEFAULT_URL, "listinfo/"), - "the maillist overview page"), + Link(os.path.join('../'* mm_utils.GetNestingLevel(), + "listinfo/"), "the maillist overview page"), "." "<p>(Send questions and comments to ", Link("mailto:%s" % mm_cfg.MAILMAN_OWNER, @@ -269,8 +267,8 @@ def FormatAdminOverview(error=None): if advertised: table.AddRow([Italic("List"), Italic("Description")]) for l in advertised: - table.AddRow([Link(l.GetScriptURL('admin'), Bold(l.real_name)), - l.description]) + table.AddRow([Link(l.GetRelativeScriptURL('admin'), + Bold(l.real_name)),l.description]) doc.AddItem(table) @@ -291,13 +289,13 @@ def FormatConfiguration(doc, lst, category, category_suffix): links_table.AddRow([Center(Bold("Configuration Categories")), Center(Bold("Other Administrative Activities"))]) other_links = UnorderedList() - link = Link(lst.GetScriptURL('admindb'), + link = Link(lst.GetRelativeScriptURL('admindb'), 'Tend to pending administrative requests.') other_links.AddItem(link) - link = Link(lst.GetScriptURL('listinfo'), + link = Link(lst.GetRelativeScriptURL('listinfo'), 'Go to the general list information page.') other_links.AddItem(link) - link = Link(lst.GetScriptURL('edithtml'), + link = Link(lst.GetRelativeScriptURL('edithtml'), 'Edit the HTML for the public list pages.') other_links.AddItem(link) @@ -306,8 +304,8 @@ def FormatConfiguration(doc, lst, category, category_suffix): if k == category: these_links.AddItem("<b> => " + v + " <= </b>") else: - these_links.AddItem(Link("%s/%s" % (lst.GetScriptURL('admin'),k), - v)) + these_links.AddItem(Link("%s/%s" % + (lst.GetRelativeScriptURL('admin'),k),v)) links_table.AddRow([these_links, other_links]) links_table.AddRowInfo(max(links_table.GetCurrentRowIndex(), 0), @@ -316,10 +314,10 @@ def FormatConfiguration(doc, lst, category, category_suffix): doc.AddItem(links_table) doc.AddItem('<hr>') if category_suffix: - form = Form("%s/%s" % (lst.GetScriptURL('admin'), + form = Form("%s/%s" % (lst.GetRelativeScriptURL('admin'), category_suffix)) else: - form = Form(lst.GetScriptURL('admin')) + form = Form(lst.GetRelativeScriptURL('admin')) doc.AddItem(form) form.AddItem("Make your changes, below, and then submit it all at the" @@ -434,7 +432,7 @@ def FormatOptionHelp(doc, varref, lst): doc.AddItem("<b>%s</b> (%s): %s<p>" % (varname, category, item[4])) doc.AddItem("%s<p>" % item[5]) - form = Form(os.path.join(lst.GetScriptURL('admin'), category)) + form = Form(os.path.join(lst.GetRelativeScriptURL('admin'), category)) valtab = Table(cellspacing=3, cellpadding=4) AddOptionsTableItem(valtab, item, category, lst, nodetails=1) form.AddItem(valtab) @@ -490,10 +488,10 @@ def GetItemGuiDescr(lst, category, varname, descr, elaboration, nodetails): elaboration if any.""" descr = '<div ALIGN="right">' + descr if not nodetails and elaboration: - if len(list_info) == 1: - ref = list_name + "/" + if mm_utils.GetNestingLevel() == 1: + ref = "../" + list_name + "/" else: - ref = "" + ref = "../" ref = ref + '?VARHELP=' + category + "/" + varname descr = Container(descr, Link(ref, " (Details)", target="MMHelp"), diff --git a/cgi/admindb b/cgi/admindb index c027dc16a..caefc4e27 100755 --- a/cgi/admindb +++ b/cgi/admindb @@ -35,12 +35,12 @@ doc = htmlformat.Document() path = os.environ['PATH_INFO'] list_info = mm_utils.GetPathPieces(path) + if len(list_info) < 1: doc.SetTitle("Admindb Error") doc.AddItem(htmlformat.Header(2, "Invalid options to CGI script.")) print doc.Format(bgcolor="#ffffff") sys.exit(0) - list_name = string.lower(list_info[0]) try: @@ -176,14 +176,14 @@ def PrintRequests(doc): doc.AddItem(htmlformat.Header(2, "Administrative requests for " "'%s' mailing list" % list.real_name)) doc.AddItem(htmlformat.FontSize("+1", htmlformat.Link( - list.GetScriptURL('admin'), htmlformat.Italic( + list.GetRelativeScriptURL('admin'), htmlformat.Italic( 'View or edit the list configuration information')))) doc.AddItem('<p><hr>') if not list.RequestsPending(): doc.AddItem(htmlformat.Header(3,'There are no pending requests.')) doc.AddItem(list.GetMailmanFooter()) return - form = htmlformat.Form(list.GetScriptURL('admindb')) + form = htmlformat.Form(list.GetRelativeScriptURL('admindb')) doc.AddItem(form) form.AddItem('Admin password: ') form.AddItem(htmlformat.PasswordBox('adminpw')) diff --git a/cgi/edithtml b/cgi/edithtml index 3c4fe3887..f2c5264d0 100755 --- a/cgi/edithtml +++ b/cgi/edithtml @@ -90,7 +90,7 @@ else: doc.AddItem(htmlformat.Header(2, 'Select page to edit:')) template_list = htmlformat.UnorderedList() for (template, info) in template_data: - l = htmlformat.Link(os.path.join(list.GetScriptURL('edithtml'), + l = htmlformat.Link(os.path.join(list.GetRelativeScriptURL('edithtml'), template), info) template_list.AddItem(l) @@ -106,14 +106,14 @@ def FormatHTML(doc): doc.AddItem('<hr>') - link = htmlformat.Link(list.GetScriptURL('admin'), + link = htmlformat.Link(list.GetRelativeScriptURL('admin'), 'View or edit the list configuration information.') doc.AddItem(htmlformat.FontSize("+1", link)) doc.AddItem('<p>') doc.AddItem('<hr>') - form = htmlformat.Form(os.path.join(list.GetScriptURL('edithtml'), + form = htmlformat.Form(os.path.join(list.GetRelativeScriptURL('edithtml'), template_name)) doc.AddItem(form) diff --git a/cgi/listinfo b/cgi/listinfo index a563bd2f8..a51e77fb7 100755 --- a/cgi/listinfo +++ b/cgi/listinfo @@ -127,8 +127,8 @@ def FormatListinfoOverview(error=None): % ((error and "right ") or "")) + '<p> List administrators, you can visit ', - Link(os.path.join(mm_cfg.DEFAULT_URL, 'admin/'), - "the list admin overview page"), + Link(os.path.join('../' * mm_utils.GetNestingLevel(), + 'admin/'), "the list admin overview page"), " to find the management interface for your list." "<p>(Send questions or comments to ", Link("mailto:%s" % mm_cfg.MAILMAN_OWNER, @@ -141,8 +141,8 @@ def FormatListinfoOverview(error=None): if advertised: table.AddRow([Italic("List"), Italic("Description")]) for l in advertised: - table.AddRow([Link(l.GetScriptURL('listinfo'), Bold(l.real_name)), - l.description]) + table.AddRow([Link(l.GetRelativeScriptURL('listinfo'), + Bold(l.real_name)), l.description]) doc.AddItem(table) |
