<!-- #include file="setup.asp" -->

<%
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XXX                                      XXX 
'XXX         XXXXXXXX      XXX   XX       XXX
'XXX         XXX    XX    XXX XXX         XXX
'XXX        XXX    XX    XXXX             XXX
'XXX       XXX    XX    XXX  XX           XXX 
'XXX      XXXXXXXX     XXX     XXX        XXX
'XXX                                      XXX
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'XXXX DK PassCanSee 需密码贴插件v1.0         X      
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
syspass="lili861224"              '这是系统管理密码
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
top

if request.cookies("username")=empty then response.redirect "login.asp"


Set Rs=Conn.Execute("clubconfig")
dk_nopassnosee_pw=rs("dk_nopassnosee_pw")
rs.close



%>

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>输入贴子浏览密码</title>
</head>

<body>



<%

if Request("menu")=empty then
menu1="putpass"
else
menu1=Request("menu")
end if

if request("id")=empty then menu1="adminthis"

select case menu1

case "putpass"
putpass

case "putpassok"
putpassok

case "adminthis"
adminthis

case "adminok"
adminok


end select



sub adminok
if instr(Request.ServerVariables("http_referer"),"http://"&Request.ServerVariables("server_name")&"") = 0 then  error("<li>来源错误(如果用诺顿防火墙，需设置一下)")
if request.form("systempass")=syspass then

if request("picpass")<>empty then
picpass=request("picpass")
if instr(picpass,"update")>0 or instr(picpass,"&#")>0 or instr(picpass,"set")>0 then error("<li>非法操作或者密码含有非法字符")
conn.execute("update [clubconfig] set dk_nopassnosee_pw='"&picpass&"' ")
mess="过滤密码已重设成功；"
end if

if isnumeric(""&request("topicid1")&"") then
topicid1=int(request("topicid1"))
checkthisidin=conn.execute("select count(*) from [dk_nopassnosee_pass] where topicid="&topicid1&"")(0)
if checkthisidin=0 then
sql="insert into [dk_nopassnosee_pass] (topicid) values ("&topicid1&")"
conn.Execute(SQL)
end if
mess=""&mess&"ID值为 "&topicid1&" 的贴子已添加密码过滤功能；"
end if

if isnumeric(""&request("topicid2")&"") then
topicid1=int(request("topicid2"))
checkthisidin=conn.execute("select count(*) from [dk_nopassnosee_pass] where topicid="&topicid2&"")(0)
if checkthisidin>0 then
conn.execute("delete from [dk_nopassnosee_pass] where topicid="&topicid2&"")
end if
mess=""&mess&"ID值为 "&topicid2&" 的贴子已不再需要进行密码过滤；"
end if

if mess=empty then mess="无操作！"

response.redirect "?menu=adminthis&message="&mess&""

else
error("<li>系统密码错误")
end if
end sub


sub adminthis
if request("message")<>empty then
%>
<SCRIPT language=JavaScript>           
<!-- Begin           
alert("[系统提示]：<%=request("message")%>");
//--></SCRIPT> 
<%
end if
%>
<table border=0 width=<%=dkuan%> align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25>&nbsp;<img src=images/Forum_nav.gif>&nbsp;<a href=default.asp><%ClubTree%></a> → 贴子密码可见后台管理</td>
</tr>

</table><br>
&nbsp;
<br>
<form action="?menu=adminok&id=1" method="post">
	<table width="<%=dkuan%>" border="0" cellspacing="1" cellpadding="2" align="center" class="a2">
		<tr>
			<td width="100%" class="a1" height="25">
			<div align="center">
				后台管理</div>
			</td>
		</tr>
		<tr>
			<td height="19" width="100%" valign="top" class="a3">
			<div align="left">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;系统提交密码：<input size="15" name="systempass" type="password">(必填)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;贴子可见密码：<input size="15" name="picpass" type="password">(不更改不要填写)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;要过滤的贴子：<input size="15" name="topicid1" type="text">(贴子ID值，此贴以后需输密码)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;不过滤的贴子：<input size="15" name="topicid2" type="text">(贴子ID值，此贴以后无需密码)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value=" 提交 " name="Submit1">　<input type="reset" value=" 取消 " name="Submit">
			</div>
			</td>
		</tr>
	</table>
</form><br>
<center>
<a href=javascript:history.back()>BACK </a><br>
<%
end sub


sub putpassok


if instr(Request.ServerVariables("http_referer"),"http://"&Request.ServerVariables("server_name")&"") = 0 then error("<li>来源错误")
if dk_nopassnosee_pw=request("picpass") then
response.cookies("dk_nopassnosee_pw")=""&request("picpass")&""
response.redirect "showpost.asp?id="&request("id")&""
else
error("<li>您输入的密码不对，您不知密码的话可以后退或者<a href=default.asp>返回首页</a>！")
end if
end sub


sub putpass
id=int(request("id"))
checkthisidin=conn.execute("select count(*) from [dk_nopassnosee_pass] where topicid="&id&"")(0)
if checkthisidin=0 then response.redirect "showpost.asp?id="&id&""

forumid=Conn.Execute("Select forumid From forum where id="&id)(0)

sql="select topic from [forum] where id="&id&""
rs.open sql,conn,1,1
if not rs.eof then
topic=rs("topic")
end if
rs.close

%>
<SCRIPT language=JavaScript>           
<!-- Begin           
alert("[系统提示]：本贴为密码可见贴，请您输入浏览密码！");
//--></SCRIPT> 

<table border=0 width=<%=dkuan%> align=center cellspacing=1 cellpadding=4 class=a2>
<tr class=a3>
<td height=25>&nbsp;<img src=images/Forum_nav.gif>&nbsp;<a href=ShowForum.asp?forumid=<%=forumid%>><%ClubTree%></a> → <%=topic%> → 输入贴子浏览密码</td>
</tr>

</table><br>
&nbsp;
<br>
<form action="?menu=putpassok&id=<%=id%>" method="post">
	<table width="<%=dkuan%>" border="0" cellspacing="1" cellpadding="2" align="center" class="a2">
		<tr>
			<td width="100%" class="a1" height="25">
			<div align="center">
				浏览密码</div>
			</td>
		</tr>
		<tr>
			<td height="19" width="100%" valign="top" class="a3">
			<div align="center">
				请输入密码: <input size="15" name="picpass" type="password"><br>
				<input type="submit" value=" 提交 " name="Submit1">　<input type="reset" value=" 取消 " name="Submit">
			</div>
			</td>
		</tr>
	</table>
</form><br>
<center>
<a href=javascript:history.back()>BACK </a><br>
<%
end sub



set rs=nothing
%>
&nbsp;
<div align="center">
  <center>
  <table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="70%" cellpadding="0" id="AutoNumber1" height="17">
    <tr>
      <td width="100%" height="17" bgcolor="#FFFFFF" align="center">　<font face="Impact" size="2" color="#FF9955">DK&nbsp; PassCanSee&nbsp; Plus&nbsp; v1.0</font><font size="2">
      </font>
      <font style="font-size:10pt; line-height:14pt" face="Comic Sans MS">
      (C)1998-2008</font><font style="font-size:10pt; line-height:14pt; color:ff9955" face="Comic Sans MS">&nbsp; 
      Code: IPSC&nbsp;&nbsp; </font><font face="Impact"><a href=passcansee.asp?menu=adminthis>
      <font color="#C0C0C0" size="2">Admindoor</font></a></font></td>
    </tr>
  </table>
  </center>
</div> 
<BR>