Site hosted by Angelfire.com: Build your free website today!

My Home Page

My Favorite things about Angelfire.

My Favorite Web Sites

Angelfire - Free Home Pages
Free Web Building Help
Angelfire HTML Library
HTML Gear - free polls, guestbooks, and more!

#!/usr/bin/perl # please inser the correct perl path in the line above #******************************************************************************* # WonderCatStudio Bulletin Board System 7.30 # BBS Note 7.x # 2000/12/07 >> LastModify 2002/05/30 # Created by WonderCatStudio NoraNeko # English version provided by shounen.org #*********************************************************************************** ###################################################### ########## Settings (Changes not required) ########## ###################################################### $BBS_Version = '7.30b7'; #----------------------------------------------------------------------------- sub AdminPassCheck; sub AdminPageOpen; sub BrowsCss; sub CountFileOpen; sub DelImageFile(); sub errorexit; sub escape(); sub unescape(); sub FileAnalyze(); sub FileListCheck(); sub FileLogDel(); sub FileLogList; sub FileLogWrite(); sub FileLogResWrite(); sub FileSave(); sub FastBoot; sub FormMultipart; sub Function; sub filelock; sub fileunlock; sub fl(); sub call(); sub randstr; sub CatalogOpen; sub CookieWrite; sub GetCookie; sub GetFileCookie; sub GetBrowse; sub GetDate(); sub GetForm; sub GetMsgPassword(); sub HelpOpen; sub Initialize; sub ImgContinue; sub ImgReplace; sub MsgCov; sub MsgConvert; sub MsgConvEsc(); sub MsgWrite; sub MsgDelete; sub MsgReflesh; sub PostCheck; sub PasswordCheck(); sub PageOpen; sub PageForm; sub PaintInt; sub PaletteOpen(); sub Panic; sub Restore; sub SetPCH_Size; #---------------------------------------------------------- #Do NOT edit the information regarding the version of this code $paint_cgi= './paint.cgi' if($paint_cgi eq ''); $Version='BBS NOTE '.$BBS_Version.' '; require './config.cgi'; errorexit ('1','There is a version regarding the config.cgi','「config.cgi」'.$CONFIG_VERSION.' はこの '.$BBS_Version.' Version does not match!
Please recheck your codes and try again.') if($CONFIG_VERSION ne 'Fair Rain'); $cookie_file="$FileSave_DIR/cookie.log"; $lock_sleep=1; $lock_try = 5; $lock_sec = 60; $lockdir = "$FileSave_DIR/lock"; &call('Initialize'); require $skin_cgi; $maxData=$MaxUpLoadData; $siiApplet_Use = 1 if(!defined $siiApplet_Use); my $c='
Client Program Shounen.org 'if$siiApplet_Use; $ClientVer.=$c.'www.gt.sakura.ne.jp/~ocosama/" TARGET="_blank">Shii-chan Oekaki 'if$siiApplet_Use; $ClientVer.='
Client Program Ono Oekaki'if$PictureBBSApplet_Use; $ClientVer.=$c.'www.geocities.co.jp/SiliconValley-SanJose/8609/" TARGET="_blank">Nina Oekaki 'if$BBSPainterApplet_Use; &Function; #------------------------------------------------------------ sub Function{ &Captor if($fc eq 'captor'); &FormMultipart; &call('Function'); if($fc eq 'write'){&MsgWrite;&MsgReflesh;&PageOpen} elsif($fc eq 'page'){&AdminPassCheck if$FORM{'password'};&PageOpen} elsif($fc eq 'repost'){&RePostOpen} elsif($fc eq 'post'){&PostOpen} elsif($fc eq 'delete'){&MsgDelete} elsif($fc eq 'del'){&AdminPassCheck;&MsgDelete} elsif($fc eq 'continue'){&ImgContinue} elsif($fc eq 'pch_size'){&SetPCH_Size} elsif($fc eq 'help'){&HelpOpen} elsif($fc eq 'admin'){&AdminPageOpen} elsif($fc eq 'reflesh'){&AdminPassCheck;&MsgReflesh;&PageOpen} elsif($fc eq 'restore'){&AdminPassCheck;&Restore} elsif($fc =~ /paint|open/){&PaintOpen} &PageOpen; } ############################################################# #Page Open # sub PageOpen{ &call('PageOpen'); $FORM{'mode'}=$MODE_TOGGLE_TURN[0] if($FORM{'mode'} eq ''); if($fc eq 'write'){&CookieWrite} elsif($fc eq 'rev'){ &call('Receive'); if(-e $cookie_file){&GetFileCookie}else{&GetCookie}$fc='page'; } else{ &GetCookie; if(!"$fc$FORM{mode}$FORM{sort}"){ $FORM{mode} = $COOKIE{mode} if($COOKIE{mode}); $FORM{sort} = $COOKIE{sort} if($COOKIE{sort}); } if($COOKIE{mode} ne $FORM{mode} || $COOKIE{sort} ne $FORM{sort}){ &GetDate(); &CookieWrite; } } &CatalogOpen if($FORM{'mode'} eq 'catalog' && $fc ne 'rev'); $FORM{'page'}=1 if ($FORM{'page'} eq ''); $page=(($FORM{'page'}-1) * $ViewMessage); &FileLogList; if ($LogTotal == 0 && !$adminMode){&FastBoot}; &PageForm; &GetBrowse; $LayerForm_Use=($USER_OS=~/Win/ && $AGENT eq 'MSIE')?$LayerForm_Use:0; print "Content-type: text/html\n$Exp\n"; &HTML_HEAD;print $SKIN_MAIN_FORMAT; #Administrator Mode View if($adminMode){ $REFLESH='

'.$SKIN_MODE_INPUT.'
「'.$IndexFile.'」has been refreshed.

'if$index_reflesh_Use; print <

* Administrator Mode *

$login$REFLESH
$SKIN_MODE_INPUT
「$FileSave_DIR」is analyzing the files in the directory.
Entire log size as well as entire image size has been collected here.

