summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xcgi/admin18
-rwxr-xr-xcgi/listinfo22
2 files changed, 35 insertions, 5 deletions
diff --git a/cgi/admin b/cgi/admin
index 942899871..e3335176f 100755
--- a/cgi/admin
+++ b/cgi/admin
@@ -5,7 +5,7 @@
To run stand-alone for debugging, set env var PATH_INFO to name of list
and, optionally, options category."""
-__version__ = "$Revision: 461 $"
+__version__ = "$Revision: 528 $"
import sys
sys.path.append('/home/mailman/mailman/modules')
@@ -127,13 +127,27 @@ def FormatAdminOverview(error=None):
table.AddCellInfo(max(table.GetCurrentRowIndex(), 0), 0,
colspan=2, bgcolor="#99ccff")
+ # XXX We need a portable way to determine the host by which we are being
+ # visited! An absolute URL would do...
+ if os.environ.has_key('HTTP_HOST'):
+ http_host = os.environ['HTTP_HOST']
+ else:
+ http_host = None
+
advertised = []
names = mm_utils.list_names()
names.sort()
for n in names:
l = maillist.MailList(n)
l.Unlock()
- if l.advertised: advertised.append(l)
+ if l.advertised:
+ if (http_host
+ and (string.find(http_host, l.host_name) == -1
+ and string.find(l.host_name, http_host) == -1)):
+ # List is for different identity for this host - skip it.
+ continue
+ else:
+ advertised.append(l)
if error:
greeting = FontAttr(error, color="ff5060", size="+1")
diff --git a/cgi/listinfo b/cgi/listinfo
index e8aee7ad0..4437defed 100755
--- a/cgi/listinfo
+++ b/cgi/listinfo
@@ -4,7 +4,7 @@
Errors are redirected to logs/errors."""
-__version__ = "$Revision: 413 $"
+__version__ = "$Revision: 528 $"
# No lock needed in this script, because we don't change data.
@@ -27,6 +27,7 @@ def main():
path = os.environ['PATH_INFO']
except KeyError:
path = ""
+
list_info = mm_utils.GetPathPieces(path)
if len(list_info) == 0:
@@ -47,7 +48,7 @@ def main():
FormatListListinfo(list)
def FormatListinfoOverview(error=None):
- "Present a general welcome and itemize the (public) lists."
+ "Present a general welcome and itemize the (public) lists for this host."
doc = Document()
legend = "%s maillists" % mm_cfg.DEFAULT_HOST_NAME
doc.SetTitle(legend)
@@ -60,10 +61,25 @@ def FormatListinfoOverview(error=None):
advertised = []
names = mm_utils.list_names()
names.sort()
+
+ # XXX We need a portable way to determine the host by which we are being
+ # visited! An absolute URL would do...
+ if os.environ.has_key('HTTP_HOST'):
+ http_host = os.environ['HTTP_HOST']
+ else:
+ http_host = None
+
for n in names:
l = maillist.MailList(n)
l.Unlock()
- if l.advertised: advertised.append(l)
+ if l.advertised:
+ if (http_host
+ and (string.find(http_host, l.host_name) == -1
+ and string.find(l.host_name, http_host) == -1)):
+ # List is for different identity for this host - skip it.
+ continue
+ else:
+ advertised.append(l)
if error:
greeting = FontAttr(error, color="ff5060", size="+1")