⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ftpmanage.asp

📁 <虚拟主机站点管理系统>呵呵是我们公司的一个小产品
💻 ASP
字号:
<%
	if Session("UserName") = "" then
		response.Redirect "login.asp"
	end if
%>

<%
session("title")="砺青站点管理系统"
session("headline")="首页 -> FTP管理"



set lqsm_ftp= server.CreateObject("lqsm.ftp")
set lqsm_config= server.CreateObject("lqsm.config")
%>


<!--#include file="head.asp"-->
 
 <br><br><br>
 <script language='JavaScript'>
<!--
function check_input()
{
	web=document.Web;
	if(web.FtpUser.value=='')
	{
		alert('用户名不能为空');
		web.FtpUser.focus();
		return false;
	}
	if(web.FtpPass.value=='')
	{
		alert('用户密码不能为空');
		web.FtpPass.focus();
		return false;
	}	
	if(web.HomeDir.value=='')
	{
		alert('上传目录不能为空');
		web.HomeDir.focus();
		return false;
	}		
	if(web.MaxNrUsers.value=='')
	{
		alert('最大链接数不能为空');
		web.MaxNrUsers.focus();
		return false;
	}	
	
	if(isNaN(web.MaxNrUsers.value))
	{
		alert('最大链接数只能为数字');
		web.MaxNrUsers.focus();
		return false;
	}
	
	if(web.DiskQuota.value=='')
	{
		alert('空间大小不能为空');
		web.DiskQuota.focus();
		return false;
	}		
	if(isNaN(web.DiskQuota.value))
	{
		alert('空间大小只能为数字');
		web.DiskQuota.focus();
		return false;
	}
	if(web.FtpLdle.value=='')
	{
		alert('超时不能为空');
		web.FtpLdle.focus();
		return false;
	}		
	if(isNaN(web.FtpLdle.value))
	{
		alert('超时只能为数字');
		web.FtpLdle.focus();
		return false;
	}	
	if(web.SpeedLimitUp.value=='')
	{
		alert('最大上传速度不能为空');
		web.SpeedLimitUp.focus();
		return false;
	}		
	if(isNaN(web.SpeedLimitUp.value))
	{
		alert('最大上传速度只能为数字');
		web.SpeedLimitUp.focus();
		return false;
	}	
	if(web.SpeedLimitDown.value=='')
	{
		alert('最大下载速度不能为空');
		web.SpeedLimitDown.focus();
		return false;
	}	
	if(isNaN(web.SpeedLimitDown.value))
	{
		alert('最大下载速度只能为数字');
		web.SpeedLimitDown.focus();
		return false;
	}	
}
//-->
</script>
<%
'on error resume next

FtpUser=request("FtpUser")
FtpPass=request("FtpPass")
HomeDir=request("HomeDir")
Access=request("Access")
MaxNrUsers=request("MaxNrUsers")
DiskQuota=request("DiskQuota")
FtpLdle=request("FtpLdle")
SpeedLimitUp=request("SpeedLimitUp")
SpeedLimitDown=request("SpeedLimitDown")
FtpAction=request("FtpAction")
FtpState=request("FtpState")
page = request("page")
if page ="" or (not IsNumeric(page)) then
	page = 1
end if
ret = lqsm_config.CfgGetConfig("PageSize",PageSize,ErrMsg)
if not IsNumeric(PageSize) then PageSize = 20
recb = (page-1) * cint(PageSize) +1
rece = recb + cint(PageSize) -1
ErrMsg=""

ret = lqsm_config.CfgManage("query",WebHomeDir,MailHomeDir,WebIPList,UserName,UserPass,HostID,RegCode,ErrMsg)

if FtpAction="" then
	 FtpAction="query"
	if WebIndex="" then WebIndex = lqsm_ftp.GetFtpUserList()
end if


if FtpAction="query" then
IndexList = split(WebIndex,",")
%>

<table border=1 bordercolor=#888888 bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=88% class='size09' align='center'>
<tr><td class='color01' bgcolor='#efefef'>序号</td>
<td class='color01' bgcolor='#efefef'>用户名</td>
<td class='color01' bgcolor='#efefef'>上传路径</td>
<td class='color01' bgcolor='#efefef'>空间(M)</td>
<td class='color01' bgcolor='#efefef'>状态</td>
<td class='color01' bgcolor='#efefef'>删除</td>
<td class='color01' bgcolor='#efefef'>编辑</td></tr>
<%
'on error resume next
i=1
for each Index in IndexList
	if Index <> "" then
		if (i >= recb) and  (i <= rece) then
	FtpUser=cstr(Index)
	FtpPass=""
	HomeDir=""
	Access=""
	MaxNrUsers=""
	DiskQuota=""
	FtpLdle=""
	SpeedLimitUp=""
	SpeedLimitDown=""
	FtpAction="query"

		ret = lqsm_ftp.FtpManage(FtpAction,FtpUser, FtpPass, HomeDir, Access, MaxNrUsers, DiskQuota, FtpLdle, SpeedLimitUp, SpeedLimitDown,FtpState,ErrMsg)
		%>
		<tr>
		<td>&nbsp;<%=i%></td>
		<td>&nbsp;<a href="FtpManage.asp?FtpAction=query_detail&FtpUser=<%=FtpUser%>"><%=FtpUser%></a></td>
		<td>&nbsp;<%=HomeDir%></td>
		<td>&nbsp;<%=DiskQuota%></td>
		<td>&nbsp;
		<%if FtpState=1 then
			response.write "正常"
			else
				response.write "停止"
			end if%></td>
		<td><a href="FtpManage.asp?FtpAction=del&FtpUser=<%=FtpUser%>">删除</a></td>
		<td><a href="FtpManage.asp?FtpAction=edit_pre&FtpUser=<%=FtpUser%>">修改</a></td>
		</tr>
		
		<%
		end if
		i = i+ 1
	end if
	
