home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 March
/
CHIPCD_3_98.iso
/
software
/
testsoft
/
exchange
/
webdata
/
global.asa
< prev
Wrap
Text File
|
1997-08-25
|
5KB
|
170 lines
' Microsoft Outlook Web Access
' Global.asa
' Copyright (c) Microsoft Corporation 1993-1997. All rights reserved.
' WARNING! This is an unlocalised file. No locale specific
' strings, formats, etc. can be used here.
' NOTE: This file does not include CONSTANT.INC. Any changes made to
' Application and Session variable names, etc. in CONSTANT.INC must be
' mirrored here.
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
On Error Resume Next
Set objRenderApp = Server.CreateObject("AMHTML.Application")
If Err = 0 Then
Set Application("RenderApplication") = objRenderApp
' for debugging only
Application("startupSID") = objRenderApp.SecurityID
' Load Registry Configuration Data
objRenderApp.LoadConfiguration 1, _
"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSExchangeWeb\Parameters"
If Err = 0 Then
bstrVirtRoot = "/exchange"
'Set up virtual root and message class formats
objRenderApp.VirtualRoot = bstrVirtRoot
objRenderApp.FormsRoot = Server.MapPath(bstrVirtRoot) & "\usa"
Else
Application("startupFatal") = Err.Number
'Failed to read registry
Application("startupFatalDescription") = "1010: " & Err.Description
End If
Else
Application("startupFatal") = Err.Number
'Failed to create application object
Application("startupFatalDescription") = "1011: " & Err.Description
End If
Application("hImp") = 0
Err.Clear
End Sub
</SCRIPT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnEnd
Set Application("RenderApplication") = Nothing
End Sub
</SCRIPT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart
On Error Resume Next
Dim objIDCache
Set objIDCache = CreateObject("Scripting.Dictionary")
Set Session("IDCache") = objIDCache
Session("hImp") = 0
Session("URLRequested") = Null
Session("fPublicFormats") = False
Session("fPrivateFormats") = False
Set objRenderApp = Application("RenderApplication")
If Not objRenderApp Is Nothing Then
'Load DSA Configuration Data
objRenderApp.LoadConfiguration 2, ""
If Err <> 0 Then
Application("startupFatal") = Err.Number
'Failed to read DS configuration
Application("startupFatalDescription") = "1012: " & Err.Description
End If
Else
Application("startupFatal") = Err.Number
'Failed to retrieve RenderApplication from Application object
Application("startupFatalDescription") = "1013: " & Err.Description
End If
End Sub
</SCRIPT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnEnd
On Error Resume Next
set objRenderApp = Application("RenderApplication")
fRevert = FALSE
hImp = Session("hImp")
fOk = 1
If Not IsEmpty(hImp) Then
fOk = objRenderApp.Impersonate(hImp)
End If
If fOk = 1 Then
' Do our cleanup
Set objCacheID = Session("IDCache")
rgObjectIDs = objCacheID.Items
For i = Lbound(rgObjectIDs) to Ubound(rgObjectIDs)
Set Session(rgObjectIDs(i)) = Nothing
Next
Set Session("IDCache") = Nothing
Set Session("URLRequested") = Nothing
Set Session("AMRenderObject") = Nothing
Set Session("AMRenderMessage") = Nothing
Set Session("AMRenderFolder") = Nothing
Set Session("AMRenderRecipients") = Nothing
Set Session("AMRenderAddressContainer") = Nothing
Set Session("AMRenderAddressEntry") = Nothing
Set Session("AMRenderHierarchy") = Nothing
Set Session("AMRenderCalendar") = Nothing
Set Session("AMPrivateStore") = Nothing
Set Session("AMPublicStore") = Nothing
Set Session("AMThisFolderLink") = Nothing
Set Session("AMPublicStoreID") = Nothing
Set Session("AMPublicStoreEntryID") = Nothing
Set Session("AMPublicStoreRootID") = Nothing
Set Session("AMDeletedItemsID") = Nothing
Set Session("CURRENT_FOLDER") = Nothing
Set Session("CURRENT_HIERARCHY") = Nothing
Set Session("CURRENT_CONTENTS") = Nothing
Set Session("CURRENT_INDEX") = Nothing
Set Session("CURRENT_COUNT") = Nothing
Set Session("CURRENT_PAGES") = Nothing
Set Session("CURRENT_ROWS") = Nothing
Set Session("CURRENT_VIEW") = Nothing
Set Session("CURRENT_PAGE") = Nothing
Set Session("CURRENT_MESSAGE") = Nothing
Set objOMSession = Session("AMAuthSession")
If Not objOMSession Is Nothing Then
Set Session("AMAuthSession") = Nothing
objOMSession.Logoff
Set objOMSession = Nothing
End If
If Not IsEmpty(hImp) Then
Set Session("hImp") = Nothing
objRenderApp.CloseSysHandle(hImp)
End If
Set Session("AMAuthenticated") = Nothing
End If
End Sub
</SCRIPT>