}
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'};
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;
$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;
}
# $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);
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);
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'}<META http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
<!--
function getCookie(obj,cookiename){
- var i,str; c = new Array(); p = new Array("",""); str = document.cookie;c = str.split(";");
+ var i,str; c = new Array(); p = new Array("","",""); str = document.cookie;c = str.split(";");
for (i = 0; i < c.length; i++) { if (c[i].indexOf(cookiename+"=") >= 0) { p = (c[i].substr(c[i].indexOf("=")+1)).split("<>"); break; }}
- if(cookiename == "SN_UPLOAD"){ obj.pass.value = unescape(p[0]);$postval }
- else if(cookiename == "SN_DEL"){ obj.delpass.value = unescape(p[0]);}
+ if(cookiename == "SN_UPLOAD"){ obj.postname.value = unescape(p[0]); obj.pass.value = unescape(p[1]);$postval }
+ else if(cookiename == "SN_DEL"){ obj.delpass.value = unescape(p[1]);}
return true;
}
function delnoin(no){
my ($minsize,$total);
if($set{'min_flag'}){ $minsize = 'Min '.dispsize($set{'min_size'}*1024).' - '; }
if($set{'max_all_flag'}){ $total .= ' Total '.dispsize($set{'max_all_size'}*1024);}
- $header .= qq|<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="$set{'base_cgi'}" name="Form">FILE $minsize$maxsize (*$set{'max_log'}Files$total)<br>|;
+ $header .= qq|<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="$set{'base_cgi'}" name="Form">NAME (\8fÈ\97ª\89Â)<br><INPUT TYPE=text SIZE="20" NAME="postname"><br> FILE $minsize$maxsize (*$set{'max_log'}Files$total)<br>|;
$header .='<INPUT TYPE=file SIZE="40" NAME="upfile">';
$header .= ' DLKey: <INPUT TYPE=text SIZE="8" NAME="dlkey" maxlength="8">' if($set{'dlkey'});
$header .= '
$footer .= "\n<table summary=\"footer\" width=\"100%\"><tr><td><div align=left><FORM METHOD=POST ACTION=\"$set{'base_cgi'}\" name=\"Del\"><span style='font-size:9pt'><input type=hidden name=mode value=delete>No.<input type=text size=4 name=delno> key<input type=password size=4 name=delpass> <input type=submit value=\"del\" name=del></span></form></div>\n";
$footer .= "</td><td><div align=right><!-- $set{'ver'} --><a href=\"http://sugachan.dip.jp/download/\" target=\"_blank\"><small>Sn Uploader</small></a></div></td></tr></table>\n</body>\n</html>";
- my $info_title = "<table summary=\"upinfo\" width=\"100%\">\n<tr><td></td><td>NAME</td>";
+ my $info_title = "<table summary=\"upinfo\" width=\"100%\">\n<tr><td></td><td>NAME</td><td>FILE</td>";
if($set{'disp_comment'}){ $info_title .= "<td>COMMENT</td>"; } if($set{'disp_size'}){ $info_title .= "<td>SIZE</td>"; } if($set{'disp_date'}){ $info_title .= "<td>DATE</td>"; }
if($set{'disp_mime'}){ $info_title .= "<td>MIME</td>"; } if($set{'disp_orgname'}){ $info_title .= "<td>ORIG</td>"; }
$info_title .= "</tr>\n";
if($set{'html_all'}){
my $buff; my $no = 1; my $time = time; my $subheader;
foreach my $value (@log){
- my ($no,$ext,$date,$comment,$mime,$orgname,$addr,$host,$pass,$dummy) = split(/<>/,$value);
+ my ($no,$postname,$ext,$date,$comment,$mime,$orgname,$addr,$host,$pass,$dummy) = split(/<>/,$value);
if(!$dummy){ next; }
$buff .= makeitem($value);
}
if($in{'addr'} =~ /(\d+).(\d+).(\d+).(\d+)/){ $tmpaddr = "$1.$2.$3."; }
my $findflag = 0;
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);
$delnote = $note;
my $delflag = 0;
if(!$addr){ next; }
<!--
setCookie();
function setCookie() {
- var key1,key2;
+ var key0,key1,key2;
var tmp = "path=/; expires=Tue, 31-Dec-2030 23:59:59; ";
EOM
if($in{'jcode'}){
my %ck; foreach(split(/;/,$ENV{'HTTP_COOKIE'})){ my($key,$val) = split(/=/); $key =~ s/\s//g; $ck{$key} = $val;}
my @ck = split(/<>/,$ck{'SN_DEL'});
if(!$ck[0] && $in{'org_pass'}){ $buff .= qq|\tdocument.cookie = "SN_DEL="+escape('$in{'org_pass'}')+"<>;"+ tmp;\n|;}
- $cookiename = 'SN_UPLOAD'; $buff .= "\tkey1 = escape('$in{'org_pass'}'); key2 = escape('$in{'postkey'}');\n";}
- else{ $cookiename = 'SN_DEL'; $buff .= "\tkey1 = escape('$in{'delpass'}'); key2 = '';\n"; }
- $buff .= qq|\tdocument.cookie = "$cookiename="+key1+"<>"+key2+"; "+ tmp;\n}\n//-->\n</script>\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</script>\n|;
}
$buff .=<<"EOM";
<body>
EOM
$buff .= leaddisp(0,1,1).'<a name="up"></a><table summary="title" width="100%"><tr><td bgcolor="#caccff"><strong><font size="4" color="#3366cc">Upload Info</font></strong></td></tr></table>';
- $buff .= qq|<table summary="check"><tr><td><form action="$set{'base_cgi'}" method="POST"><input type=hidden name="checkmode" value="allcheck"><input type=hidden name=delno value="$in{'delno'}"><input type=hidden name=delpass value="$in{'delpass'}"><input type=submit value="\82·\82×\82Ä\83`\83F\83b\83N"></form></td><td><form action="$set{'base_cgi'}" method="POST"><input type=hidden name="checkmode" value="nocheck"><input type=hidden name=delno value="$in{'delno'}"><input type=hidden name=delpass value="$in{'delpass'}"><input type=submit value="\82·\82×\82Ä\8aO\82·"></form></td><td><form action="$set{'base_cgi'}" method="POST"><input type=hidden name=delpass value="$set{'admin_pass'}"><input type=submit value="HTML\82ð\8dX\90V\82·\82é/\83\8d\83O\83A\83E\83g"></form></td></tr></table>\n<form action="$set{'base_cgi'}" method="POST"><input type=hidden name="mode" value="delete"><input type=hidden name=delno value="$in{'delno'}"><input type=hidden name=delpass value="$in{'delpass'}"><input type=submit value="\83`\83F\83b\83N\82µ\82½\82à\82Ì\82ð\8dí\8f\9c"><br>\n|."<table summary=\"upinfo\" width=\"100%\">\n<tr><td>DEL</td><td>NAME</td><td>COMMENT</td><td>SIZE</td><td>ADDR</td><td>HOST</td><td>DATE</td><td>NOTE</td><td>MIME</td><td>ORIG</td></tr>\n";
+ $buff .= qq|<table summary="check"><tr><td><form action="$set{'base_cgi'}" method="POST"><input type=hidden name="checkmode" value="allcheck"><input type=hidden name=delno value="$in{'delno'}"><input type=hidden name=delpass value="$in{'delpass'}"><input type=submit value="\82·\82×\82Ä\83`\83F\83b\83N"></form></td><td><form action="$set{'base_cgi'}" method="POST"><input type=hidden name="checkmode" value="nocheck"><input type=hidden name=delno value="$in{'delno'}"><input type=hidden name=delpass value="$in{'delpass'}"><input type=submit value="\82·\82×\82Ä\8aO\82·"></form></td><td><form action="$set{'base_cgi'}" method="POST"><input type=hidden name=delpass value="$set{'admin_pass'}"><input type=submit value="HTML\82ð\8dX\90V\82·\82é/\83\8d\83O\83A\83E\83g"></form></td></tr></table>\n<form action="$set{'base_cgi'}" method="POST"><input type=hidden name="mode" value="delete"><input type=hidden name=delno value="$in{'delno'}"><input type=hidden name=delpass value="$in{'delpass'}"><input type=submit value="\83`\83F\83b\83N\82µ\82½\82à\82Ì\82ð\8dí\8f\9c"><br>\n|."<table summary=\"upinfo\" width=\"100%\">\n<tr><td>DEL</td><td>NAME</td><td>FILE</td><td>COMMENT</td><td>SIZE</td><td>ADDR</td><td>HOST</td><td>DATE</td><td>NOTE</td><td>MIME</td><td>ORIG</td></tr>\n";
shift(@log);
foreach (@log){ $buff .= makeitem($_,'admin'); }
$buff .= '</table></form><br><br>';
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);
if($dlpath){ $path .= "$filepre$no.${ext}_$dlpath/"; }
if($addr eq $host){ undef $host; }
if($in{'checkmode'} eq 'allcheck'){$check = ' checked';}
- $buff = "<tr><td><INPUT TYPE=checkbox NAME=\"admin_delno\" VALUE=\"$no\"$check></td><td><a href=\"$path$filepre$no.$ext\"$target>$filepre$no.$ext</a></td><td>$comment</td><td>$size</td><td>$addr</td><td>$host</td><td>$date</td><td>$note</td><td>$mime</td><td>$orgname</td></tr>\n";
+ $buff = "<tr><td><INPUT TYPE=checkbox NAME=\"admin_delno\" VALUE=\"$no\"$check></td><td>$postname</td><td><a href=\"$path$filepre$no.$ext\"$target>$filepre$no.$ext</a></td><td>$comment</td><td>$size</td><td>$addr</td><td>$host</td><td>$date</td><td>$note</td><td>$mime</td><td>$orgname</td></tr>\n";
}else{
my($d_com,$d_date,$d_size,$d_mime,$d_org);
if($set{'disp_comment'}){ $d_com = "<td>$comment</td>"; } if($set{'disp_size'}){ $d_size = "<td>$size</td>"; } if($set{'disp_date'}){ $d_date= "<td>$date</td>"; }
if($set{'disp_mime'}){ $d_mime = "<td>$mime</td>"; } if($set{'disp_orgname'}){ $d_org = "<td>$orgname</td>"; }
- if(-e "$set{'src_dir'}$filepre$no.$ext.html"){$buff = "<tr><td><SCRIPT type=\"text/javascript\" Language=\"JavaScript\"><!--\ndocument.write(\"<a href=\\\"javascript:delnoin($orgno)\\\">$set{'char_delname'}<\\/a>\");\n// --></SCRIPT></td><td><a href=\"$path$filepre$no.$ext.html\"$target>$filepre$no.$ext</a></td>$d_com$d_size$d_date$d_mime$d_org</tr>\n";}
- elsif($dlpath){$buff = "<tr><td><SCRIPT type=\"text/javascript\" Language=\"JavaScript\"><!--\ndocument.write(\"<a href=\\\"javascript:delnoin($orgno)\\\">$set{'char_delname'}<\\/a>\");\n// --></SCRIPT></td><td><a href=\"$set{'base_cgi'}?mode=dl&file=$orgno\">$filepre$no.$ext</a></td>$d_com$d_size$d_date$d_mime$d_org</tr>\n";}
- else{ $buff = "<tr><td><SCRIPT type=\"text/javascript\" Language=\"JavaScript\"><!--\ndocument.write(\"<a href=\\\"javascript:delnoin($orgno)\\\">$set{'char_delname'}<\\/a>\");\n// --></SCRIPT></td><td><a href=\"$path$filepre$no.$ext\"$target>$filepre$no.$ext</a></td>$d_com$d_size$d_date$d_mime$d_org</tr>\n";}
+ if(-e "$set{'src_dir'}$filepre$no.$ext.html"){$buff = "<tr><td><SCRIPT type=\"text/javascript\" Language=\"JavaScript\"><!--\ndocument.write(\"<a href=\\\"javascript:delnoin($orgno)\\\">$set{'char_delname'}<\\/a>\");\n// --></SCRIPT></td><td>$postname</td><td><a href=\"$path$filepre$no.$ext.html\"$target>$filepre$no.$ext</a></td>$d_com$d_size$d_date$d_mime$d_org</tr>\n";}
+ elsif($dlpath){$buff = "<tr><td><SCRIPT type=\"text/javascript\" Language=\"JavaScript\"><!--\ndocument.write(\"<a href=\\\"javascript:delnoin($orgno)\\\">$set{'char_delname'}<\\/a>\");\n// --></SCRIPT></td><td>$postname</td><td><a href=\"$set{'base_cgi'}?mode=dl&file=$orgno\">$filepre$no.$ext</a></td>$d_com$d_size$d_date$d_mime$d_org</tr>\n";}
+ else{ $buff = "<tr><td><SCRIPT type=\"text/javascript\" Language=\"JavaScript\"><!--\ndocument.write(\"<a href=\\\"javascript:delnoin($orgno)\\\">$set{'char_delname'}<\\/a>\");\n// --></SCRIPT></td><td>$postname</td><td><a href=\"$path$filepre$no.$ext\"$target>$filepre$no.$ext</a></td>$d_com$d_size$d_date$d_mime$d_org</tr>\n";}
}
return $buff;
}
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;