From: leonora Date: Sat, 6 Feb 2010 07:55:25 +0000 (+0000) Subject: * add a new textbox for input the username who uploaded X-Git-Tag: r89-trunk~45 X-Git-Url: http://lab.mitty.jp/git/?a=commitdiff_plain;h=25b41dcbde13fad8d78e5810c258aed610ece5a0;p=lab.git * add a new textbox for input the username who uploaded git-svn-id: https://lab.mitty.jp/svn/lab/trunk@36 7d2118f6-f56c-43e7-95a2-4bb3031d96e7 --- diff --git a/snuploader/upload.cgi b/snuploader/upload.cgi index 9e8554d..4c5d35b 100755 --- a/snuploader/upload.cgi +++ b/snuploader/upload.cgi @@ -167,6 +167,7 @@ unless(-e $set{'base_html'}){ &makehtml; } } if($upflag || $valueflag){ unlink("$set{'src_dir'}$random.temporary"); &error(108);} + $in{'postname'} = $FORM{'postname'}; $in{'org_pass'} = $in{'pass'} = $FORM{'pass'}; $in{'dlkey'} = $FORM{'dlkey'}; $in{'comment'} = $FORM{'comment'}; @@ -212,7 +213,7 @@ unless(-e $set{'base_html'}){ &makehtml; } if ($in{'addr'} =~ /$value/ || $in{'host'} =~ /$value/){ &error(101);} } - my @form = ($in{'comment'},$in{'orgname'},$in{'type'},$in{'dlkey'}); + my @form = ($in{'postname'},$in{'comment'},$in{'orgname'},$in{'type'},$in{'dlkey'}); foreach my $value (@form) { if (length($value) > 128) { $value = substr($value,0,128).'...'; } # $value =~ s/&/&/g; @@ -224,7 +225,7 @@ unless(-e $set{'base_html'}){ &makehtml; } $value =~ s/\t//g; $value =~ s/\0//g; } - ($in{'comment'},$in{'orgname'},$in{'type'},$in{'dlkey'}) = @form; + ($in{'postname'},$in{'comment'},$in{'orgname'},$in{'type'},$in{'dlkey'}) = @form; } @@ -321,7 +322,7 @@ if(!$in{'upfile'}){ &error(99); } # $in{'date'} = conv_date(time()); my @new; $new[0] = "$no<>$in{'addr'}<>$in{'time'}<>1\n"; - my $addlog = "$no<>$in{'ext'}<>$in{'date'}<>$in{'comment'}<>$in{'type'}<>$orgname<>$in{'addr'}<>$in{'host'}<>$in{'pass'},$userid<>$set{'file_pre'}<>$note<>1\n"; + my $addlog = "$no<>$in{'postname'}<>$in{'ext'}<>$in{'date'}<>$in{'comment'}<>$in{'type'}<>$orgname<>$in{'addr'}<>$in{'host'}<>$in{'pass'},$userid<>$set{'file_pre'}<>$note<>1\n"; $new[1] = $addlog; # open(OUT,">>./alllog.cgi"); print OUT $addlog; close(OUT); @@ -329,7 +330,7 @@ if(!$in{'upfile'}){ &error(99); } my $i = 2; foreach my $value (@log){ - my ($no,$ext,$date,$comment,$mime,$orgname,$addr,$host,$pass,$filepre,$note,$dummy) = split(/<>/,$value); + my ($no,$postname,$ext,$date,$comment,$mime,$orgname,$addr,$host,$pass,$filepre,$note,$dummy) = split(/<>/,$value); if(!$dummy){ $filepre = $set{'file_pre'};} $no = sprintf("%04d",$no); @@ -378,16 +379,16 @@ sub makehtml{ if($log == 1){ $log++; $init++;} my $lastpage = int(($log - 2)/$set{'pagelog'}) + 1; - $postval = ' obj.postkey.value = unescape(p[1]);' if($set{'post_flag'}); + $postval = ' obj.postkey.value = unescape(p[2]);' if($set{'post_flag'}); my $header =<<"EOM"; $set{'html_head'} \n|; + $cookiename = 'SN_UPLOAD'; $buff .= "\tkey0 = escape('$in{'postname'}'); key1 = escape('$in{'org_pass'}'); key2 = escape('$in{'postkey'}');\n";} + else{ $cookiename = 'SN_DEL'; $buff .= "\tkey0 = ''; key1 = escape('$in{'delpass'}'); key2 = '';\n"; } + $buff .= qq|\tdocument.cookie = "$cookiename="+key0+"<>"+key1+"<>"+key2+"; "+ tmp;\n}\n//-->\n\n|; } $buff .=<<"EOM"; @@ -619,7 +620,7 @@ $set{'html_head'}$set{'html_css'} EOM $buff .= leaddisp(0,1,1).'
Upload Info
'; - $buff .= qq|
\n

