<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("EmailAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf Request("id")="" Then
	ef=True
	ec="请输入产品ID！"
ElseIf Instr(1, Request("id"), "'", 1)>0 then
	ef=True
	ec="非法产品ID！"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="产品ID应该是数字！"
ElseIf Instr(1, session("username"), "'", 1)>0 then
	ef=True
	ec="非法用户名！"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Product_Email where id='"&session("EmailAUID")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsph.Open Sql,conn,1,1
if dsph.Eof then
	ef=True
	ec="不存在的邮箱ID！"
end if
end if

if not ef then
if dsph("istest")="y" then
'	ef=True
	ec="试用期产品不能绑定域名！"
end if
end if

if not ef then
	Set dsHostpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_EmailProductlist where Emailtype='"&dsph("Emailtype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsHostpdlist.Open Sql,conn,1,1
if dsHostpdlist.Eof then
	ef=True
	ec="产品不存在！"
end if
end if

if not ef then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerEmaillist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
end if
end if

if not ef then
Set dspdallemail = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_Product_ALLEmail where PdEID='"&dsph ("id")&"' and emailname is not null order by emailname"
		dspdallemail.Open Sql,conn,1,3
if  not dspdallemail.eof then
emailarryX=split(dspdallemail("emailname"),"@")
domainhaveset=emailarryX(1)
end if
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/template-emailadm-top.asp"-->
　邮箱自助管理


<br>
<form action="handemail3.asp" method="post" name="form1">
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD width="25%" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">修改邮箱管理员密码：</font></TD>
      <TD width="38%" height="35" bgColor=#ffffff>　用户名：<%=session("username")%></TD>
      <TD width="37%" height="35" bgColor=#ffffff>　已绑定域名：<%=domainhaveset%></TD>
    </TR>
    <TR>
      <TD width="25%" rowspan="3" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
      <TD height="35" bgColor=#ffffff>　管理邮箱：
        <%if haveadmset then%>
        <%=dspdallemail("emailname")%>
        <%else%>
        无
        <%end if%></TD>
      <TD width="37%" height="35" bgColor=#ffffff>　服务器IP：<%=dsserver("ip")%> </TD>
    </TR>
    <TR>
      <TD height="35" bgColor=#ffffff>　新密码：
        <input name="password" type="password" id="password" size="14"></TD>
      <TD width="37%" height="35" bgColor=#ffffff>　重复新密码：
        <input name="repassword" type="password" id="repassword" size="14">
        <input name="id" type="hidden" value="<%=Request("id")%>"></TD>
    </TR>
    <TR>
      <TD height="35" colspan="2" bgColor=#ffffff>　
      <input name="Submit" type="submit" id="Submit" value="马上修改"></TD>
    </TR>
  </TBODY>
</TABLE>
</form>

　<a href="selfemailmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回上一页]</font></a>
<!--#include virtual="/inc-freehost-function/template-emailadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>