<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/md5.asp"-->
<%
If app_user = 0 Then writeE "会员系统关闭中"
	Dim cname, filepath, sessionState
    sessionState = False
    If Session("userid") = "" Then
        cname = "template_userlogin"
        filepath = app_installdir & "template/" & app_templatedir & "/" & app_htmldir & "/userlogin.html"
    Else
        sessionState = True
        cname = "template_userlogged"
        filepath = app_installdir & "template/" & app_templatedir & "/" & app_htmldir & "/userlogged.html"
    End If
    
    objTemplate.html = getFileByCache(cname, filepath)
    With objTemplate
    	.html = replaceStr(.html, "{maccms:userlink}", app_installdir & "user/index.asp?action=main")
		.html = replaceStr(.html, "{maccms:userreglink}", app_installdir & "user/index.asp?action=reg")
		.html = replaceStr(.html, "{maccms:userfindpasslink}", app_installdir & "user/index.asp?action=findpass")
		.html = replaceStr(.html, "{maccms:userlogoutlink}", app_installdir & "user/index.asp?action=logout")
	End With
    If sessionState Then
        Dim rs: Set rs = objdb.DB("SELECT u_id, u_name, u_qq, u_email, u_phone ,u_regtime,u_status,u_points,u_tj, u_loginnum, u_logintime,u_ip,u_random,u_flag,u_start,u_end,ug_id,u_group,ug_name,ug_type,ug_popedom,ug_popvalue FROM ({pre}user LEFT OUTER JOIN {pre}user_group ON {pre}user.u_group = {pre}user_group.ug_id) where u_id=" & Session("userid"), "rs1")
        
        If Not rs.EOF Then
            With objTemplate
                .html = replaceStr(.html, "{maccms:userid}", rs("u_id"))
                .html = replaceStr(.html, "{maccms:username}", rs("u_name"))
                .html = replaceStr(.html, "{maccms:userqq}", rs("u_qq"))
                .html = replaceStr(.html, "{maccms:useremail}", rs("u_email"))
                .html = replaceStr(.html, "{maccms:userphone}", rs("u_phone"))
                .html = replaceStr(.html, "{maccms:userregtime}", rs("u_regtime"))
                .html = replaceStr(.html, "{maccms:userpoints}", rs("u_points"))
                .html = replaceStr(.html, "{maccms:userlogintime}", rs("u_logintime"))
                .html = replaceStr(.html, "{maccms:userloginnum}", rs("u_loginnum"))
                .html = replaceStr(.html, "{maccms:usertj}", rs("u_tj"))
                .html = replaceStr(.html, "{maccms:usergroupid}", rs("ug_id"))
                .html = replaceStr(.html, "{maccms:usergroupname}", rs("ug_name"))
                .html = replaceStr(.html, "{maccms:userloginip}", rs("u_ip"))
            End With
        End If
        objdb.C (rs)
    End If
    
    objTemplate.mark
    objTemplate.ifEx
    objTemplate.run
    writeA objTemplate.html
    dispseObj()
%>