<!--#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,TempPassword,ComeUrl
Dim NewPassword,UserOldPassword
ComeUrl=""
ComeUrl=Trim(Request("ComeUrl"))
If ComeUrl="" Then ComeUrl=Request.ServerVariables("HTTP_REFERER")
ComeUrl=Lcase(ComeUrl)
IF instr(ComeUrl,"user_userinfo.asp")>0 Then ComeUrl=Replace(ComeUrl,"user_userinfo.asp","User_Index.asp")'返回网站首页
IF instr(ComeUrl,"user_top.asp?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")


%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD><TITLE>修改密码</TITLE>
<SCRIPT language="javascript">
function docheck()
{ 
var filter=/^\s*[.A-Za-z0-9_-]{3,15}\s*$/;
if (!filter.test(document.ModifyPWD.UserOldPassword.value)) { 
alert("密码填写不正确,请重新填写！注意不要使用空格。"); 
document.ModifyPWD.UsernameGet.focus();
document.ModifyPWD.UsernameGet.select();
return false; 
} 
if (document.ModifyPWD.UserOldPassword.value =="") 
{
alert("请填写您的密码！");
document.ModifyPWD.UserOldPassword.focus();
return false; 
}
var filter=/^\s*[.A-Za-z0-9_-]{5,15}\s*$/;
if (!filter.test(document.ModifyPWD.UserNewPassword.value)) { 
alert("密码填写不正确,请重新填写！注意不要使用空格。"); 
document.ModifyPWD.UserNewPassword.focus();
document.ModifyPWD.UserNewPassword.select();
return false; 
}
if ((document.ModifyPWD.UserNewPassword.value) !=(document.ModifyPWD.UserRePassword.value)) 
{
alert("两次输入密码不相同！");
document.ModifyPWD.UserNewPassword.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}
.STYLE15 {
	font-size: 14px;
	color: #FFFFFF;
}
</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="middle"  style="BACKGROUND-POSITION: left top; BACKGROUND-REPEAT: no-repeat"><img height="35" src="img/txzmmxg.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_ModifyPWD.asp" onSubmit="return docheck()">
                  <input type="hidden" name="action" value="SavePWD">
<%
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")%>">
<input type="hidden" name="ComeUrl" value="<%=ComeUrl%>">
<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 type=password name="UserOldPassword">
</td></tr>
<tr><td height=20 width=40% align=right>新密码:</td><td width=60% align=left><input type=password name="UserNewPassword">
</td></tr>
<tr><td height=20 width=40% align=right>确认密码:</td><td width=60% align=left><input type=password name="UserRePassword">
</td></tr>
<tr>
  <td width=40% height=25 align=right class="STYLE15">&nbsp;</td>
  <td width=60% 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")="SavePWD" then
Call SavePWD()
End IF

Sub SavePWD()
UserOldPassword=MD5(Replace(Trim(request("UserOldPassword")),"'",""),32)
NewPassword=MD5(Replace(Trim(request("UserNewPassword")),"'",""),32)
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 "<span class='style15'>密码修改成功，请记住新密码！</span><br>"
AdminName=rs("username")
password=NewPassword
Interface_Action="ModifyPsw"
ComeUrl=Trim(Request("ComeUrl"))
Call Interface
rs("userpassword")=NewPassword
rs.update
rs.close
set rs=nothing
Response.Cookies("hl_user")("password")=Mid(NewPassword,9,16)

End if

End Sub

Sub Interface()
            Md5Info=MD5(AdminName & SecurityKey, 32)
            If IsNull(SecurityKey) = False And SecurityKey <> "" And IsNull(arrUpiUrls) = False And arrUpiUrls <> "" Then
            HLUpi = Split(arrUpiUrls, "|")
			RegSiteId=split(RegSiteIds,",")   
            For iNums = 0 To UBound(HLUpi)
			Response.Write "<script src=""" & HLUpi(iNums) & "?action="&Interface_Action&"&Md5Info=" & Md5Info & "&name=" & AdminName & "&pass=" & password & "&oldpass=" & UserOldPassword & """></script>"& vbCrLf
			Response.Write "&nbsp;"
			Next
            End If
            response.Write("<script language=JavaScript>top.location='"&ComeUrl&"';</script>")
End Sub
%> 

</BODY>
</HTML>