www.gusucode.com > 全球营销软件站整站源码4月最新数据 4.0源码程序 > 801wyxqf\adminadmin\sys\admin_lockip.asp

    <!--#include file="../../conn.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/const.asp"-->
<!--#include file="../inc/check.asp"-->
<%
Admin_header
'=====================================================================
' 软件名称:801w软件代理系统
' 当前版本:801wAsp 801w cn 801w com
' 文件名称:admin_main.asp
' 更新日期:2010-2-16
' 官方网站:801w代理系统(www.801w.cn www.801w.com) QQ:274667447
'=====================================================================
' Copyright 2003-2010 801w.cn - All Rights Reserved.
' 801wasp is a trademark of 801w.cn
'=====================================================================
%>
<table class="table1" cellspacing="1" cellpadding="3" align="center" border="0">
	<tr>
		<td class="tableline linetitle" width="200" align="left">IP地址访问限制管理</td>
		<td class="tableline" width="*" align="right"><a href="admin_setting.asp">基本设置</a>
			 - <a href="admin_setting.asp?action=upload">上传设置</a>
			 - <a href="admin_setting.asp?action=editkey">内容关键字管理</a>
			 - <a href="admin_lockip.asp">IP限制管理</a>
			 - <a href="admin_badword.asp">过滤字符管理</a>
		</td>
	</tr>
</table>
<%
Dim Action
If Not ChkAdmin("LockIP") Then
	Call Transfer_error()
End If
Action = LCase(Request("action"))
Select Case Trim(Action)
	Case "save"
		Call savelockip()
	Case Else
		Call showmain()
End Select
If FoundErr = True Then
	ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
NewAsp.PageEnd
Sub showmain()
	Dim Rs,i,m_strLockIPlist
	Set Rs = NewAsp.Execute("SELECT id,LockIPlist FROM NC_Setup")
	If Rs.BOF And Rs.EOF Then
		Set Rs = Nothing
		FoundErr = True
		ErrMsg = "系统安装错误,找不到系统设置!"
		Exit Sub
	End If
	m_strLockIPlist = TrimLockIPList(Rs("LockIPlist"),1)

%>
<form name="myform" method="post" action="?action=save">
<table border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
	<th colspan="2">IP地址访问限制列表--管理</th>
</tr>
<tr>
	<td colspan="2" class="tablerow1"><b>说明:</b><br/>您可以添加多个限制IP,每个IP用回车分隔,如:218.28.86.97或218.28.*.*;*.*.*.*将限制所有IP的访问。</td>
</tr>
<tr>
	<td class="tablerow2" width="20%" align="right"><u>IP地址访问限制列表</u>:</td>
	<td class="tablerow2" width="80%"><textarea name="LockIPlist" rows="15" cols="70"><%=m_strLockIPlist%></textarea>
	<div align="left"><a href="javascript:admin_Size(-15,'LockIPlist')"><img src="../images/minus.gif" unselectable="on" border="0"></a>
	<a href="javascript:admin_Size(15,'LockIPlist')"><img src="../images/plus.gif" unselectable="on" border="0"></div>
	</td>
</tr>
<tr>
	<td class="tablerow1" align="right">&nbsp;</td>
	<td class="tablerow1"><input type="submit" value="保存设置" name="submit_button" id="submit_button" class="button"></td>
</tr>
</table>
</form>
<%
End Sub

Sub savelockip()
	Dim Rs,SQL
	Dim m_strLockIPlist
	m_strLockIPlist = TrimLockIPList(Request.Form("LockIPlist"),0)
	If FoundErr = True Then Exit Sub
	Set Rs = NewAsp.CreateAXObject("ADODB.Recordset")
	SQL = "SELECT * FROM NC_Setup"
	Rs.Open SQL,Conn,1,3
		Rs("LockIPlist") = m_strLockIPlist
	Rs.Update
	Rs.Close:Set Rs = Nothing
	NewAsp.DelCache("setup")
	Succeed("<li>恭喜您!保存IP地址访问限制列表完成。</li>")
End Sub

Function TrimLockIPList(str,stype)
	str = Trim(str)
	If IsNull(str) Or Len(str) < 2 Then
		TrimLockIPList = ""
		Exit Function
	End If
	str = Replace(str, vbNewline, "|")
	str = Replace(str, Chr(13), "")
	str = Replace(str, Chr(10), "|")
	Dim a,s,i
	a = Split(str, "|")
	For i = 0 To UBound(a)
		If Len(a(i)) > 0 Then
			s = s & a(i) & "|"
		End If
	Next
	If Len(s)>0 Then s = Left(s,Len(s)-1)
	If stype = 1 Then
		TrimLockIPList = Replace(s, "|", vbNewline)
	Else
		TrimLockIPList = s
	End If
End Function
%>