<!--#include file="conn.asp"-->
<%
page_title=Eval("about_title"&Language)
page_keywords=Eval("about_keywords"&Language)
page_description=Eval("about_description"&Language)
if page_title="" then
page_title=city_title
page_keywords=city_keywords
page_description=city_description
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="zh-CN">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=page_title%></title>
<meta name="keywords" content="<%=page_keywords%>" />
<meta name="description" content="<%=page_description%>" />
<!--#include file="top.asp"-->
<!--#include file="header.asp"-->
<%
if session("user_xxx_name")="" then
response.Redirect("login.asp")
end if
%>
<link href="<%=filepath%>inc/mycenter.css" type="text/css" rel="stylesheet">
<link href="<%=filepath%>inc/style.css" type="text/css" rel="stylesheet">
<link href="<%=filepath%>inc/user.css" type="text/css" rel="stylesheet">

    <div id="wrap">
        <!--container-->
        <div class="main">
            
<!--sidebar-->
<!--#include file="Mb_left.asp"-->

<script type="text/javascript">
                try
                {
                    document.getElementById("User_ModifyPassword").className = "current"; //控制CSS
                }
                catch(e){}
</script>

<!--sidebar end-->
<!--#include file="../inc/md5.asp"-->
<%
action=request.QueryString("action")
username=session("user_xxx_name")
select case action
'//用户资料
case "savepassset"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [com_user] where username='"&username&"'",conn,1,3
if md5(trim(request("oldPassword")))<>trim(rs("userpassword")) then
response.Write "<script language=javascript>alert('对不起，您输入的原密码错误！');window.location.href='modifyPassword.asp';</script>"
response.End
else
if trim(request("newPassword2"))<>"" and request("newPassword")<>"" and (request("newPassword2")=request("newPassword"))then
rs("userpassword")=md5(trim(request("newPassword2")))
else
response.Write "<script language=javascript>alert('对不起，您输入的密码不一致，请重新输入！');window.location.href='member.asp?show=security';</script>"
response.End
end if
if request("pw_question")<>"" then
rs("UserQuesion")=request("pw_question")
end if
if request("pw_answer")<>"" then
rs("UserAnswer")=md5(request("pw_answer"))
end if
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('密码更改成功！');window.location.href='modifyPassword.asp';</script>"
response.End
end if

end select
%>

            <!--main-->
<form id="myform" action="?action=savepassset" method="post">
		<!--main-->
		<div class="mainBox">
			<div class="mainContent dltable">
				<h3 class="mainContent_title" style="margin-bottom: 15px">
					<span>修改密码</span>
				</h3>
				<!--内容-->
				<!--   修 改 密 码  -->
				<dl>
					<dt>
						<span class="star">*</span> 输入旧密码：
					</dt>
					<dd>
						<input name="oldPassword" type="password" maxlength="20" id="txtOldPwd" class="input"> <span id="WrongOldPwd" style="display: none" class="wrongtext">请输入旧密码</span>
					</dd>
					<dt>
						<span class="star">*</span> 输入新密码：
					</dt>
					<dd>
						<input name="newPassword" type="password" maxlength="20" id="newPassword" class="input"><span id="WrongNewPwd" style="display: none" class="wrongtext"> 请输入新密码</span>
					</dd>
					<dt>
						<span class="star">*</span> 新密码确认：
					</dt>
					<dd>
						<input name="newPassword2" type="password" maxlength="20" id="newPassword2" class="input"> <span id="WrongPassword" style="display: none" class="wrongtext">两次密码输入不一致</span>
					</dd>
					<dt></dt>
					<dd>
						<span> <input type="submit" name="btnConfirm" value=" 确 定 " id="btnConfirm" class="btn"></span>
					</dd>
				</dl>
				
				<!--内容end-->
			</div>

		</div></form>
            <!--main end-->
        </div>
        <!--container end-->
        <div class="clr">
        </div>
        
<script>
$("#myform").submit(function() {
    if($("#oldPassword").val()==''){
    	alert("请输入旧密码");
    	return false;
    }
    if($("#newPassword").val()==''){
    	alert("请输入新密码");
    	return false;
    }
    if($("#newPassword2").val()==''){
    	alert("请输入新密码确认");
    	return false;
    }
    if($("#newPassword").val() != $("#newPassword2").val()){
    	alert("两次密码输入不一致");
    	return false;
    }  
	return true;
});

</script>
  
<!--#include file="foot.asp"--> 