<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("SqlAUID")="" 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 dsphSql = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_Sql where id='"&session("SqlAUID")&"'"
			if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsphSql.Open Sql,conn,1,1
if dsphSql.Eof then
	ef=True
	ec="不存在的数据库ID！"
end if
end If

If not ef then
if not dsphsql("status")="正常" then
		ef=True
		ec="必须是处于正常状态的数据库才能管理！"
end if
end if

if not ef then
	Set dsHostpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_SQLProductlist where SQLtype='"&dsphSql("SQLtype")&"'"
	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_ServerSQLlist where id='"&dsphSql ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
end if
end if

if not ef then
%>
<!--#include virtual="/inc-freehost-function/template-sqladm-top.asp"-->
　数据库自助管理


<br>
<form action="selfsqlmodifypass.asp" method="post" name="form1">
<TABLE 
            width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
  <TBODY>
    <TR>
      <TD width="22%" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">修改数据库密码：</font></TD>
      <TD width="41%" height="35" bgColor=#ffffff>　用户名：<%=session("username")%></TD>
      <TD width="37%" height="35" bgColor=#ffffff>　服务器IP：<%=dsserver("ip")%> </TD>
    </TR>
    <TR>
      <TD width="22%" rowspan="3" vAlign=middle bgColor=#EEEEEE>&nbsp;</TD>
      <TD height="35" bgColor=#ffffff>　数据库名：<%=dsphSql("sqlname")%></TD>
      <TD width="37%" height="35" bgColor=#ffffff>　数据库用户名：<%=dsphSql("sqlname")%></TD>
    </TR>
    <TR>
      <TD height="35" bgColor=#ffffff>　新密码：
        <strong>
        <input name="newpassword" type="password" id="newpassword" size="10" maxlength="14">
        </strong></TD>
      <TD width="37%" height="35" bgColor=#ffffff>　重复新密码：
        <strong>
        <input name="renewpassword" type="password" id="renewpassword" size="10" maxlength="14">
        </strong>        <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="selfsqlmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回上一页]</font></a>
<!--#include virtual="/inc-freehost-function/template-sqladm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>