Metropoli BBS
VIEWER: logonfrm.asp MODE: TEXT (ASCII)
<% @ LANGUAGE=VBSCRIPT CODEPAGE = 1252 %>
<!--#include file="constant.inc" -->
<!--#include file="lib/session.inc" -->
<!--#include file="lib/logon.inc" -->
<!--#include file="lib/pageutil.inc" -->
<%
'=======================
' RedirectToRequest
' Redirects user to their originally requested URL
'
'=======================
Sub RedirectToRequest
	On Error Resume Next

    bstrPgReq = Session(bstrURLReq)
	Session(bstrURLReq) = 0

    If (bstrPgReq <> 0) Then
	If InStr(1, bstrPgReq, ".asp", vbTextCompare) Then
		' WARNING! No script after this line will be executed!
		Response.Redirect bstrPgReq
	End If
    End If

End Sub


'=======================
' MainLogon
' Authenticates, and logs on user
'
'=======================
Sub MainLogon

	On Error Resume Next

    urlIsNewWindow = Request.QueryString("isnewwindow")
	CheckSession "", "top"

    ' Logoff if already logged on
	ClearSession
    Session("iFontSize")=2  'Default font size

    If isMSIE then
       If isWin16 then
          Session("nTWfactor") = .138
          Session("nTAfactor") = .125
          Session("nTARows") = 4 '19
       ElseIf isMac Then
          Session("nTWfactor")= .173
          Session("nTAfactor")= .169
          Session("nTARows")= 4 '27
       Else
          If getVersion>=4.0 Then
             Session("nTWfactor")= .126 '.130
             Session("nTAfactor") = .119
             Session("nTARows")= 4 '17
          Else
             Session("nTWfactor")= .189
             Session("nTAfactor") = .20
             Session("nTARows")= 4 '22
          End If
       End If
    Else
       If isSun=4 Then
          Session("nTWfactor") = .095
          Session("nTAfactor") = .084
          Session("nTARows") = 4 '13
       ElseIf isSun=3 Then
          Session("nTWfactor") = .176
          Session("nTAfactor") = .152
          Session("nTARows") = 4 '23
       ElseIf isMac Then
          Session("nTWfactor") = .155
          Session("nTAfactor") = .156
          Session("nTARows") = 4 '24
       ElseIf isUnix Then	
          Session("nTWfactor") = .146
          Session("nTAfactor") = .152'.132
          Session("nTARows") = 4 '23
       Else 'win16 and win32
          If getVersion>=4.0 Then
	         Session("iFontSize")=3
             Session("nTWfactor") = .110 '.120
             Session("nTAfactor") = .120
             Session("nTARows") = 4 '17
          Else
             Session("nTWfactor") = .137
             Session("nTAfactor") = .118
             Session("nTARows") = 4 '15
          End If    
       End If
    End If

	bstrNewSession = Request.QueryString("newsession")
	bstrAT = Request.ServerVariables("AUTH_TYPE")

	If InStr(1, bstrAuthTypesAccepted, bstrAT, vbTextCompare) < 12 Then
		If Session(NEW_SESSION) <> bstrNewSession Then
			Session(NEW_SESSION) = bstrNewSession
			Response.Buffer = TRUE
			Response.Status = ("401 Unauthorized")
			Response.End
		End If
	End If

	bAuthenticated = BAuthenticateUser

	If bAuthenticated Then

		Session(bstrAuthenticated) = True
		bstrLogonUser = Request.ServerVariables("LOGON_USER")

		fAnonymousUser = False
		If bstrLogonUser = "" Then
			fAnonymousUser = True
		End If

		If fAnonymousUser Then

			Response.Redirect(bstrVirtRoot & "/logoff.asp?anony=1")

		Else

			Session(CURRENT_USER) = bstrLogonUser
			Session(CURRENT_MAINWIN) = 0

			If (BLogonUser(bstrLogonUser)) Then

				bstrRootURL = "/root.asp"

				If urlIsNewWindow="1" Then
					'new logon window so close me 
					Response.Redirect(bstrVirtRoot & "/relogon.htm")
				Else
					'refresh callers location
					'If original request was for a different URL, send user on their way
					' Execution will end here if user redirected
					RedirectToRequest

					'Else we go to root page
					Response.Redirect(bstrVirtRoot & bstrRootURL)
				End If
			End If

		End If
	Else
		 ReportError1 L_errFailedToAuthenticate_ErrorMessage
	End If
   
End Sub
%>
<%MainLogon%>
[ RETURN TO DIRECTORY ]