#!/usr/bin/perl
if($ENV{"REMOTE_USER"}){
	print <<EOF;
Content-type: text/html

Access OK!
EOF
}
else{
	print <<EOF;
Status: 401 Login Required
WWW-Authenticate: Basic realm="ad.water.ca.gov"
Content-type: text/html

Sorry, you must provide an authorized username and password to continue
EOF
exit;
}
print "<pre>";
foreach $env(sort keys %ENV){
	print "$env\t$ENV{$env}\n";
}
print "</pre>";
