#!/usr/bin/perl $cookie = $ENV{'HTTP_COOKIE'} || $ENV{'COOKIE'}; $referer = lc $ENV{'HTTP_REFERER'}; $qs = $ENV{QUERY_STRING}; $internal = ''; $setcookie = ''; if ($qs =~ /access=r/) { $setcookie = 'restricted'; } elsif ($qs =~ /access=o/) { $setcookie = 'open'; } elsif ($cookie !~ /access=restricted/) { if ($referer =~ m=http://([^/]*)=) { my $host = lc $1; if (!( $host =~ /phoenix.com/ || $host =~ /phx.com/ || $host =~ /wfnx.com/ )) { # it is an outside link if ($referer =~ /digitalcity.com/ || $referer =~ /arity.com/) { $setcookie = 'restricted'; } else { $setcookie = 'open'; } } else { # an internal link $internal = 1; if ($referer =~ /indexo.html/) { $setcookie = 'open'; } elsif ($referer =~ /indexr.html/) { $setcookie = 'restricted'; } } } } if (!$setcookie) { if ($internal) { $setcookie = ($cookie =~ /open/) ? 'open' : 'restricted'; } else { $setcookie = ($cookie =~ /restricted/) ? 'restricted' : 'open'; } } if ($setcookie eq 'open') { $redir = "indexo.html"; } else { $redir = "indexr.html"; } print <