#!/usr/bin/perl # Vote.pl is freeware: (c)GOMASUKE # Ver.1.0 1999/12/14 # # The following DENY BLOCK: write permission denied domain(0) require './jcode.pl'; $base = 'http://www.hogehoge.ne.jp/~foo/'; $pg = 'vote.cgi'; $cfile1 = '../bbs/vcnt1.txt'; $cfile2 = '../bbs/vcnt2.txt'; $ifile1 = '../bbs/vidx1.txt'; $ifile2 = '../bbs/vidx2.txt'; $dfile = '../bbs/'; $pwd = 'xyz'; $max = 12; $mmax = 400; $cmax = 20; @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'} = 'i'; $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/g; $itm{$var} = $value; } $act = $itm{'act'}; $no = $itm{'no'}; $nm = $itm{'nm'}; if ($ref eq '') { $act = 'i'; $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 "
cgi script (c)GOMASUKE<vote.pl>
http://www.orange.ne.jp/~kibita/n88/index.html