<!--#include file="../conn.asp"-->
<!-- #include file="../inc/const.asp" -->
<!-- #include file="../inc/md5.asp" -->
<%
Dim username
Dim password
Dim repassword
Dim answer
Dim Rs, SQL
If Not IsObject(Conn) Then ConnectionDatabase
If Trim(Request("username")) = "" Or Trim(Request("pass")) = "" Or Trim(Request("repass")) = "" Or Trim(Request("answer")) = "" Then
	Response.Write "<script>alert('非法参数！');history.go(-1)</script>"
Else
	username = Newasp.Checkstr(Request("username"))
	password = Newasp.Checkstr(Request("pass"))
	repassword = MD5(Newasp.Checkstr(Request("repass")))
	answer = MD5(Request("answer"))
	SQL = "SELECT password,UserGrade FROM [NC_User] WHERE username='" & username & "' And password='" & password & "' And answer='" & answer & "'"
	Set Rs = Server.CreateObject("adodb.recordset")
	Rs.open SQL, Conn, 1, 3
	If Rs.EOF And Rs.bof Then
		Response.Write "<script>alert('您返回的用户资料不正确，非法操作！');history.go(-1)</script>"
	Else
		If Rs("UserGrade") = 999 Then
			Response.Write "<script>alert('非法操作！必须和管理员联系取回密码！');history.go(-1)</script>"
		Else
			Rs("password") = repassword
			Rs.Update
			Response.Write "<script>alert('您的密码成功激活，请登陆!');location.replace('./')</script>"
		End If
	End If
	Rs.Close
	Set Rs = Nothing
End If
CloseConn
%>