#!/usr/bin/perl if (-f '/Beebrain/bin/flycgi/.rdstcnfg'){ @var=split(/,/,`/Beebrain/bin/flycgi/.rdstcnfg`) } else {die "ERROR: Config file not found"; } use CGI; $query = new CGI; $counter=0; $found=0; $in="\index.htm"; $called = $ENV{"HTTP_REFERER"}; $log="/Beebrain/bin/flycgi/a-log"; $indx="/Beebrain/bin/flycgi/index.file"; $run="/Beebrain/bnchmrk/temp/temp$$.html"; $look1 = "http://$var[1]"; $look2 = "/bin/flycgi/mfs/01"; $look3 = "http://$var[3]"; $look5 = "http://$var[1]"; $called=~ s/.\d\d\d#mfs//g; $called=~ s/.\d\d#mfs//g; $called=~ s/.\d#mfs//g; $called=~ s/$look2//; $called=~ s/$look1//; $called=~ s/$look3//; $called=~ s/$look5//; $called=~ s|http://web||g; $called=~ s|http://www.flybrain.org||g; #find location $other = $called; $other =~ s|^(.*?)\/*|$1|; open(IN,"/Beebrain/bin/flycgi/a-log"); while() { @field = split; if ($called eq $field[0]){ $location=$field[1]; $found=1; } if ($field[1]!~ "XX"){ if (index($field[1],"+") == -1){ if ($field[0] =~ m|$called|){ $second=$field[1]; } $other = $called; $other =~ s|^(.*?)\/*|$1|; if ($field[0] =~ m|$other|){ $third=$field[1]; } }} } close(IN); # $found=1; if($found != 1) { if ((defined $second )||(defined $third )){ if (defined $third ){ $location = $third;} if (defined $second ){ $location = $second;} } else { print $query->header; print <<'EOM' ; Location

Beebrain Home

Index


   Help     Index     Where Am I?     Search     Page Status Contact Us 

The location of this file cannot be described.

EOM printf("Return to the previous page.\n\n

", $ENV{"HTTP_REFERER"}); print <<'EOM' ;

Beebrain : Docs : Location

  EOM exit; }} #header open(OUT,">$run"); print OUT <<'EOM' ; Where Am I?

Beebrain Home

Index


   Help     Index     Where Am I?     Search     Page Status Contact Us 

EOM #end header open(ININDEX,"/Beebrain/bin/flycgi/index.file"); while($REF= ) { @index = split /,/, $REF; $index[0] =~ s|\s||g; if ($index[0] =~ m|[#][/]Beebrain|){ $passed=$index[0]; $passed =~ s|#||g; $field[4] = ""; $field[1] = ""; &write_line; } else { open(IN,"/Beebrain/bin/flycgi/a-log"); while() { @field = split; if ($index[0] eq $field[1]){ if (($field[4] !~ r) &&(index($field[1],"+") == -1)){ #parse html for title $passed=$field[0]; &write_line; }} } } #end else } print OUT ("

\n"); sub write_line { #$counter++; open(IN2,"$passed"); while() { if (($_=~ "/TITLE") || ($_=~ "/title") || ($_=~ "/Title")){ $_=~ s/\n*.*//; $_=~ s/<\/TITLE>*..*//; $_=~ s/\n*.*<title>//; $_=~ s/<\/title>*..*//; $_=~ s/\n*.*<Title>//; $_=~ s/<\/Title>*..*//; $title= "$_"; if ($field[1] eq $location){ printf OUT ("<a name=\"current_location\">"); printf OUT ("<img src=\"/Beebrain/html/gifs/point.gif\" width =14> "); $counter = $countr; } else { printf OUT ("<img src=\"/Beebrain/html/gifs/space.gif\" width =14> "); $countr++; } for ($x = 0;$x < $index[1]; $x++){ printf OUT ("<img src=\"/Beebrain/html/gifs/space.gif\" width =40> "); } if ($field[4] eq g){ $statustoken="<img src=\"/Beebrain/html/gifs/ball_grn.gif\"> "; } else { $statustoken="<img src=\"/Beebrain/html/gifs/ball_ylw.gif\"> "; } if ($field[1] ne ""){ printf OUT ("<font size=-1><NOBR>%s <A HREF=\"%s\">%s<\/a> (%s) </NOBR></font><BR>\n", $statustoken, $passed, $title, $field[1] ); } else { printf OUT ("<font size=-1><NOBR>%s <A HREF=\"%s\">%s<\/a> </NOBR></font><BR>\n", $statustoken, $passed, $title ); } close(IN2); } } } print OUT <<'EOM' ; <P> <HR> <P> <font size=-1> Status codes:<BR> <img src="/Beebrain/html/gifs/space.gif" width =40> <IMG Align=Bottom SRC="/Beebrain/html/gifs/ball_rd.gif" ALT="-disconnected-"> Section temporarily disconnected<br> <img src="/Beebrain/html/gifs/space.gif" width =40> <IMG Align=Button SRC="/Beebrain/html/gifs/ball_ylw.gif" ALT="-development-"> Section under development<br> <img src="/Beebrain/html/gifs/space.gif" width =40> <IMG Align=Bottom SRC="/Beebrain/html/gifs/ball_grn.gif" ALT="-completed-"> Section completed<br> </font> <P> <P> <TABLE WIDTH=100% BGCOLOR=DDBB66><TR><TD ALIGN=center><FONT SIZE=-1><A HREF="/Beebrain/html/index.html" CLASS="button">Beebrain</A> <A HREF="/Beebrain/html/docs/index.html" CLASS="button">: Docs</A> <A HREF="#" CLASS="button">: Location</A> </FONT></TD></TR></TABLE> <P>  </BODY> </HTML> EOM #printf OUT ("<BR>%s (%s %s) _%s+<BR>\n", $location, $second, $third, $counter); for($x = 0;$x < 40; $x++){ print OUT ("<BR>\n"); } print OUT ("</HTML>\n"); close(OUT); printf("Location: http://%s%s#current_location\n\n",$var[2], $run);