#!/usr/local/bin/perl

print "Content-type: text/html", "\n\n"  ;


# require TimeUtilities ;
require ChatSign ;
$URLdir_executables=&ChatSign::URLdir_executables ;
# $data_basedir=&ChatSign::data_basedir ;


$request_method=$ENV{'REQUEST_METHOD'} ;

if ($request_method eq "GET") {
$query_string=$ENV{'QUERY_STRING'}
} else {
$size_of_form=$ENV{'CONTENT_LENGTH'} ;
read(STDIN, $query_string, $size_of_form) ;
}

# Split the name-value pairs
@pairs = split(/&/, $query_string);

foreach $pair (@pairs) {
	($name, $value) = split(/=/, $pair);
	# Un-Webify plus signs and %-encoding
	$value =~ tr/+/ /;
	# Get rid of all non-alpha/numeric stuff esp " ' ,
	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
	# $value =~ s/['|"|`|,]//g;
	# Stop people from using subshells to execute commands
	# when using UCB mail (aka mailx).
	$value =~ s/~!/ ~!/g;
	$FORM{$name}=$value ;
}

$now=time ;

$operator=$FORM{operator}  ;

print <<ENUF;
<HTML>
<TITLE>
ChatSign - Chats Waiting for $FORM{operator}
</TITLE>
<BODY>
<CENTER>
<B><font face=\"Arial, Helvetica, sans-serif\" size=\"2\">ChatSign - Chats Waiting for $FORM{operator}</B><BR>
<FORM ACTION="$URLdir_executables/operator_list_domains.pl" METHOD=POST TARGET=_blank>
<INPUT TYPE=hidden NAME=operator VALUE=$FORM{operator}>
<INPUT TYPE=SUBMIT VALUE="List all domains for $FORM{operator}">
</FORM>
</BODY>
</HTML>
ENUF
exit (0) ;
