<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#include file="Connections/conn_news.asp" -->
<!--#include file="yns_config.asp" -->
<!--#include file="yns_chklogin.asp" -->
<% chk_user_login(3) %>
<!--#include file="md5.asp" -->
<%
Dim rsu__MMColParam
rsu__MMColParam = "1"
If (Request.Form("u_id") <> "") Then
  rsu__MMColParam = Request.Form("u_id")
End If
%>
<%
Dim rsu
Dim rsu_numRows

Set rsu = Server.CreateObject("ADODB.Recordset")
rsu.ActiveConnection = MM_conn_news_STRING
rsu.Source = "SELECT * FROM t_user WHERE u_id = " + Replace(rsu__MMColParam, "'", "''") + ""
rsu.CursorType = 0
rsu.CursorLocation = 2
rsu.LockType = 1
rsu.Open()

rsu_numRows = 0
%>
<%
dim uocode
dim uncode1
dim uncode2

uocode = md5(request.Form("u_pass1"))
uncode1 = request.Form("u_pass2")
uncode2 = request.Form("u_pass3")

if uocode = "" or uncode1 = "" or uncode2 = "" then
response.Write("密码不能为空!<br><a href='javascript:history.back();'>返回重填</a>")
elseif uocode <> (rsu.Fields.Item("u_password").Value) then
response.Write("你的旧密码有误<br><a href='javascript:history.back();'>返回重填</a>")
elseif uncode1 <> uncode2 then
response.Write("你两次输入的新密码不一致<br><a href='javascript:history.back();'>返回重填</a>")
else
%>
<%

if(request.form("u_pass2") <> "") then Command1__mmncode = md5(request.form("u_pass2"))

if(request.form("u_id") <> "") then Command1__mmuid = request.form("u_id")

if(request.form("u_level") <> "") then Command1__mmnlevel = request.form("u_level")

%>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_conn_news_STRING
Command1.CommandText = "UPDATE t_user  SET u_password = '" + Replace(Command1__mmncode, "'", "''") + "', u_level = '" + Replace(Command1__mmnlevel, "'", "''") + "' WHERE u_id = " + Replace(Command1__mmuid, "'", "''") + " "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>湖南百润医药有限公司-------康曼德www.hnicp.com</title>
</head>

<body>
</body>
</html><% Response.Write("恭喜你,密码修改成功！请牢记你的密码。<br><a href='yns_user.asp'>返回用户管理</a>")%>
<% end if %>
<%
rsu.Close()
Set rsu = Nothing
%>