<!--#include file="conn.asp"-->
<!--#include file="../md5.asp"-->
<%if session("nyeee_admin")="" then
response.redirect "login.asp"
end if

dim username,oldpass,newpass,confirmpass,sql,rs
username=HtmlEncode(trim(request.form("username")))
oldpass=HtmlEncode(trim(request.form("oldpass")))
newpass=HtmlEncode(trim(request.form("newpass")))
confirmpass=HtmlEncode(trim(request.form("confirmpass")))
if username<>"" and newpass=confirmpass then
sql="select * from nyeee_admin where username='"&username&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,3,2
if not rs.eof then
	if md5(oldpass)=rs("password") then
	rs("password")=md5(newpass)
	rs.update
	rs.close  
    set rs=nothing                                                                                     
    conn.close   
    set conn=nothing
	response.redirect "editpassok.asp"
	end if
	end if
end if%>
<html>
<head>
<style type="text/css">
<!-- 
td           { font-size: 12px; line-height: 17px }
body         { font-size: 12px; line-height: 17px }
p            { margin-top: 1; margin-bottom: 1 }
a:link       { text-decoration: none; color: black }
a:visited    { text-decoration: none; color: black }
a:active     { text-decoration: none }
a:hover      { text-decoration: underline; color: red }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>修改管理密码</title>
</head>
<body background="images/background.gif">                                                                 
  <table border="0" width="725">
    <tr>
      <td width="100%">
          <table width="300" height="177" border="0" align="center" cellpadding="0" cellspacing="0">
          
            <tr>
              <td width="100%" background="images/bg1.gif" height="11"></td>
            </tr>
          
            <tr>
              <td width="100%" height="166"><form action="" method="post">
                <table border="0" width="100%">
                  <tr>
                    <td width="28%" valign="bottom">
                      <p align="right">原始帐号：</td>
          <td width="72%"><input type="text" name="username" size="17"></td>
  </tr>
                  <tr>
                    <td width="28%" align="right" valign="bottom">
                      原始密码：</td>
          <td width="72%"><input type="password" name="oldpass" size="17"></td>
  </tr>
                  <tr>
                    <td width="28%" align="right" valign="bottom">
                      新设密码：</td>
          <td width="72%"><input type="password" name="newpass" size="17"></td>
  </tr>
                  <tr>
                    <td width="28%" align="right" valign="bottom">
                      确认密码：</td>
          <td width="72%"><input type="password" name="confirmpass" size="17"></td>
  </tr>
  <tr>
    <td width="100%" colspan="2">
      <p align="center"><input type="submit" value="修改" name="edit"> <input type="reset" value="取消" name="reset"> 
      <input type="button" value="返回" name="back" onclick="javascript:history.back()"></p>                     
    </td>                    
  </tr>                    
                </table></form>                    
              </td>                    
            </tr>                    
        </table>                    
        </div>                    
      </td>                    
    </tr>                    
  </table>                                                          
</body>                    
                    
</html>                    
