📄 deletevhost.asp
字号:
<% ModuleCode="M0410" %>
<!--#include file="../../Include/Reference.asp"-->
<%
Call PrintPageHead
VHID=Request("ID")
%>
<!--#include file="../../Include/connect.asp"-->
<%
strSQL="Select * from v_VHostList Where VHID='" & VHID & "'"
if Session("IsHost")<>"YES" then
strSQL = strSQL & " and UserID=" & Session("UserID")
end if
Set Rs= Server.CreateObject("ADODB.Recordset")
Rs.open strSQL,Cn,1,1
If Rs.Eof Then
Rs.Close
Set Rs=Nothing
Cn.Close
Set Cn=Nothing
Response.Write "<br><br><P align='center' class='titletext'>对不起, 找不到此虚拟主机或者您没有权限!</p>"
Call PrintPageBottom
Response.End
End if
ServerCode=Rs("ServerCode")
MaxSize=Rs("MaxSize")
ServerIP=Rs("ServerIP")
SiteNum=Rs("DNSeq")
FtpUser=Rs("UserName")
UserDir=Rs("VHDir")
UOID=Rs("UOID")
Rs.Close
%>
<!--#include file="../../Include/WEBCtrl.asp"-->
<%
if Request.Form("OP")="NEXT" then
if DeleteIISServer(ServerIP,SiteNum)=0 then
if DeleteDirectory(ServerIP,UserDir)=0 then
Call DeleteFtpUser(ServerIP,FtpUser)
strSQL="Delete From T_DNS_AllBDN Where VHID='" & VHID & "'"
Cn.Execute(strSQL)
strSQL="Delete From T_DNS_AllVH Where VHID='" & VHID & "'"
Cn.Execute(strSQL)
Cn.Execute("SP_UserOP "& session("UserID")& ",'T_DNS_AllVH','管理员删除主机','" & VHID & "','删除','"& Request.ServerVariables("REMOTE_ADDR") &"'" )
strSQL="Update T_DNS_ServerInfo Set RealSize=RealSize-" & MaxSize & ",RealUser=RealUser-1 Where ServerCode='" & ServerCode & "'"
Cn.Execute(StrSQL)
%>
<br><br><br><P align='center' class='titletext'>删除虚拟主机成功! <a href="VHostList.asp" class="a2">返回</a></p>
<%
strSQL="Select * from v_MailList Where UOID='" & UOID & "' and Stat='2'"
Rs.open strSQL,Cn,1,1
If Not Rs.Eof Then
ServerCode=Rs("ServerCode")
MaxSize=Rs("MaxSize")
MaxUser=Rs("MaxUser")
ServerIP=Rs("ServerIP")
MailDomain=Rs("BPostDN")
MailSiteNum=Rs("ServerPara")
PostID=Rs("PostID")
if DeleteMailDomain(ServerIP,MailDomain)=0 then
strSQL="Update T_DNS_ServerInfo Set RealSize=RealSize-" & MaxSize & ",RealUser=RealUser-" & MaxUser & " Where ServerCode='" & ServerCode & "'"
Cn.Execute(StrSQL)
if DeleteIISSiteBindings(ServerIP,MailSiteNum,":80:mail." & MailDomain)=0 then
strSQL="Delete From T_DNS_AllPost Where PostID='" & PostID & "'"
Cn.Execute(strSQL)
Cn.Execute("SP_UserOP "& session("UserID")& ",'T_DNS_AllPost','管理员删除邮局','" & PostID & "','删除','"& Request.ServerVariables("REMOTE_ADDR") &"'" )
%>
<P align='center' class='titletext'>删除赠送的邮局成功! </p>
<%
else
%>
<P align='center' class='titletext'>删除邮局失败(2)! </p>
<%
end if
else
%>
<P align='center' class='titletext'>删除邮局失败(1)! </p>
<%
end if
End If
Rs.Close
else
%>
<br><br><br><P align='center' class='titletext'>删除虚拟主机失败(2)! 请重新尝试 <a href="VHostList.asp" class="a2">返回</a></p>
<%
end if
else
%>
<br><br><br><P align='center' class='titletext'>删除虚拟主机失败(1)! 请重新尝试 <a href="VHostList.asp" class="a2">返回</a></p>
<%
end if
Call PrintPageBottom
Response.End
end if
%>
<br><br><br>
<center>
<p>
<TABLE align=center border=0 cellPadding=5 cellSpacing=1 width="90%">
<tr>
<td>
<font color="red" class="titletext"><b>警告: 本操作将彻底删除虚拟主机所有数据, 并无法恢复! 请谨慎使用</b></font>
</td>
</tr>
</table>
</p>
<form name="inputform" action="" method="post">
<input type="hidden" name="OP" value="NEXT">
<input type="hidden" name="ID" value="<%=VHID%>">
<input type="submit" name="del" value=" 删除 " class="button">
<input type="button" name="back" value=" 取消 " onclick="javascript:history.go(-1)" class="button">
</form>
</center>
<%
Cn.Close
Set Cn=Nothing
Call PrintPageBottom
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -