Devide to css file. Clean up the sources. Security fix (map.pl).
[chise/kage.git] / linkmap / map.cgi
1 #!/usr/bin/perl
2
3 $PERL = "/usr/bin/perl";
4 $LINKMAP_DIR = "/var/www/chiseperl";
5
6 $random = "linkmap_".(sprintf "%05X", int(rand()*0x100000));
7
8 use CGI;
9 $cgi = new CGI;
10 $target = $cgi->param('code');
11 $target =~ s/[^a-zA-Z0-9]//g;
12
13 $dummy = `$PERL $LINKMAP_DIR/map.pl $target $random 2>/dev/null`;
14
15 $buffer = "";
16 open FH, "<${random}.html";
17 while(!eof(FH)){
18   $buffer .= <FH>;
19 }
20 close FH;
21
22 print "Content-type: text/html\n\n";
23 print $buffer;
24