;
close IN;
foreach $i(@all){
if(!($i =~ /^#/ || $i eq "\n")){
if($i =~/^\$([\[\]\w ]*)=(.*);/){
$d1=$1;$d2=$2;
$d2 =~ s/\"//g;
$$d1=$d2;
}
}
}
rmdir($lockdir);
$denyhost =~ s/ /\n/g;
$denyword =~ s/ /\n/g;
if($language ne "English"){
print <<"EOM";
EOM
print "";
} else {
#english mastermode
print <<"EOM";
EOM
}
}
#
#汎用サブ
#
sub form_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/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
&jcode'convert(*value,'sjis');
# $value =~ s/</g;
# $value =~ s/>/>/g;
$value =~ s/\n//g;
$value =~ s/\t//g;
$value =~ s/\r/
/g;
$value =~ s/\,//g;
$FORM{$name} = $value;
}
$pass=$FORM{'pass'};
$function=$FORM{'function'};
$mode=$FORM{'mode'};
if($page eq ""){$page=1;}
if($level==1){$level_mode=1;}
if($limit eq ""){$limit=$limit_table;}
$ENV{'TZ'} = "JST-9";
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
@wday_array = ('日','月','火','水','木','金','土');
$mon++;
$year=$year-100;
if($year<10){
$year="0$year";
}
if($mon<10){
$mon="0$mon";
}
if($mday<10){
$mday="0$mday";
}
if($hour<10){
$hour="0$hour";
}
if($min<10){
$min="0$min";
}
$timenow="$year/$mon/$mday/$hour$min";
$today = "$mon/$mday";
$today2= "$mon/$mday $hour:$min";
}
sub header {
print "Content-type: text/html\n\n";
print "$topic\n";
if($language ne "English"){
print '';
} else {
print '';
}
print "\n";
if($bgimg eq ""){
print "\n\n";
} else {
print "\n\n";
}
}
sub reload_header {
print "Content-type: text/html\n\n";
print "$topic\n";
if($language ne "English"){
print '';
} else {
print '';
}
print "";
print '";
print "\n\n";
}
sub footer {
print "
";
print "\n";
print "FF11 Member Registration System Admin $version
\n";
print "";
}
sub error_message {
print "$_[0]
\n";
print "$_[1]
\n";
if($language ne "English"){
print "ブラウザの[戻る]ボタンを押して前の画面に移動してください.\n";
} else {
print "Push back button for former page.
\n";
}
&footer;
exit;
}
sub dirlock {
if($dirlock eq ""){return;}
if((-M $lockdir)>0.001){ #1分半ほどlockdirが存在している場合は強制的に削除
rmdir($lockdir);
}
for ($i = 0; $i <= 20; $i++) {
if (mkdir($lockdir, 0755)) {
last;
} else {
sleep(1);
}
}
$SIG{'TERM'} = $SIG{'PIPE'} = $SIG{'HUP'} = "sigexit";
if($i == 20){&error_message('busy','処理が混雑しています');}
}
sub sigexit { rmdir($lockdir); exit(1); }
sub custom{
#カスタムフィールド編集・入力
#mode list
#input 一括入力(入力)
#submit 一括入力(登録)
#list 項目リスト編集
#insert 項目リスト追加
#delete 項目リスト削除
#custom 編集項目更新
#listedit リスト編集
#listmodify リスト更新
#listinsert リスト追加
#lisetdelete リスト削除
local(@templist);
if($language ne "English"){
@templist=('一括入力',' を一括修正しました。','フィールド編集','項目タイトル(空欄でカスタムフィールドなし)','未入力者表示','する','しない','項目名','編集属性','ソート設定','リスト設定','自由編集','マスター編集','リスト式','リスト内容設定','新規項目追加','挿入位置(指定番号の後ろに追加されます)','項目削除','項目削除番号','項目追加処理','項目削除処理','項目編集','更新','追加項目名','追加','削除','リスト編集へ戻る','さらに追加','カスタムメニューへ','マスターモードへ戻る','メンバーリストへ戻る');
} else {
@templist=('master input mode',' modified all custom field','CustomField edit','CutomField title','no input members data','View','omit','Column name','attribute','sort','list edit','free','master','pulldown','List Edit','New Field','Insert position','Field Delete','Delete field number','Add Field','Delete Field','Edit Field','modify','New Field Name','Add','delete','back to list edit','more','back to custom menu','back to master mode','back to member list');
}
if($pass ne $master_pass){
&header; &error_message('pass error','access failed.');
}
&header;
if($mode eq "input"){
#一括入力モード(入力画面)
print "$templist[0]";
print "
name | ";
for($i=1;$i<$#custom_field+1;$i++){
print "$custom_field[$i] | ";
}
print "
";
print "
";
print <<"EOM";
EOM
} elsif($mode eq "submit"){
#一括入力モード(登録処理)
print "$custom_field[0]";
print "$templist[1]";
&dirlock;
if(!open(IN,"$datafile")){&header; &error_message('datafile error/system','data file access failed.');}
@all=;
close IN;
@out=();
$count=0;
foreach $i (@all){
($no,$name,$pass,$anon,$race,$relm,$mainjob,$supportjob,$prof,$handle,$polhn,$mail,$home,$comment2,$point,$class,$time,$comment,$mrank,$etc[0],$etc[1],$etc[2],$prod[0],$prod[1],$prod[2],$prod[3],$prod[4],$prod[5],$prod[6],$prod[7],$prod[8],$prod[9],$prod[10],$prod[11],$prod[12],$prod[13],$prod[14],$prod[15],$lev[0],$lev[1],$lev[2],$lev[3],$lev[4],$lev[5],$lev[6],$lev[7],$lev[8],$lev[9],$lev[10],$lev[11],$lev[12],$lev[13],$lev[14],$lev[15],$lev[16],$lev[17],$lev[18],$lev[19])=split(/\t/,$i);
@custom=();
for ($j=1;$j<$#custom_field+1;$j++){
$temp="custom$count"."_$j";
$custom[$j]=$FORM{"$temp"};
}
$prod[11]=join(",", @custom);
push(@out,"$no\t$name\t$pass\t$anon\t$race\t$relm\t$mainjob\t$supportjob\t$prof\t$handle\t$polhn\t$mail\t$home\t$comment2\t$point\t$class\t$time\t$comment\t$mrank\t$etc[0]\t$etc[1]\t$etc[2]\t$prod[0]\t$prod[1]\t$prod[2]\t$prod[3]\t$prod[4]\t$prod[5]\t$prod[6]\t$prod[7]\t$prod[8]\t$prod[9]\t$prod[10]\t$prod[11]\t$prod[12]\t$prod[13]\t$prod[14]\t$prod[15]\t$lev[0]\t$lev[1]\t$lev[2]\t$lev[3]\t$lev[4]\t$lev[5]\t$lev[6]\t$lev[7]\t$lev[8]\t$lev[9]\t$lev[10]\t$lev[11]\t$lev[12]\t$lev[13]\t$lev[14]\t$lev[15]\t$lev[16]\t$lev[17]\t$lev[18]\t$lev[19]\t\n");
$count++;
}
if(!open(OUT,">$datafile")){&header; &error_message('datafile error1560','data file access failed.');}
print OUT @out;
close OUT;
rmdir($lockdir);
} elsif($mode eq "list"){
#項目リスト(編集画面)
if(!open(IN,"$datafile")){&header; &error_message('datafile error/system','data file access failed.');}
@all=;
close IN;
print "$templist[2]
";
print "
$templist[14]
$templist[15]
$templist[17]
EOM
} elsif($mode eq "insert"){
#項目追加 custom0:項目名 custom1:項目属性 custom2 挿入位置
print "$templist[19]
";
if($FORM{"custom0"} eq ""){print"項目名がありません。(No field name)";return;}
@new_customfield=();
@new_customcontrol=();
@new_customsort=();
@new_custompulldown=();
for($i=0;$i<$#custom_field+1;$i++){
push(@new_customfield,$custom_field[$i]);
push(@new_customcontrol,$custom_control[$i]);
push(@new_customsort,$custom_sort[$i]);
push(@new_custompulldown,$custom_pulldown[$i]);
if($i == $FORM{"custom2"}){
push(@new_customfield,$FORM{"custom0"});
push(@new_customcontrol,$FORM{"custom1"});
push(@new_customsort,"0");
push(@new_custompulldown,"0");
}
}
@custom_field=@new_customfield;
@custom_control=@new_customcontrol;
@custom_sort=@new_customsort;
@custom_pulldown=@new_custompulldown;
&custom_setup_write;
#customlist番号整理
&dirlock;
if(!open(IN,"setup.cgi")){&error_message('config file error','data file access failed.');}
@all=;
close IN;
for($list=$#custom_field;$list>0;$list--){
$item="custom_list$list";
$new=$list+1;
$newitem="custom_list$new";
if($list>$FORM{'custom2'}){
for($i=0;$i<$#all+1;$i++){
if($all[$i] =~ /^\@$item=(.*);(.*)/){
$temp=$2;
$arr="\@$newitem=(";
for($j=0;$j<$#$item+1;$j++){
if ($$item[$j] =~ /.*\\$/){
$$item[$j].="\\";
}
$$item[$j] =~ s/'//g;
$arr.="'$$item[$j]',";
}
$arr.=");$2\n";
$all[$i]=$arr;
}
}
}
}
@out=@all;
&check_out;
if(!open(OUT,">setup.cgi")){&error_message('config file error','data file access failed.');}
print OUT @out;
close OUT;
rmdir($lockdir);
#新規に空欄追加
&dirlock;
if(!open(IN,"$datafile")){&header; &error_message('datafile error/system','data file access failed.');}
@all=;
close IN;
@out=();
$count=0;
foreach $i (@all){
($no,$name,$pass,$anon,$race,$relm,$mainjob,$supportjob,$prof,$handle,$polhn,$mail,$home,$comment2,$point,$class,$time,$comment,$mrank,$etc[0],$etc[1],$etc[2],$prod[0],$prod[1],$prod[2],$prod[3],$prod[4],$prod[5],$prod[6],$prod[7],$prod[8],$prod[9],$prod[10],$prod[11],$prod[12],$prod[13],$prod[14],$prod[15],$lev[0],$lev[1],$lev[2],$lev[3],$lev[4],$lev[5],$lev[6],$lev[7],$lev[8],$lev[9],$lev[10],$lev[11],$lev[12],$lev[13],$lev[14],$lev[15],$lev[16],$lev[17],$lev[18],$lev[19])=split(/\t/,$i);
@customold=split(/,/,$prod[11]);
@custom=();
for($j=0;$j<$#custom_field+1;$j++){
push(@custom,$customold[$j]);
if($j == $FORM{"custom2"}){
push(@custom,"");
}
}
$prod[11]=join(",", @custom);
push(@out,"$no\t$name\t$pass\t$anon\t$race\t$relm\t$mainjob\t$supportjob\t$prof\t$handle\t$polhn\t$mail\t$home\t$comment2\t$point\t$class\t$time\t$comment\t$mrank\t$etc[0]\t$etc[1]\t$etc[2]\t$prod[0]\t$prod[1]\t$prod[2]\t$prod[3]\t$prod[4]\t$prod[5]\t$prod[6]\t$prod[7]\t$prod[8]\t$prod[9]\t$prod[10]\t$prod[11]\t$prod[12]\t$prod[13]\t$prod[14]\t$prod[15]\t$lev[0]\t$lev[1]\t$lev[2]\t$lev[3]\t$lev[4]\t$lev[5]\t$lev[6]\t$lev[7]\t$lev[8]\t$lev[9]\t$lev[10]\t$lev[11]\t$lev[12]\t$lev[13]\t$lev[14]\t$lev[15]\t$lev[16]\t$lev[17]\t$lev[18]\t$lev[19]\t\n");
$count++;
}
if(!open(OUT,">$datafile")){&header; &error_message('datafile error1560','data file access failed.');}
print OUT @out;
close OUT;
rmdir($lockdir);
print "[$FORM{'custom0'}] を新規カスタム項目として追加しました。
";
print "New Field [$FORM{'custom0'}] wasa added.";
} elsif($mode eq "delete"){
#項目追加 custom0:削除項目番号
if($FORM{"custom0"} == 0){ print "番号が存在しません。(such number does not exist)";return;}
print "$templist[20]
";
@new_customfield=();
@new_customcontrol=();
@new_customsort=();
@new_custompulldown=();
for($i=0;$i<$#custom_field+1;$i++){
if($i != $FORM{"custom0"}){
push(@new_customfield,$custom_field[$i]);
push(@new_customcontrol,$custom_control[$i]);
push(@new_customsort,$custom_sort[$i]);
push(@new_custompulldown,$custom_pulldown[$i]);
}
}
@custom_field=@new_customfield;
@custom_control=@new_customcontrol;
@custom_sort=@new_customsort;
@custom_pulldown=@new_custompulldown;
&custom_setup_write;
#customlist番号整理
&dirlock;
if(!open(IN,"setup.cgi")){&error_message('config file error','data file access failed.');}
@all=;
close IN;
#ターゲット削除
$item="custom_list$FORM{'custom0'}";
for($i=0;$i<$#all+1;$i++){
if($all[$i] =~ /^\@$item=(.*);(.*)/){
$all[$i]="\n";
}
}
for($list=1;$list<$#custom_field+3;$list++){
$item="custom_list$list";
$new=$list-1;
$newitem="custom_list$new";
if($list>$FORM{'custom0'}){
for($i=0;$i<$#all+1;$i++){
if($all[$i] =~ /^\@$item=(.*);(.*)/){
$temp=$2;
$arr="\@$newitem=(";
for($j=0;$j<$#$item+1;$j++){
if ($$item[$j] =~ /.*\\$/){
$$item[$j].="\\";
}
$$item[$j] =~ s/'//g;
$arr.="'$$item[$j]',";
}
$arr.=");$2\n";
$all[$i]=$arr;
}
}
}
}
&check_out;
if(!open(OUT,">setup.cgi")){&error_message('config file error','data file access failed.');}
print OUT @all;
close OUT;
rmdir($lockdir);
#指定行データ削除
&dirlock;
if(!open(IN,"$datafile")){&header; &error_message('datafile error/system','data file access failed.');}
@all=;
close IN;
@out=();
$count=0;
foreach $i (@all){
($no,$name,$pass,$anon,$race,$relm,$mainjob,$supportjob,$prof,$handle,$polhn,$mail,$home,$comment2,$point,$class,$time,$comment,$mrank,$etc[0],$etc[1],$etc[2],$prod[0],$prod[1],$prod[2],$prod[3],$prod[4],$prod[5],$prod[6],$prod[7],$prod[8],$prod[9],$prod[10],$prod[11],$prod[12],$prod[13],$prod[14],$prod[15],$lev[0],$lev[1],$lev[2],$lev[3],$lev[4],$lev[5],$lev[6],$lev[7],$lev[8],$lev[9],$lev[10],$lev[11],$lev[12],$lev[13],$lev[14],$lev[15],$lev[16],$lev[17],$lev[18],$lev[19])=split(/\t/,$i);
@customold=split(/,/,$prod[11]);
@custom=();
for($j=0;$j<$#custom_field+2;$j++){
if($j != $FORM{"custom0"}){
push(@custom,$customold[$j]);
}
}
$prod[11]=join(",", @custom);
push(@out,"$no\t$name\t$pass\t$anon\t$race\t$relm\t$mainjob\t$supportjob\t$prof\t$handle\t$polhn\t$mail\t$home\t$comment2\t$point\t$class\t$time\t$comment\t$mrank\t$etc[0]\t$etc[1]\t$etc[2]\t$prod[0]\t$prod[1]\t$prod[2]\t$prod[3]\t$prod[4]\t$prod[5]\t$prod[6]\t$prod[7]\t$prod[8]\t$prod[9]\t$prod[10]\t$prod[11]\t$prod[12]\t$prod[13]\t$prod[14]\t$prod[15]\t$lev[0]\t$lev[1]\t$lev[2]\t$lev[3]\t$lev[4]\t$lev[5]\t$lev[6]\t$lev[7]\t$lev[8]\t$lev[9]\t$lev[10]\t$lev[11]\t$lev[12]\t$lev[13]\t$lev[14]\t$lev[15]\t$lev[16]\t$lev[17]\t$lev[18]\t$lev[19]\t\n");
$count++;
}
if(!open(OUT,">$datafile")){&header; &error_message('datafile error1560','data file access failed.');}
print OUT @out;
close OUT;
rmdir($lockdir);
print "項目No. $FORM{'custom0'} を削除しました。
";
print "Field No. $FORM{'custom0'} was deleted.";
} elsif($mode eq "custom"){
#編集項目更新処理
for($i=0;$i<$#custom_field+1;$i++){
$custom_field[$i]=$FORM{"custom$i"};
$custom_control[$i]=$FORM{"customc$i"};
$custom_sort[$i]=$FORM{"customs$i"};
$custom_pulldown[$i]=$FORM{"customp$i"};
}
&custom_setup_write;
print "編集項目更新処理を行いました。
";
print "Custom field updated.";
} elsif($mode eq "listedit"){
#custom0 番項目のリスト編集
$j=$FORM{'custom0'};
if($j eq ""){&header;&error_message('no number1548','illegal number');}
print "No.$j ($custom_field[$j])のリスト編集を行います。
";
print "Editing List No.$j ($custom_field[$j])
";
if($#{"custom_list$j"} !=-1){
print "$templist[21]
EOM
} else {
print "現在リストは存在しません。
";
print "No list exists.
";
}
print <<"EOM";
$templist[15]
\n";
if($#{"custom_list$j"} != -1){
print <<"EOM";
$templsit[17]
EOM
}
} elsif($mode eq "listmodify"){
#custom0番編集 customlist0-X custom_listへ出力
print "listmodify
";
for($i=0;$i<$#{"custom_list$FORM{'custom0'}"}+1;$i++){
${"custom_list$FORM{'custom0'}"}[$i]=$FORM{"customlist$i"};
}
&custom_list_write;
print "項目を編集しました。
";
print "Field was modified.";
print <<"EOM";
EOM
} elsif($mode eq "listinsert"){
#custom0番編集 custom1をリストに追加 custom2番目に。
@new_list=();
if($FORM{"custom2"}==-1){
push(@new_list,$FORM{"custom1"}) ;
}
for($i=0;$i<$#{"custom_list$FORM{'custom0'}"}+1;$i++){
push(@new_list,${"custom_list$FORM{'custom0'}"}[$i]);
if($i==$FORM{"custom2"}){
push(@new_list,$FORM{"custom1"});
}
}
@{"custom_list$FORM{'custom0'}"}=@new_list;
&custom_list_write;
print $FORM{"custom1"}."を追加しました。
";
print $FORM{"custom1"}." was added.";
print <<"EOM";
EOM
EOM
} elsif($mode eq "listdelete"){
#custom0番編集 custom1番目をリストから削除
@new_list=();
for($i=0;$i<$#{"custom_list$FORM{'custom0'}"}+1;$i++){
if($i!=$FORM{"custom1"}){push(@new_list,${"custom_list$FORM{'custom0'}"}[$i]);}
}
@{"custom_list$FORM{'custom0'}"}=@new_list;
if($#{"custom_list$FORM{'custom0'}"} == -1){
&custom_list_delete;
} else {
&custom_list_write;
}
print "項目を削除しました。
";
print "Field deleted.";
print <<"EOM";
EOM
} else {
print "mode:$mode";
}
print <<"EOM";
$templist[30]
EOM
}
sub custom_list_write{
&dirlock;
if(!open(IN,"setup.cgi")){&error_message('config file error','data file access failed.');}
@all=;
close IN;
$item="custom_list".$FORM{"custom0"};
$match=0;
for($i=0;$i<$#all+1;$i++){
if($all[$i] =~ /^\@$item=(.*);(.*)/){
$match=1;
$temp=$2;
$arr="\@$item=(";
for($j=0;$j<$#$item+1;$j++){
if ($$item[$j] =~ /.*\\$/){
$$item[$j].="\\";
}
$$item[$j] =~ s/'//g;
$arr.="'$$item[$j]',";
}
$arr.=");$2\n";
$all[$i]=$arr;
}
}
if($match==0){
$arr="\@$item=(";
for($j=0;$j<$#$item+1;$j++){
if ($$item[$j] =~ /.*\\$/){
$$item[$j].="\\";
}
$$item[$j] =~ s/'//g;
$arr.="'$$item[$j]',";
}
$arr.=");\n\n";
push(@all,$arr);
}
@out=@all;
&check_out;
if(!open(OUT,">setup.cgi")){&error_message('config file error','data file access failed.');}
print OUT @out;
close OUT;
rmdir($lockdir);
}
sub custom_list_delete{
&dirlock;
if(!open(IN,"setup.cgi")){&error_message('config file error','data file access failed.');}
@all=;
close IN;
$item="custom_list".$FORM{"custom0"};
$match=0;
for($i=0;$i<$#all+1;$i++){
if($all[$i] =~ /^\@$item=(.*);(.*)/){
$all[$i]="";
}
}
@out=@all;
&check_out;
if(!open(OUT,">setup.cgi")){&error_message('config file error','data file access failed.');}
print OUT @out;
close OUT;
rmdir($lockdir);
}
sub custom_setup_write{
@list=(
'custom_field',
'custom_control',
'custom_sort',
'custom_pulldown',
);
&dirlock;
if(!open(IN,"setup.cgi")){&error_message('config file error','data file access failed.');}
@all=;
close IN;
foreach $item(@list){
$match=0;
for($i=0;$i<$#all+1;$i++){
if($all[$i] =~ /^\@$item=(.*);(.*)/){
$match=1;
$temp=$2;
$arr="\@$item=(";
for($j=0;$j<$#$item+1;$j++){
if ($$item[$j] =~ /.*\\$/){
$$item[$j].="\\";
}
$$item[$j] =~ s/'//g;
$arr.="'$$item[$j]',";
}
$arr.=");$2\n";
$all[$i]=$arr;
}
}
if($match==0){
$arr="\@$item=(";
for($j=0;$j<$#$item+1;$j++){
if ($$item[$j] =~ /.*\\$/){
$$item[$j].="\\";
}
$$item[$j] =~ s/'//g;
$arr.="'$$item[$j]',";
}
$arr.=");\n\n";
push(@all,$arr);
}
}
@out=@all;
&check_out;
if(!open(OUT,">setup.cgi")){&error_message('config file error','data file access failed.');}
print OUT @out;
close OUT;
rmdir($lockdir);
}
sub maintenance{
if($pass ne $master_pass){
&header; &error_message('pass error','access failed.');
}
&header;
if($mode eq "ahtjob"){
if(!open(IN,"$datafile")){&header; &error_message('datafile error/system','data file access failed.');}
@all=;
close IN;
@out=();
foreach $i (@all){
($no,$name,$pass,$anon,$race,$relm,$mainjob,$supportjob,$prof,$handle,$polhn,$mail,$home,$comment2,$point,$class,$time,$comment,$mrank,$etc[0],$etc[1],$etc[2],$prod[0],$prod[1],$prod[2],$prod[3],$prod[4],$prod[5],$prod[6],$prod[7],$prod[8],$prod[9],$prod[10],$prod[11],$prod[12],$prod[13],$prod[14],$prod[15],$lev[0],$lev[1],$lev[2],$lev[3],$lev[4],$lev[5],$lev[6],$lev[7],$lev[8],$lev[9],$lev[10],$lev[11],$lev[12],$lev[13],$lev[14],$lev[15],$lev[16],$lev[17],$lev[18],$lev[19])=split(/\t/,$i);
if($no eq ""){
print "delete blank line
";
} else {
for($j=0;$j<20;$j++){
$lev[$j] =~ s/\n//g;
}
push(@out,"$no\t$name\t$pass\t$anon\t$race\t$relm\t$mainjob\t$supportjob\t$prof\t$handle\t$polhn\t$mail\t$home\t$comment2\t$point\t$class\t$time\t$comment\t$mrank\t$etc[0]\t$etc[1]\t$etc[2]\t$prod[0]\t$prod[1]\t$prod[2]\t$prod[3]\t$prod[4]\t$prod[5]\t$prod[6]\t$prod[7]\t$prod[8]\t$prod[9]\t$prod[10]\t$prod[11]\t$prod[12]\t$prod[13]\t$prod[14]\t$prod[15]\t$lev[0]\t$lev[1]\t$lev[2]\t$lev[3]\t$lev[4]\t$lev[5]\t$lev[6]\t$lev[7]\t$lev[8]\t$lev[9]\t$lev[10]\t$lev[11]\t$lev[12]\t$lev[13]\t$lev[14]\t$lev[15]\t$lev[16]\t$lev[17]\t$lev[18]\t$lev[19]\t\n");
print "modify $name aht job data
";
}
}
if(!open(OUT,">$datafile")){&header; &error_message('datafile error/system','data file access failed.');}
print OUT @out;
close OUT;
print "アトルガンジョブ追加による改行補正と空行の削除を行いました。
";
print "Aht Urgan new job data was modified, and blank user data was deleted.
";
} else {
print "メンテモード予備
";
}
if($language ne "English"){
print "";
print "
[登録システム入り口][使い方][ホームページへ戻る]
";
} else {
print "
[Entrance][usage][back to home]
";
}
}
sub vercheck{
#バージョンチェック。行数決め打ちという危険仕様
#$verにはサブバージョンをカットして格納。
if(!open(IN,"setup.cgi")){&error_message('config file error','data file access failed.');}
@all=;
close IN;
if($ver eq ""){
if( $all[2] =~ /(0\.[A-Za-z0-9]+)/){$ver="$1";} else {$ver="unknown";}
}
print "
Configfile version:$ver
";
}
sub verup{
if($pass ne $master_pass){
&header; &error_message('pass error','access failed.');
}
&header;
&vercheck; #@all取得済
if($mode eq '060' || $mode eq '060a' || $mode eq '067'){
print "check version
";
if($mode eq '060a'){$ver="0.5";}
if($mode eq '067'){$ver="0.63";}
#要設定ファイル変更点
if($ver eq "0.5"){
print "setup config 050 to 052
";
#050->052 RSS・複数画像・keyword・mission menu・icon sort追加 日記入力フラグ
push (@all,"
#日記入力無効化(1:無効) 0.52新設
\$diaryallow=\"0\";
#アップ画像最大数
\$imgmax=\"5\";
#キーワード
\$keyfile=\"keyword.dat\";
\$key_avail=\"0\";
\$keydir=\"keyword/\";
\$scriptdir=\"../\";
#\$scriptdir=\"http://\";(フルパス)
");
$count=0;
foreach $i(@all){
if($i =~ /^\@modelist=/){$all[$count]="\@modelist=('Simple','Job','合成スキル','Status','Full','ALL','Icon','Skill','Icon(Time)','LevelSearch','Mission');\n";}
if($i =~ /^\@menu=/){$all[$count]="\@menu=('シンプル','Job','Job(Lv)','合成','','','フル2','アイコン','スキル','アイコン(新着順)','レベルサーチ','ミッション');\n";}
$count++;
}
$ver="0.52";
}
if($ver eq "0.52"){
print "setup config 052 to 053
";
#052->053 history 日記フロートフラグ
push(@all,'
#日記フロート機能(0:無効 1:有効)
$sage="1";
#履歴書き込みファイル
$historyfile="history.cgi";
#ログ取得の有無
$loghistory="1";
#ログ取得行数
$logmax="50";
');
$ver="0.53";
}
if($ver eq "0.53"){
print "setup config 053 to 060
";
print "max_job change
";
print "default joblist change
";
$count=0;
foreach $i(@all){
if($i =~ /^\$job_max=/){$all[$count]="\$job_max=18;\n";}
if($i =~ /^\@joblist=/){$all[$count]="\@joblist=('戦','モ','白','黒','赤','シ','ナ','暗','狩','吟','獣','竜','召','忍','侍','青','コ','か','?','19');\n";}
$count++;
}
print "msg config set
";
#めせじ設定がない場合はconfigに追記
if($msg_avail eq ""){
push(@all,'
#メッセージ関連機能
$mes_avail="1";
$mesdir="message/";
');
}
}
#0.60a3スキル追加、ミッション追加
#0.61 履歴追加・メリットポイント追加
#メリポ設定がない場合はconfigに追記
if($mpoint eq ""){
push(@all,'
#メリポ設定
$mpoint="1";
');
}
#カスタム設定がない場合はconfigに追記
if($custom_field[1] eq ""){
push(@all,"
#カスタムフィールド 0.63beta1(最初のデータはボタン名兼利用フラグ)
\@custom_field=('追加項目','チョコボ名前','チョコボ性別','フェロー名前','フェローレベル','好きなお肉','ブラビアX',);
#カスタムフィールドコントロールコード(0:ユーザー自由 1:アドミンのみ)
\@custom_control=('','0','0','0','0','0','0',);
#カスタムフィールドソート(0:なし 1:数値 2:逆順 3:数値逆順)
\@custom_sort=('','0','0','0','0','0','0',);
#カスタムフィールドプルダウン(0:自由編集 1:プルダウン)
\@custom_pulldown=('','0','0','0','0','1','0',);
\@custom_list5=('','タン','ミノ','ロース','テッチャン','コリコリ','ウルテ','センマイ','ハート','ユッケ','コブクロ','ハラミ','ツラミ','テール',);
");
}
$count=0;
foreach $i(@all){
if($i =~ /^\@tablelist=/){$all[$count]="\@tablelist=('table_limit','table_job','table_prod','table_stat','table_full2','table_full3','table_limit2','table_skill','table_limit3','table_level','table_mission','table_assault','table_history','table_custom');\n";}
if($i =~ /^\@tablelimit=/){$all[$count]="\@tablelimit=('0','1','1','2','3','4','5','6','7','8','9','10','11','12','13');\n";}
if($i =~ /^\@skilllist=/){$all[$count]="\@skilllist=('格闘','短剣','片手剣','両手剣','片手斧','両手斧','両手鎌','両手槍','片手刀','両手刀','片手棍','両手棍','弓術','射撃','投擲','ガード','回避','盾','受流し','神聖','回復','強化','弱体','精霊','暗黒','歌唱','弦楽器','管楽器','忍術','召喚','青魔');\n";}
if($i =~ /^\@menu=/){$all[$count]="\@menu=('シンプル','Job','Job(Lv)','合成','','','フル2','アイコン','スキル','アイコン(新着順)','レベルサーチ','ミッション','アサルト','履歴','カスタム');\n";}
if($i =~ /^\@modelist=/){$all[$count]="\@modelist=('Simple','Job','合成スキル','Status','Full','ALL','Icon','Skill','Icon(Time)','LevelSearch','Mission','Assault','History','Custom');\n";}
$count++;
$ver="0.63";
}
print "table.pl subroutine configuration modification.
";
#ver0.63 to 0.67 Altana 拡張
if($ver eq "0.63"){
print "setup config 063 to 067
";
print "max_job change
";
print "default joblist change
";
$count=0;
foreach $i(@all){
if($i =~ /^\$job_max=/){$all[$count]="\$job_max=20;\n";}
if($i =~ /^\@joblist=/){$all[$count]="\@joblist=('戦','モ','白','黒','赤','シ','ナ','暗','狩','吟','獣','竜','召','忍','侍','青','コ','か','踊','学');\n";}
$count++;
}
}
# ver cahange
$all[2]="# ver. 0.67 (automatically modified)\n";
@out=@all;
&check_out;
if(!open(OUT,">setup.cgi")){&error_message('config file error','data file access failed.');}
print OUT @out;
close OUT;
####data.cgi conv (0.60a3 to 0.60a4)
if($ver eq "0.60a3"){
print "convert 0.60a3 to 0.60a4(assault rank addition)
";
if(!open(IN,"$datafile")){&header; &error_message('datafile error/system','data file access failed.');}
@all=;
close IN;
@out=();
foreach $i (@all){
($no,$name,$pass,$anon,$race,$relm,$mainjob,$supportjob,$prof,$handle,$polhn,$mail,$home,$comment2,$point,$class,$time,$comment,$mrank,$etc[0],$etc[1],$etc[2],$prod[0],$prod[1],$prod[2],$prod[3],$prod[4],$prod[5],$prod[6],$prod[7],$prod[8],$prod[9],$prod[10],$prod[11],$prod[12],$prod[13],$prod[14],$prod[15],$lev[0],$lev[1],$lev[2],$lev[3],$lev[4],$lev[5],$lev[6],$lev[7],$lev[8],$lev[9],$lev[10],$lev[11],$lev[12],$lev[13],$lev[14],$lev[15],$lev[16],$lev[17],$lev[18],$lev[19])=split(/\t/,$i);
@mission = split(/,/,$prod[15]);
$mission[16]="X".$mission[16];
$prod[15]=join(",", @mission);
$lev[15] =~ s/\n//g;
$lev[16] =~ s/\n//g;
push(@out,"$no\t$name\t$pass\t$anon\t$race\t$relm\t$mainjob\t$supportjob\t$prof\t$handle\t$polhn\t$mail\t$home\t$comment2\t$point\t$class\t$time\t$comment\t$mrank\t$etc[0]\t$etc[1]\t$etc[2]\t$prod[0]\t$prod[1]\t$prod[2]\t$prod[3]\t$prod[4]\t$prod[5]\t$prod[6]\t$prod[7]\t$prod[8]\t$prod[9]\t$prod[10]\t$prod[11]\t$prod[12]\t$prod[13]\t$prod[14]\t$prod[15]\t$lev[0]\t$lev[1]\t$lev[2]\t$lev[3]\t$lev[4]\t$lev[5]\t$lev[6]\t$lev[7]\t$lev[8]\t$lev[9]\t$lev[10]\t$lev[11]\t$lev[12]\t$lev[13]\t$lev[14]\t$lev[15]\t$lev[16]\t$lev[17]\t$lev[18]\t$lev[19]\t\n");
}
if(!open(OUT,">$datafile")){&header; &error_message('datafile error/system','data file access failed.');}
print OUT @out;
close OUT;
}
####data.cgi conv end
print "change/convert done
";
print "";
print "memberlist top";
}
}
sub login2{
if($pass ne $master_pass){
&header; &error_message('pass error','access failed.');
}
&header;
&vercheck;
if($registed eq "yes"){
if($language ne "English"){
print "設定ファイルを書き換えました。";
print "";
} else {
print "Configuration file modified.";
}
}
srand();
$xx = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
. "abcdefghijklmnopqrstuvwxyz"
. "0123456789.";
$salt = substr($xx, int(rand(63)), 1);
$salt .= substr($xx, int(rand(63)), 1);
$salt .= substr($xx, int(rand(63)), 1);
$salt .= substr($xx, int(rand(63)), 1);
if($language ne "English"){
print "
[登録システム入り口][使い方][ホームページへ戻る]
";
} else {
print "
[Entrance][usage][back to home]
";
}
if($language ne "English"){
@drelmlist=("Sand'Oria",'Bastok','Windurst');
@drelmlist=('
','
','
'); #大
@drelmlistl=("Sand'Oria",'Bastok','Windurst');
#@drelmlist=('
','
','
'); #小
#@dindex=('No.','称号','名前','種族','国','ポイント','ミッションランク','ジョブ','時間','コメント');
@dindex=('No.','class','name','race','realm','point','m_rank','job','time','comment');
@dmenu=('Simple','Job','Job(Lv)','Skill','Status','Full','Full2','Icon','Skill','','LevelSearch','Mission','Assault','History','Custom');
@dmenux=('BBS','Home','Manual','Menu: ','Memberlist Top');
#@dmenu=('シンプル','ジョブ1','ジョブ2','スキル','ステータス','フル','フル2','アイコン','掲示板','ホーム','マニュアル','メニュー:','リストトップ');
@dfield=('class','name','pass','anon mode','Race','フェイスタイプ','Realm','MainJob','SupportJob','個人ポイント ','ミッションランク ','comment ','profile 公開','ハンドル','POL内ハンドル ','e-mail','homepage url','プロフィール用コメント','サンプル');
@dmodelist=('Simple','Job','Production','Status','Full','Full2','Icon','Skill,','Icon(Time)','LevelSearch','Mission','Assault','History','Custom');
@dranklist=('素人','見習','徒弟','下級職人','名取','目録','印可','高弟','皆伝','Rank9','Rank10');
@dracelist=('Hume♂','Hume♀','Elvaan♂','Elvaan♀','Tarutaru♂','Tarutaru♀','Mithra♀','Galka♂');
#@djoblist=('WAR','MNK','WHM','BLM','RDM','THF','PLD','DRK','RNG','BRD','BST','DRG','SMN','NIN','SAM','BLU','COR','PAP','18','19');
@djoblist=('戦','モ','白','黒','赤','シ','ナ','暗','狩','吟','獣','竜','召','忍','侍','青','コ','か','18','19');
#@dprodlist=('鍛冶','裁縫','錬金','木工','彫金','革細工','骨工','釣り','調理');
@dprodlist=('鍛','織','錬','木','彫','革','骨','釣','調');
@dskilllist=('格闘','短剣','片手剣','両手剣','片手斧','両手斧','両手鎌','両手槍','片手刀','両手刀','片手棍','両手棍','弓術','射撃','投擲','ガード','回避','盾','受流し','神聖','回復','強化','弱体','精霊','暗黒','歌唱','弦楽器','管楽器','忍術','召喚','青魔法');
@buttonlist=('login','writediary','new entry','master mode');
print "表\示項目には国別表\示以外は[']は使えません。どうしても使用したい場合は全角の[’]を利用してください。";
print "
EOM
} else {
@drelmlist=("Sand'Oria",'Bastok','Windurst');
@drelmlist=('
','
','
'); #大
@drelmlistl=("Sand'Oria",'Bastok','Windurst');
@dindex=('No.','class','name','race','realm','point','m_rank','job','time','comment');
@dmenu=('Simple','Job','Job(Lv)','Skill','Status','Full','Full2','Icon','Skill','','LevelSearch','Mission','Assault','History','Custom');
@dmenux=('BBS','Home','Manual','Menu: ','Memberlist Top');
@dfield=('class','name','pass','anon mode','Race','FaceType','Realm','MainJob','SupportJob','Conquest point','MissionRank','comment','profile open','handle','POL handle','e-mail','homepage url','profile comment','sample');
@dmodelist=('Simple','Job','Production','Status','Full','Full2','Icon','Skill,','Icon(Time)','LevelSearch','Mission','Assault','History','Custom');
@dranklist=('Rank0','Rank1','Rank2','Rank3','Rank4','Rank5','Rank6','Rank7','Rank8','Rank9','Rank10');
@dracelist=('HumeMale','HumeFemale','ElvaanMale','ElvaanFemale','TarutaruMale','TarutaruFemale','Mithra','Galka');
@djoblist=('WAR','MNK','WHM','BLM','RDM','THF','PLD','DRK','RNG','BRD','BST','DRG','SMN','NIN','SAM','BLU','COR','PUP','18','19');
@dprodlist=('SMITH','CLOTH','ALCHEMY','WOOD','GOLDSMTH','TANNER','BONEWRK','FISHING','COOKING');
@dskilllist=('Hand-To-Hand','Dagger','Sword','GreatSword','Axe','GreatAxe','Sythe','Spear','Katana','GreatKatana','Club','GreatClub','Archery','Marksmanship','Throwing','Guard','Evasion','Shield','Parrying','DivineMagic','HealingMagic','EnhanceMagic','EnfMagic','ElemantalMagic','DarkMagic','Singing','Strings','WindInstrument','Ninjutsu','Summoning','BlueMagic');
@buttonlist=('login','writediary','new entry','master mode');
print "
EOM
print "";
}
}
sub regist2{
if($pass ne $master_pass){
&header; &error_message('pass error','access failed.');
}
for($j=0;$j<$#index+1;$j++){
$index[$j]=$FORM{"index$j"};
}
for($j=0;$j<$#menu+1;$j++){
$menu[$j]=$FORM{"menu$j"};
}
for($j=0;$j<$#menux+1;$j++){
$menux[$j]=$FORM{"menux$j"};
}
for($j=0;$j<$#field+1;$j++){
$field[$j]=$FORM{"field$j"};
}
for($j=0;$j<$#modelist+1;$j++){
$modelist[$j]=$FORM{"modelist$j"};
}
for($j=0;$j<$#ranklist+1;$j++){
$ranklist[$j]=$FORM{"ranklist$j"};
}
for($j=0;$j<$#racelist+1;$j++){
$racelist[$j]=$FORM{"racelist$j"};
}
for($j=0;$j<$#joblist+1;$j++){
$joblist[$j]=$FORM{"joblist$j"};
}
for($j=0;$j<$#prodlist+1;$j++){
$prodlist[$j]=$FORM{"prodlist$j"};
}
for($j=0;$j<$#relmlistl+1;$j++){
$relmlistl[$j]=$FORM{"relmlistl$j"};
}
for($j=0;$j<$#relmlist+1;$j++){
$relmlist[$j]=$FORM{"relmlist$j"};
$relmlist[$j] =~ s/\"//g;
}
for($j=0;$j<$#skilllist+1;$j++){
$skilllist[$j]=$FORM{"skilllist$j"};
}
for($j=0;$j<$#button+1;$j++){
$button[$j]=$FORM{"button$j"};
}
@list=(
'index',
'menu',
'menux',
'field',
'modelist',
'ranklist',
'racelist',
'joblist',
'prodlist',
'relmlistl',
'relmlist',
'skilllist',
'button'
);
&dirlock;
if(!open(IN,"setup.cgi")){&error_message('config file error','data file access failed.');}
@all=;
close IN;
foreach $item(@list){
for($i=0;$i<$#all+1;$i++){
if($all[$i] =~ /^\@$item=(.*);(.*)/){
$temp=$2;
$arr="\@$item=(";
for($j=0;$j<$#$item+1;$j++){
if ($$item[$j] =~ /.*\\$/){
$$item[$j].="\\";
}
if(($item eq "relmlist") || ($item eq "relmlistl")){
$arr.="\"$$item[$j]\",";
} else {
$$item[$j] =~ s/'//g;
$arr.="'$$item[$j]',";
}
}
$arr.=");$2\n";
$all[$i]=$arr;
}
}
}
@out=@all;
&check_out;
if(!open(OUT,">setup.cgi")){&error_message('config file error','data file access failed.');}
print OUT @out;
close OUT;
rmdir($lockdir);
$registed="yes";
$function="login2";
&login2;
}
sub check_out{
@temp=@out;
@out=();
foreach $i(@temp){
if( !($i =~ /^1;/) ){
push(@out,$i);
}
}
push(@out,"1;\n");
}