\n|."\n\n"; + $buff .= qq|
DELNAMECOMMENTSIZEADDRHOSTDATENOTEMIMEORIG
\n

\n|."\n\n"; shift(@log); foreach (@log){ $buff .= makeitem($_,'admin'); } $buff .= '
DELNAMEFILECOMMENTSIZEADDRHOSTDATENOTEMIMEORIG


'; @@ -727,7 +728,7 @@ sub dispsize{ sub makeitem{ my ($src,$mode) = @_; my ($buff,$check,$target); - my ($no,$ext,$date,$comment,$mime,$orgname,$addr,$host,$pass,$filepre,$note,$dummy) = split(/<>/,$src); + my ($no,$postname,$ext,$date,$comment,$mime,$orgname,$addr,$host,$pass,$filepre,$note,$dummy) = split(/<>/,$src); if(!$dummy){ $filepre = $set{'file_pre'}; } my $orgno = $no; $no = sprintf("%04d",$no); @@ -747,14 +748,14 @@ sub makeitem{ if($dlpath){ $path .= "$filepre$no.${ext}_$dlpath/"; } if($addr eq $host){ undef $host; } if($in{'checkmode'} eq 'allcheck'){$check = ' checked';} - $buff = "$filepre$no.$ext$comment$size$addr$host$date$note$mime$orgname\n"; + $buff = "$postname$filepre$no.$ext$comment$size$addr$host$date$note$mime$orgname\n"; }else{ my($d_com,$d_date,$d_size,$d_mime,$d_org); if($set{'disp_comment'}){ $d_com = "$comment"; } if($set{'disp_size'}){ $d_size = "$size"; } if($set{'disp_date'}){ $d_date= "$date"; } if($set{'disp_mime'}){ $d_mime = "$mime"; } if($set{'disp_orgname'}){ $d_org = "$orgname"; } - if(-e "$set{'src_dir'}$filepre$no.$ext.html"){$buff = "$filepre$no.$ext$d_com$d_size$d_date$d_mime$d_org\n";} - elsif($dlpath){$buff = "$filepre$no.$ext$d_com$d_size$d_date$d_mime$d_org\n";} - else{ $buff = "$filepre$no.$ext$d_com$d_size$d_date$d_mime$d_org\n";} + if(-e "$set{'src_dir'}$filepre$no.$ext.html"){$buff = "$postname$filepre$no.$ext$d_com$d_size$d_date$d_mime$d_org\n";} + elsif($dlpath){$buff = "$postname$filepre$no.$ext$d_com$d_size$d_date$d_mime$d_org\n";} + else{ $buff = "$postname$filepre$no.$ext$d_com$d_size$d_date$d_mime$d_org\n";} } return $buff; } @@ -990,7 +991,7 @@ sub dlfile{ if($dlno == 0) { &error(51,$in{'file'}); } foreach my $value (@log){ - my ($no,$ext,$date,$comment,$mime,$orgname,$addr,$host,$pass,$filepre,$note,$dummy) = split(/<>/,$value); + my ($no,$postname,$ext,$date,$comment,$mime,$orgname,$addr,$host,$pass,$filepre,$note,$dummy) = split(/<>/,$value); my @note = split(/,/,$note); if(int($dlno) == $no){ $dl_comment = $comment;