#!/usr/mesh/bin/perl # Forum.pl is freeware: (c)GOMASUKE # Dept. of Computer Science, Faculty of Engineering, # Shizuoka Univ., Hamamatsu, Japan # Ver.1.0 1998/05/23 # # The following DENY BLOCK: write permission denied domain(0) require './jcode.pl'; $base = 'http://www.hogehoge.(or|ne).jp/~foo/'; $pg = 'forum.cgi'; $cfile = 'xcnt.txt'; $ifile = 'xidx.txt'; $dfile = 'bbs/'; $max = 12; @week = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); $rh = $ENV{'REMOTE_HOST'}; $ra = $ENV{'REMOTE_ADDR'}; $rf = $ENV{'HTTP_X_FORWARDED_FOR'}; $ref = $ENV{'HTTP_REFERER'}; $ref =~ s/%7E/~/gi; $itm{'act'} = 'd'; $itm{'pos'} = 1; $itm{'no'} = 0; $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/; if ($ENV{'REQUEST_METHOD'} eq "GET") { $dat = $ENV{'QUERY_STRING'}; } else { read(STDIN, $dat, $ENV{'CONTENT_LENGTH'}); } @buf = split('&',$dat); foreach $item (@buf) { ($var,$value) = split('=',$item); $value =~ tr/+/ /; $value =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack("C", hex($1))/eg; &jcode'convert(*value,'sjis'); $value =~ s/</g; $value =~ s/>/>/g; $value =~ s/\r\n/\n/g; $value =~ s/\r/\n/g; #Win,Mac $value =~ s/\n{2,}/\n\n/g; $itm{$var} = $value; } $act = $itm{'act'}; $pos = $itm{'pos'}; $no = $itm{'no'}; if ($ref eq '') { $act = 'i'; $pos = 1; $ref = $base; } if ($ref =~ /^$base/) { $acl = 1; if ($act eq "p") { if ($rh eq $ra) { $rh = gethostbyaddr(pack("C4", split('\.',$rh)),2) || $ra; } $user = "$rh\/$ra"; if ($rf ne '') { $rff = gethostbyaddr(pack("C4", split('\.',$rf)),2) || $rf; $user = "$user\/$rff\/$rf"; } } DENY: { # if ($rh =~ /\.zzz\.(or|ne)\.jp/i) { $acl = 2; last DENY; } # if ($rh =~ /\.interq\.(or|ne)\.jp/i) { $acl = 2; last DENY; } # if ($rh =~ /\.eznet\.(or|ne)\.jp/i) { $acl = 2; last DENY; } # if ($rh =~ /\.interwave\.(or|ne)\.jp/i) { $acl = 2; last DENY; } # if ($ra =~ /^xxx\.xxx\.xxx\./) { $acl = 2; last DENY; } } } else { $acl = 3; } print "Content-type: text/html\n\n"; if ($acl == 2) { print "