summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorbwarsaw1998-05-26 18:09:14 +0000
committerbwarsaw1998-05-26 18:09:14 +0000
commit4d4705fac5cd8f4e8aa45265271c725364cc0a29 (patch)
tree535dc7394ec0f5822faf44469c62e4923acf0490 /cgi
parentc80e942eddb60094a87c07eabc901ad4c8af3598 (diff)
downloadmailman-4d4705fac5cd8f4e8aa45265271c725364cc0a29.tar.gz
mailman-4d4705fac5cd8f4e8aa45265271c725364cc0a29.tar.zst
mailman-4d4705fac5cd8f4e8aa45265271c725364cc0a29.zip
1. Use the standard Python invocation #! line to get the interpreter
from $PATH 2. Do no direct sys.path munging in this file. Import the `paths' module, which is created during the configure process, and which performs all necessary path munging (and exports some useful variables too). 3. Remove RCS crud Also: Rewrote PAGE TQS to use ''' instead of """ so that embedded "s don't mess up font-lock. Also, name_pat looks broken to me. I think there are some quotes missing around each component, but since I don't yet know what name_pat does, I haven't modified this. I have left a potentially better rewrite in comments just following.
Diffstat (limited to 'cgi')
-rwxr-xr-xcgi/private30
1 files changed, 20 insertions, 10 deletions
diff --git a/cgi/private b/cgi/private
index a91e4d35a..72d5c6031 100755
--- a/cgi/private
+++ b/cgi/private
@@ -1,4 +1,5 @@
-#!/usr/local/bin/python -u
+#! /usr/bin/env python -u
+#
# Copyright (C) 1998 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
@@ -26,15 +27,9 @@ subscribers.
executables are).
"""
-__version__ = "$Revision: 547 $"
-
import sys, os, string, re
-
-sys.path.append( os.path.expanduser('~mailman/mailman/modules/') )
-
+import paths # path hacking
import maillist, mm_err, mm_utils
-
-sys.path.append('.')
import Cookie
sys.stderr = sys.stdout
@@ -42,7 +37,7 @@ sys.stderr = sys.stdout
ROOT = "/local/pipermail/private/"
SECRET = "secret" # XXX used for hashing
-PAGE = """
+PAGE = '''
<html>
<head>
<title>%(listname)s Private Archives Authentication</title>
@@ -74,11 +69,12 @@ PAGE = """
</tr>
</TABLE>
</FORM>
-"""
+'''
login_attempted = 0
_list = None
+# XXX: This looks broken, should investigate
name_pat = re.compile(r"""
(?: / (?: \d{4} q \d\. )? # Match "/", and, optionally, 1998q1."
( [^/]* ) /? # The SIG name
@@ -92,6 +88,20 @@ name_pat = re.compile(r"""
)
""", re.VERBOSE)
+# " XXX: Emacs turd
+# the following is a potentially better rewrite
+
+## name_pat = re.compile(
+## r'(?: / (?: \d{4} q \d\. )?' # Match "/", and, optionally, 1998q1."
+## r'( [^/]* ) /?' # The SIG name
+## r'/[^/]*$' # The trailing 12345.html portion
+## r') | (?:'
+## r'/ ( [^/.]* )' # Match matrix-sig
+## r'(?:\.html)?' # Optionally match .html
+## r'/?' # Optionally match a trailing slash
+## r'$)' # Must match to end of string
+## , re.VERBOSE)
+
def getListName(path):
match = name_pat.search(path)
if match is None: return