<!--#include file = "Startup.asp"-->
<!-- #include file="Function.asp" -->
<!--#include file="inc/md5.asp"-->
<%
call adminer()
call Header()
Call ComeUrl()
%>

<%
dim username,password,id,userclass
Dim zRs
userclass=Trim(Request("userclass"))
password=trim(request("password"))
id=trim(request("id"))

ssql="select password,userclass from admin where id="&id
ors.open ssql,oconn,1,3
If Not oRs.Eof Then
	If oRs("userclass")=1 Then
		If userclass=0 Then
			Set zRs=Server.CreateObject("ADODB.Recordset")
			zSql="Select UserClass From Admin Where UserClass=1"
			zRs.Open zSql,oConn,1,1
			If Not zRs.Eof Then
				If zrs.recordcount<=1 Then
					oRs("userclass")=1
					response.write "<script>"
					response.write "alert('系统必须保留至少一个超级管理员,才能正常运行！！');"
					response.write "history.back(1);"
					response.write "</script>"
					Response.End
				End If
			End If
			zRs.Close
		End If
	End If
	password=md5(password)
	ors("password")=password
	oRs("userclass")=userclass
	ors.update
End If
ors.close

response.write("<table width='300' border='0' align='center' cellpadding='0' cellspacing='0'>")
response.write("<tr><td><div align='center'>用户修改成功！<br>2秒钟后自动返回用户管理面页</div></td></tr></table>")
response.write("<meta http-equiv='refresh' content='2;URL=user.asp'>")
%>
