<%
if request.cookies("buyok")("admin")="" then response.write "<meta http-equiv='refresh' content='0;URL=../admin.asp'>"
%>
<!--#include file="../include/config.asp"-->

<script language=javascript src=../include/mouse.js></script>
 <%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("01")%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>
<BODY bgcolor="#D9EAFC">
<%
rows=request("rows")
if rows="" or rows=0 then rows=10
action=request("ok")
if action="" then 
Set rs = conn.Execute("select * from bconfig") 
%>
<table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
            <TBODY>
              <TR> 
                
      <TD bgColor=#f4f5fd height=30><font color="#000000">　<B><font color="#FF0000">&nbsp;锁定IP设置</font></B></font></TD>
              </TR>
            </TBODY>
</TABLE>
		  <table height="5"><tr><td></td></tr></table>

<table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee"><form action=config8.asp method=post name=setup>
  <tr bgcolor="#FFFFFF">
    <td width=20% align=right>是否锁定IP &nbsp;</td>
    <td > <input type="radio" name="lockip" value="1" <%if rs("lockip")="1" then%>checked<%end if%>>
      是 
      <input type="radio" name="lockip" value="0" <%if rs("lockip")<>"1" then%>checked<%end if%>>
      否</td>
  </TR>
  <tr bgcolor="#FFFFFF">
    <td width=20% align=right>锁定IP列表 &nbsp;</td>
    <td><TEXTAREA alt="请输入限制访问本站的IP地址<br>如：205.158.40.15<br>每个IP地址占一行" NAME="IP" ROWS="<%=rows%>" COLS="25" style="overflow:auto;">
<%
if rs("IP")<>"" then response.write Replace(rs("IP"),"@",vbCRLF)
%>
</TEXTAREA></td>
  </TR>
  <tr bgcolor="#FFFFFF">
    <td width="568" colspan=2 ><INPUT name="ok" TYPE="hidden" value="ok">
      <INPUT name=action TYPE="submit" value="保存设置">
</table>
</form>
<font color=red>※提示：</font><br>若输入IP地址的一部分，如：220.50，那么任何包含220.50的IP地址都将禁止访问本站。
<DIV style="position:absolute; top:150; left:400"> 
<table border=0 width=100><tr><td width=50% align=center>
<form action=config8.asp method=post name=setup2>
<INPUT name="rows" TYPE="hidden" value="<%=rows+10%>">
<input type=image src=../images/admin/jia.gif border=0 alt="增加编辑区域">
</form>
</td>
<td width=100 align=center>
<form action=config8.asp method=post name=setup3>
<INPUT name="rows" TYPE="hidden" value="<%=rows-10%>">
<input type=image src=../images/admin/jian.gif border=0 alt="减少编辑区域">
</form>
</td></tr></table>
</td></tr>
</table>
</DIV> 
		  <table height="5"><tr><td></td></tr></table>

<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
if action="ok" then
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from bconfig"
rs.open sql,conn,1,3
rs("lockip")=request.form("lockip")
ip=replace(request.form("ip")," ","")
ip=replace(ip,vbCRLF,"@")
for i=1 to 5
ip=replace(ip,"@@","@")
next
if right(ip,1)="@" then ip=left(ip,len(ip)-1)
if left(ip,1)="@" then ip=right(ip,len(ip)-1)
rs("IP")=ip
rs.update
url="config8.asp"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<script language='javascript'>"
response.write "alert('操作成功，您设置的信息已保存！');"
response.write "location.href='"&url&"';"
response.write "</script>"
end if
%>
