#!/usr/local/bin/perl
$discus_conf = '/usr/u/web/estarc/discus_admin_1969/discus.conf';
#Discus board contact script
#-------------------------------------------------------------------------------
# This script is copyright (c) 1998 by DiscusWare, LLC, all rights reserved.
# Its use is subject to the license agreement that can be found at the following
# URL:  http://www.chem.hope.edu/discus/license
#-------------------------------------------------------------------------------
if (open (FILE, "$discus_conf")) {
	@file = <FILE>;
	close (FILE);
	$evals = "";
	foreach $line (@file) {
		if ($line =~ /^(\w+)=(.*)/) {
			$varname = $1;
			$value = $2;
			$value =~ s/'/\\'/g; $value =~ s/\r//g;
			$evals .= "\$$varname='$value'; ";
		}
	}
	eval($evals);
	require "$admin_dir/source/src-board-subs-common";
} else {
	print "Content-type: text/html\n\n";
	print "<HTML><HEAD><TITLE>Script Execution Error</TITLE></HEAD>\n";
	print "<BODY BGCOLOR=#ffffff TEXT=#000000>\n";
	print "<H1>Script Execution Error</H1>\n";
	print "Discus scripts could not execute because the discus.conf file\n";
	print "could not be opened.";
	print "<P>Reason: <FONT COLOR=#ff0000><B>$!</B></FONT>" if $!;
	print "<P>This generally indicates a setup error of some kind.\n";
	print "Consult the <A HREF=\"http://www.chem.hope.edu/discus/rc\">Discus ";
	print "Resource Center</A> for troubleshooting information.</BODY></HTML>\n";
	exit(0);
}
&parse_form;
&header;
&ex('printuntil', 1, 1, 0, "$L{BCTITLE}");
print "<CENTER><FONT SIZE=+1><B>$L{BCTITLE}</B></FONT></CENTER>\n";
print "<HR>\n";
&ex('printuntil', 3, 9, 0, "", 0, 1);
print "<P>$L{BCMOD}<P><UL>\n";
open (PASSWD, "$admin_dir/passwd.txt");
@passwd = <PASSWD>;
close (PASSWD);
foreach $line (@passwd) {
	($usr, $pas, $em, $fn) = split(/:/, $line);
	$emf = 0; print "<LI>";
	if ($pro) {
		$filename = "$usr-MODERATOR.txt";
		$filename = &getfn($filename);
		if (-e "$admin_dir/profiles/$filename") {
			print "<A HREF=\"$script_url/board-profile.$cgi_extension?action=display_profile&profile=$usr-MODERATOR\">$fn</A>";
			next;
		}
	}
	if ($em ne "email" && $em ne "none" && $em ne "") {
		print "<A HREF=\"mailto:$em\">";
		$emf = 1;
	}
	if ($fn ne "fullname" && $fn ne "none" && $fn ne "") {
		print $fn;
	} else {
		print "\u$usr";
	}
	print "</A>" if $emf ne "";
	print "</LI>\n";
}
print "</UL><P>\n";
print "<P>$L{BCINSTR} $contact.<P>\n";
print "<HR><CENTER><BR>\n";
print "<A HREF=\"javascript:history.back()\">$L{BCBACK}</A>\n";
print "</CENTER>\n";
&ex('printuntil', 11, 17, 0, "", 0, 1);
exit(0);

