#!/bin/perl
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# NEXT CGI: Scripts for use on next.gen.oh.us
# http://www.next.gen.oh.us/users/asm/cgi/
#
# Copyright (C) 2001 Ian Jackson <ian@chiark.greenend.org.uk>
# Copyright (C) 2026 Anton McClure <asm@next.gen.oh.us>

print <<END or die $!;
Content-Type: text/html

<html><head><title>NEXT home pages</title>
<link rev="made" href="mailto:asm\@next.gen.oh.us">
</head>
<body>
<h1><img align="left" src="/nexth.gif" alt="">NEXT users' home pages</h1>
<b>http://www.next.gen.oh.us/users/</b>
<hr>
<ul>
END

open UL, "/etc/userlist" or die $!;
while (<UL>) {
    next if m/^\#/ or !m/\S/;
    chomp($user= $_);
    $pc= "/home/$user/www/";
    next unless opendir D, $pc;
    $full = (getpwnam($user))[6];
    $full=~ s/,.*//;
    print "<li><A href=\"http://www.next.gen.oh.us/users/$user/\">$full</A> ($user)</li>\n" or die $!;
}

close UL or die $!;

print '</ul>
<hr>Generated by <a href="http://www.next.gen.oh.us/users/asm/cgi/">NEXT CGI 0.1</a>.
<p>
Copyright (C) 2001 Ian Jackson
<br>
Copyright (C) 2026 Anton McClure
<p>
NEXT CGI
is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.  This program is distributed in the hope
that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.  See the GNU Affero General Public License for more details.
<p>
You may download the
<a href="ftp://ftp.next.gen.oh.us/users/asm/cgi/">source code</a>
for the version currently running here.  (Also via
<a href="http://ftp.next.gen.oh.us/users/asm/cgi/">http</a> &
<a href="https://ftp.next.gen.oh.us/users/asm/cgi/">https</a>)
<hr>
<address>
<a href="http://www.next.gen.oh.us/users/asm/">Anton McClure</a> /
<a href="mailto:asm@next.gen.oh.us">asm@next.gen.oh.us</a> /
<a href="http://www.next.gen.oh.us/">NEXT</a>
</address>';
