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

📄 webmanage.asp

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

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


set lqsm_web= server.CreateObject("lqsm.web")
set lqsm_config= server.CreateObject("lqsm.config")
%>


<!--#include file="head.asp"-->
 
 <br><br>
 <script language='JavaScript'>
<!--
function check_input()
{
return true;
	web=document.Web;
	if(web.WebSiteName.value=='')
	{
		alert('站点名称不能为空');
		web.WebSiteName.focus();
		return false;
	}
	if(web.WebFilesPath.value=='')
	{
		alert('主目录不能为空');
		web.WebFilesPath.focus();
		return false;
	}	
	if(web.WebIP.value=='')
	{
		alert('IP不能为空');
		web.WebIP.focus();
		return false;
	}		
	if(web.WebPort.value=='')
	{
		alert('端口不能为空');
		web.WebPort.focus();
		return false;
	}	
	
	if(isNaN(web.WebPort.value))
	{
		alert('端口只能为数字');
		web.WebPort.focus();
		return false;
	}
	
	if(web.WebHostName.value=='')
	{
		alert('主机头不能为空');
		web.WebHostName.focus();
		return false;
	}	
	if(web.WebLogPath.value=='')
	{
		alert('日志目录不能为空');
		web.WebLogPath.focus();
		return false;
	}
	if(web.WebLinks.value=='')
	{
		alert('链接数不能为空');
		web.WebLinks.focus();
		return false;
	}		
	if(isNaN(web.WebLinks.value))
	{
		alert('链接数只能为数字');
		web.WebLinks.focus();
		return false;
	}
	if(web.WebTimes.value=='')
	{
		alert('超时不能为空');
		web.WebTimes.focus();
		return false;
	}		
	if(isNaN(web.WebTimes.value))
	{
		alert('超时只能为数字');
		web.WebTimes.focus();
		return false;
	}	
	if(web.WebWidth.value=='')
	{
		alert('带宽不能为空');
		web.WebWidth.focus();
		return false;
	}		
	if(isNaN(web.WebWidth.value))
	{
		alert('带宽只能为数字');
		web.WebWidth.focus();
		return false;
	}	
	if(web.WebCPU.value=='')
	{
		alert('CPU不能为空');
		web.WebCPU.focus();
		return false;
	}	
	if(isNaN(web.WebCPU.value))
	{
		alert('CPU只能为数字');
		web.WebCPU.focus();
		return false;
	}	
}
//-->
</script>
<%
on error resume next

WebIndex=request("WebIndex")
WebAction=request("WebAction")
WebSiteName=request("WebSiteName")
WebFilesPath=request("WebFilesPath")
WebDefaultDoc=request("WebDefaultDoc")
WebIP=request("WebIP")
WebPort=request("WebPort")
WebHostName=request("WebHostName")
WebAccess=request("WebAccess")
WebLogPath=request("WebLogPath")
WebLinks=request("WebLinks")
WebTimes=request("WebTimes")
WebWidth=request("WebWidth")
WebCPU=request("WebCPU")
IUSRName=request("IUSRName")
IUSRPass=request("IUSRPass")
WebState = request("WebState")
ErrMsg = ""


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

if WebAction="" then
	 WebAction="query"
	if WebIndex="" then WebIndex = lqsm_web.GetWebIndexList()
end if


