<!--#include file="conn/hl_conn.asp"-->
<!--#include file="inc/hl_user.inc"-->
<!--#include file="inc/md5.asp"-->
<!--#include file="inc/upiconfig.asp"-->
<%
Dim Md5Info,AdminName,password,Interface_Action,ComeUrl
Dim UserOldPassword,UserQuestion,UserAnswer,UserEmail,UserSex,UserTrueName,TempPassword
ComeUrl=Request.ServerVariables("HTTP_REFERER")
ComeUrl=Lcase(ComeUrl)

If instr(ComeUrl,"actiontype=left")>0 Then ComeUrl=Replace(ComeUrl,"user_top.asp?actiontype=left","user_setting.asp")
If instr(ComeUrl,"user_index_left")>0 Then ComeUrl=Replace(ComeUrl,"user_index_left","user_index_main")
IF instr(ComeUrl,"user_userinfo")>0 Then ComeUrl=Replace(ComeUrl,"user_userinfo","User_Index")'返回创力首页
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD><TITLE>修改密码</TITLE>
<SCRIPT language="javascript">
function dosubmitReg3(myform) {
	if(myform.UserOldPassword.value==""){
			alert("请输入密码！");
			myform.UserOldPassword.focus();
			return false;
	} else {
    	//密码处请输入'以外的字符
    	if(!isRight(myform.UserOldPassword.value)){
	    	alert("密码处请输入'以外的字符");
            myform.UserOldPassword.focus();
	    	return false;
	    }
		if (myform.UserOldPassword.value.length<6||myform.UserOldPassword.value.length>16) {
			alert("密码必须在6-16位！");
			myform.UserOldPassword.focus();
			return false;
		}
	}
    //密码提示问题处请输入'以外的字符
	if(myform.UserQuestion.value ==null ||myform.UserQuestion.value == ""){
	}else{
		if (!isRight(myform.UserQuestion.value)){
	    	alert("密码提示问题处请输入'以外的字符");
	        myform.UserQuestion.focus();
	    	return false;
	    }
    }
    //密码提示答案处请输入'以外的字符
}
</SCRIPT>