$ADMIN_FUNCTION
$SKIN_MODE_INPUT
-- Restore --
The follow logs have been analyzed「file.log」「count.log」and have been reconstructed.
If you wish to edit info, please directly go to those files.
FileLog :    CountLog :
$PAGE_FormTAG
EOF } for($n=$page,$cnt=0;($cnt < $ViewMessage && $cnt < $LogTotal);$n++,$cnt++){ &fl($fileNo[$n]); if(-e "$LogFile") { open(MSG,$LogFile);@FileData=;close(MSG); $LogSize=-s $LogFile; &MsgLine;&call('MsgLine'); if($adminMode){ ################################## print < $SKIN_MODE_INPUT DEL print $DEL_FUNCTION; ############################################################## } } } &HTML_FOOT; exit } sub CatalogOpen{ $CATALOG_View = $ViewMessage = $CATALOG_W * $CATALOG_H; $FORM{'page'}=1 if ($FORM{'page'} eq ''); $page = (($FORM{'page'}-1) * $CATALOG_View); &FileLogList; &PageForm; &GetCookie; if($COOKIE{mode} ne $FORM{mode} || $COOKIE{sort} ne $FORM{sort}){ &GetDate(); &CookieWrite; } print "Content-type: text/html\n$Exp\n"; &HTML_HEAD;print $SKIN_MAIN_FORMAT; $CATALOG_View = $LogTotal if($LogTotal < $CATALOG_View); print <
HTML for($n=$page,$cnt=0,$Tcnt=$CATALOG_W;($cnt < $CATALOG_View && $n < $LogTotal);$n++){ &fl($fileNo[$n]); if(-e "$LogFile") { $LogSize=-s $LogFile; open(MSG,$LogFile);@FileData=;close(MSG); $_=shift @FileData;chomp;$MSG=''; ($Cnum,$Cname,$Cdate,$CTitle,$_,$_,$_,$_,$_,$_,$Csrc,$Cw,$Ch,$Csize,$LOG__,$Cthumb,$Cptime,$Capp,$ADD_FORMAT) = split(/\t/); my @F = split(/\x08/,$ADD_FORMAT);undef %l; foreach(@F){($_,$val) = split /=/;$l{$_}=$val} $Cthumb = $l{'thumbsrc'} ? $l{'thumbsrc'}:$Cthumb; $LOG_Animedata_SRC = $l{'animesrc'} ? $l{'animesrc'}:''; $RES_Enable=(($MaxResmesg > $LogSize)&&($Cnum ne "")&&($fc ne "delete"))?1:0; $IMG_Enable=($Csrc =~ /(\.gif$|\.jpg$|\.png$|\.pch$)/i)&&(&FileListCheck($Csrc) == 1)?1:0; $PCH_Enable=($Cthumb =~ /(\.pch$|\.jpeg$)/i)?1:0; $ANI_Enable=($Csrc =~ /(\.pch$|\.jpeg$)/i)?1:0; $Csize=$Csize>1000? int $Csize/1000:1; local($Image,$Anim,$l[16]); if($IMG_Enable){ if($Cthumb =~ /(\.png$|\.jpg$|\.gif$)/){ $Image = "\"$CTitle"; }elsif(exists $l{'thumbsrc'} && $FORM{'mode'} ne "noimage"){ $Image = "\"$CTitle"; }else{ local $w = ' width='.$CATALOG_KeepW if($CATALOG_KeepW ne ''&&$CATALOG_KeepW != 0); if($ANI_Enable){ $Csrc .= '&width='.$Cw.'&height='.$Ch; $Image = 'Shii Oekaki
Animation Data ( '.$Csize." KB )
$CTitle ($Cname)

" }else{ $Image = "\"$CTitle" } } if($RES_Enable){ $Image = "".$Image.''; }else{ $Image = "".$Image.''; } }else{ $Image = '

No image

' } if($Cthumb =~ /(\.pch$|\.jpeg$)/){ $Anim = '*Animation Available'; } print "

"; $Tcnt--;$cnt++; if(($cnt) % $CATALOG_W ==0){ $a = $cnt % $CATALOG_W; print ""; $Tcnt=$CATALOG_W; if($cnt < $CATALOG_View){ print "\n"; } } } } for(;($Tcnt > 0)&&($Tcnt != $CATALOG_W);$Tcnt--){ print ''; if($Tcnt-1 == 0){ print "\n"; } } print <
$Image
$CATALOG_FONT DATE : $Cdate
$Anim $CATALOG_FONT_END$admintag
 
HTML &HTML_FOOT; exit } #------------------------------ sub PostCheck{eval << '_SUB_'; &call('PostCheck'); return if($MultiplePostingLv == 0); if(open(FILE,"<$count_file")) { local(@ACC)=;close(FILE); local($msglog_time,$msg_name,$msg_title,$msg_mesg,$msg_IP,$msg_imgsize)=split(/\t/ , $ACC[1]); $msg_IP =~ s/\(.*\)//; local($dny_flag)=0;$msg_imgsize=~ s/\s//g; if($msg_imgsize){ if($MultiplePostingLv == 5){$msglog_time=int $msglog_time; if((time() - $msglog_time)-$MultipleDnyTime < 0){$dny_flag=1} }else{ if(($msg_imgsize eq $FORM{'file_length'}) && ($msg_IP eq $IP)){$dny_flag=1}} }else{ if($MultiplePostingLv == 5){$msglog_time=int $msglog_time; if((time() - $msglog_time)-$MultipleDnyTime < 0){$dny_flag=1} }elsif($MultiplePostingLv == 4){ if($msg_IP eq $IP){$dny_flag=1} }elsif($MultiplePostingLv == 3){ if(($msg_name eq $name) && ($msg_IP eq $IP)){$dny_flag=1} }elsif($MultiplePostingLv == 2){ if(($msg_name eq $name) && ($msg_title eq $title) && ($msg_IP eq $IP)){$dny_flag=1} }elsif($MultiplePostingLv == 1){ if(($msg_name eq $name) && ($msg_title eq $title) && ($msg_mesg eq $mesg_log) && ($msg_IP eq $IP)){$dny_flag=1} } } if($dny_flag){ if($fc eq 'captor'){ print "Content-type: text/plain\n\nerror\n Error! \n You submission has been rejected. \n Please wait and try again.";exit }else{ errorexit ('post','Double Posting!','You have already posted a similar message.
Please change your content and try again.'); } } } _SUB_ } #################################################### #Refreshing the info onto index.html # sub MsgReflesh{eval << '_SUB_'; if($index_reflesh_Use){ &call('MsgReflesh'); $MsgRefleshFlag=1; &FileLogList; filelock; local(@back)=($fc, $adminMode, $LayerForm_Use, $name, $mail, $url, $flower); $LayerForm_Use=$adminMode=0; $name=$mail=$url=$flower=$fc=""; &PageForm; push @back, $PAGE_FormTAG; $PAGE_FormTAG =~ s/(name=password value=)\w*>/$1>/sg; open(INDEXFILE,">$IndexFile"); select INDEXFILE; &HTML_HEAD; print $SKIN_MAIN_FORMAT; for($n=0;($n < $ViewMessage && $n < $LogTotal);$n++){ &fl($fileNo[$n]); if(-e "$LogFile") { $LogSize=-s $LogFile; open(MSG,$LogFile); @FileData=; close(MSG); &MsgLine; } } print $SKIN_FOOTER_FORMAT; close(INDEXFILE); select STDOUT; fileunlock; ($fc, $adminMode, $LayerForm_Use, $name, $mail, $url, $flower, $PAGE_FormTAG)=@back; undef $MsgRefleshFlag; &call('MsgRefleshEnd'); } errorexit ('c','Please insert the PCH file.',"

width x height Indicate Animation Speed
Corrections cannot be made.")if$WCS_PCH; _SUB_ } ############################################################# #CGI Page Tag info # sub PageForm{ $PageLink_Style = 1 if$adminMode; if($PAGE_FORM_FLAG!=1){ $PAGE_LinkTAG=$PAGE_FormTAG=''; my $MaxPage=int ($LogTotal / $ViewMessage); $MaxPage++ if($LogTotal-($MaxPage * $ViewMessage) > 0); return if($MaxPage < 2); my $fc_b = $fc; $fc_b='page' if($fc eq ''||$fc eq 'write'); my $nMaxPage =$MaxPage; my $MODE=''; my $Next,$N=0; my $page=$FORM{'page'}?$FORM{'page'}:1; my $Pass=$FORM{'password'} if($adminMode); if($FORM{'mode'}){ $MODE="&mode=$FORM{'mode'}"; $SKIN_MODE_INPUT.=''; } my $PageLink=" 0){ $Next++; $nMaxPage--; if($Next == $page){ if($Next - 1 > 0){ $N=$Next -1; $PAGE_LinkTAG .= $PageLink.$N.'"><< NEXT |'; } if($Next < $MaxPage){ $N=$Next +1; $PAGE_LinkTAG .= '|'.$PageLink.$N.'"> BACK >>'; } last; } } $Next=0;$nMaxPage=$MaxPage; $PAGE_LinkTAG .= " PAGE <\/A>"; while($nMaxPage > 0){ $Next++; $nMaxPage--; if($Next == $page){ $PAGE_LinkTAG .= '['.$Next.']';next } $PAGE_LinkTAG .= '['.$PageLink.$Next.'">'.$Next.']'; } local($PageTag)=''.$SKIN_MODE_INPUT.'
'; $PAGE_FormTAG='
'; $Next=0;$nMaxPage=$MaxPage; while($nMaxPage > 0){ $Next++;$nMaxPage--; if($Next == $page){ if($Next - 1 > 0){ $_=$Next -1; $PAGE_FormTAG .= $PageTag.'
'; } if($Next < $MaxPage){ $_=$Next +1; $PAGE_FormTAG .= $PageTag.'
'; } last } } $Next=0; $PAGE_FormTAG .= $PageTag.''; $PAGE_FORM_FLAG=1; } } #################################################### #Admin Password Insertion Area # sub AdminPageOpen{eval << '_SUB_'; &call('AdminPageOpen'); &GetCookie; if($password eq $passwrd){$FORM{'password'}=$passwrd;$adminMode =1;$login='

Automatic Login

';&PageOpen} $TXT_ADMIN='

Please enter your administrator password.

'if(!$TXT_ADMIN); print "Content-type: text/html\n\n"; print <Enter your administrator password $TXT_HEADER



$TXT_ADMIN
$SKIN_MODE_INPUT
[BACK]
$TXT_BBS_MSGDOWN
$Version$SkinVer$ClientVer
EOF exit _SUB_ } ################################################## #Message and Tag check # sub MsgCov{eval << '_SUB_'; &call('MsgCov'); if($jcode_pl=~/jcode/){ &jcode'convert(*name,"sjis"); &jcode'convert(*title,"sjis"); &jcode'convert(*mail,"sjis"); &jcode'convert(*mesg,"sjis"); } &MsgConvEsc(\$name); &MsgConvEsc(\$mail,1); &MsgConvEsc(\$url,1); &MsgConvEsc(\$title); &MsgConvEsc(\$mesg); #Check if($name eq ""){errorexit ('post','You have not entered your name.','You have not enter your name.
Please go back and enter in the required elements.')} if($title eq ""&&$Input_Title){errorexit ('post','You have not entered your title.','You have not enter your title.
Please go back and enter in the required elements.')} if($mesg eq ""){errorexit ('post','You have not entered your message.','You have not enter your message.
Please go back and enter in the required elements.')}; &MsgConvert; _SUB_ } sub MsgConvert{eval << '_SUB_'; &call('MsgConvert'); if(!$mail && $Input_Mail){ if($fc eq 'captor'){print "Content-type: text/plain\n\nerror\n Error! \n Your email address has not been entered. \n Please go back and enter in the required elements.";exit}; errorexit ('post','You have not entered your email address.','You have not enter your email address.
Please go back and enter in the required elements.') } if(length $mail > 0 && $mail !~ /(.*)\@(.*)\.(.*)/){errorexit ('post','You have entered an incorrect email address format.','Please only use letters and numbers.')} if(length $name > $Maxnamelen){$len=length $name;errorexit ('post','Your name contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \ This board's character limit is $Maxnamelen characters.<\/FONT>")} if(length $title > $Maxtitlelen){$len=length $title;errorexit ('post','Your title contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \ This board's character limit is $Maxmaillen characters.<\/FONT>")} if(length $mail > $Maxmaillen){$len=length $mail;errorexit ('post','Your email address contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \ This board's character limit is $Maxmaillen characters.<\/FONT>")} if(length $url > $MaxURLlen){$len=length $url;errorexit ('post','Your URL contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \/ character limit. $MaxURLlen characters.<\/FONT>")} if(length $mesg > $Maxmesg){$len=length $mesg;errorexit ('post','Your message contains too many characters.',"Please go back and try again.
You currently have $len<\/FONT> characters. \ This board's character limit is $Maxmesg characters.<\/FONT>")} $RankCmt=$RankCmt+$mesglen; #-------------------------- Tag Usage ------------------------------- if($TAGS_Use){ local($msg,$end,@parts,@NeedCnt,$pre_flag); $mesg =~ s/\<\;BR>/\n/ig; $mesg =~ s/\<\;P>/\n\n/ig; my @parts = split(/(>)/,$mesg); my $end = pop @parts; foreach(@parts){ if(index $_,'<' > -1){ local($n,$aliment,$need,$slash,@l); foreach $need(@l=@OKTags){ ($need,@tag_element) = split /:/,$need; if(s/\<\;(\/)?$need(.*|$)/<$1$need/i){ $slash=$1; if($need eq 'PRE'){ $pre_flag = $pre_flag != 1?1:0; } if($slash eq ''){ $NeedCnt[$n]++; }else{ $NeedCnt[$n]--; } if(!$pre_flag){ $aliment = $2; $aliment =~ s/\=/\&equ\;/gi; $aliment =~ s/\&equ\;\"\;([\w-.!~*'();\/?:\@\&\+\$,%\#\x80-\xFF]+)\"\;(\s|$)/\&equ\;\"\;$1\e\"\;$2/g; $URLAutoLink=0 if($need eq 'A'); if($need eq 'FONT'){ $aliment =~ s/\bSIZE\&equ\;\"\;(\w*)(?:\e)\"\;/size=\"$1\"/i; $aliment =~ s/\bCOLOR\&equ\;\"\;([\w\#]*)(?:\e)\"\;/color=\"$1\"/i; $aliment =~ s/\bFACE\&equ\;\"\;(.*)(?:\e)\"\;/face=\"$1\"/i; }elsif($need eq 'DIV'){ $aliment =~ s/\bALIGN\&equ\;\"\;(CENTER|LEFT|RIGHT)(?:\e)\"\;/align=\"$1\"/i; } foreach $e(@tag_element){ $aliment =~ s/(\s*)$e\&equ\;\"\;([^ ]*)(?:\e)\"\;/$1$e\=\"$2\"/si; } undef %tag_element; }elsif($need ne 'PRE'){s/0){ ($tag) = split /:/,$OKTags[$n],1; $s = "$_ places" if $_>1; $error.= "<$tag>$s "; } $n++ } errorexit ('post','You have not closed one fo your tags.',"$errorIn order for message to send, you MUST make sure all of your tags are closed.")if($error); $mesg = $msg.$end; } #---------------------------------------------------------------------- #Linkage if($URLAutoLink){$mesg =~ s/https?:\/\/([-_.!~*'()\w;\/?:\@&=+\$,%#]+)/http\:\/\/$1<\/A>/ig}; if($MailAutoLink){$mesg =~ s/mailto\:([\w\.\?\#\_\:\;\/\%\&\$\"\!\'\(\)\=\~\^\-\+\|\@]*)/$1<\/A>/ig}; #Breaks $mesg=~ s/\x0D\x0A/\n/g; $mesg=~ s/\x0D/\n/g; $mesg=~ s/\x0A/\n/g; if($Msg_Quotation){ for($m=0;$m<2;$m++){$mesg=~ s/(^|\n)(>|>|#)(.+)(\n|$)/$1$Msg_Quot_Font$2$3$Msg_Quot_Font_End$4/g} } $LineCntCapa=($mesg =~ s/\n\n/

/img);$LineCntCapa*=2; $LineCntCapa+=($mesg =~ s/\n/
/img); if($LineCntCapa > $MaxLine){errorexit ('post','Your message contains too many lines.',"Your message contains too many lines.
You currently have $LineCntCapa lines. \ The board's limit is $MaxLine lines.")};$mesg_log=$mesg; if(($flower eq "1"||$Panic_Mode == 1)&&$Panic_Mode != 2){&Panic(*mesg,$PanicTable,$PanicDat);} _SUB_ } sub MsgConvEsc(){ ($_,$c)=@_; if($c == 1){ $$_ =~ s/http\:\/\///g; $$_ =~ s/ftp\:\/\///g; $$_ =~ s/mailto\:\/\///g; $$_ =~ s/ //g; }else{ $$_ =~ s/\"/\"\;/g; $$_ =~ s/. # http://www.cup.com/yui/ require $jcode_pl; &call('MsgWrite'); if($MetaCookie_use){utime time,time,$BBSNoteCGI} &GetBrowse; &GetDate(); if($fc eq "write"){ $REFERER= $ENV{'HTTP_REFERER'}; $name = $FORM{'name'}; $title = $FORM{'title'}; $mail = $FORM{'mail'}; $url = $FORM{'url'}; $mesg = $FORM{'mesg'}; $passwrd= $FORM{'password'}; $flower = $FORM{'flower'}; $paint_time= $FORM{'paint_time'}; $app = $FORM{'app'}; $add_Thread= $FORM{'l'}; $interrupt= $FORM{'interrupt'}; if($add_Thread eq ""){ &MsgCov }else{ if($name eq ""){errorexit ('post','Your name has not been entered.','Your name has not been entered.
Please go back and try again.')}; if($mesg eq ""){errorexit ('post','Your message has not been entered.','Your message has not been entered.
Please go back and try again.')}; &MsgConvEsc(\$name); &MsgConvEsc(\$mesg); &MsgConvEsc(\$flower); &MsgConvEsc(\$mail,1); &MsgConvEsc(\$url,1); if($jcode_pl=~/jcode/){ &jcode'convert(*name,"sjis"); &jcode'convert(*mesg,"sjis"); } &MsgConvert; } }#>>Captor if(($fc ne "write")&&(length $FORM{'ExpHead'} > 0)){ local(@head,$s,$t,$f); $s = substr $FORM{'ExpHead'},0,1; if($s eq 'a'){$t='\=';$f='&'}else{$t="\t";$f="\f"} @head=split(/$f/, $FORM{'ExpHead'}); foreach (@head){ local($_, $val)=split(/$t/); &unescape(\$val); &jcode'convert(*val,"sjis") if($jcode_pl=~/jcode/); $$_=$val } &MsgConvEsc(\$name); &MsgConvEsc(\$app); &MsgConvEsc(\$mail,1); &MsgConvEsc(\$url,1); &MsgConvEsc(\$title); &MsgConvEsc(\$mesg); &MsgConvEsc(\$flower); $FORM{'flower'}=$flower; &MsgConvEsc(\$passwrd); $FORM{'password'}=$passwrd; &MsgConvEsc(\$newpass); &MsgConvEsc(\$agent); &MsgConvEsc(\$anime_speed); $browse=$agent if(length $agent > 0); &MsgConvert } $paint_time='' if(!$PaintTime_Use); $app = $App if $app eq ""; if($paint_time){ &MsgConvEsc(\$paint_time); &MsgConvEsc(\$paint_add); $paint_time=int($paint_time-$paint_add); if($paint_time > 0){ local($p_day,$p_hour,$p_min,$p_sec); $TIME = time + $TIME_DIFF_SEC; $paint_time = $TIME - $paint_time; if($paint_time > 86400){ $p_day = int $paint_time / 86400; $paint_time = $paint_time - ($p_day*86400); } if($paint_time > 3600){ $p_hour = int $paint_time / 3600; $paint_time = $paint_time - ($p_hour*3600); } if($paint_time > 60){ $p_min = int $paint_time / 60; $paint_time = $paint_time - ($p_min*60); } $p_sec = $paint_time; $p_day=$p_day == 0?'':$p_day.'Day'; $p_hour=$p_hour == 0?'':$p_hour.'Hour'; $p_min=$p_min == 0?'':$p_min.'Min'; $p_sec=$p_sec == 0?'':$p_sec.'Sec'; $paint_time = $p_day.$p_hour.$p_min.$p_sec; } }else{$paint_time=''} &CountFileOpen; $s = length $FORM{'file'}; &FileAnalyze('file',$FileSave_DIR,$FileNameHead); if($app eq 'pai' && $FORM{'file_length'} > $MaxPaintData){ errorexit ('1','Your image data size is over the maximum limit.',$MaxPaintData.'byte is the maximum data size limit. Your image is currently'.$FORM{'file_length'}.' byte'); }elsif($fc eq 'write' && $FORM{'file_length'} > $MaxUpLoadData){ errorexit ('post','Your upload image data size is over the maximum limit.',$MaxUpLoadData.'byte is the maximum data size limit for uploading. Please go back and make the correct adjustments.'); } if(length $FORM{'thumbnail'} > $MaxThumbnailData){ errorexit ('post','Your thumbnail data size is too big.',$MaxThumbnailData.'byte is the maximum data size limit for thumbnails. Please go back and make the correct adjustments.'); } &FileAnalyze('thumbnail',$FileSave_DIR,$ThumbnailNameHead); &FileAnalyze('animedata',$FileSave_DIR,$ThumbnailNameHead); &PostCheck; filelock; $crypt_pass=$crypt_Use ? crypt($passwrd,'ID'):$passwrd if($passwrd ne ""); if($FORM{'file_length'} > 0 ){ if($maxImageWidth < $FORM{'file_width'}||$maxImageHeight < $FORM{'file_height'}){ fileunlock; errorexit ('post','Your image width and height is too big.', $maxImageWidth.'x'.$maxImageHeight.'is the maximum image dimensions.
Your current dimensions are '.$FORM{'file_width'}.'x'.$FORM{'file_height'}) } &call('FileSave'); &ImgReplace; &FileSave }else{$FORM{file_name}=$FORM{file_length}=""} if($FORM{'file_name'} eq ""&&$NotCommentOnlyPost&&$interrupt eq ""&&$add_Thread eq ""){ fileunlock; errorexit ('post','You cannot olny post messages.', 'Messages must be accompanied by an image.
') } if($add_Thread eq ""||$interrupt){ my $log_thumb = $FORM{animedata_name}?$FORM{animedata_name}:$FORM{thumbnail_name}; if($interrupt){ if(!&PasswordCheck($FORM{'interpass'},&GetMsgPassword($interrupt))){errorexit ('1','Incorrect password.','Inncorect password!
Please go back and try again.')}; chomp $line; ($ac_msgcnt,$_,$_,$_,$_,$_,$_,$_,$_,$_,$FORM{'file_name'},$FORM{'file_width'},$FORM{'file_height'},$FORM{'file_length'},$_,$log_thumb,$paint_time,$app,$MSG_ADD_FORMAT)=split(/\t/,$line) }else{ $ac_Thread++; &FileLogWrite($FORM{'file_name'},$log_thumb,$ac_Thread); &fl($ac_Thread) } if($fc eq 'captor'){ $c_flag=1 if(!$name || !$mesg); my $c_pass = $passwrd ? $passwrd:&randstr; $crypt_pass=$crypt_Use ? crypt($c_pass,'ID'):$c_pass; open(CREV,">>$cookie_file"); &call('CookieLog'); print CREV time."\t$id\t$ac_Thread\t$c_flag\t$c_pass\t$name\t$mail\t$url\t$passwrd\t$flower\t$FORM{'file_name'}\t$app\n"; close(CREV); } open(MSGFILE,">$LogFile"); #LOG WRITE FORMAT $MsgFormat="$ac_msgcnt\t$name\t$C_date\t$title\t$mail\t$url\t$mesg\t$HOST\t$IP\t$browse\t$FORM{'file_name'}\t$FORM{'file_width'}\t$FORM{'file_height'}\t$FORM{'file_length'}\t$crypt_pass\t$log_thumb\t$paint_time\t$app\t$MSG_ADD_FORMAT"; $MsgFormat=~s/\n//g;$MsgFormat.="\n"; &call('Log_Write'); print MSGFILE $MsgFormat; local($Logcnt)=1; if($interrupt){ foreach (@FileData){print MSGFILE} } } else{ #----------------Cache Reposting #CHECK &fl($add_Thread); if($MaxResmesg < -s $LogFile){ fileunlock; errorexit ('post','You have already posted a comment for this message.', 'You can no longer post another message in this slot.
Please create a new heading.'); } &call('Log_AddWrite'); open(MSGFILE,"<$LogFile");@FileData=;close(MSGFILE);$l=0; foreach (@FileData){$l++;if($l>1){$interrupt=1;last}@Re=split(/\t/)} if($Re[8] eq $IP&&$interrupt eq ''&&length $Re[6] == 0){ open(MSGFILE,">$LogFile"); $MsgFormat="$Re[0]\t$name\t$C_date\t$title\t$mail\t$url\t$mesg\t$HOST\t$IP\t$browse\t$Re[10]\t$Re[11]\t$Re[12]\t$Re[13]\t$crypt_pass\t$Re[15]\t$Re[16]\t$Re[17]\t$Re[18]"; }else{ open(MSGFILE,">>$LogFile"); $MsgFormat="$ac_msgcnt\t$name\t$C_date\t$mesg\t$crypt_pass\t$IP\($HOST\)\t$mail\t$url\t$AGENT_S\t$USER_OS".$RES_ADD_FORMAT; } $MsgFormat=~s/\n//g; print MSGFILE $MsgFormat."\n"; &FileLogResWrite($add_Thread); } close(MSGFILE); if(open(FILE,">$count_file")) { $ac_msgcnt++; print FILE "$ac_Thread\t$ac_msgcnt\t$access\n"; print FILE time()."\t$name\t$title\t$mesg_log\t$IP\($HOST\)\t$FORM{'file_length'}"; close(FILE); } fileunlock; } sub MsgDelete{eval << '_SUB_'; &GetCookie; &PageOpen if($FORM{'No'} eq ""); local($Re)=&GetMsgPassword($FORM{'No'}); if($Re == -1){errorexit ('1','Data does not exist.','The data you have pointed to does not exist.')} if($FORM{'password'} ne $password){ if(!&PasswordCheck($FORM{'password'},$Re)){errorexit ('1','Incorrect password','The password you have entered is incorrect.
Please go back and try again.')} } &call('MsgDelete'); if($FORM{'No'} =~ /(\d+)\-(\d+)/){ local($ThredID)=$1;local($AesNo)=$2; filelock; &fl($ThredID); open(MSG,">$LogFile"); local($cnt)=0; foreach (@FileData) { $cnt++; @l=split(/\t/,$_,2); print MSG if($AesNo ne $l[0]); } close(MSG); fileunlock; &MsgReflesh; } elsif($FORM{'No'} =~ /(\d+)/){ &fl($FORM{'No'}); if(-e "$LogFile") { filelock; open(MSG,"<$LogFile");@FileData=;close(MSG); $_=shift @FileData; @l=split(/\t/); @a=split /\x08/,$l[18]; foreach(@a){($_,$v)=split /=/;$$_=$v} &DelImageFile($l[10],$l[15],$thumbsrc,$animesrc); &FileLogDel($FORM{'No'}); unlink ($LogFile); &call('Log_Delete'); fileunlock; } &MsgReflesh; } &PageOpen; _SUB_ } sub escape(){ local($_)=@_; $$_ =~ s/(\W)/sprintf("%%%02X", unpack("C", $1))/eg; } sub unescape(){ local($_)=@_; $$_ =~ s/%([0-9A-Fa-f][0-9A-Fa-f])/pack("C", hex($1))/eg; } sub fl(){ local($_)=sprintf("%06d",@_[0]);$LogFile="$FileSave_DIR/$MessageNameHead$_.log"; } ################################################### sub FileAnalyze(){ eval pack'H*','24563D756E7061636B22253332432A222C2456657273696F6E3B28246F626A5F666F726D2C246F626A5F706174682C246F626A5F6865616429203D405F2069662824563D3D3738303529'; undef $obj_ext; local($mime,$fext,$obj_jhead,$pointer); $obj_length=length $FORM{$obj_form}; $FORM{$obj_form.'_length'}=$obj_length; return if($obj_length == 0); &call('FileAnalyze'); #---Binary Header Check if($FORM{$obj_form} =~ /^GIF\d\d[a-z].+/) { $obj_ext='.gif'; $FORM{$obj_form.'_Content-Type'}='image/gif'; } elsif($FORM{$obj_form} =~ /^\x89\x50\x4E\x47\r\n\x1A\n.+/) { $obj_ext='.png'; $FORM{$obj_form.'_Content-Type'}='image/x-png'; } elsif($FORM{$obj_form} =~ /^\xFF\xD8\xFF\xE0\x00.+/) { $obj_ext='.jpg'; $FORM{$obj_form.'_Content-Type'}='image/jpeg'; } elsif($FORM{$obj_form} =~ /^\x1F\x8B\x08\x00.+/) { $sii_pch_ext = '.pch' if($sii_pch_ext eq ''); $obj_ext=$sii_pch_ext; $FORM{$obj_form.'_Content-Type'}='image/pch'; } if($obj_ext eq '') { #--- MIME type check $mime=$FORM{$obj_form.'_Content-Type'}; if( $mime =~ /image\/gif/i) { $obj_ext='.gif'; } # GIF elsif($mime =~ /image\/jpeg/i) { $obj_ext='.jpg'; } # JPEG elsif($mime =~ /image\/x-png/i) { $obj_ext='.png'; } # PNG } #--- M extension check if($obj_ext eq '') { $fext =$FORM{$obj_form.'_filename'}; if($fext =~ /\.gif$/i) { # GIF $obj_ext='.gif'; $FORM{$obj_form.'_Content-Type'}='image/gif'; } elsif($fext =~ /\.jpe?g$/i) { # JPEG $obj_ext='.jpg'; $FORM{$obj_form.'_Content-Type'}='image/jpeg'; } elsif($fext =~ /\.png$/i) { # PNG $obj_ext='.png'; $FORM{$obj_form.'_Content-Type'}='image/x-png'; } elsif($fext =~ /\.pch$/i) { # PCH $obj_ext='.pch'; $FORM{$obj_form.'_Content-Type'}='image/pch'; } } if($obj_ext eq '') { errorexit ('post','The file extension you have uploaded is not supported by us.','Please change the extension and try again.'); } #--- File name my $No = sprintf("%06d",$access); $FORM{$obj_form.'_name'}=$obj_head.$No.$obj_ext; if($obj_ext eq '.gif') { # Incoming Headers if($FORM{$obj_form} =~ /^GIF\d\d[a-z](.)(.)(.)(.).+/s) { $FORM{$obj_form.'_width'} =ord($2)*256 + ord($1); $FORM{$obj_form.'_height'}=ord($4)*256 + ord($3); } else { # Header Trouble $FORM{$obj_form.'_width'} =0; $FORM{$obj_form.'_height'}=0; } } elsif($obj_ext eq '.png') { if($FORM{$obj_form} =~ /^\x89\x50\x4E\x47\r\n\x1A\n.{10}(.)(.)..(.)(.).+/s) { $FORM{$obj_form.'_width'} =ord($1)*256 + ord($2); $FORM{$obj_form.'_height'}=ord($3)*256 + ord($4); } else { # Header Trouble $FORM{$obj_form.'_width'} =0; $FORM{$obj_form.'_height'}=0; } } elsif($obj_ext eq $sii_pch_ext) { $MSG_ADD_FORMAT = "thumbsrc=$FORM{thumbnail_name}\b" if($FORM{thumbnail_name} ne ''); if($FORM{'file_width'} > 0){ $s = pack("v",int $anime_speed); $w = pack("v",$FORM{'file_width'}); $h = pack("v",$FORM{'file_height'}); $FORM{$obj_form} =~ s/^(\x1F\x8B\x08\x00).{6}(.+)/$1$s$w$h$2/s } elsif($FORM{$obj_form} =~ /^\x1F\x8B\x08\x00(.)(.)(.)(.)(.)(.).+/s) { $FORM{$obj_form.'_width'} =ord($4)*256 + ord($3); $FORM{$obj_form.'_height'}=ord($6)*256 + ord($5); $WCS_PCH=1if($FORM{$obj_form.'_width'}==0); } }elsif($obj_ext eq '.jpg') { $pointer=2; while() { $obj_jhead=substr($FORM{$obj_form}, $pointer, 9); # SOF(Start Of Frame) Marker Analysis # FFC0 : Baseline DCT, Huffman coding # FFC1 : Extended sequential DCT, Huffman coding # FFC2 : Progressive DCT, Huffman coding if($obj_jhead =~ /\xff(.)(.)(.)(.?)(.?)(.?)(.?)(.?)/s) { if(($1 eq "\xc0") ||($1 eq "\xc1") ||($1 eq "\xc2")) { $FORM{$obj_form.'_width'} =ord($7)*256 + ord($8); $FORM{$obj_form.'_height'}=ord($5)*256 + ord($6); last; } else { $pointer += ord($2)*256 + ord($3) + 2; } } else { # Reject incoming headers $FORM{$obj_form.'_width'} =0; $FORM{$obj_form.'_height'}=0; last; } } } else { $FORM{$obj_form.'_width'} =0; $FORM{$obj_form.'_height'}=0; } } sub FileLogList{ undef @logfilelist;undef @fileNo; local($NO,$T,@Log,$n,$s,@S); if(!(-e "$filelog") ){ #When file does not exist, a new one is made open(MSGFILE,">$filelog"); } if(open(LOG,"<$filelog")) { @Log=; close(LOG); $n=0; $FORM{'sort'}=$SortMode if($FORM{'sort'} eq ""); if($FORM{'sort'}){ foreach (@Log){ ($NO,$_,$s)=split(/\t/); $NO =~ s/\s//g;$NO =~ s/\((.*)\)//; $T=$1; $T='0000/00/00[00:00:00]'if($T eq ""); $_ =~ s/\s//g; if($NO ne ""){$n++;push @S,"$T\=$NO"} push @logfilelist,$_ } @S=reverse sort @S; foreach (@S){ ($_,$NO)=split(/\=/); push @fileNo,$NO } }else{ foreach (@Log){ ($NO,$_,$s)=split(/\t/); $NO =~ s/\s//g; $NO =~ s/\(.*\)//; $_ =~ s/\s//g; if($NO ne ""){$n++;push @fileNo,$NO} push @logfilelist,$_ } } $LogTotal=$n } } sub FileListCheck(){ local($filename)=@_[0]; foreach (@logfilelist){ if($filename eq $_){return 1} }return 0 } sub FileLogWrite(){eval << '_SUB_'; my ($filename,$thumbnailname,$Thread)=@_; my (@Log,$cnt,$t);$cnt=1; if(open(LOG,"<$filelog")) { @Log=; close(LOG); } if(open(LOG,">$filelog")){ $filename=$filename?"\t".$filename:''; $thumbnailname=$thumbnailname?"\t".$thumbnailname:''; $t="\($year\/$month\/$mday\[$hour\:$min\:$sec\]\)"; print LOG "$Thread$t$filename$thumbnailname\n"; foreach (@Log){ s/ //g; chomp;next if($_ eq ""); ($msg_thread,$img_name,$sum_name)=split(/\t/); $cnt++; if($cnt > $LogMax){ &DelImageFile($img_name,$sum_name); $msg_thread =~ s/\(.*\)//; &fl($msg_thread); open(LOG,"<$LogFile"); @l=split /\t/,; close LOG; @a=split /\x08/,$l[18]; foreach(@a){($_,$v)=split /=/;$$_=$v} &DelImageFile($thumbsrc,$animesrc); unlink($LogFile); &call('Log_Delete'); next } print LOG "$_\n"; } close(LOG)} _SUB_ } sub FileLogResWrite(){eval << '_SUB_'; local($Thread)=@_[0]; local(@Log,$cnt,$t);$cnt=1; if(open(LOG,"<$filelog")){@Log=;close(LOG)} if(open(LOG,">$filelog")){ $t="\($year\/$month\/$mday\[$hour\:$min\:$sec\]\)"; foreach (@Log){ chomp;next if($_ eq ""); ($NO,$img_name,$sum_name)=split(/\t/); $NO =~ s/\(.*//; if($Thread eq $NO){ $t.="\t" if($img_name); $img_name.="\t" if($sum_name); print LOG "$Thread$t$img_name$sum_name\n";next; } print LOG "$_\n"; } close(LOG)} _SUB_ } sub FileLogDel(){eval << '_SUB_'; local($Thread)=@_[0]; local(@Log); if(open(LOG,"<$filelog")) { @Log=; close(LOG); } if(open(LOG,">$filelog")){ foreach (@Log){ chomp;if($_ eq ""){next}; ($msg_thread,$img_name,$sum_name)=split(/\t/); $msg_thread =~ s/\(.*\)//; next if($Thread eq $msg_thread); print LOG "$_\n"; } close(LOG) } _SUB_ } sub DelImageFile(){eval << '_SUB_'; foreach $filename(@_){ unlink ($FileSave_DIR.'/'.$filename) } _SUB_ } sub FileSave(){eval << '_SUB_'; if($FORM{'file_name'} ne ""){ if(open(BIN,">$FileSave_DIR/$FORM{'file_name'}")) { binmode BIN; print BIN $FORM{'file'};close BIN; } if($FORM{thumbnail_name} ne ""){ if(open(BIN,">$FileSave_DIR/$FORM{thumbnail_name}")) { binmode BIN; print BIN $FORM{'thumbnail'};close BIN; } } if($FORM{animedata_name} ne ""){ if(open(BIN,">$FileSave_DIR/$FORM{animedata_name}")) { binmode BIN; print BIN $FORM{'animedata'};close BIN; } } $access++; } _SUB_ } #------ sub CountFileOpen{ if(open(FILE,"<$count_file")) { local(@ACC)=; my @AccLine=split(/\t/ , $ACC[0]); ($ac_Thread ,$ac_msgcnt ,$access)=@AccLine[0..2]; $access =~ s/\s//g; }else{ if(open(FILE,">$count_file")){print FILE "0\t0\t0";} $ac_msgcnt=$ac_Thread=$access=0; } close(FILE) } sub SetPCH_Size{eval << '_SUB_'; $W = int $FORM{'width'}; $H = int $FORM{'height'}; $A = int $FORM{'speed'}; $E = 'The size oyu have indicated is strange.
Please choose a number between 0-99'; errorexit ('1','エラー',$E) if($W == 0||$H == 0||$W > 999||$H > 999); &fl($FORM{'No'}); if(-e "$LogFile") { open(MSG,$LogFile);@FileData=;close(MSG); $_=shift @FileData; @l = split(/\t/); errorexit ('1','Incorrect password','Inccorect password!
Please so back and try again.')if($FORM{'password'} ne $password &&!&PasswordCheck($FORM{'password'},$l[14])); } $pch="$FileSave_DIR/$l[10]"; if(open(PCH,"<$pch")){ binmode(PCH); $PCHSIZE = -s $pch; read(PCH, $PCHHEAD, 10); read(PCH, $PCHDATA, $PCHSIZE-10); close PCH; if($PCHHEAD =~ /(\x1F\x8B\x08\x00)\x00{6}/){ filelock; $s = pack("v",$FORM{'speed'}); $w = pack("v",$FORM{'width'}); $h = pack("v",$FORM{'height'}); open(PCH,">$pch");binmode(PCH); print PCH "$1$s$w$h$PCHDATA"; open(MSG,">$LogFile"); $l[11]=$FORM{'width'}; $l[12]=$FORM{'height'}; print MSG join "\t",@l; print MSG foreach(@FileData); close (PCH,MSG); fileunlock; }else{errorexit ('1','Error!','The data you have submitted cannot be entered.')} } &PageOpen _SUB_ } sub ImgContinue{eval << '_SUB_'; errorexit ('2','Error!','This program does not that capability!')if(!$Image_Continue_Use); &GetBrowse;&GetCookie; if($Input_Mail){ $FORM{mail}=$mail if $mail; if($FORM{mail} =~ /(.*)\@(.*)\.(.*)/){ &CookieWrite; } else { my $t = '*Your email format is incorrect.
Please enter letters and numbers.'if $FORM{mail}; errorexit ('c','Please enter an email address.',"$t

You are required to enter your email address.")if!$mail; } } my $cFlag; &fl($FORM{No}); if(open(LOG,"<$LogFile")) { $_=;close(LOG); @l=split /\t/; my @a=split(/\x08/,$l[18]); foreach(@a){($_,$v)=split /=/;$$_=$v} }else{ errorexit ('2','Error!','The number you have indicated cannot be found.') if(!$cFlag); } $OKj=1 if($l[10]=~/\.jpg$|\.gif$/); $OKp=1 if($l[10]=~/\.jpeg$|\.pch$/||$l[15]=~/\.jpeg$|\.pch$/||$animesrc=~/\.jpeg$|\.pch$/); $OKpj=1 if($l[10]=~/\.jpg$|\.png$/); if($FORM{"mode"} eq 'jpg'){ $cFlag = 2 }elsif($FORM{"mode"} eq 'pch'){ $cFlag = 3 } $Image=$l[10]=~/\.jpeg$|\.pch$/?'Animation Data':""; $err = 'The data cannot be salvaged.'; errorexit ('2','Error!',$err) if($OKj+$OKp+$OKpj+$OKpm < 1); if($cFlag > 1){ errorexit ('1','Incorrect password!','The password you have inserted is incorrect.
Please go back and try again.') unless($FORM{'password'} eq $password || &PasswordCheck($FORM{'password'},$l[14]) || !$Image_Continue_Pass || $Image_Continue_Pass==2 && $FORM{'t'} eq 'new' ); if($cFlag == 3){ if($l[10] =~/\.jpeg$|\.pch$/){ $Lfile=$l[10]; }elsif($l[15] =~/\.jpeg$|\.pch$/){ $Lfile=$l[15]; }elsif($animesrc=~/\.jpeg$|\.pch$/){ $Lfile=$animesrc; }else{errorexit ('2','Error!',$err)} $FORM{'anime'}='true'; }elsif($cFlag == 2 && $l[10] =~/\.jpg$|\.gif$/){ $Lfile=$l[10]; $FORM{'anime'}='false'; }else{errorexit ('2','Error!',$err)} $pch = "$FileURL_DIR/$Lfile"; $FORM{'width'} = $l[11]; $FORM{'height'} = $l[12]; $l[16]=~ s/(\d+)Day//; $p_day = $1; $l[16]=~ s/(\d+)Hour//; $p_hour= $1; $l[16]=~ s/(\d+)Min//; $p_min = $1; $l[16]=~ s/(\d+)Sec//; $p_sec = $1; $paint_add_time = ($p_day*24*3600)+($p_hour*3600)+($p_min*60)+$p_sec; if($sii_archive=~/applet\.cgi/){ if(-e 'pch.cgi'){$pch = "pch.cgi?$Lfile"} elsif(-e '../pch.cgi'){$pch = '../pch.cgi?'.$Lfile} else{errorexit ('1','pch.cgi cannot be found.','In order to continue the animationa nd this image, you have have pch.cgi.
Please go to WonderCatStudio to obtain a copy.')} $pch = "pch.cgi?$Lfile" } &escape(\$LOG_app);&escape(\$FORM{'password'});&escape(\$FORM{'newpass'});&escape(\$browse); $cgi_param.="&mode=$FORM{'t'}&No=$FORM{'No'}&app_add=$l[17]&passwrd=$FORM{'password'}&newpass=$FORM{'newpass'}"; $param = $Lfile=~/\.pch$|\.jpeg$/?'pch_file':'image_canvas'; $PARAM_SII.=""; $SII_ARGUMENT.=$cgi_param; &PaintOpen; } $OKj=$OKj==1 ? '':''; $OKp=$OKp==1 ? '':''; if($Image_Continue_Pass){$PINPUT ="Password:"} else{$PINPUT =""} print "Content-type: text/html\n$Exp\n"; &HTML_HEAD; print <

Continue No.$FORM{No}

$OKb$Image

The continued image will appear on the: $PINPUT
New password:
$I
[
BACK]
HTML &HTML_FOOT; exit; _SUB_ } sub ImgReplace{ $crypt_pass=$crypt_Use ? crypt($newpass,'ID'):$newpass if($fc eq 'captor' && $newpass ne ''); if($mode eq 'new'){ $app = AppName($app_add); } return if($mode ne 'rep'); &fl($No); if(-e "$LogFile") { open(MSG,$LogFile);@FileData=;close(MSG); $_=shift @FileData;chomp; my @l = split(/\t/); if($Image_Continue_Pass && !&PasswordCheck($passwrd,$l[14]) && $passwrd ne $password ){ print "Content-type: text/plain\n\nerror\n Error! \n Incorrect password! \ Please go back and try again."; fileunlock;exit } open(MSG,">$LogFile"); $app = AppName($l[17]); my(%a,%A); @a = split /\x08/,$l[18]; foreach(@a){ ($_,$v)=split /=/; $A{$_}=$v; } &DelImageFile($l[10],$l[15],$A{'animesrc'},$A{'thumbsrc'}); my $log_thumb; if($FORM{animedata_name}){ $log_thumb = $FORM{animedata_name}; $A{'thumbsrc'} = $FORM{thumbnail_name}; }elsif($FORM{thumbnail_name}){ $log_thumb = $FORM{thumbnail_name}; delete $A{'animesrc'}; }else{ delete $A{'thumbsrc'}; } $MSG_ADD_FORMAT="$_=$A{$_}\b" foreach(keys %A); $l[14]=$crypt_pass if($newpass ne ''); print MSG "$l[0]\t$l[1]\t$C_date\t$l[3]\t$l[4]\t$l[5]\t$l[6]\t$HOST\t$IP\t$browse\t$FORM{'file_name'}\t$FORM{'file_width'}\t$FORM{'file_height'}\t$FORM{'file_length'}\t$l[14]\t$log_thumb\t$paint_time\t$app\t$MSG_ADD_FORMAT\n"; foreach(@FileData){print MSG}; close(MSG); } if(open(LOG,"<$filelog")){@Log=;close(LOG)} if(open(LOG,">$filelog")){ $t="\($year\/$month\/$mday\[$hour\:$min\:$sec\]\)"; foreach (@Log){ chomp;next if($_ eq ""); ($NO,$img_name,$sum_name)=split(/\t/); $NO =~ s/\(.*//; if($No eq $NO){ $t.="\t" if($img_name); print LOG "$No$t$FORM{'file_name'}\t$log_thumb\n";next; } print LOG "$_\n"; } close(LOG)} &FileSave; if(open(FILE,">$count_file")) { $ac_msgcnt++; print FILE "$ac_Thread\t$ac_msgcnt\t$access\n"; print FILE time()."\t$name\t$title\t$mesg_log\t$IP\($HOST\)\t$FORM{'file_length'}"; close(FILE); } fileunlock; &MsgReflesh; print "Content-type: text/plain\n\nok"; exit } sub AppName(){eval << '_SUB_'; if(@_[0] eq 'sii'){ @_[0] = 'sii*1'; }elsif(@_[0] eq ''){ @_[0] = '+sii'; }elsif(@_[0]=~/(\+?)sii\*?(\d*)/){ $up = $1; $cnt = $2+1; @_[0] = $up.'sii*'.$cnt; }else{@_[0] = $app} return @_[0] _SUB_ } ############################################################# #Oekaki page open # sub PaintOpen{eval << '_SUB_'; if($Input_Mail && $fc =~ /^paint/){ if($FORM{mail} =~ /(.*)\@(.*)\.(.*)/){ &CookieWrite; } else { &GetCookie; my $t = '*You have not entered an email address.
Emails can only contain letters and numbers.'if $FORM{mail}; errorexit ('c','Please enter your email address.',"$t
Your email address must be entered for the action to work.")if!$mail; } $SII_ARGUMENT.="&mail=$mail"; } errorexit ('p','Error','「'.$paint_cgi.'」cannot be found.
This file is important for all WCS boards 7.0 and over.')if(!-e $paint_cgi); require $paint_cgi; errorexit ('1','Oekaki update error.','「paint.cgi」'.$PAINT_VERSION.' and '.$BBS_Version.' cannot be used together.
Please make sure the version of the two files match.') if($PAINT_VERSION ne 'Blue Pencil'); if($fc eq 'paint_sii'){&Open_sii} elsif($fc eq 'paint_pai'){&Open_pai} elsif($fc eq 'paint_pic'){&Open_pic} elsif($fc eq 'open_pch'){&Open_pch} else{&Open_sii} _SUB_ } sub Restore{eval << '_SUB_'; $TotalMsgByte=0; $TotalIMGByte=0; $ThreadID=0; $IMG_ID=0; $MSG_ID=0; $MSG_CNT=0; &GetDate(); if(! opendir DIR,$FileSave_DIR){errorexit ('1','Directory cannot be opened.','「'.$FileSave_DIR.'」cannot be opened.
Please go check your config.cgi file.')}; while ($_=readdir DIR){ if($_ =~ /$MessageNameHead.*\.log/){ push @FileList,$_;$MSG_CNT++; } } if($FORM{'filelog'} eq ""&&$FORM{'countlog'} eq ""){$analyze=1}; print "Content-type: text/html\n\n"; $TITLE=$analyze==1?'Analysis':'Restore'; print < $TITLE

Directory $TITLE

EOF #SORT @FileList=reverse sort @FileList; if($FORM{'filelog'}){open(FLOG, ">$FORM{'filelog'}")} foreach (@FileList){ $MSG_SIZE=-s "$FileSave_DIR/$_"; open(MSG,"<$FileSave_DIR/$_");@LOG=;close(MSG); print ""; $_f_ID=''; $_f_src=''; $_f_sum=''; $_ =~ s/$MessageNameHead(.*)\.log//; if($ThreadID < $1){$ThreadID=int $1}; $_f_ID=int $1; ($AC_msgcnt,$name,$date,$title,$mail,$url,$mesg,$HOST,$IP,$BROWSER,$FileSRC,$FileW,$FileH,$FileSize,$_,$ThumbnailName,$Paint_Time)=split(/\t/,shift @LOG); $IMG_SIZE=0;$IMG_F="";$IMG_S=""; if($FileSRC){$IMG_SIZE=-s "$FileSave_DIR/$FileSRC"; $TotalIMGByte+=$IMG_SIZE; if($IMG_SIZE > 0){ $IMG_F="○ \($IMG_SIZE byte\)"; $_f_src="\t".$FileSRC; }else{$IMG_F='× Not Found'} } if($ThumbnailName){$IMG_SIZE=-s "$FileSave_DIR/$ThumbnailName"; $TotalIMGByte+=$IMG_SIZE; if($IMG_SIZE > 0){ $IMG_S="○ \($IMG_SIZE byte\)"; $_f_sum="\t".$ThumbnailName; }else{$IMG_S='× Not Found'} } foreach (@LOG){ chomp ;@Re=split(/\t/); $date=$Re[2]; } $date =~ /^(\d*)\/(\d\d)\/(\d\d).*(\d\d\:\d\d)$/; $date="\($1\/$2\/$3\[$4\:00\]\)"; if($FORM{'filelog'}){print FLOG "$_f_ID$date$_f_src$_f_sum\n"} if($FileSRC =~ /$FileNameHead(.*)\.(png|jpg|gif)/){ if($IMG_ID < $1){$IMG_ID=$1}; } if($AC_msgcnt =~ /(\d*)/){ if($MSG_ID < $1){$MSG_ID=$1}; } foreach (@LOG){ @Re=split(/\t/); if($Re[0] =~ /(\d*)/){ if($MSG_ID < $1){$MSG_ID=$1}; } } print "\n"; $TotalMsgByte +=$MSG_SIZE; } $MSG_ID++;$IMG_ID++; if($FORM{'countlog'}){open(CLOG, ">$FORM{'countlog'}"); print CLOG "$ThreadID\t$MSG_ID\t$IMG_ID\n"; close(CLOG)} if($FORM{'filelog'}){close(FLOG)} print <
Log File(Size) Message ID Image Size Thumbnail Size
".$_." \( $MSG_SIZE byte\)$AC_msgcnt$FileSRC$IMG_F$ThumbnailName$IMG_S
Log Number
Slot ID
Image ID
Message ID
Total Message Log Size 
Total Image Data Size
$MSG_CNT
$ThreadID
$IMG_ID
$MSG_ID
$TotalMsgByte byte
$TotalIMGByte byte
EOF if(!$analyze){print "FileLog \: $FORM{'filelog'}
CountLog \: $FORM{'countlog'}

as been restored."} print <
$SKIN_MODE_INPUT

EOF exit _SUB_ } #Restore ############################################################# # sub HelpOpen{eval << '_SUB_'; print "Content-type: text/html\n$Exp\n"; print < BBS Configuration $TXT_HEADER

$TXT_HELP_TOP
EOF print $TXT_HELP_SII if($siiApplet_Use); print $TXT_HELP_OHONO if($PictureBBSApplet_Use); print $TXT_HELP_NINA if($BBSPainterApplet_Use); print <
$F BBS Configurations
*Canvas's biggest resolution is "at the image's greatest resolution". $F Maximum log entries$F $LogMax entries $F Maximum message size$F $Maxmesg byte $F Maximum response message size$F $MaxResmesg byte $F Maximum paint image size$F $MaxPaintData byte $F Maximum animation data size$F $MaxAnimeData byte $F Maximum thumbnail data size$F $MaxThumbnailData byte $F Maximum upload data size$F $MaxUpLoadData byte $F Maximum received resolution$F $maxImageWidth x $maxImageHeight $F Maximum canvas size$F $viewLimitW x $viewLimitH EOF if($TAGS_Use){ print ''.$F.' Listed below are tags you can use. *Tags must be closed in order for message to send.
'; foreach(@OKTags){print "\<\;$_\>\;\ \;"} print ''; } print <
[BACK]
$TXT_BBS_MSGDOWN
$Version$SkinVer$ClientVer
EOF exit _SUB_ } sub PaletteOpen(){ my $Palette_name=@_[0]; my $l_name,$p_name,@value; open(Palette,"$color_Palette_file"); while ($_=){ s/[\t\s]//g; @_=split /\,/; $l_name=shift;$p_name=shift; push @Palette,$l_name."\t".$p_name; if($Palette_name eq $l_name){@C_Palette=@_} } close Palette; } #---------------------------------------- sub errorexit{eval << '_SUB_'; $E_Flag=@_[0];$E_TITLE=@_[1];$E_BODY=@_[2];local $eADMIN; if($E_Flag eq "0"){$eADMIN="\[ADMIN\] "} elsif(($E_Flag eq "post")&&(!$E_NoPost)){ print "Content-type: text/html\n$Exp\n"; $fc ='post';&HTML_HEAD; $_=$SKIN_MAIN_FORMAT; s/(name="title")/$1 value="$title"/si; s/(name="mesg".*)(<\/textarea>)/$1$FORM{'mesg'}$2/si; if($FORM{'l'} ne ""){ s/(.*)//si; $ImageUpload_Use=0 } if($interrupt){ s/(name="fc" VALUE="write">)/$1/si; $ImageUpload_Use=0 } s//

$E_TITLE<\/H1>
$E_BODY
$TXT_ERROR/si; $SKIN_MAIN_FORMAT=$_; &PostForm; print $SKIN_MAIN_FORMAT; &HTML_FOOT; exit; }elsif($E_Flag eq "ref"){ $REF = "\n"; } print "Content-type: text/html\n$Exp\n" if($E_Flag ne 'skin'); eval '&skin("SKIN_ERROR_HTML")'; $_=$SKIN_ERROR_HTML; if(!$_){ print < $REF$E_TITLE$TXT_HEADER



$E_TITLE


$E_BODY
$TXT_ERROR

$eADMIN\[BACK\]
$TXT_BBS_MSGDOWN
$Version$SkinVer$ClientVer
EOF }else{ s/(.*)//si; $SKIN_HEAD_FORMAT=$1; s/(.*)//si; $SKIN_FOOTER_FORMAT=$1; s/(.*)//si; $SKIN_MAIN_FORMAT=$1; if($E_Flag eq "c"){ $E_BODY.='
'; }else{ $E_BODY.='
'; } $_=$SKIN_HEAD_FORMAT; s/()(.*)(<\/TITLE>)/$1$E_TITLE$3/si; s/(<\/HEAD>)/$TXT_HEADER\n$1/si; print; $_=$SKIN_MAIN_FORMAT; s/<BODY>/<BODY $BODY>/si; s/\$ErrorTitle/$E_TITLE/si; s/\$ErrorMessage/$E_BODY/si; s/\$TXT_ERROR/$TXT_ERROR/si; s/href="RELOAD"/href="$BBSNoteCGI$SKIN_MODE_RE"/sig; print; $_=$SKIN_FOOTER_FORMAT; s/<!--SKIN_TXT_BBS_MSGDOWN-->/$TXT_BBS_MSGDOWN/si; s/<!--SKIN_Version:begin-->.*<!--SKIN_Version:end-->/$ADMIN$Version$SkinVer$ClientVer/si; print } exit _SUB_ } #DLL #----------------<Form Data> sub GetForm{ if($ENV{'REQUEST_METHOD'} eq 'GET'){$func=$ENV{'QUERY_STRING'}} else{read (STDIN, $func, $ENV{'CONTENT_LENGTH'})} @parts=split(/&/, $func); foreach (@parts) { ($v_name, $value)=split(/=/); $value =~ tr/+/ /; &unescape(\$value); $FORM{$v_name}=$value }} ############################################################# #Multipart Form sub FormMultipart{ binmode(STDIN);binmode(STDOUT);binmode(STDERR); if($ENV{'CONTENT_TYPE'} =~ /\Amultipart\/form-data/) { if($ENV{'REQUEST_METHOD'} eq 'GET'){$func="$ENV{'QUERY_STRING'}"} else{read (STDIN, $func, $ENV{'CONTENT_LENGTH'})} local($CR)="\r\n"; # Line feed code split(/$CR/,$func,2);#Begin split $bound=@_[0]; @forms=split(/$bound/,$func); shift(@forms);pop(@forms);my $f; foreach (@forms) { $_ =~ s/^$CR//;$f=0; $_ =~ s/\s$//;$_ =~ s/\s$//; ($FORM_head,$FORM_data)=split(/$CR$CR/,$_,2); $FORM_head =~ s/$CR/; /g;$FORM_head =~ s/: /=/g;$FORM_head =~ s/\"//g; @pairs=split(/; /,$FORM_head); foreach $pair(@pairs) { ($param_name,$param_value)=split(/=/,$pair,2); if($param_name eq 'name'){next if($f);$f=1} $names{$param_name}=$param_value; } $FORM_name=$names{'name'}; foreach(keys(%names)) { $FORM{$FORM_name.'_'.$_}=$names{$_}; } $FORM{$FORM_name}=$FORM_data; } }else{&GetForm}$fc=$FORM{'fc'} } #--------------------------------- sub GetDate(){ $TIME = @_[0] eq ''? time + $TIME_DIFF_SEC:@_[0]; @youbi=("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); @tuki=("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); ($sec,$min,$hour,$mday,$month,$year,$wday) = gmtime(time + 2*365*24*3600);$year += 1900; $cookielimit=sprintf( "%s, %02d-%s-%4d %02d:%02d:%02d GMT",$youbi[$wday],$mday,$tuki[$month],$year,$hour,$min,$sec); @T=localtime($TIME); ++$T[4];$T[5] += 1900; $date=sprintf( "%4d/%02d/%02d (%s) %02d:%02d:%02d",$T[5],$T[4],$T[3],$youbi[$T[6]],$T[2],$T[1],$T[0]); $date=~/(\d*)\/(\d\d)\/(\d\d) \((.*)\) (\d\d)\:(\d\d)\:(\d\d)/; $year=$1;$month=$2;$mday=$3;$week=$4;$hour=$5;$min=$6;$sec=$7; $C_date="$year\/$month\/$mday ($week) $hour\:$min"; $Today="$year\/$month\/$mday"; $C_before="$year\/$month\/$mday\($hour\:$min\:$sec\)"; chop($date) if($date =~ /\n$/); } sub GetBrowse{eval << '_SUB_'; $IP=$ENV{'REMOTE_ADDR'}; $HOST=$ENV{'REMOTE_HOST'}; if($HOST eq '') { $HOST=$IP; } if($HOST eq $IP) { $HOST=gethostbyaddr(pack('C4',split(/\./,$HOST)),2) || $IP} $browse= $ENV{'HTTP_USER_AGENT'}; $browse =~ s/</</g; $browse =~ s/>/>/g; $browse =~ s/\n//g; if($browse=~ /MSIE ([\d.]+)/){$AGENT="MSIE";$AGENT_S="MSIE ".$1} elsif($browse=~ /DreamPassport/){$AGENT="DC";$AGENT_S="DreamPassport"} elsif($browse=~ /Mozilla\/5/){$AGENT="NN";if($browse=~ /Netscape6/){$AGENT_S="NN 6"}else{$AGENT_S="NN 5"}} elsif($browse=~ /Mozilla\/4/){$AGENT="NN";$AGENT_S="NN 4"} elsif($browse=~ /Mozilla\/3/){$AGENT="NN";$AGENT_S="NN 3"} elsif($browse=~ /MSIE/){$AGENT="MSIE";$AGENT_S="MSIE"} else{$AGENT="OTHER";$AGENT_S="OTHER"} local(@BrowsOS)=( 'Opera,Opera', 'Windows NT 5.1,WinXP', 'Windows NT 5,Win2000', 'Windows NT,WinNT', 'Win2000,Win2000', 'WinNT,WinNT', 'Win95,Win95', 'Windows 95,Win95', 'Windows 98,Win9x', 'Mac_PowerPC,Mac', 'Macintosh,Mac', 'PPC,Mac', '68K,Mac', 'DreamPassport,DC', 'FREEBSD,FreeBSD', 'FRINBSD,FrinBSD', 'BSD/OS,HP-UX', 'Linux,Linux' ); foreach(@BrowsOS){ @_=split(/,/); if($browse =~ /\Q@_[0]\E/){ $USER_OS=@_[1];last } } if($USER_OS eq "Win9x"){if($browse =~ /Win 9x/){$USER_OS='WinMe'}else{$USER_OS='Win98'}} $USER_OS='OTHER' if($USER_OS eq ''); _SUB_ } sub GetMsgPassword(){eval << '_SUB_'; local($ThreadID)=@_[0]; if($ThreadID =~ /(\d+)\-(\d+)/){ $MsgNo=$1;local($AesNo)=$2; &fl($MsgNo); if(-e "$LogFile") { open(MSG,$LogFile);@FileData=<MSG>;close(MSG); foreach (@FileData) { @l=split(/\t/); return $l[4] if($AesNo eq $l[0]); } } return -1; } &fl($ThreadID); if(-e "$LogFile") { open(MSG,$LogFile);@FileData=<MSG>;close(MSG); $line=shift @FileData; @LogLine=split(/\t/ , $line); $_=$LogLine[14];chomp; return $_ } return -1; _SUB_ } sub PasswordCheck(){eval << '_SUB_'; local($pass)=@_[0];local($c_pass)=@_[1]; if($crypt_Use){ if($c_pass eq crypt($pass,'ID')){return 1} } else{ if($c_pass eq $pass){return 1} } return 0; _SUB_ } sub Panic{eval << '_SUB_'; #Flower Panic (Code improved) local(*mesg, $C_table, $datfile)=@_; $PanicFile=$datfile if($datfile ne ''); open(PANIC, "$PanicFile"); local(@c,$plen,$panic_before,$panic_after,$panic_conf,$panic_tagpre,$panic_tagpost); if($C_table eq 'black'){ @c=("CCCCFF","6666FF","9966FF","9999FF","CC99FF","FFCCFF","FF99FF","FF33FF","FF66CC","FF99CC","FFCCCC","FF99FF","FF99CC","FF9999","FF6666","FF3333","FF9999","FF9933","FFCC66","FFFF99","FFFF66","99FF99","99FF66","66FF66","00CC00","00CC66","00CC99","00FF99","33FFCC","66FFCC","99FFCC"); } elsif($C_table eq 'custum'){ @c=@PanicColorTable } else{ @c=("9999FF","0099FF","0033CC","6600CC","6600FF","9966FF","9933FF","9900CC","CC00CC","FF00FF","FF66FF","FF99FF","FF99CC","FF6699","FF0099","FF0066","FF3333","FF6666","FF3333","FF6633","FF6600","FF9900","FFCC33","669900","009966","00CC00","33CC99","00CCCC","336699","663399","CC3399"); } $plen = @c; while ( $panic_before=<PANIC> ) { #↑line 1 break unless ( $panic_after=<PANIC> ); #line 2 break unless ( $panic_conf =<PANIC> ); #line 3 break unless ( <PANIC> ); #line 4 empty read chomp($panic_before,$panic_after,$panic_conf); if($panic_conf eq "rand"){$panic_tagpre="<Font color=\"$c[rand $plen]\">";$panic_tagpost='</Font>'} elsif($panic_conf eq "brand") { $panic_tagpre="<B><Font color=\"$c[rand $plen]\">"; $panic_tagpost='</Font></b>'} elsif($panic_conf eq "bbrand") { $panic_tagpre="<B><Font color=\"$c[rand $plen]\" SIZE=\"+1\">"; $panic_tagpost='</Font></b>'} elsif($panic_conf eq "Bbrand") { $panic_tagpre="<B><Font color=\"$c[rand $plen]\" SIZE=\"+2\">"; $panic_tagpost='</Font></b>'} elsif($panic_conf eq "Birand") { $panic_tagpre="<i><Font color=\"$c[rand $plen]\" SIZE=\"+2\">"; $panic_tagpost='</Font></i>'} elsif($panic_conf eq "birand") { $panic_tagpre="<i><Font color=\"$c[rand $plen]\" SIZE=\"+1\">"; $panic_tagpost='</Font></i>'} elsif($panic_conf eq "irand") { $panic_tagpre="<i><Font color=\"$c[rand $plen]\">"; $panic_tagpost='</Font></i>'} elsif($panic_conf eq "b") { $panic_tagpre='<b>'; $panic_tagpost='</b>'} elsif($panic_conf eq "i") { $panic_tagpre='<i>'; $panic_tagpost='</i>'} elsif($panic_conf eq "") { $panic_tagpre=''; $panic_tagpost=''} $mesg =~ s/([^\201-\236]|^)\Q$panic_before\E/$1$panic_tagpre$panic_after$panic_tagpost/g; } close(PANIC); _SUB_ } sub CookieWrite{eval << '_SUB_'; &GetDate(); my($c_name,$c_mail,$c_url,$c_pass,$c_flower); $c_name=$name=$FORM{'name'}; $c_name=$COOKIE{name}if !$c_name; $c_mail=$mail=$FORM{'mail'}; $c_mail=$COOKIE{mail}if !$c_mail; $c_mail =~ s/mailto\://g; $c_url=$url=$FORM{url}; $c_url=$COOKIE{url}if !$c_url; $c_url =~ s/http\:\/\///g; $c_pass=$passwrd=$FORM{'password'}; $c_pass=$COOKIE{password}if !$c_pass; $c_flower=$flower=$FORM{'flower'}; $c_flower=$COOKIE{flower}if !$c_flower; if($flower eq "1"){$PanicON="Checked"} if($AGENT eq "NN"){$CookiePath =~ s/\/$//}; if($FORM{mode}=~/light|catalog|noimage|normal/ || $FORM{mode} eq ''){ $c_mode=$FORM{mode}; $c_sort=$FORM{sort}; } else { $c_mode=$COOKIE{mode}; $c_sort=$COOKIE{sort}; } &escape(\$c_name);&escape(\$c_mail);&escape(\$c_url);&escape(\$c_pass);&escape(\$c_flower); $CookieData="BBSNote\=version\:Ver7x\,name\:$c_name\,mail\:$c_mail\,url\:$c_url\,flower\:$c_flower\,passwrd\:$c_pass\,mode\:$c_mode\,sort\:$c_sort\,$ADD_COOKIE>; expires=$cookielimit"; &call('CookieWrite'); print "Set-Cookie: $CookieData\n"; if($MetaCookie_use){$Meta_Cookie .= "<META HTTP-EQUIV=\'Set-Cookie\' CONTENT=\'$CookieData\'>"} _SUB_ } sub GetFileCookie{eval << '_SUB_'; my ($F,$T); open(CREV,"<$cookie_file");@c=<CREV>;close CREV; @c = reverse @c; foreach(@c){ ($c_time,$ID,$interrupt,$rev_flag,$c_pass,$FORM{name},$FORM{mail},$FORM{url},$FORM{password},$FORM{flower},$imgname,$app)=split /\t/; if($FORM{'id'} eq $ID){$F = 1;chomp $app;$PanicON=' checked'if$FORM{flower};last} } if($F){ $T = time - $MainMsgForm_Limit; filelock; open(CREV,">$cookie_file"); foreach(@c){ ($c_time,$ID,$F) = split /\t/,$_,3; print CREV if($c_time > $T && $FORM{'id'} ne $ID); } close CREV; fileunlock; unlink $cookie_file if(-z $cookie_file); $rev_flag=int $rev_flag; if($FORM{name}){&CookieWrite}else{&GetCookie} $TXT_HEADER.='<META HTTP-EQUIV="Expires" CONTENT="no-cache"><META HTTP-EQUIV="Pragma" CONTENT="no-cache">'; &PostOpen if $rev_flag; } $fc=page; &GetCookie; return _SUB_ } sub GetCookie{ $name="";$mail='';$url='';$PanicON=""; if($ENV{"HTTP_COOKIE"}){ my ($s,$e); my $c =$ENV{"HTTP_COOKIE"}; $s=index $c,"BBSNote="; if($s != -1){ $e=index $c,">",$s; $e=length $c if($e == -1); local(@cdata); @cdata=split(/\,/, substr $c,$s,$e-$s); foreach (@cdata){ local($c_name, $val)=split(/\:/); &unescape(\$val); $COOKIE{$c_name}=$val } $C_before=$COOKIE{"C_before"}; $name=$COOKIE{"name"}; $mail=$COOKIE{"mail"}; $url=$COOKIE{"url"}; $flower=$COOKIE{"flower"}; $passwrd=$COOKIE{"passwrd"}; $PanicON="Checked" if($flower eq "1"); &call('GetCookie') } } } sub AdminPassCheck{eval << '_SUB_'; errorexit ('1','Incorrect password!','The password you have entered is incorrect.<BR>Please go back and try again.')if($FORM{'password'} ne $password );$adminMode =1 _SUB_ } sub BrowsCss{eval << '_SUB_'; &GetBrowse; &GetCookie if $fc ne 'rev'; $T_SIZE=$AGENT eq 'MSIE'?30:20; local($FmaxData)=int($maxData / 1000); if($ImageUpload_Use){ $POST_COUTION_MSG1="$Font_UserTag \* The maximum accepted image size is<B> $FmaxData </b>KB.(The biggest resolution is \: $maxImageWidth x $maxImageHeight )<BR>\n"; $POST_COUTION_MSG1.= '* The following extensions are accepted <B>JPG・PNG・GIF・PCH</b>.<BR>'.$Font_UserEndTag; } $POST_COUTION_MSG2=$Font_UserTag.'* Password can be up to 8 letters or numbers.'.$Font_UserEndTag; _SUB_ } sub FastBoot{eval << '_SUB_'; if($NotFastCheck eq "true"){return} my @err=(' cannot be found.',' cannot be started without permission.','Startup error.'); if(! -e $FileSave_DIR){ if(!mkdir $FileSave_DIR,0777){ errorexit ('0',$err[3],"「$FileSave_DIR」Directory".$err[0]); } chmod 0777,$FileSave_DIR; } errorexit ('0',$err[3],"「$FileSave_DIR」is not there.")if(! -d $FileSave_DIR); errorexit ('0',$err[3],"「$FileSave_DIR」Directory".$err[1].'(777 or 705)')if((! -R $FileSave_DIR)||(! -W $FileSave_DIR)||(! -X $FileSave_DIR)); errorexit ('0',$err[3],"Count file「$count_file」".$err[0])if(! -e $count_file); errorexit ('0',$err[3],"Count file「$count_file」".$err[1])if(! -W $count_file); errorexit ('0',$err[3],"File log「$filelog」".$err[0])if(! -e $filelog); errorexit ('0',$err[3],"File log「$filelog」".$err[1])if(! -W $filelog); errorexit ('0',$err[3],"Panic file「$PanicFile」".$err[0])if(! -e $PanicFile); errorexit ('0',$err[3],"Palette file「$color_Palette_file」".$err[0])if(! -e $color_Palette_file); _SUB_ } sub randstr{ my($n,$ti,$id); while($n<8){$ti=chr(int(rand(74)+48));if($ti =~ /\w/){$n++;$id.=$ti}} return $id; } sub call(){foreach (eval '@'.@_[0]){eval}} ###// File Lock sub filelock { $try=$lock_try; while(!mkdir($lockdir,0755)){ if(--$try <= 0) { if((-M $lockdir)*86400 > $lock_sec) { rmdir($lockdir)if(-e $lockdir); last; } $e1='You are already currently sending a file'.$lockdir;$e2='Please wait for file to send or wait longer to try again.'; errorexit ('5',$e1,$e2) if($fc ne 'captor'); print "Content-type: text/plain\n\nerror\n Error! \n$e1\n$e2";exit } sleep($lock_sleep); } } sub fileunlock { rmdir($lockdir)if(-e $lockdir) } <!--EndFreetext--> <p> </body> </html>