next
%>
<Tr><td colspan="13" align="center"><a href="FtpManage.asp?FtpAction=add_pre">增加FTP帐号</a></td></TR>
</table>
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%
pageall = cint(i / PageSize )
if (pageall * PageSize) < i then
	pageall = pageall + 1
end if
response.write page & "/" & pageall
do while ii<=pageall 
	if ii<> page then
		response.write "&nbsp;&nbsp;<A HREF=ftpmanage.asp?page="&ii&">"&ii&"</A>"
else
	response.write ii
end if
ii=ii+1
loop

response.write Msg
response.end
end if 
%>

<%if FtpAction="query_detail" then 
FtpAction="query"
ret = lqsm_ftp.FtpManage(FtpAction,FtpUser, FtpPass, HomeDir, Access, MaxNrUsers, DiskQuota, FtpLdle, SpeedLimitUp, SpeedLimitDown,FtpState,ErrMsg)
%>
<table border=1 bordercolor=#888888 bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=65% class='size09' align='center'>
<tr><td class='color01' bgcolor='#efefef' colspan="2" align="center">FTP详细信息</td></tr>
<tr><td>用&nbsp;户&nbsp;名</td><td>&nbsp;<%=FtpUser%></td></tr>
<tr><td>密&nbsp;&nbsp;&nbsp;&nbsp;码</td><td>&nbsp;<%=FtpPass%></td></tr>
<tr><td>上传路径</td><td>&nbsp;<%=HomeDir%></td></tr>
<tr><td>目录权限</td><td>&nbsp;<%=Access%>&nbsp;[<font color="#ff0000">R读 W写 A覆盖 M删除 L列目录 C建目录 D删目录 P继承</font>]</td></tr>
<tr><td>用&nbsp;户&nbsp;数</td><td>&nbsp;<%=MaxNrUsers%>&nbsp;个</td></tr>
<tr><td>空&nbsp;&nbsp;&nbsp;&nbsp;间</td><td>&nbsp;<%=DiskQuota%>&nbsp;M</td></tr>
<tr><td>超&nbsp;&nbsp;&nbsp;&nbsp;时</td><td>&nbsp;<%=FtpLdle%>&nbsp;分钟</td></tr>
<tr><td>上传速度</td><td>&nbsp;<%=SpeedLimitUp%>&nbsp;KB/秒</td></tr>
<tr><td>下载速度</td><td>&nbsp;<%=SpeedLimitDown%>&nbsp;KB/秒</td></tr>
<tr><td>状&nbsp;&nbsp;&nbsp;&nbsp;态</td><td>&nbsp;
		<%if FtpState=1 then
			response.write "正常"
			else
				response.write "停止"
			end if%></td></tr>
<tr><td align="center" colspan="2"> <input type='button' value='返  回' onclick='history.go(-1)' name='button' style='text-align:center'></td></tr>
</table>
<%
response.end
end if%>





<%if FtpAction="add_pre" then 
ret = lqsm_config.CfgManage("query",WebHomeDir,MailHomeDir,WebIPList,UserName,UserPass,HostID,RegCode,ErrMsg)%>
<form name="Web" action="FtpManage.asp" onsubmit='return check_input()'>
<table border=1 bordercolor=#888888 bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=65% class='size09' align='center'>
<tr><td class='color01' bgcolor='#efefef' colspan="2" align="center">请输入FTP信息</td></tr>
<input name="FtpAction" type="Hidden" value="add">
<tr><td>用&nbsp;户&nbsp;名</td></td><td><input name="FtpUser" class="form" type="Text" maxlength="100"></td></tr>
<tr><td>密&nbsp;&nbsp;&nbsp;&nbsp;码</td><td><input name="FtpPass" class="form" type="Text" maxlength="100"></td></tr>
<tr><td>上传路径</td><td><input name="HomeDir" class="form" type="Text" maxlength="100" size="50"  value="<%=WebHomeDir%>\www"></td></tr>
<tr><td>目录权限</td><td><input name="Access" class="form" type="Text" maxlength="8" size="8" value="RWAMLCDP">&nbsp;<font color="#ff0000">R读 W写 A覆盖 M删除 L列目录 C建目录 D删目录 P继承</font> </td></tr>
<tr><td>用&nbsp;户&nbsp;数</td><td><input name="MaxNrUsers" class="form" type="Text" maxlength="6" size="6" value="10">&nbsp;个</td></tr>
<tr><td>空间大小</td><td><input name="DiskQuota" class="form" type="Text" maxlength="100" size="10" value="100">&nbsp;M</td></tr>
<tr><td>超&nbsp;&nbsp;&nbsp;&nbsp;时</td><td><input name="FtpLdle" class="form" type="Text" maxlength="100" size="6" value="20">&nbsp;分钟</td></tr>
<tr><td>上传速度</td><td><input name="SpeedLimitUp" class="form" type="Text" maxlength="100" size="6" value="100">&nbsp;KB/秒</td></tr>
<tr><td>下载速度</td><td><input name="SpeedLimitDown" class="form" type="Text" maxlength="100" size="6" value="900">&nbsp;KB/秒</td></tr>
<tr><td>状&nbsp;&nbsp;&nbsp;&nbsp;态</td><td>
	<select name="FtpState" size="1">
		<option value="1" <%if FtpState="1" then response.write "selected"%>>正常
		<option value="2" <%if FtpState="2" then response.write "selected"%>>停止
	</select>
