<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If Request.Form ("username")="" or RegExpTest("[^A-Za-z0-9]",Request.Form ("username")) Then
	ef=True
	ec="用户名没填或非法！"
ElseIf Request.Form ("password")="" Then
	ef=True
	ec="密码没填！"
ElseIf Request.Form ("newpassword")<>""  and len(Request.Form ("newpassword"))<6 Then
	ef=True
	ec="密码没填/或密码过于简单(不能小于6位数)！"
ElseIf Request.Form ("newpassword")<>Request.Form ("renewpassword") Then
	ef=True
	ec="重复输入的密码不一致！"
ElseIf len(Request.Form ("postid"))>7 Then
	ef=True
	ec="邮编出错！"
ElseIf len(Request.Form ("truename"))<2 or RegExpTest("[A-Za-z0-9]",Request.Form ("truename")) Then
	ef=True
	ec="请提供准确的姓名！"
ElseIf RegExpTest("[^\u4e00-\u9fa5]",Request("truename")) Then
	ef=True
	ec="姓名中有非法字符！"
ElseIf RegExpTest("[^\u4e00-\u9fa5]",Request("coun")) Then
	ef=True
	ec="国家中有非法字符！"
ElseIf RegExpTest("[^\u4e00-\u9fa5]",Request("prv")) Then
	ef=True
	ec="省份中有非法字符！"
ElseIf RegExpTest("[^\u4e00-\u9fa5]",Request("city")) Then
	ef=True
	ec="城市中有非法字符！"
elseif Trim(Request("email"))="" or RegExpTest("^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$",Request("email"))=false then
	ef=True
	ec="邮箱不正确！"
'elseif IDCheck(Request.Form ("perid"))=false then
'	ef=True
'	ec="请提供准确的身份证地址！"
elseIf checkscript(Request.Form ("qq")) Then
	ef=True
	ec="QQ有非法字符！如<>script"
elseIf checkscript(Request.Form ("postid")) Then
	ef=True
	ec="postid有非法字符！如<>script"
elseIf checkscript(Request.Form ("truename")) Then
	ef=True
	ec="truename有非法字符！如<>script"
elseIf checkscript(Request.Form ("contact")) Then
	ef=True
	ec="contact有非法字符！如<>script"
elseIf checkscript(Request.Form ("tel")) Then
	ef=True
	ec="tel有非法字符！如<>script"
elseIf checkscript(Request.Form ("fax")) Then
	ef=True
	ec="fax有非法字符！如<>script"
elseIf checkscript(Request.Form ("perid")) Then
	ef=True
	ec="perid有非法字符！如<>script"
elseIf checkscript(Request.Form ("prv")) Then
	ef=True
	ec="prv有非法字符！如<>script"
elseIf checkscript(Request.Form ("city")) Then
	ef=True
	ec="city有非法字符！如<>script"
elseIf checkscript(Request.Form ("address")) Then
	ef=True
	ec="address有非法字符！如<>script"
End if


'验证会员资格
If not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
  Set dsreg = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_USER where username='"&Request.Form ("username")&"'"
		if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
		dsreg.Open Sql,conn,1,3
If dsreg.Eof Then
		ef=True
		ec="会员名不存在或密码出错了！"
end if
end if
if not ef then
if Request.Form ("password")<>dsreg("password") then
		ef=True
		ec="密码不正确！"
end if
end if

if not ef then

if Request.Form ("newpassword")<>"" then dsreg("password")=md5(Request.Form ("newpassword"))
session ("password")=dsreg("password")

dsreg("email")=Request.Form ("email")
dsreg("truename")=Request.Form ("truename")
dsreg("etruename")=Request.Form ("etruename")
dsreg("coun")=Request.Form ("coun")
dsreg("ecoun")=Request.Form ("ecoun")
dsreg("prv")=Request.Form ("prv")
dsreg("eprv")=Request.Form ("eprv")
dsreg("city")=Request.Form ("city")
dsreg("ecity")=Request.Form ("ecity")
dsreg("address")=Request.Form ("address")
dsreg("eaddress")=Request.Form ("eaddress")
dsreg("postid")=Request.Form ("postid")
dsreg("tel")=Request.Form ("tel")
dsreg("qq")=Request.Form ("qq")
dsreg("fax")=Request.Form ("fax")

dsreg("contact")=Request.Form ("contact")

If Application("opencheckmobi")=true Then
If dsreg("mobi")<>Request.Form ("mobi") Then'需要重查手机
dsreg("checkmobiok")=false
dsreg("wantcheckmobiok")=True
dsreg("checkmobisend")=0
End If
End if

dsreg("mobi")=Request.Form ("mobi")

