Steve Rifkin <[EMAIL PROTECTED]> writes:

> I'd have to have a list available to me (we could
> potentially have dozens of lists made where the list admins would
> choose whether to advertise the list or not), and I was hoping I'd
> have that list available through a password-protected webpage,
> especially since there are other pages that require the site admin
> to log in within Mailman (specific list maintenance, etc.)

I wrote a nasty script to generate an HTML file that lists all the
lists.

I run it daily from cron because I didn't want to monkey around with a
setuid mailman CGI program.

Use your web server to restrict access to the generated HTML file as
appropriate.

Here's an example.  Customize as required.  Works for me; it might
work for you.

#!/usr/bin/perl
# Create a web page from the output of the Mailman list_lists command.

$cmd="/usr/share/mailman/bin/list_lists";

open LISTINFO, "$cmd |" or die "cannot run $cmd: $!\n";

print '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
<html>
<head>
<title>Mailing lists</title>
<style type="text/css">
.shaded {background: #EEEEEE;}
</style>
</head>
<body>
<h1>Mailing lists</h1>
<table>
';

$rownumber = 0;
$headerline = <LISTINFO>;
while (<LISTINFO>) {
    chop;
    ($listname, $description) = split / - /;
    $listname =~ s/^\s+//;
    if ($rownumber % 2) {
        $class = "";
    } else {
        $class = 'class="shaded"';
    }
    $rownumber++;
    $lc_listname = lc $listname;
    print "<tr $class>\n";
    print "<td><a href=\"/mailman/listinfo/$lc_listname\">$listname</a>\n";
    print "<td>$description\n";
    print "<td><a href=\"mailto:[EMAIL PROTECTED]">
mail list owner</a>\n";
    print "</tr>\n";
}

print "</table>";

# page footer
print '
</body>
</html>
';

-- 
Matt Emerson
[EMAIL PROTECTED]
------------------------------------------------------
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&amp;file=faq01.027.htp

Reply via email to