</td></tr>
<tr><td align="center" colspan="2"><input type="Submit" value="添  加" style='text-align:center'> <input type='button' value='返  回' onclick='history.go(-1)' name='button' style='text-align:center'></td></tr>
</table>
</form>
<%
response.end
end if%>



<%if FtpAction="edit_pre" then 
FtpAction="query"
ret = lqsm_ftp.FtpManage(FtpAction,FtpUser, FtpPass, HomeDir, Access, MaxNrUsers, DiskQuota, FtpLdle, SpeedLimitUp, SpeedLimitDown,FtpState,ErrMsg)
%>
<form name="Web" action="FtpManage.asp" onsubmit='return check_input()'>
<table border=1 bordercolor=#888888 bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=65% class='size09' align='center'>
<tr><td class='color01' bgcolor='#efefef' colspan="2" align="center">请输入FTP信息</td></tr>
<input name="FtpAction" type="Hidden" value="edit">
<input name="FtpUser" type="Hidden" value="<%=FtpUser%>">
<tr><td>用&nbsp;户&nbsp;名</td><td><%=FtpUser%></td></tr>
<tr><td>密&nbsp;&nbsp;&nbsp;&nbsp;码</td><td><input name="FtpPass" class="form" type="Text" maxlength="100" value="<%=FtpPass%>"></td></tr>
<tr><td>上传路径</td><td><input name="HomeDir" class="form" type="Text" maxlength="100" size="50"  value="<%=HomeDir%>"></td></tr>
<tr><td>目录权限</td><td><input name="Access" class="form" type="Text" maxlength="8" size="8" value="<%=Access%>">&nbsp;<font color="#ff0000">R读 W写 A覆盖 M删除 L列目录 C建目录 D删目录 P继承</font></td></tr>
<tr><td>用&nbsp;户&nbsp;数</td><td><input name="MaxNrUsers" class="form" type="Text" maxlength="100" size="6" value="<%=MaxNrUsers%>">&nbsp;个</td></tr>
<tr><td>空间大小</td><td><input name="DiskQuota" class="form" type="Text" maxlength="100" size="10" value="<%=DiskQuota%>">&nbsp;M</td></tr>
<tr><td>超&nbsp;&nbsp;&nbsp;&nbsp;时</td><td><input name="FtpLdle" class="form" type="Text" maxlength="100" size="6" value="<%=FtpLdle%>">&nbsp;秒</td></tr>
<tr><td>上传速度</td><td><input name="SpeedLimitUp" class="form" type="Text" maxlength="100" size="6" value="<%=SpeedLimitUp%>">&nbsp;KB/秒</td></tr>
<tr><td>下载速度</td><td><input name="SpeedLimitDown" class="form" type="Text" maxlength="100" size="6" value="<%=SpeedLimitDown%>">&nbsp;KB/秒</td></tr>

<tr><td>状态</td><td>
	<select name="FtpState" size="1">
		<option value="1" <%if FtpState="1" then response.write "selected"%>>正常
		<option value="2" <%if FtpState="2" then response.write "selected"%>>停止
	</select>
	</td></tr>
<tr><td align="center" colspan="2"><input type="Submit" value="修  改" style='text-align:center'> <input type='button' value='返  回' onclick='history.go(-1)' name='button' style='text-align:center'></td></tr>
</table>
</form>
<%
response.end
end if%>

<%
ret = lqsm_ftp.FtpManage(FtpAction,FtpUser, FtpPass, HomeDir, Access, MaxNrUsers, DiskQuota, FtpLdle, SpeedLimitUp, SpeedLimitDown,FtpState,ErrMsg)

if ret = 0  then
	Msg = "交易成功"
else
	Msg = "交易失败:错误码=["&ret&"]; 描述=["&ErrMsg&"]"
end if
response.write "<table width='80%' align='center'><tr><td align='center'>"&Msg&"</td></tr></table>"


%>

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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -