%@ Language=VBScript %>
<% '==================================================
' Microsoft Server Appliance
' Alert Details Page
' Copyright (c) Microsoft Corporation. All rights reserved.
'================================================== %>
<% Option Explicit %>
<%
Dim page
Dim g_sCookie
Dim g_sAction
Dim g_sReturnURL
Dim g_bAlertCleared
Dim g_sPageDescription
Dim g_sPageTitle
Dim g_sPageImage
Dim g_bIsAreaPage
Dim L_CLEARALERT_TEXT
Dim L_ALERTVWRTITLE_TEXT
Dim L_CLEARDESC_TEXT
Dim L_PAGETITLE
g_sAction = Request.Form("Method")
g_sReturnURL = Request("ReturnURL")
g_sCookie= Request("Cookie")
If ( UCase(g_sAction) = "CLEAR" ) Then
ClearAlert(g_sCookie)
g_bAlertCleared = TRUE
If ( Len(g_sReturnURL) > 0 ) Then
'
' Area Page uses ServeClose
'
Call ServeClose()
Response.End
Else
'
' Pagelet uses top.location.refresh()
' See OnServePageletPage()
End If
Else
g_bAlertCleared = FALSE
End If
L_PAGETITLE = GetLocString("sakitmsg.dll", "&H4001002C", "")
If ( UCase(g_sAction) = "CLEAR" ) Then
' Skip getting page image and title if we just cleared it. This is the case
' when we are dealing with a pagelet.
Else
Call GetPageImageAndTitle(g_sCookie, g_sPageImage, g_sPageTitle, g_sPageDescription)
End If
If ( Len(g_sReturnURL) > 0 ) Then
'
' Area page
'
g_bIsAreaPage = TRUE
Call SA_TraceOut("SH_ALERTDETAILS", "Creating as Area page")
Call SA_CreatePage(g_sPageTitle, g_sPageImage, PT_AREA, page)
Call SA_ShowPage(page)
Else
'
' Pagelet
'
g_bIsAreaPage = FALSE
Call SA_TraceOut("SH_ALERTDETAILS", "Creating as Pagelet")
Call SA_CreatePage(g_sPageTitle, g_sPageImage, PT_PAGELET, page)
Call SA_ShowPage(page)
End If
Public Function OnInitPage(ByRef pageIn, ByRef EventArg)
OnInitPage = TRUE
L_CLEARALERT_TEXT = GetLocString("sakitmsg.dll", "&H4001002D", "")
L_ALERTVWRTITLE_TEXT = GetLocString("sakitmsg.dll", "&H4001002E", "")
L_CLEARDESC_TEXT = GetLocString("sakitmsg.dll", "&H4001002F", "")
End Function
Public Function OnServeAreaPage(ByRef PageIn, ByRef EventArg)
OnServeAreaPage = TRUE
Call ServeAlertDetailsPage()
'Call SA_ServeBackButton(FALSE, g_sReturnURL)
End Function
Public Function OnServePageletPage(ByRef PageIn, ByRef EventArg)
OnServePageletPage = TRUE
If ( TRUE = g_bAlertCleared ) Then
%>
<%
Else
Call ServeAlertDetailsPage()
End If
End Function
Private Function ServeAlertDetailsPage()
ServeAlertDetailsPage = TRUE
on error resume next
Err.Clear
Dim objAlert
Dim objElementCol
Dim objElement
Dim strAlertSrc
Dim intAlertID
Dim intAlertType
Dim strElementID
Dim strContainerPrefix
Dim varReplacementStrings
Dim varReplacementStringsNone
Dim bVirtualRootIsNeeded
Dim returnURL
Dim objElements
Dim objItem
Dim arrTitle
Dim arrURL
Dim arrHelpText
Dim blnEnabled
Dim i
Dim oValidator
Dim oEncoder
Dim strIconPath
Set oValidator = New CSAValidator
Set oEncoder = New CSAEncoder
Set objAlert = GetObject("WINMGMTS:" & SA_GetWMIConnectionAttributes() & "!\\" & GetServerName & "\root\cimv2:Microsoft_SA_Alert.Cookie=" & g_sCookie )
If ( Err.Number <> 0 ) Then
ServeAlertNotFound()
Exit Function
End If
strAlertSrc = objAlert.AlertLog
intAlertID = objAlert.AlertID
intAlertType = objAlert.AlertType
If ( Err.Number <> 0 ) Then
ServeAlertNotFound()
Exit Function
End If
strElementID = strAlertSrc & Hex(intAlertID)
strContainerPrefix = Request.QueryString("AlertDefinitions")
If ( Len(strContainerPrefix) > 0 ) Then
If ( oValidator.IsValidIdentifier(strContainerPrefix) ) Then
' Valid container prefix name, use it.
Else
' Invalid container prefix name
Call SA_TraceOut("inc_alertdetails.asp", "Function ServeAlertDetailsPage detected invalid QueryString(AlertDefinitions) value: " & strContainerPrefix)
' Use default
strContainerPrefix = "AlertDefinitions"
End If
Else
' Use default alert container name
strContainerPrefix = "AlertDefinitions"
End If
Set objElementCol = GetElements(strContainerPrefix)
Set objElement = objElementCol.Item(strContainerPrefix+strElementID)
If ( Err.Number <> 0 ) Then
Err.Clear
strContainerPrefix = ""
Set objElement = objElementCol.Item(strElementID)
If (Err.Number <> 0) Then
ServeAlertDetailsPage = FALSE
Exit Function
End If
End If
Set objAlert = Nothing
Set objElementCol = Nothing
Set objElement = Nothing
%>
<%
' User Actions - keys off of AlertSource + AlertID (hex)
intAlertID = Hex(intAlertID)
Set objElements = GetElements(strContainerPrefix & strAlertSrc & intAlertID)
Response.Write(oEncoder.EncodeElement(g_sPageDescription))
Response.Write("
")
Response.Write("
") Response.Write(" | ") strSourceName = "" strSourceName = objItem.GetProperty ("Source") If strSourceName = "" Then strSourceName = "svrapp" End If arrTitle = GetLocString(strSourceName, objItem.GetProperty("CaptionRID"), "") arrHelpText = GetLocString(strSourceName, objItem.GetProperty("DescriptionRID"), "") arrURL = objItem.GetProperty("URL") Call SA_MungeURL( arrURL, "Tab1", GetTab1()) Call SA_MungeURL( arrURL, "Tab2", GetTab2()) Call SA_MungeURL( arrURL, "Cookie", g_sCookie) Call SA_MungeURL( arrURL, SAI_FLD_PAGEKEY, SAI_GetPageKey()) Dim bEmbedded Dim sPageType bEmbedded = TRUE sPageType = objItem.GetProperty("PageType") If ( Len(sPageType) > 0 ) Then If ( UCase(sPageType) = "NORMAL" ) Then bEmbedded = FALSE End IF End If If ( TRUE = bEmbedded ) Then If (TRUE = bVirtualRootIsNeeded) Then returnURL = m_VirtualRoot + returnURL End If If ( Left(returnURL, 1) <> "/") Then returnURL = "/" + returnURL End If %> onMouseOver="window.status='<%=Server.HTMLEncode(EscapeQuotes(arrHelpText))%>';return true;"> <% Else Call SA_MungeURL( arrURL, "ReturnURL", returnURL) Call SA_TraceOut("SH_ALERTDETAILS", "Details URL: " + arrURL) %> onMouseOver="window.status='<%=Server.HTMLEncode(SA_EscapeQuotes(arrHelpText))%>';return true;"> <% End If Response.Write(oEncoder.EncodeElement(arrTitle)) Response.Write("") Response.Write(" |
" & oEncoder.EncodeElement(L_CLEARDESC_TEXT)) %> | |
onMouseOver="window.status='<%=Server.HTMLEncode(SA_EscapeQuotes(L_CLEARALERT_TEXT))%>';return true;"> <%=oEncoder.EncodeElement(L_CLEARALERT_TEXT)%> | |