<%setCookies = "CompanyZY"
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
Dim SsMasterName,SsMasterPurview,SsLoginSystem,SsMasterLoginCode,SsMasterLoginIP
SsMasterName = ReplaceBadChar(Trim(Request.Cookies(""&setCookies&"")("AdminName")))
SsMasterPurview = ReplaceBadChar(Trim(Request.Cookies(""&setCookies&"")("AdminPurview")))
SsLoginSystem= ReplaceBadChar(Trim(Request.Cookies(""&setCookies&"")("LoginSystem")))
SsMasterLoginCode = ReplaceBadChar(Trim(Request.Cookies(""&setCookies&"")("AdminLoginCode")))
SsMasterLoginIP = ReplaceBadChar(Trim(Request.Cookies(""&setCookies&"")("LoginIP")))

Function ReplaceBadChar(strChar)
    If strChar = "" Or IsNull(strChar) Then
        ReplaceBadChar = ""
        Exit Function
    End If
    Dim strBadChar, arrBadChar, tempChar, i
    strBadChar = "+,',%,^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ",--"
    arrBadChar = Split(strBadChar, ",")
    tempChar = strChar
    For i = 0 To UBound(arrBadChar)
        tempChar = Replace(tempChar, arrBadChar(i), "")
    Next
    tempChar = Replace(tempChar, "@@", "@")
    ReplaceBadChar = tempChar
End Function

Dim AdminAction
AdminAction = request.QueryString("AdminAction")
Select Case AdminAction
    Case "Out"
        Call OutLogin()
    Case Else
        Call Login()
End Select

Sub Login()
    If SsMasterName = "" Or SsMasterPurview = "" Or SsLoginSystem<> "Succeed" Or (EnableSiteManageCode = True And SsMasterLoginCode <> SiteManageCode) Then
        Response.Redirect "/admins/Ss_login.asp"
		'Call Alert("Error!!!!!!","Ss_login.asp")
        Response.End
    End If
End Sub

Sub OutLogin()
    Response.Cookies(""&setCookies&"")("AdminName") = ""
    Response.Cookies(""&setCookies&"")("AdminPurview") = ""
    Response.Cookies(""&setCookies&"")("LoginSystem") = ""
    Response.Cookies(""&setCookies&"")("AdminLoginCode") = ""
    Response.Cookies(""&setCookies&"")("LoginIP") = ""
    Response.Redirect("/admins/Ss_login.asp")
End Sub
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
%>