主机管理
<%
conn.open constr
p_id=requesta("p_id")
act=requesta("act")
if len(p_id)<=0 then url_return "参数错误",-1
sql="select * from vhhostlist where s_sysid="& p_id &" and S_ownerid=" & session("u_sysid")
rs.open sql,conn,1,3
if rs.eof and rs.bof then rs.close:conn.close:url_return "没有找到此产品",-1
s_comment=rs("s_comment")
session("Control_vhost_name")=s_comment
s_ftppassword=rs("s_ftppassword")
s_serverIP=rs("s_serverIP")
if s_serverIP="" then s_serverIP = s_comment & "." & rs("s_serverName")
s_buydate=rs("s_buydate")
s_expiredate=rs("s_expiredate")
s_ProductId=rs("s_ProductId")
if act="changepwd" then
newpwd=requesta("p_pwd")
commandstr="vhost" & vbcrlf & _
"mod" & vbcrlf & _
"entityname:ftppassword" & vbcrlf & _
"sitename:" & s_comment & vbcrlf & _
"ftppassword:" & newpwd & vbcrlf & _
"." & vbcrlf
if isBad(s_comment,newpwd,binfo) then url_return "FTP密码很重要,您输入的密码过于简单,请重新设置。",-1
if checkPassStrw(newpwd) then url_return "密码中含有不可识别的字符,请重新设置。",-1
renewdata=pcommand(commandstr,session("user_name"))
if left(renewdata,3)="200" then
alert_redirect "修改密码成功",request("script_name") & "?p_id=" & p_id
else
alert_redirect "修改密码失败:"& renewdata ,request("script_name") & "?p_id=" & p_id
end if
rs.close
conn.close
response.end
elseif act="syn" then
returnstr=doUserSyn("vhost",s_comment)
if left(returnstr,3)="200" then
alert_redirect "同步数据成功",request("script_name") & "?p_id=" & p_id
else
alert_redirect "同步数据失败" & returnstr,request("script_name") & "?p_id=" & p_id
end if
end if
''''''''''''''''''''''''''''''''''''''赠品相关''''''''''''''''''''''''''''''''''''
set prs=server.CreateObject("adodb.recordset")
domainFree=false
hostFree=false
mssqlFree=false
mysqlFree=false
preSql="select top 1 a.*,b.pre1,b.pre2,b.pre3,b.pre4 from protofree a inner join vhhostlist b on (b.s_buytest=false and a.proid=b.s_productId and b.s_ownerid=" & session("u_sysid") & " and b.s_sysid=" & p_id & " and a.type='host') where not exists(select sysid from protofree where b.s_productid in (freeproid1,freeproid2,freeproid3,freeproid4) and type='host')"
prs.open preSql,conn,3
if not prs.eof then
if len(trim(prs("pre1")&""))=0 and len(prs("freeproid1")&"")>0 and dateDiff("d",s_buydate,date)<=15 and isgetFreeProduct("host",s_comment,prs("freeproid1")) then domainFree=true
if len(trim(prs("pre2")&""))=0 and len(prs("freeproid2")&"")>0 and isgetFreeProduct("host",s_comment,prs("freeproid2")) then hostFree=true
if len(trim(prs("pre3")&""))=0 and len(prs("freeproid3")&"")>0 and isgetFreeProduct("host",s_comment,prs("freeproid3")) then mysqlFree=true
if len(trim(prs("pre4")&""))=0 and len(prs("freeproid4")&"")>0 and isgetFreeProduct("host",s_comment,prs("freeproid4")) then mssqlFree=true
end if
prs.close
set prs=nothing
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
rs.close
conn.close
%>