if WebAction="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'>IP地址</td>
<td class='color01' bgcolor='#efefef'>主机头</td><br>
<td class='color01' bgcolor='#efefef'>权限</td>
<td class='color01' bgcolor='#efefef'>连接数</td>
<td class='color01' bgcolor='#efefef'>CPU</td>
<td class='color01' bgcolor='#efefef'>状态</td>
<td class='color01' bgcolor='#efefef'>删除</td>
<td class='color01' bgcolor='#efefef'>编辑</td></tr>
<%
i=1
for each Index in IndexList
	if Index <> "" then
		if (i >= recb) and  (i <= rece) then
		WebSiteName=""
		WebFilesPath=""
		WebIP=""
		WebHostName=""
		WebAccess=""
		WebLinks=""
		WebCPU=""
		WebState=""
		WebIndex=Index
		ret=lqsm_web.WebManage(WebAction,WebIndex, WebSiteName,WebFilesPath,WebDefaultDoc,WebIP,WebPort,WebHostName,WebAccess,WebLogPath,WebLinks,WebTimes,WebWidth,WebCPU,IUSRName,IUSRPass,WebState,ErrMsg)

		%>
		<tr>
		<td>&nbsp;<%=i%></td>
		<td>&nbsp;<a href="WebManage.asp?WebAction=query_detail&WebIndex=<%=Index%>"><%=WebSiteName%></a></td>
		<td>&nbsp;<%=WebFilesPath%></td>
		<td>&nbsp;<%=WebIP%></td>
		<td>&nbsp;<%=WebHostName%></td>
		<td>&nbsp;<%=WebAccess%></td>
		<td>&nbsp;<%=WebLinks%></td>
		<td>&nbsp;<%=WebCPU%></td>
		<td>&nbsp;
			<%if WebState=1 then
			response.write "正常"
			else
				response.write "停止"
			end if%></td>
		<td><a href="WebManage.asp?WebAction=del&WebIndex=<%=Index%>">删除</a></td>
		<td><a href="WebManage.asp?WebAction=edit_pre&WebIndex=<%=Index%>">修改</a></td>
		</tr>
		
		<%
		end if
		i = i+ 1
	end if
	
next
%>
<Tr><td colspan="12" align="center"><a href="WebManage.asp?WebAction=add_pre"  >增加虚拟主机</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=webmanage.asp?page="&ii&">"&ii&"</A>"
else
	response.write ii
end if
ii=ii+1
loop

response.write Msg
response.end
end if 
%>

<%if WebAction="query_detail" then
WebAction="query"
ret=lqsm_web.WebManage(WebAction,WebIndex, WebSiteName,WebFilesPath,WebDefaultDoc,WebIP,WebPort,WebHostName,WebAccess,WebLogPath,WebLinks,WebTimes,WebWidth,WebCPU,IUSRName,IUSRPass,WebState,ErrMsg)
%>
<table border=1 bordercolor=#888888 bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=50% class='size09' align='center'>
<tr><td class='color01' bgcolor='#efefef' colspan="2" align="center">站点详细信息</td></tr>
<tr><td>站点名称</td><td>&nbsp;<%=WebSiteName%></td></tr>
<tr><td>主目录</td><td>&nbsp;<%=WebFilesPath%></td></tr>
<tr><td>默认文档</td><td>&nbsp;<%=WebDefaultDoc%></td></tr>
<tr><td>IP地址</td><td>&nbsp;<%=WebIP%></td></tr>
<tr><td>端口</td><td>&nbsp;<%=WebPort%></td></tr>
<tr><td>主机头</td><td>&nbsp;<%=WebHostName%></td></tr>
<tr><td>权限</td><td>&nbsp;<%=WebAccess%>&nbsp;[<font color="#ff0000">S脚本资源访问 R读取 W写入 D目录浏览</font>]</td></tr>
<tr><td>日志目录</td><td>&nbsp;<%=WebLogPath%></td></tr>
<tr><td>连接数</td><td>&nbsp;<%=WebLinks%>&nbsp;个</td></tr>
<tr><td>超时</td><td>&nbsp;<%=WebTimes%>&nbsp;秒</td></tr>
<tr><td>带宽</td><td>&nbsp;<%=WebWidth%>&nbsp;KB/S</td></tr>
<tr><td>CPU</td><td>&nbsp;<%=WebCPU%>&nbsp;%</td></tr>
<tr><td>用户名</td><td>&nbsp;<%=IUSRName%></td></tr>
<tr><td>密码</td><td>&nbsp;<%=IUSRPass%></td></tr>
<tr><td>状态</td><td>&nbsp;
		<%if WebState=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 WebAction="add_pre" then 
ret = lqsm_config.CfgManage("query",WebHomeDir,MailHomeDir,WebIPList,UserName,UserPass,HostID,RegCode,ErrMsg)%>
<form name="Web" action="WebManage.asp" onsubmit='return check_input()'>
<table border=1 bordercolor=#888888 bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=50% class='size09' align='center'>
<tr><td class='color01' bgcolor='#efefef' colspan="2" align="center">请输入站点信息</td></tr>
<input name="WebAction" type="Hidden" value="add">
<tr><td>站点名称</td><td><input name="WebSiteName" class="form" type="Text" maxlength="100"></td></tr>
<tr><td>主目录</td><td><input name="WebFilesPath" class="form" type="Text" maxlength="100" value="<%=WebHomeDir%>"></td></tr>
<tr><td>默认文档</td><td><input name="WebDefaultDoc" class="form" type="Text" maxlength="100" size="50"  value="Default.htm, Default.asp, Index.htm, Index.asp"></td></tr>
<tr><td>IP地址</td><td>
	<select name="WebIP">
	<% 
	if instr(WebIPList,",") then
		tmp = Split(WebIPList, ",")
		for each tmp2 in tmp
			if tmp2 <> "" then
		 		response.write "<option value="&tmp2&">"&tmp2&"</option>"
			end if
		next
	elseif WebIPList <> "" then
		response.write "<option value="&WebIPList&">"&WebIPList&"</option>"
	else
		response.write "<option value=127.0.0.1>127.0.0.1</option>"
	end if
	%>
	</select>
</td></tr>
<tr><td>端口</td><td><input name="WebPort" class="form" type="Text" maxlength="100" size="4" value="80"></td></tr>
<tr><td>主机头</td><td><input name="WebHostName" class="form" type="Text" maxlength="100"></td></tr>
<tr><td>权限</td><td><input name="WebAccess" class="form" type="Text" maxlength="100" size="6" value="R">&nbsp;[<font color="#ff0000">S脚本资源访问 R读取 W写入 D目录浏览</font>]</td></tr>
<tr><td>日志目录</td><td><input name="WebLogPath" class="form" type="Text" maxlength="100" size="50" value="<%=WebHomeDir%>\log"></td></tr>
<tr><td>连接数</td><td><input name="WebLinks" class="form" type="Text" maxlength="100" size="6" value="50">个</td></tr>
<tr><td>超时</td><td><input name="WebTimes" class="form" type="Text" maxlength="100" size="6" value="900">秒</td></tr>
<tr><td>带宽</td><td><input name="WebWidth" class="form" type="Text" maxlength="100" size="10" value="1024">KB/S</td></tr>
<tr><td>CPU</td><td><input name="WebCPU" class="form" type="Text" maxlength="100" size="3" value="10">%</td></tr>
<tr><td>用户名</td><td><input name="IUSRName" class="form" type="Text" maxlength="100" value="">&nbsp;[<font color="#ff0000">用户名和密码为空表示应用默认帐号</font>]</td></tr>
<tr><td>密码</td><td><input name="IUSRPass" class="form" type="Text" maxlength="100" value=""></td></tr>
<tr><td>状态</td><td>
	<select name="WebState" size="1">
		<option value="1" selected >正常
		<option value="2" >停止
	</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 WebAction="edit_pre" then 
