<!--#include file="conn.asp"-->
<!--#include file="chkadmin.asp"-->
<!--#include file="inc/char.asp"-->
<%dim usr,action
usr=Trim(Request.QueryString("usr"))
action=Trim(Request.QueryString("action"))

dim errmsg,founderr
founderr=false

if chkadmin=false or power(5)="0" then
	founderr=true
	errmsg=errmsg+"<li>您没有锁定与解锁用户的权限</li>"
end if

if usr="admin" then
	founderr=true
	errmsg=errmsg+"<li>默认的管理员账号不能锁定</li>"
end if

if founderr=false then
	if action="lock" then
		conn.execute("update UserInfo set LockUser=true where USR='"&usr&"'")
		response.Redirect(request.ServerVariables("HTTP_REFERER"))
	else
		conn.execute("update UserInfo set LockUser=false where USR='"&usr&"'")
		response.Redirect(request.ServerVariables("HTTP_REFERER"))
	end if
else
	call error()
end if

conn.close
set conn=nothing%>