<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK href="img/css.css" type=text/css rel=stylesheet>
<STYLE type=text/css>
.style1 {
	COLOR: #ff0000
}
.style6 {
	FONT-SIZE: 14px; FONT-FAMILY: "宋体"
}
.style7 {
	FONT-SIZE: 14px
}
.style128 {
	FONT-SIZE: 24px; COLOR: #ff3300; FONT-STYLE: italic; FONT-FAMILY: Geneva, Arial, Helvetica, sans-serif
}
.style13 {
	FONT-SIZE: 20px; COLOR: #0066ff; FONT-FAMILY: "黑体"
}
.style3 {
	FONT-WEIGHT: bold; FONT-SIZE: 18px; COLOR: #ff3300; FONT-FAMILY: "宋体"
}
body {
	background-color: #1776B6;
}
.td {font-size: 12px}
.STYLE16 {color: #FF0000}
</STYLE>

<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY 
style="BACKGROUND-IMAGE: url(img/myalibaba_topbg.gif); BACKGROUND-REPEAT: repeat-x; BACKGROUND-COLOR: #4296ce" 
leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide

function killErrors() {
return true;
}

window.onerror = killErrors;

// -->
</SCRIPT>
<!--容错代码结束-->
<TABLE width="628" border="0" cellPadding="0" cellSpacing="0">
  <TBODY>
    <TR>
      <TD class=s vAlign=top align=right width=459 
          background=img/leftmanu_top1.gif height=30>&nbsp;</TD>
      <TD class=s vAlign=top width=141 
          background=img/top_nav_bg2.gif>&nbsp;</TD>
      <TD width=28><IMG height=30 src="img/top_nav_5.gif" 
            width=28></TD>
    </TR>
  </TBODY>
</TABLE>
<table width="628" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><table width="623" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td height="35"  align="center"  style="BACKGROUND-POSITION: left top; BACKGROUND-REPEAT: no-repeat"><img height="35" src="img/txzxg.gif" width="544" /> </td>
      </tr>
      <tr>
        <td  style="BACKGROUND-POSITION: left top; BACKGROUND-REPEAT: no-repeat" align="middle"></td>
      </tr>
    </table>
        <table width="623" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <tr>
            <td valign="top" height="80"><table border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#0E7FC5" style="BORDER-COLLAPSE: collapse" width="544">
              <form name="ModifyPWD" method="post" action="User_Passport.asp" onSubmit="return dosubmitReg3(ModifyPWD)">
                  <input type="hidden" name="action" value="SavePassport">
				  <input type="hidden" name="ComeUrl" value="<%=ComeUrl%>">
<%
userUserId=replace(Request.Cookies("hl_user")("username"),"'","")
userPassword=replace(Request.Cookies("hl_user")("password"),"'","")
set rs=server.CreateObject("adodb.recordset")
sql="select top 1 * from hl_user where username='"&userUserId&"'"
rs.open sql,conn,1,1
TempPassword=rs("userpassword")
If Len(rs("userpassword"))=32 Then TempPassword=Mid(rs("userpassword"),9,16)
if userPassword=TempPassword then

%>
<input type="hidden" name="ID" value="<%=rs("id")%>">
<tr>
  <td height=20 width=40% align=right>通行证用户名:</td>
  <td width=60% align=left><%=rs("username")%></td></tr>
<tr>
  <td height=20 width=40% align=right>提示问题:</td>
  <td width=60% align=left><input name="UserQuestion" type=text id="UserQuestion" value="<%=rs("userquestion")%>"></td></tr>
<tr>
  <td height=20 width=40% align=right>问题答案:</td>
  <td width=60% align=left><input name="UserAnswer" type=text id="UserAnswer">
    <span class="STYLE16">*不修改请留空</span></td>
</tr>
<tr>
  <td height=25 align=right>电子邮箱:</td>
  <td align=left><input name="UserEmail" type=text id="UserEmail" value="<%=rs("useremail")%>"></td>
</tr>
<tr>
  <td height=25 align=right>请输入密码:</td>
  <td align=left><input name="UserOldPassword" type=password id="UserOldPassword"></td>
</tr>
<tr>
  <td height=25 align=right>&nbsp;</td>
  <td align=left><input type=submit name=submit value="确认">
&nbsp;&nbsp;
<input type=reset name=reset value="重设"></td>
</tr>

<%
end if
rs.close
set rs=nothing
%>
              </form>
            </table ></td>
          </tr>
        </table>
        <table width="623" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <tr>
            <td>&nbsp;</td>
          </tr>
      </table></td>
  </tr>
</table>
<table width="628" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="img/user_index_bottom.jpg" width="630" height="10" /></td>
  </tr>
</table>
<br>
<%
If Request("action")="SavePassport" then
Call SavePassport()
End IF

Sub SavePassport()
UserOldPassword=MD5(Replace(Trim(request("UserOldPassword")),"'",""),32)
IF Trim(Request("UserAnswer"))<>"" Then UserAnswer=Md5(Replace(Trim(Request("UserAnswer")),"'",""),32)
UserQuestion=Replace(Trim(Request("UserQuestion")),"'","")
UserEmail=Replace(Trim(Request("UserEmail")),"'","")
UserSex=Request("UserSex")
UserTrueName=Replace(Trim(Request("UserTrueName")),"'","")
set rs=server.CreateObject("Adodb.recordset")
sql="select * from hl_user where id="&replace(request("ID"),"'","")
rs.open sql,conn,1,3
TempPassword=UserOldPassword
If Len(rs("userpassword"))=16 Then TempPassword=Mid(UserOldPassword,9,16)
If rs("userpassword")=TempPassword then
response.Write "<div align='center'><font color='white' size='3pt'>通行证修改成功！</span></div><br>"

AdminName=rs("username")
Interface_Action="ModifyInfo"
ComeUrl=Request("ComeUrl")
rs("useremail")=UserEmail
rs("userquestion")=UserQuestion
rs("useranswer")=UserAnswer
rs.update
rs.close
set rs=nothing
Call Interface()
End if

End Sub

Sub Interface()
            Md5Info=MD5(AdminName & SecurityKey, 32)
			Response.Write "<html>" & vbCrLf
            Response.Write "<head>" & vbCrLf
            Response.Write "<meta http-equiv=""refresh"" content=""" & RefreshTime & ";URL="&ComeUrl&""" />"&vbCrLf
            Response.Write "<title>修改通行证</title>" & vbCrLf 
			Response.Write "<div align='center'><span style='font-size:9pt'>正在同步资料，请稍等，" & RefreshTime & "秒后返回...</span></div>" & vbCrLf      
			If IsNull(SecurityKey) = False And SecurityKey <> "" And IsNull(arrUpiUrls) = False And arrUpiUrls <> "" Then
            HLUpi = Split(arrUpiUrls, "|")
			For iNums = 0 To UBound(HLUpi)
			Response.Write "<script src=""" & HLUpi(iNums) & "?action="&Interface_Action&"&Md5Info=" & Md5Info & "&name=" & AdminName & "&pass="&UserOldPassword&"&Email=" &UserEmail& "&question="&UserQuestion&"&answer="&UserAnswer&"""></script>"& vbCrLf
			
			Next
            End If
            Response.Write "</head>" & vbCrLf
            Response.Write "<body>" & vbCrLf				
			Response.Write "<br><br>"           
            Response.Write "</body>" & vbCrLf
            Response.Write "</html>" & vbCrLf ' 
End Sub
%> 

</BODY>
</HTML>