WebAction="query"
ret=lqsm_web.WebManage(WebAction,WebIndex, WebSiteName,WebFilesPath,WebDefaultDoc,WebIP,WebPort,WebHostName,WebAccess,WebLogPath,WebLinks,WebTimes,WebWidth,WebCPU,IUSRName,IUSRPass,WebState,ErrMsg)
ret = lqsm_config.CfgManage("query",WebHomeDir,MailHomeDir,WebIPList,UserName,UserPass,HostID,RegCode,ErrMsg)
%>
<form name="Web" action="WebManage.asp" onsubmit='return check_input()'>
<table border=1 bordercolor=#888888 bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=50% class='size09' align='center'>
<tr><td class='color01' bgcolor='#efefef' colspan="2" align="center">请输入站点信息</td></tr>
<input name="WebAction" type="Hidden" value="edit">
<input name="WebIndex" type="Hidden" value="<%=WebIndex%>">
<tr><td>站点名称</td><td><input name="WebSiteName" class="form" type="Text" maxlength="100" value="<%=WebSiteName%>"></td></tr>
<tr><td>主目录</td><td><input name="WebFilesPath" class="form" type="Text" maxlength="100" value="<%=WebFilesPath%>"></td></tr>
<tr><td>默认文档</td><td><input name="WebDefaultDoc" class="form" type="Text" maxlength="100" size="50"  value="<%=WebDefaultDoc%>"></td></tr>
<tr><td>IP地址</td><td>
	<select name="WebIP">
	<% 
	if instr(WebIPList,",") then
		tmp = Split(WebIPList, ",")
		for each tmp2 in tmp
			if tmp2 <> "" then
			if tmp2<>WebIP then
		 		response.write "<option value="&tmp2&">"&tmp2&"</option>"
			else
				response.write "<option value="&tmp2&" selected>"&tmp2&"</option>"
			end if
			end if
		next
	elseif WebIPList <> "" then
		if WebIPList<>WebIP then
			response.write "<option value="&WebIPList&">"&WebIPList&"</option>"
		else
			response.write "<option value="&WebIPList&" selected>"&WebIPList&"</option>"
		end if
	else
		response.write "<option value=127.0.0.1>127.0.0.1</option>"
	end if
	%>
	</select>
</td></tr>
<tr><td>端口</td><td><input name="WebPort" class="form" type="Text" maxlength="100" size="4" value="<%=WebPort%>"></td></tr>
<tr><td>主机头</td><td><input name="WebHostName" size="50" class="form" type="Text" maxlength="100" value="<%=WebHostName%>"></td></tr>
<tr><td>权限</td><td><input name="WebAccess" class="form" type="Text" maxlength="100" size="6" value="<%=WebAccess%>">&nbsp;[<font color="#ff0000">S脚本资源访问 R读取 W写入 D目录浏览</font>]</td></tr>
<tr><td>日志目录</td><td><input name="WebLogPath" class="form" type="Text" maxlength="100" size="50" value="<%=WebLogPath%>"></td></tr>
<tr><td>连接数</td><td><input name="WebLinks" class="form" type="Text" maxlength="100" size="6" value="<%=WebLinks%>">个</td></tr>
<tr><td>超时</td><td><input name="WebTimes" class="form" type="Text" maxlength="100" size="6" value="<%=WebTimes%>">秒</td></tr>
<tr><td>带宽</td><td><input name="WebWidth" class="form" type="Text" maxlength="100" size="10" value="<%=WebWidth%>">KB/S</td></tr>
<tr><td>CPU</td><td><input name="WebCPU" class="form" type="Text" maxlength="100" size="3" value="<%=WebCPU%>">%</td></tr>
<tr><td>用户名</td><td><input name="IUSRName" class="form" type="Text" maxlength="100" value="<%=IUSRName%>">&nbsp;[<font color="#ff0000">用户名和密码为空表示应用默认帐号</font>]</td></tr>
<tr><td>密码</td><td><input name="IUSRPass" class="form" type="Text" maxlength="100" value="<%=IUSRPass%>"></td></tr>
<tr><td>状态</td><td>
	<select name="WebState" size="1">
		<option value="1" <%if WebState="1" then response.write "selected"%>>正常
		<option value="2" <%if WebState="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_web.WebManage(WebAction,WebIndex, WebSiteName,WebFilesPath,WebDefaultDoc,WebIP,WebPort,WebHostName,WebAccess,WebLogPath,WebLinks,WebTimes,WebWidth,WebCPU,IUSRName,IUSRPass,WebState,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 + -