If Application("mustcheckid")=True Then
If dsreg("emailR")<>dsreg("email") Or dsreg("truenameR")<>dsreg("truename") Or dsreg("prvR")<>dsreg("prv") Or dsreg("cityR")<>dsreg("city") Or dsreg("addressR")<>dsreg("address") Or dsreg("postidR")<>dsreg("postid") Or dsreg("telR")<>dsreg("tel") Or dsreg("qqR")<>dsreg("qq") Or dsreg("peridR")<>dsreg("perid") Or dsreg("faxR")<>dsreg("fax") Or dsreg("contactR")<>dsreg("contact") Or dsreg("mobiR")<>dsreg("mobi") Then
dsreg("havechnR")=1
Sql="UPDATE [FreeHost].[FreeHost_AGENT] set havechnR=1 where username='"&Request.Form ("username")&"'"
    conn.Execute Sql
End if
End If

If Not Application("mustcheckid")=True Then
dsreg("emailR")=Request.Form ("email")
dsreg("truenameR")=Request.Form ("truename")
dsreg("prvR")=Request.Form ("prv")
dsreg("cityR")=Request.Form ("city")
dsreg("addressR")=Request.Form ("address")
dsreg("postidR")=Request.Form ("postid")
dsreg("telR")=Request.Form ("tel")
dsreg("qqR")=Request.Form ("qq")
dsreg("peridR")=Request.Form ("perid")
dsreg("faxR")=Request.Form ("fax")
dsreg("contactR")=Request.Form ("contact")
dsreg("mobiR")=Request.Form ("mobi")
End If

if request("kefunow")<>"" then
Set dskefu = Server.CreateObject("ADODB.Recordset")	
	Sql="Select id from FreeHost.FreeHost_KeFu where kefumd5='"&md5(trim(request("kefunow")))&"'"
	dskefu.Open Sql,conn,1,1
if not dskefu.Eof then
dsreg("kefuto")=Request("kefunow")'修改业务人员名
dsreg("changekefufor")=left(Request("changekefufor"),25)'修改业务人员名
end if
dskefu.close
end if

if session("FormUser")="freehost" then dsreg("coreinfo")=Request.Form ("coreinfo")
if session("FormUser")="freehost" then dsreg("perid")=Request.Form ("perid")
if dsreg("perid")="" then dsreg("perid")=Request.Form ("perid")
'dsreg("regtime")=NOW
dsreg("lastuse")=NOW
if Application("hpsystem")=true then
if dsreg("homepagestatus")="n" then
dsreg("homepagestatus")="w"
end if
end if
dsreg.update


Set dsreg = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_AGENT where username='"&Request.Form ("username")&"'"
		dsreg.Open Sql,conn,1,3
if not dsreg.eof then
if Request.Form ("newpassword")<>"" Then
dsreg("password")=md5(Request.Form ("newpassword"))
dsreg("Domain_Agent_nonemd5_6")=Request.Form ("newpassword")
End if
dsreg("email")=Request.Form ("email")
dsreg("truename")=Request.Form ("truename")
dsreg("etruename")=Request.Form ("etruename")
dsreg("coun")=Request.Form ("coun")
dsreg("ecoun")=Request.Form ("ecoun")
dsreg("prv")=Request.Form ("prv")
dsreg("eprv")=Request.Form ("eprv")
dsreg("city")=Request.Form ("city")
dsreg("ecity")=Request.Form ("ecity")
dsreg("address")=Request.Form ("address")
dsreg("eaddress")=Request.Form ("eaddress")
dsreg("postid")=Request.Form ("postid")
dsreg("tel")=Request.Form ("tel")
dsreg("qq")=Request.Form ("qq")
dsreg("fax")=Request.Form ("fax")

dsreg("contact")=Request.Form ("contact")

If Application("opencheckmobi")=true Then
If dsreg("mobi")<>Request.Form ("mobi") Then'需要重查手机
dsreg("checkmobiok")=false
dsreg("wantcheckmobiok")=True
dsreg("checkmobisend")=0
End If
End if

dsreg("mobi")=Request.Form ("mobi")

dsreg("Domain_Agent_md5_6")=md5(LCase(dsreg("username"))&"7i24.com"&dsreg("password"))
if request("kefunow")<>"" then
Set dskefu = Server.CreateObject("ADODB.Recordset")	
	Sql="Select id from FreeHost.FreeHost_KeFu where kefumd5='"&md5(trim(request("kefunow")))&"'"
	dskefu.Open Sql,conn,1,1
if not dskefu.Eof then
dsreg("kefuto")=Request("kefunow")'修改业务人员名
dsreg("changekefufor")=leftb(Request("changekefufor"),25)'修改业务人员名
end if
dskefu.close
end if

dsreg.update
end if

%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>
　资料修改成功
<%=htmlwrite("html3")%>
<br>
<br>
<table width="100%"  border="0" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td width="9%" height="30" rowspan="2" bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="22%" height="179" align="center" bgcolor="#eeeeee"><font color="#CC6600"><img src="../style/img/5.jpg" width="81" height="94"></font></td>
        <td width="29%" align="left" bgcolor="#eeeeee"><font color="#CC6600">恭喜您！修改成功了！</font></td>
        </tr>
    </table>    </td>
  </tr>
</table>
<%=htmlwrite("html4")%>
<%
dsreg.close
conn.Close
set conn=nothing
end if

if ef then
Response.Redirect "e.asp?e="&ec
end if%>
