#!C:/Perl/bin/perl.exe
$discus_conf = 'd:/inetpub/wwwroot/wielens/discus_admin/discus.conf';
$pro_fileid = '3348162969543224';
#Discus board contact script
#-------------------------------------------------------------------------------
# DISCUS VERSION 3.10 COPYRIGHT NOTICE
#
# Discus 3.10 is copyright (c) 2000 by DiscusWare, LLC, all rights reserved.
# The use of Discus is governed by the Discus License Agreement which is
# available from the Discus WWW site at:
#    http://www.discusware.com/discus/license
#
# Pursuant to the Discus License Agreement, this copyright notice may not be
# removed or altered in any way.
#-------------------------------------------------------------------------------
if (open (FILE, "$discus_conf")) {
	@file = <FILE>;
	close (FILE);
	foreach $line (@file) {
		if ($line =~ /^(\w+)=(.*)/) {
			$varname = $1;
			$value = $2;
			$value =~ s/\r//g;
			${$varname} = $value;
		}
	}
	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.discusware.com/support\">Discus ";
	print "Resource Center</A> for troubleshooting information.</BODY></HTML>\n";
	exit(0);
}
&ex('cleaning_jobs', 1);
&parse_form;
&header;
&ex('printuntil', 1, 1, 0, "$L{BCTITLE}");
print "<CENTER><FONT SIZE=+1><B>$L{BCTITLE}";
print " ($FORM{'group'})" if $FORM{'group'};
print "</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);
if ($FORM{'group'} ne "") {
	$FORM{'group'} =~ s/\W//g;
	$FORM{'group'} =~ tr/A-Z/a-z/;
	open (GROUP, "$admin_dir/groups.txt");
	@group = <GROUP>;
	close (GROUP);
	$group = $FORM{'group'};
	($grp) = grep(/^$group:/, @group);
	($grp, $mod) = split(/:/, $grp);
	@mods = split(/,/, $mod);
}
foreach $line (@passwd) {
	($usr, $pas, $em, $fn) = split(/:/, $line);
	if ($FORM{'group'}) {
		next if !grep(/^$usr$/, @mods);
	}
	$fn = $usr if ($fn eq "fullname" || $fn eq "" || $fn !~ m|\S|);
	$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";
if ($GLOBAL_OPTIONS{'admin_contact_name'}) {
	$contact = "<A HREF=\"mailto:$GLOBAL_OPTIONS{'admin_contact_email'}\">$GLOBAL_OPTIONS{'admin_contact_name'}</A>" if $GLOBAL_OPTIONS{'admin_contact_email'} ne "";
	$contact = "$GLOBAL_OPTIONS{'admin_contact_name'}" if $GLOBAL_OPTIONS{'admin_contact_email'} eq "";
}
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);
# END - FILE IS CORRECTLY UPLOADED #
