#!/usr/local/bin/perl # --------------------------------------------------- # # TeaChat $version = '1.7.2'; # 2002/2/18 # (c) 1998-2002 Toshikazu.S All rights reserved. # # URL : http://www.teachat.org/ # E-Mail : webmaster@teachat.org # # --------------------------------------------------- ############################### ユーザー設定ここから $script = 'http://maiban.e-nihongo.net/chat.cgi'; # 【必須】chat,cgiのURL(http://からの記述を推奨) $password = 'banmai33'; # 【必須】管理パスワード(半角英数字) $dir = '.'; # chat.cgiから他のファイルへのパス。最後に「/」をつけないこと。意味がわからない人は触らないように。 $kcode = 'sjis'; # 漢字コード。EUCで設置する場合はここを「euc」に # --------データファイル-------- # ファイル名は変更を推奨。変更する場合は下記記述の他サーバー上のファイル名の変更も忘れずに。 $chat_file = "$dir/chat.dat"; $ctz_file = "$dir/ctz.dat"; $decorate_file = "$dir/decorate.dat"; $rank_file = "$dir/rank.dat"; $mem_file = "$dir/mem.dat"; $count_file = "$dir/count.dat"; $punish_file = "$dir/punish.dat"; ############################### ユーザー設定ここまで &file_open; # ---------------------基本設定---------------------- $method = 'POST'; $html_pl = "$dir/html.pl"; $tool_pl = "$dir/tool.pl"; $ctz_pl = "$dir/customize.pl"; $decorate_pl = "$dir/decorate.pl"; $color_dat = "$dir/color.dat"; $lockdir = "$dir/lock/"; $jcode = "$dir/jcode_se.pl"; $retry = 4; $background = " background=\"$background\"" if($background); $body = " $title EOF } # ---------------元IP取得 ホスト変換----------------- sub getip{ $ip = $ENV{'REMOTE_HOST'}; $ip = $ENV{'REMOTE_ADDR'} if(!$ip); if($trueip){ if($ENV{'HTTP_X_FORWARDED_FOR'} =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)(\D*).*/){ $ip = "$1.$2.$3.$4"; } elsif($ENV{'HTTP_CACHE_INFO'} =~ m/(\d+)\.(\d+)\.(\d+)\.(\d+)/){ $ip = "$1.$2.$3.$4"; } elsif($ENV{'HTTP_FROM'} =~ m/(\d+)\.(\d+)\.(\d+)\.(\d+)/){ $ip = "$1.$2.$3.$4"; } elsif($ENV{'HTTP_SP_HOST'} =~ m/(\d+)\.(\d+)\.(\d+)\.(\d+)/){ $ip = "$1.$2.$3.$4"; } elsif($ENV{'HTTP_VIA'} =~ m/.*\s(\d+)\.(\d+)\.(\d+)\.(\d+)/){ $ip = "$1.$2.$3.$4"; } elsif($ENV{'HTTP_FORWARDED'} =~ m/.*\s(\d+)\.(\d+)\.(\d+)\.(\d+)/){ $ip = "$1.$2.$3.$4"; } elsif($ENV{'HTTP_CLIENT_IP'} =~ m/.*\s(\d+)\.(\d+)\.(\d+)\.(\d+)/){ $ip = "$1.$2.$3.$4"; } } if($ip =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/){ ($i1,$i2,$i3,$i4) = split(/\./,$ip); $p_name = pack("CCCC",$i1,$i2,$i3,$i4); ($iname, @addr) = gethostbyaddr($p_name, 2); } $iname = $ip if(!$iname); return $iname; } # -------------------アクセス制限-------------------- sub punish{ open(DB,"$punish_file") || &error(8); @p_line = ; close(DB); $p_mode_ch = shift(@p_line); chop($p_mode_ch); $p_flag = 0; foreach (@p_line) { ($pmv, $phv) = split(/\t/, $_); chop($phv) if($phv =~ /\n/); if(($p_mode_ch eq "1") && ($pmv eq "1")){ if(($host =~ /$phv/) || ($xfor =~ /$phv/)){ &error(0); } } elsif(($p_mode_ch eq "2") && ($pmv eq "2")){ if($host =~ /$phv/){ $p_flag = 1; } } } if(($p_mode_ch eq "2") && !$p_flag){ &error(12); } if($hua =~ /Iria/i){ &error(0); } } # ---------------------表示処理---------------------- sub read{ $x_namez_cnt = @x_namez; if($x_namez_cnt){ foreach (@x_namez){ # $eucname = $name; # &jcode'convert(*eucname,'euc'); # &jcode'convert(*line,'euc'); &error(14) if($name eq $_); } } # &getreferer if($kickrom); &lock(3) if($lock_check); open(IN, "$chat_file") || &error(1); @lines = ; close(IN); &member if(!($ktai_ua && $FORM{'peephole'} && ($pass eq $password))); rmdir($lockfile) if($lock_check); $n_color =~ s/#//g; $s_color =~ s/#//g; $script =~ s/~/%7E/g; $realname = $name; $rom_name = $name; &encode($rom_name); $rom_name = '' if(!$romer && ($name eq $host)); $relper = "$script?name=$rom_name&reload=$reload&window=$window&view=on&space=$space&line_ch=$line_ch&high=$high&sechide=$sechide&secret3=$secret3&n_color=$n_color&addalert=$FORM{'addalert'}&filecheck=$FORM{'filecheck'}"; &http_header; $relper_nof = "&email=$email&s_color=$s_color&nof=on" if($nof); print qq(\n) if($reload && !$ktai_ua); &css if(!$high || !$ktai_ua); $rb = " [Reload]
\n" if($relb && !$nof); if($reloadcnt && !$high && $reload){ print qq(); $reljs = " onLoad=\"cnt=$reload\;timer\(\)\""; } print qq($body2$reljs>\n); print qq($title) if(!$ktai_ua); print qq($rb); if(!$filesize_flag && $ktai_ua && $FORM{'filecheck'} && !$chat){ print "
新規の発言はありません。新規の発言がある場合のみログを表\示します。
[1.Reload]
\n"; exit; } print qq(\n) if($alert_flag && $FORM{'addalert'}); if(!$high){ $mem_num = @mem_num; if($mem_num eq "0"){ $mem_num = 'なし'; } else{ $mem_num = "$mem_num人 : @mem_num"; } if(!$romer){ $memt = '参加者'; } else{ $memt = 'Access'; } if($romcount && !$romer){ $rom_num = @rom_num; if($rom_num eq "0"){ $rom_num = ' ROM なし'; } else{ $rom_num = " ROM $rom_num人"; } } else{ $rom_num = ''; } print qq( $memt $mem_num$rom_num); } print qq(
) if(!$ktai_ua); if($nof eq "on"){ require "$html_pl"; &operation; print qq(
\n); } elsif($inlog_sec_send eq "on"){ require "$html_pl"; &inlog_sec_send; print qq(
\n); } if($ktai_ua && ($k_tairom ne "on")){ if(!$exit){ require "$html_pl"; &i_operation; print qq(
\n); } else{ print qq(1.再入室); print qq(/2.HOME) if($home_k); print qq(
\n); } } $i = 0; foreach $line (@lines){ if(++$i > $window){ last; } ($time_v, $host3_v, $hua2, $name, $email, $chat, $n_color, $s_color, $greet, $s_host_v, $s_host_n, $realhost) = split(/\t/, $line); chop($realhost) if($realhost =~ /\n/); &time; $secflag = ''; if($email && ($email =~ /(.*)\@(.*)\.(.*)/)){ $mb = "$mailb_mark"; } elsif($email && ($email =~ /http:\/\//)){ $mb = "$mailb_mark"; } else{ $mb = "$mailb_mark"; } $flag_e = ''; if($s_host_v eq "enter" || $s_host_v eq "exit"){ $name = $notice; $n_color_ch = $notice_color; $mb = ''; if($greet){ $greet = "『$greet』 "; } if($secret3){ $line = ''; --$i; next; } $flag_e = 1; } elsif($s_host_v){ if($sechide){ $line = ''; --$i; next; } if(($s_host_v eq $host) && ($s_host_n eq $realname)){ $secflag = "さんから$s_host_nさんへの電報"; } elsif(($realhost eq $host) && ($s_host_v eq "ALL")){ $secflag = ":参加者全員への電報"; } elsif(($realhost eq $host) && ($realname eq $name)){ $secflag = ":$s_host_nさんへの電報"; } elsif(($s_host_v eq "ALL") && ($realname ne $host)){ $secflag = "さんから参加者全員への電報"; } else{ $line = ''; --$i; next; } $chat =~ tr/a-fA-F0-9/fedcbaFEDCBA9876543210/; $chat = &decode3($chat); $chat =~ tr/+/ /; } elsif($secret3){ $line = ''; --$i; next; } else{ $greet = ''; } if(!$flag_e){ $n_color_ch = $n_color; $chat = "$chat" if($saycolor_check); } # ログのホストアドレス表示 if($ipcomout eq "1"){ # 入室・退室時のみ表示する if($hua2){ $host3_v = " $host3_v"; }else{ $host3_v = ''; } } elsif($ipcomout eq "2"){ # 常に表示する $host3_v = " $host3_v"; } elsif($ipcomout eq "3"){ # コメントアウトしてソースに表示 $host3_v = ""; } else{ $host3_v = ''; # 条件にマッチしない場合は表示しない } $hua2 = " $hua2" if($hua2); $user = "$date_v$hua2$host3_v"; $chat = "$chat" if($cs_markbold); if(!$high){ $br = "

" if($space eq "on"); print qq($mb$name$secflag > $chat $greet[$user]$br); if($line_ch eq "on"){ print qq(
); } else{ print "
"; } print "\n"; } else{ $chat=~s/<[^>]*>//ig; $greet=~s/<[^>]*>//ig; print qq($name$secflag > $chat $greet\[$date_i\]); # print qq($name$secflag > $chat $greet\[$date_i\]); # print qq(

) if($space eq "on"); if($line_ch eq "on"){ print qq(


); } else{ print "
"; } print "\n"; } } print qq(); if($reload){ print qq(Reload : $reload ); } else{ print qq(Reload : off ) } print qq(Line : $window\n); # 下記の改変は禁止されています。 print qq(
TeaChat $version
); print qq(); print qq($endhtml) if(!$ktai_ua); } # ---------------------記録処理---------------------- sub write{ &getreferer if($firewall); $failure = 0; $chat2 = $chat; $host3 = $host; $host4 = $host3; &lieip if($lieip_check); if($enter eq "on" || $exit eq "on"){ if($cs_notice_style eq "off"){ if($greet){ $chat = $greet; $time_v = $time; &time; &rank_write; &tag; } else{ $failure = 1; } } else{ if($name eq $host4){ if($enter && $cs_nameconfirm){ &error(13); } else{ $name = "\[$host4\]"; } } foreach(@x_namez){ &error(14) if($name eq $_); } srand($time); @enter_mes2 = @enter_mes; @leave_mes2 = @leave_mes; $em_num = @enter_mes2; $lm_num = @leave_mes2; $em_num2 = int(rand $em_num); $lm_num2 = int(rand $lm_num); if($enter eq "on"){ $e1 = $enter_mes[$em_num2]; } elsif($exit eq "on"){ $e1 = $leave_mes[$lm_num2]; } $e1 =~ s/"/"/g; $e1 =~ s/>/>/g; $e1 =~ s/</[発言の中に不正なキーワードが含まれています。削除されました。]" if($cs_xwords && ($echat =~ /$xwords/i)); if($s_host){ $chat = &encode($chat); $chat =~ tr/a-fA-F0-9/fedcbaFEDCBA9876543210/; } } &lock(1) if($lock_check); open(IN, "$chat_file") || &error(1); @lines = ; close(IN); @continuity_confirm = @lines; $lastline = shift(@continuity_confirm); ($d1, $d2, $d3, $last_name, $d5, $last_comment, $d7, $d8, $d9, $d10, $d11, $last_realhost) = split(/\t/, $lastline); chop($last_realhost) if($last_realhost =~ /\n/); if($cs_chatconfirm && ($last_name eq $name) && ($last_comment eq $chat) && ($last_realhost eq $host)){ $failure = 1; } if($clear_on && ($chat2 eq "clear")){ foreach $line (@lines){ ($d1, $d2, $d3, $last_name2, $d5, $d6, $d7, $d8, $d9, $shv, $d10, $realhost) = split(/\t/, $line); chop($realhost) if($realhost =~ /\n/); if(($host eq $realhost) && ($shv ne 'exit') && ($last_name2 eq $name)){ $line = ''; } } $chat = "[発言者によって$nameさんの発言ログは消去されました。]"; } $allclear_flag = 0; $allclear_flag = 1 if($chat2 eq $cs_allclear); $chatstyle = ""; if($FORM{'fontsize'} && ($FORM{'fontsize'} ne "3")){ $chatstyle = " size=\"$FORM{'fontsize'}\""; } if($FORM{'fontfamily'} && ($FORM{'fontfamily'} ne "-")){ $chatstyle .= " style=\"font-family: \'$FORM{'fontfamily'}\';\""; } if($FORM{'fontstyle'} && ($FORM{'fontstyle'} ne "-")){ if($FORM{'fontstyle'} eq "iv"){ $chatstyle .= " color=\"$bgcolor2\""; } elsif($FORM{'fontstyle'} eq "b"){ $chat = "$chat"; } elsif($FORM{'fontstyle'} eq "i"){ $chat = "$chat"; } elsif($FORM{'fontstyle'} eq "s"){ $chat = "$chat"; } elsif($FORM{'fontstyle'} eq "u"){ $chat = "$chat"; } } $chat = "$chat" if($chatstyle); $w_val = "$time\t$host3\t$hua2\t$name\t$email\t$chat\t$n_color\t$s_color\t$greet\t$s_host_v\t$s_host_n\t$host\n"; if(!$failure){ $i = 0; foreach $line (@lines){ if(++$i > $log_max){ last; } push(@array, $line); } unshift(@array, $w_val); open(OUT, ">$chat_file") || &error(1); if(!$allclear_flag){ print OUT @array; } close(OUT); } rmdir($lockfile) if($lock_check); } # -------------------タグチェック-------------------- sub tag{ &tag_error if($chat =~ /<($x_tag)|($x_tag)>|<.*style=|<.*mailbox:|<.*width|<.*height/i); $chat =~ s/$1<\/a>/g unless $chat =~ /$1<\/a>/g unless $chat =~ /]*)>(.*)/$1/; $tag =~s/^\/(.*)//; $tag =~s/^([^\s]*).*/$1/; } $chat.='>' if($chat=~/<\/$/); @tags = reverse(@tags); foreach $tag (@tags){ next if($tag =~/(img|^hr$|^br$)/i); $chat.="" if($tag); } } sub tag_error{ $chat =~ s//>/g; $chat = $chat . "[注意:そのタグは使用を禁止しております。ご了承下さい]"; } # --------------------時刻変換----------------------- sub time{ ($sec, $min, $hour, $mday, $mon, $year, $wday) = localtime($time_v); $mon2 = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec') [$mon]; $wday2 = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat') [$wday]; $wday3 = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday') [$wday]; $youbi = ('日','月','火','水','木','金','土') [$wday]; $year2 = $year; $year2 = $year2 - 100; $year2 = sprintf("%.2d",$year2); if($year < 90){ $year = $year+2000; } else{ $year = $year+1900; } ++$mon; $hour = sprintf("%.2d",$hour); if($hour > 11){ $hour2 = $hour - 12; $ampm = "PM"; } else{ $hour2 = $hour; $ampm = "AM"; } $min = sprintf("%.2d",$min); $sec = sprintf("%.2d",$sec); if($cs_timestyle eq "1"){ $date_v = "$wday2 $mday $mon2 $year $hour:$min:$sec"; } elsif($cs_timestyle eq "2"){ $date_v = "$wday3, $mday-$mon2-$year $hour:$min:$sec"; } elsif($cs_timestyle eq "3"){ $date_v = "$year/$mon/$mday $hour:$min"; } elsif($cs_timestyle eq "4"){ $date_v = "$year/$mon/$mday $hour:$min:$sec"; } elsif($cs_timestyle eq "5"){ $date_v = "$year/$mon/$mday $hour2:$min:$sec $ampm"; } elsif($cs_timestyle eq "6"){ $date_v = "$year/$mon/$mday($youbi) $hour:$min"; } elsif($cs_timestyle eq "7"){ $date_v = "$year/$mon/$mday($youbi) $hour:$min:$sec"; } elsif($cs_timestyle eq "8"){ $date_v = "$year/$mon/$mday($youbi) $hour2:$min:$sec $ampm"; } elsif($cs_timestyle eq "9"){ $date_v = "$year年$mon月$mday日($youbi) $hour:$min"; } elsif($cs_timestyle eq "10"){ $date_v = "$year年$mon月$mday日($youbi) $hour:$min:$sec"; } elsif($cs_timestyle eq "11"){ $date_v = "$year年$mon月$mday日($youbi) $hour2:$min:$sec $ampm"; } elsif($cs_timestyle eq "12"){ $date_v = "$year2/$mon/$mday($wday2) $hour:$min:$sec"; } $date_i = "$mon/$mday $hour:$min"; } # -------------------ホスト名置換-------------------- sub lieip{ $dmy = shift(@ctzline2); $dmy = shift(@ctzline2); $dmy = shift(@ctzline2); $dmy = shift(@ctzline2); $dmy = shift(@ctzline2); $dmy = shift(@ctzline2); $dmy = shift(@ctzline2); foreach $l_line (@ctzline2){ ($ip_email, $ip_host, $ip_new) = split(/\t/, $l_line); chop($ip_new) if($ip_new =~ /\n|\cM/); if($email =~ /$ip_email/ && $host3 =~ /$ip_host/){ $host3 = $ip_new; } chop($host3) if($host3 =~ /\n|\cM/); } } # ---------------設定ファイルオープン---------------- sub file_open{ open(IN, "$ctz_file") || &error(7); @ctzline = ; close(IN); @ctzline2 = @ctzline; $line_base = shift(@ctzline); $line_frame1 = shift(@ctzline); $line_frame2 = shift(@ctzline); $line_function = shift(@ctzline); $line_xwords = shift(@ctzline); $enter_mes = shift(@ctzline); $leave_mes = shift(@ctzline); chop($line_base) if($line_base =~ /\n/); chop($line_frame1) if($line_frame1 =~ /\n/); chop($line_frame2) if($line_frame2 =~ /\n/); chop($line_function) if($line_function =~ /\n/); chop($line_xwords) if($line_xwords =~ /\n/); chop($enter_mes) if($enter_mes =~ /\n/); chop($leave_mes) if($leave_mes =~ /\n/); ($cs_title, $cs_home, $cs_bbs, $cs_log_max, $cs_rank_max, $cs_rank_mini, $cs_stdtime, $cs_home_k, $cs_allclear, $cs_chatmaxlength) = split(/\t/, $line_base); chop($cs_chatmaxlength) if($cs_chatmaxlength =~ /\n|\cM/); ($cs_bgcolor, $cs_text, $cs_link, $cs_vlink, $cs_alink, $cs_hlink, $cs_background, $cs_logo, $cs_b_text, $cs_b_bgcolor, $cs_b_border, $cs_form_bg, $cs_form_tx, $cs_form_bd, $cs_icq_uin, $cs_icq_img, $cs_f_size, $cs_font) = split(/\t/, $line_frame1); chop($cs_font) if($cs_font =~ /\n|\cM/); ($cs_notice, $cs_notice_color, $cs_bgcolor2, $cs_text2, $cs_link2, $cs_vlink2, $cs_alink2, $cs_background2, $cs_hlink2, $cs_mailb, $cs_mailb_mark, $cs_ipcolor, $cs_defa_space, $cs_err_color, $cs_markbold, $cs_ipsize, $cs_ipfont, $cs_ipcomout, $cs_timestyle, $cs_notice_style, $cs_hr_b_style, $cs_hr_b_color) = split(/\t/, $line_frame2); chop($cs_hr_b_color) if($cs_hr_b_color =~ /\n|\cM/); ($cs_ctch, $cs_saycolor_check, $cs_secret_check, $cs_lieip_check, $cs_punish_check, $cs_clear_on, $cs_lock_check, $cs_reloadcnt, $cs_romer, $cs_romcount, $cs_xrom, $cs_firewall, $cs_kickrom, $cs_nameconfirm, $cs_chatconfirm, $cs_trueip) = split(/\t/, $line_function); chop($cs_trueip) if($cs_trueip =~ /\n|\cM/); ($cs_xwords, $cs_x_tag, $cs_x_namez) = split(/\t/, $line_xwords); chop($cs_x_namez) if($cs_x_namez =~ /\n|\cM/); $title = $cs_title; $background2 = $cs_background2; $home = $cs_home; $hlink2 = $cs_hlink2; $bbs = $cs_bbs; $mailb = $cs_mailb; $log_max = $cs_log_max; $mailb_mark = $cs_mailb_mark; $rank_max = $cs_rank_max; $ipcolor = $cs_ipcolor; $rank_mini = $cs_rank_mini; $defa_space = $cs_defa_space; $stdtime = $cs_stdtime; $err_color = $cs_err_color; $bgcolor = $cs_bgcolor; $ctch = $cs_ctch; $text = $cs_text; $saycolor_check = $cs_saycolor_check; $link = $cs_link; $secret_check = $cs_secret_check; $vlink = $cs_vlink; $lieip_check = $cs_lieip_check; $alink = $cs_alink; $punish_check = $cs_punish_check; $hlink = $cs_hlink; $clear_on = $cs_clear_on; $background = $cs_background; $lock_check = $cs_lock_check; $logo = $cs_logo; $reloadcnt = $cs_reloadcnt; $b_text = $cs_b_text; $ipcomout = $cs_ipcomout; $b_bgcolor = $cs_b_bgcolor; $romer = $cs_romer; $b_border = $cs_b_border; $romcount = $cs_romcount; $form_bg = $cs_form_bg; $xrom = $cs_xrom; $form_tx = $cs_form_tx; $firewall = $cs_firewall; $home_k = $cs_home_k; $kickrom = $cs_kickrom; $form_bd = $cs_form_bd; $trueip = $cs_trueip; $notice = $cs_notice; $icq_uin = $cs_icq_uin; $notice_color = $cs_notice_color; $icq_img = $cs_icq_img; $bgcolor2 = $cs_bgcolor2; $xwords = $cs_xwords; $text2 = $cs_text2; $x_tag = $cs_x_tag; $x_namez = $cs_x_namez; $link2 = $cs_link2; $logo =~ s/"/"/g; $vlink2 = $cs_vlink2; $logo =~ s/>/>/g; $alink2 = $cs_alink2; $logo =~ s/<//g; $mailb_mark =~ s/<//>/g; $value =~ s/"/"/g; &jcode'convert(*value,$kcode); $FORM{$vn} = $value; } $cookie = $FORM{'cookie'}; $name = $FORM{'name'}; $first = $FORM{'first'}; $name =~ s/ /_/g; $name =~ s/:/:/g; $enter = $FORM{'enter'}; $name = $host if(!$name); $email = $FORM{'email'}; $exit = $FORM{'exit'}; $email = '' if(!(($email =~ /(.*)\@(.*)\.(.*)/) || ($email =~ /http:\/\//))); $email =~ s/ /_/g; $rank = $FORM{'rank'}; $view = $FORM{'view'}; $cc = $FORM{'cc'}; $relb = $FORM{'relb'}; $window = $FORM{'window'}; $change = $FORM{'change'}; $window = 20 if(!$window); $nof = $FORM{'nof'}; $reload = $FORM{'reload'}; $nofent = $FORM{'nofent'}; $reload = 0 if(!$reload); $administer = $FORM{'administer'}; $n_color = $FORM{'n_color'}; $pass = $FORM{'pass'}; $n_color2 = $FORM{'n_color2'}; $adexe = $FORM{'adexe'}; $s_color = $FORM{'s_color'}; $n_color =~ s/ //g; $n_color2 =~ s/ //g; $s_color =~ s/ //g; $s_color =~ s/\n//g; $n_color = $text2 if($n_color =~ /[^\w#]/); $n_color2 = $text2 if($n_color2 =~ /[^\w#]/); $s_color = $text2 if($s_color =~ /[^\w#]/); $unlock = $FORM{'unlock'}; $greet = $FORM{'greet'}; $space = $FORM{'space'}; $chat = $FORM{'chat'}; $chat =~ s/\n//g; $greet =~ s/\n//g; $email =~ s/\n//g; $n_color2 =~ s/\n//g; $name =~ s/\n//g; if(!$space){ if($defa_space){ $space = "on" } else{ $space = "off" } } $s_host = $FORM{'s_host'}; $line_ch = $FORM{'line_ch'}; $line_ch = "on" if(!$line_ch); if($FORM{'usetag'} eq "on"){ $chat =~ s/<//g; $chat =~ s/"/"/g; } $face = $FORM{'face'}; $auto = $FORM{'auto'}; $face =~ s/<//g; $e_host = $FORM{'e_host'}; $face =~ s/"/"/g; $secret2 = $FORM{'secret2'}; $face = '' if($face eq '-'); $ncsame = $FORM{'ncsame'}; $hidden = $FORM{'hidden'}; $high = $FORM{'high'}; $secret3 = $FORM{'secret3'}; $sechide = $FORM{'sechide'}; $customize = $FORM{'customize'}; $ctz_exe = $FORM{'ctz_exe'}; $k_tairom = $FORM{'k_tairom'}; $ktairank = $FORM{'ktairank'}; $xrom_flag = $FORM{'xrom_flag'}; $inlog_sec_send = $FORM{'inlog_sec_send'}; } sub decode2{ $n_color = $n_color2 if($n_color2); $n_color = "$text2" if(!$n_color); if(!$s_color){ if($ncsame){ $s_color = $n_color; } else{ $s_color = $text2; } } elsif($s_color && $ncsame){ $s_color = $n_color; } } sub decode3{ $_[0] =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $_[0]; } sub encode{ $_[0] =~ s/([^0-9A-Za-z_ ])/'%'.unpack('H2',$1)/ge; $_[0] =~ s/\s/+/g; $_[0]; } # --------------------参加者表示--------------------- sub member{ open(LOG,"$mem_file") || &error(5); @lastmember=; close(LOG); $filesize = -s $chat_file; $flag = 1; $alert_flag = 0; $now_mem = 0; foreach (@lastmember){ # mem.datのフラッシュ ($mtime, $name2, $host2, $n_color3, $last_mem, $lastsize) = split(/\t/, $_); $lastsize =~ tr/\x0D\x0A//d; if($exit && ($name2 eq $name)){ $flag = 0; next; # 退室する場合は自分のデータを削除。 } if($time-300 > $mtime){ next; # 5分以上前の参加者は削除 } elsif(($host2 eq $host) || ($name2 eq $name)){ push(@member,$_) if($flag); $flag = 0; # 5分以内の参加者で本人なら追加。ホスト、又は名前で本人判定 } else{ push(@member,$_); } } push(@member,"$time\t$name\t$host\t$n_color\t$now_mem\t$filesize\n") if($flag); # 参加者ファイルの中に自分がいない場合は追加 # @member = grep($_, @member); foreach (@member){ ($mtime, $name2, $host2, $n_color3, $last_mem, $lastsize) = split(/\t/, $_); $lastsize =~ tr/\x0D\x0A//d; if(!$romer){ # 通常参加者表示時 push(@mem_num,"$name2 ") if($name2 ne $host2); # ホスト名と名前が異なる場合参加者配列にいれる push(@rom_num, "$name2 ") if($name2 eq $host2); # ROMはROM表示用配列にいれる } else{ # Access表示時 push(@mem_num,"$name2 "); # $name2がホスト名(ROM)でも参加者配列にいれる(ROM表示モード) } if($secret || $inlog_sec_send){ push(@sec_mem,"