#! /usr/local/bin/perl ################################################ #BooNewsClipboard v1.02 / this program is free.# #(C) BooBooClub 2002-2006 # ################################################ #set data $pass = 'pass'; $dat = './bnews.html'; $htmltag = 'disallow'; $rtn = 'off'; #read_lib require 'jcode.pl'; #time $ENV{'TZ'}='JST-9'; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $year = ($year + 1900); $mon++; if ($sec < 10) { $sec = "0$sec";} if ($min < 10) { $min = "0$min";} if ($hour < 10){ $hour = "0$hour";} if ($mon < 10) { $mon = "0$mon";} if ($mday < 10){ $mday = "0$mday";} $time = "$year/$mon/$mday $hour:$min:$sec"; #read if ($ENV{'REQUEST_METHOD'} eq "POST"){ read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else{ $buffer = $ENV{'QUERY_STRING'}; } @pairs = split(/&/,$buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/\cM\n//g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/\,//g; if($htmltag ne 'allow'){ $value =~ s//>/ig; } if($rtn eq 'on'){ $value =~ s/\r\n|[\r\n]/
/ig; } #prevent chr error &jcode'convert(*value,'sjis'); $FORM{$name} = $value; } #branch if (!$FORM{'write'}) { &html; } else { ✓ &write; &html; } sub check { if ($FORM{'pass'} ne $pass) { &error; } } sub write { #write new dat $FORM{'txt'} =~ s/
/
\n/g; $wrt = $FORM{'txt'}; open (DAT,">$dat"); print DAT $wrt; close (DAT); } sub html { #get dat open (DAT,"$dat"); @dats = ; close (DAT); $dats = join('',@dats); $dats =~ s/\r\n|[\r\n]//g; $dats =~ s/
/\n/g; #html print "Content-type: text/html\n\n"; print "BooNewsClipboard\n"; print "\n"; print "
\n"; print "Boo News Clipboard\n"; print "


\n"; print "
\n"; print "
\n"; print "News :
\n"; print "\n"; print "
\n"; print "
\n"; print "Password:\n"; print "\n"; print "  "; print " \n"; print "
\n"; print "
\n"; print "
\n"; print "
\n"; print "
Produced by BooBooClub

\n"; print "\n"; exit 0; } sub error { print "Content-type: text/html\n\n"; print "Error\n"; print "\n"; print "
Error

\n"; print "パスワードに誤りがあります。\n"; print "
\n"; exit 0; }