Index: trunk/snuploader/upload.cgi
===================================================================
--- trunk/snuploader/upload.cgi	(revision 35)
+++ trunk/snuploader/upload.cgi	(revision 36)
@@ -169,4 +169,5 @@
 		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'};
@@ -214,5 +215,5 @@
 	}
 
-	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).'...'; }
@@ -226,5 +227,5 @@
 		$value =~ s/\0//g;
 	}
-	($in{'comment'},$in{'orgname'},$in{'type'},$in{'dlkey'}) = @form;
+	($in{'postname'},$in{'comment'},$in{'orgname'},$in{'type'},$in{'dlkey'}) = @form;
 }
 
@@ -323,5 +324,5 @@
 	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;
 
@@ -331,5 +332,5 @@
 
 	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);
@@ -380,5 +381,5 @@
 	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">
@@ -386,8 +387,8 @@
 <!--
 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;
 }
@@ -409,5 +410,5 @@
 	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 (ÈªÂ)<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'});
@@ -436,5 +437,5 @@
 	$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>"; }
@@ -446,5 +447,5 @@
 		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);
@@ -513,5 +514,5 @@
 	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;
@@ -583,5 +584,5 @@
 setCookie();
 function setCookie() {
-	var key1,key2;
+	var key0,key1,key2;
 	var tmp = "path=/; expires=Tue, 31-Dec-2030 23:59:59; ";
 EOM
@@ -590,7 +591,7 @@
 			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";
@@ -621,5 +622,5 @@
 
 	$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="·×Ä`FbN"></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="·×ÄO·"></form></td><td><form action="$set{'base_cgi'}" method="POST"><input type=hidden name=delpass value="$set{'admin_pass'}"><input type=submit value="HTMLðXV·é/OAEg"></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="`FbNµ½àÌðí"><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="·×Ä`FbN"></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="·×ÄO·"></form></td><td><form action="$set{'base_cgi'}" method="POST"><input type=hidden name=delpass value="$set{'admin_pass'}"><input type=submit value="HTMLðXV·é/OAEg"></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="`FbNµ½àÌðí"><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'); }
@@ -730,5 +731,5 @@
 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;
@@ -750,12 +751,12 @@
 		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;
@@ -993,5 +994,5 @@
 
 	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){
