From 224da5d716292811316af847876cc5435ebf1ef2 Mon Sep 17 00:00:00 2001 From: viega Date: Wed, 3 Jun 1998 12:53:59 +0000 Subject: 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). --- cgi/admin | 40 +++++++++++++++++++--------------------- cgi/admindb | 6 +++--- cgi/edithtml | 6 +++--- cgi/listinfo | 8 ++++---- 4 files changed, 29 insertions(+), 31 deletions(-) (limited to 'cgi') diff --git a/cgi/admin b/cgi/admin index e9a096933..31640ef87 100755 --- a/cgi/admin +++ b/cgi/admin @@ -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"), "." "
(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(" => " + v + " <= ") 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('
" % (varname, category, item[4])) doc.AddItem("%s
" % 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 = '
') doc.AddItem('
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." "
(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) -- cgit v1.3.1