<%
Dim GroupSetting,Cookies_Name
Dim rsmember,sqlmember,MemberName,MemberEmail,memberid
MemberName = Newasp.CheckBadstr(Newasp.memberName)
memberid = Newasp.ChkNumeric(Newasp.memberid)
If Trim(MemberName) = "" Or memberid = 0 Then
	Response.Redirect ("./login.asp")
End If
MemberName = Left(MemberName,45)
If Trim(Request.Cookies(Newasp.Cookies_Name)) = "" Then
	Response.Redirect ("./login.asp")
End If
sqlmember = "SELECT userid,UserLock,usermail FROM xp90com_User WHERE username='" & MemberName & "' And UserGrade="& CInt(Newasp.membergrade) &" And userid=" & CLng(memberid)
Set rsmember = Newasp.Execute(sqlmember)
If rsmember.BOF And rsmember.EOF Then
	Response.Cookies(Newasp.Cookies_Name) = ""
	Set rsmember = Nothing
	Response.Redirect "login.asp"
	Response.End
Else
	If rsmember("UserLock") > 0 Then
		Response.Cookies(Newasp.Cookies_Name) = ""
		Set rsmember = Nothing
		ErrMsg = "<li>你的用户名已被锁定,你不能登陆！如要开通此帐号，请联系管理员。</li>"
		Call Returnerr(ErrMsg)
		Response.End
	End If
	MemberEmail = Trim(rsmember("usermail"))
End If
Set rsmember = Nothing
GroupSetting = Split(Newasp.UserGroupSetting(CInt(Newasp.membergrade)), "|||")
Call GetUserTodayInfo
Cookies_Name = "usercookies_" & Newasp.memberid
If Trim(Request.Cookies(Cookies_Name)) = "" Then
	Response.Cookies(Cookies_Name)("userip") = Newasp.GetUserIP
	Response.Cookies(Cookies_Name)("dayarticlenum") = 0
	Response.Cookies(Cookies_Name)("daysoftnum") = 0
	Response.Cookies(Cookies_Name).Expires = Date + 1
End If
If CInt(Newasp.memberclass) > 0 Then
	Dim rsUserClass,SQLUserClass
	Set rsUserClass = Server.CreateObject("ADODB.Recordset")
	SQLUserClass = "SELECT userid,UserClass,UserLock,ExpireTime FROM xp90com_User WHERE username='" & MemberName & "' And userid=" & CLng(Newasp.memberid)
	rsUserClass.Open SQLUserClass,Conn,1,3
	If rsUserClass.BOF And rsUserClass.EOF Then
		Response.Cookies(Newasp.Cookies_Name) = ""
		rsUserClass.Close:Set rsUserClass = Nothing
		Response.Redirect "login.asp"
	Else
		If rsUserClass("UserLock") > 0 Then
			Response.Cookies(Newasp.Cookies_Name) = ""
			rsUserClass.Close:Set rsUserClass = Nothing
			Response.Redirect "login.asp"
		End If
		If DateDiff("D", CDate(rsUserClass("ExpireTime")), Now()) > 0 And rsUserClass("UserClass") <> 999 Then
			rsUserClass("UserClass") = 999
			rsUserClass.Update
		End If
	End If
	rsUserClass.Close:Set rsUserClass = Nothing
End If
%>
